MHTCXL q un lý Phân chia tin huê hng ca mt chu k bán hàng

Một phần của tài liệu Xây dựng data web trợ giúp quản lý chu kỳ bán hàng thực hiện theo hợp đồng với công ty phần mềm ID (Trang 51)

II. Môhìn ht ch cx lý (MHTCXL)

5.MHTCXL q un lý Phân chia tin huê hng ca mt chu k bán hàng

Période Ban Giám c NV S H u Type Interactif Interactif Interactif Ch p Nh n Không Ch p Nh n Ki m tra CKBH CK đã hoàn t t H S Khách Hàng CK đã n đnh ph n thanh toán K t Qu CK đã k t thúc B và C Luôn luôn Thi t l p % Huê H ng

D a vào doanh thu th c t & c l ng D a vào Chi Phí L a ra % Huê H ng Yêu c u lãnh % Huê H ng (A) Xác đnh % Huê H ng (C) ngh ti p t c c p nh t CKBH (D) Cung c p chi ti t doanh thu chu k (B) Ti n huê h ng c a chu k (D) Xác đnh % Huê H ng c a Ng i S H u (E) D và E Luôn luôn Thi t l p % Huê H ng c a Ng i S H u Ki m tra quá trình ti p xúc khách hàng Ti n huê h ng c a Ng i s h u, đng s h u B ng phân chia ti n s h u chu k (F)

6. MHTCXL qu n lý “H tr khách hàng vay v n mua B t ng S n” Période T1=T0+deltaT1 T2=T1+deltaT2 T3=T2+deltaT3 T4=T3+deltaT4 Khách Hàng NV S H u Ngân Hàng Type Interactif Interactif Interactif Interactif A ho c B Không Ch p Nh n Ch p Nh n Ki m tra đt hàng c a Khách Hàng Ki m tra quá trình đt hàng c a Khách Hàng Ki m tra H S Pháp Lý c a KHách Hàng C và D Ch p nh n Không ch p nh n Ki m tra thông tin Khách Hàng vay v n

Ki m tra h s Khách Hàng

Ki m tra thông tin B S Khách Hàng mu n mu

Yêu c u vay v n đ mua B S (A) Liên h v i Ngân Hàng (C) Ngân Hàng ti p nh n (D) ngh ti p t c c p nh t H S ngh ki m tra l i (B) Yêu c u Khách Hàng n p h s vay v n (F) Khách Hàng n p h s (E) Thông báo không đ c vay v n C p H S ch p nh n cho vay (H) Khách Hàng c p nh t H S cho CKBH (G) Thông báo hoàn t t H S vay v n E & F Ch p nh n Không ch p nh n Ki m tra h s vay v n Ki m tra tài s n Khách Hàng Ki m tra kh n ng chi tr c a Khách Hàng Ki m tra Khách Hàng có n Ngân Hàng không.

G & H

Luôn luôn

L u tr thông tin vay v n c a Khách Hàng

Ti p nh n H S xác nh n vay v n c a Khách Hàng L u tr thông tin chi ti t v quá trình nh n ti n vay c C p nh t thông tin H S cho CKBH

CH NG 4: H THÔNG TIN V T LÝ

I. MÔ HÌNH V T LÝ D LI U

1. AMC Designor h tr t o ra C s d li u (d ng “Mã SQL” trong SQL Server 2005): SQL Server 2005):

/*==============================================================*/ /* Nom de SGBD : Microsoft SQL Server 2005 */

/* Date de création : 2/12/2009 11:41:38 AM */

/*==============================================================*/

alter table BAT_DONG_SAN

drop constraint FK_BAT_DONG_CKBH_NHAN_NHOM_BAT go

alter table BAT_DONG_SAN

drop constraint FK_BAT_DONG_CKBH_NHAN_KHU_VUC go

alter table CAP_NHAT_HO_SO

drop constraint FK_CAP_NHAT_CKBH_NHAN_CHU_KY_B go

alter table CHI_NHANH_NH

drop constraint FK_CHI_NHAN_CKBH_NHAN_NGAN_HAN go

alter table CHI_TIET_CHI_PHI_LE

drop constraint FK_CHI_TIET_CKBH_NHAN_CHU_KY_B go

alter table CHI_TIET_CHI_PHI_LE

drop constraint FK_CHI_TIET_CKBH_NHAN_NHAN_VIE go

alter table CHU_KY_BAN_HANG

drop constraint FK_CHU_KY_B_CKBH_NHAN_BAT_DONG go

alter table CHU_KY_BAN_HANG (adsbygoogle = window.adsbygoogle || []).push({});

drop constraint FK_CHU_KY_B_CKBH_NHAN_KHACH_HA go

alter table CKBH_NHANVIEN

drop constraint FK_CKBH_NHA_CKBH_NHAN_NHAN_VIE go

drop constraint FK_CKBH_NHA_CKBH_NHAN_CHU_KY_B go

alter table DON_BAN

drop constraint FK_DON_BAN_CKBH_NHAN_BAT_DONG go

alter table KET_QUA_CHU_KY

drop constraint FK_KET_QUA__CKBH_NHAN_CHU_KY_B go

alter table KHACH_HANG

drop constraint FK_KHACH_HA_CKBH_NHAN_LOAI_KHA go

alter table KHU_VUC

drop constraint FK_KHU_VUC_CKBH_NHAN_TINH_THA go

alter table NGANHANG_KHACHHANG

drop constraint FK_NGANHANG_NGANHANG__NGAN_HAN go

alter table NGANHANG_KHACHHANG

drop constraint FK_NGANHANG_NGANHANG__KHACH_HA go

alter table NHAN_TIEN_VAY

drop constraint FK_NHAN_TIE_CKBH_NHAN_VAY_VON go

alter table NHAN_VIEN

drop constraint FK_NHAN_VIE_CKBH_NHAN_LOAI_NHA go

alter table THANH_TOAN

drop constraint FK_THANH_TO_CKBH_NHAN_CHU_KY_B go

alter table THANH_TOAN

drop constraint FK_THANH_TO_CKBH_NHAN_CHI_NHAN go

alter table THANH_TOAN

drop constraint FK_THANH_TO_CKBH_NHAN_NHAN_VIE go

alter table VAY_VON

drop constraint FK_VAY_VON_CKBH_NHAN_KHACH_HA go

alter table VAY_VON

drop constraint FK_VAY_VON_CKBH_NHAN_LOAI_VAY go (adsbygoogle = window.adsbygoogle || []).push({});

alter table VAY_VON

drop constraint FK_VAY_VON_CKBH_NHAN_NGAN_HAN go

if exists (select 1

from sysindexes

where id = object_id('BAT_DONG_SAN') and name = 'CKBH_NHANVIEN8_FK' and indid > 0

and indid < 255)

drop index BAT_DONG_SAN.CKBH_NHANVIEN8_FK go

if exists (select 1

from sysindexes

where id = object_id('BAT_DONG_SAN') and name = 'CKBH_NHANVIEN7_FK' and indid > 0

and indid < 255)

drop index BAT_DONG_SAN.CKBH_NHANVIEN7_FK go

if exists (select 1

from sysobjects

where id = object_id('BAT_DONG_SAN') and type = 'U')

drop table BAT_DONG_SAN go

if exists (select 1

from sysindexes

where id = object_id('CAP_NHAT_HO_SO') and name = 'CKBH_NHANVIEN12_FK' and indid > 0

and indid < 255)

drop index CAP_NHAT_HO_SO.CKBH_NHANVIEN12_FK go

if exists (select 1

from sysobjects

where id = object_id('CAP_NHAT_HO_SO') and type = 'U')

drop table CAP_NHAT_HO_SO go

if exists (select 1

where id = object_id('CHI_NHANH_NH') and name = 'CKBH_NHANVIEN4_FK' and indid > 0

and indid < 255)

drop index CHI_NHANH_NH.CKBH_NHANVIEN4_FK go

if exists (select 1 (adsbygoogle = window.adsbygoogle || []).push({});

from sysobjects

where id = object_id('CHI_NHANH_NH') and type = 'U')

drop table CHI_NHANH_NH go

if exists (select 1

from sysindexes

where id = object_id('CHI_TIET_CHI_PHI_LE') and name = 'CKBH_NHANVIEN16_FK'

and indid > 0 and indid < 255)

drop index CHI_TIET_CHI_PHI_LE.CKBH_NHANVIEN16_FK go

if exists (select 1

from sysindexes

where id = object_id('CHI_TIET_CHI_PHI_LE') and name = 'CKBH_NHANVIEN13_FK'

and indid > 0 and indid < 255)

drop index CHI_TIET_CHI_PHI_LE.CKBH_NHANVIEN13_FK go

if exists (select 1

from sysobjects

where id = object_id('CHI_TIET_CHI_PHI_LE') and type = 'U')

drop table CHI_TIET_CHI_PHI_LE go

if exists (select 1

from sysindexes

where id = object_id('CHU_KY_BAN_HANG') and name = 'CKBH_NHANVIEN22_FK' and indid > 0

and indid < 255)

drop index CHU_KY_BAN_HANG.CKBH_NHANVIEN22_FK go

if exists (select 1

from sysindexes

and name = 'CKBH_NHANVIEN3_FK' and indid > 0

and indid < 255)

drop index CHU_KY_BAN_HANG.CKBH_NHANVIEN3_FK go

if exists (select 1

from sysobjects

where id = object_id('CHU_KY_BAN_HANG') and type = 'U') (adsbygoogle = window.adsbygoogle || []).push({});

drop table CHU_KY_BAN_HANG go

if exists (select 1

from sysindexes

where id = object_id('CKBH_NHANVIEN') and name = 'CKBH_NHANVIEN2_FK' and indid > 0

and indid < 255)

drop index CKBH_NHANVIEN.CKBH_NHANVIEN2_FK go

if exists (select 1

from sysindexes

where id = object_id('CKBH_NHANVIEN') and name = 'CKBH_NHANVIEN_FK' and indid > 0

and indid < 255)

drop index CKBH_NHANVIEN.CKBH_NHANVIEN_FK go

if exists (select 1

from sysobjects

where id = object_id('CKBH_NHANVIEN') and type = 'U')

drop table CKBH_NHANVIEN go

if exists (select 1

from sysindexes

where id = object_id('DON_BAN') and name = 'CKBH_NHANVIEN6_FK' and indid > 0

and indid < 255)

drop index DON_BAN.CKBH_NHANVIEN6_FK go

if exists (select 1

from sysobjects

where id = object_id('DON_BAN') and type = 'U')

drop table DON_BAN go

if exists (select 1

from sysindexes

where id = object_id('KET_QUA_CHU_KY') and name = 'CKBH_NHANVIEN9_FK' and indid > 0

and indid < 255)

drop index KET_QUA_CHU_KY.CKBH_NHANVIEN9_FK go

if exists (select 1 (adsbygoogle = window.adsbygoogle || []).push({});

from sysobjects

where id = object_id('KET_QUA_CHU_KY') and type = 'U')

drop table KET_QUA_CHU_KY go

if exists (select 1

from sysindexes

where id = object_id('KHACH_HANG') and name = 'CKBH_NHANVIEN11_FK' and indid > 0

and indid < 255)

drop index KHACH_HANG.CKBH_NHANVIEN11_FK go

if exists (select 1

from sysobjects

where id = object_id('KHACH_HANG') and type = 'U')

drop table KHACH_HANG go

if exists (select 1

from sysindexes

where id = object_id('KHU_VUC') and name = 'CKBH_NHANVIEN10_FK' and indid > 0

and indid < 255)

drop index KHU_VUC.CKBH_NHANVIEN10_FK go

if exists (select 1

from sysobjects

where id = object_id('KHU_VUC') and type = 'U')

drop table KHU_VUC go

if exists (select 1

from sysobjects

where id = object_id('LOAI_KHACH_HANG') and type = 'U')

drop table LOAI_KHACH_HANG go

if exists (select 1

from sysobjects

where id = object_id('LOAI_NHAN_VIEN') and type = 'U')

drop table LOAI_NHAN_VIEN go

if exists (select 1 (adsbygoogle = window.adsbygoogle || []).push({});

from sysobjects

where id = object_id('LOAI_VAY_VON') and type = 'U')

drop table LOAI_VAY_VON go

if exists (select 1

from sysindexes

where id = object_id('NGANHANG_KHACHHANG') and name = 'NGANHANG_KHACHHANG2_FK' and indid > 0

and indid < 255)

drop index NGANHANG_KHACHHANG.NGANHANG_KHACHHANG2_FK go

if exists (select 1

from sysindexes

where id = object_id('NGANHANG_KHACHHANG') and name = 'NGANHANG_KHACHHANG_FK' and indid > 0

and indid < 255)

drop index NGANHANG_KHACHHANG.NGANHANG_KHACHHANG_FK go

if exists (select 1

from sysobjects

where id = object_id('NGANHANG_KHACHHANG') and type = 'U')

drop table NGANHANG_KHACHHANG go

if exists (select 1

from sysobjects

where id = object_id('NGAN_HANG') and type = 'U')

go

if exists (select 1

from sysindexes

where id = object_id('NHAN_TIEN_VAY') and name = 'CKBH_NHANVIEN21_FK' and indid > 0

and indid < 255)

drop index NHAN_TIEN_VAY.CKBH_NHANVIEN21_FK go

if exists (select 1

from sysobjects

where id = object_id('NHAN_TIEN_VAY') and type = 'U')

drop table NHAN_TIEN_VAY go (adsbygoogle = window.adsbygoogle || []).push({});

if exists (select 1

from sysindexes

where id = object_id('NHAN_VIEN') and name = 'CKBH_NHANVIEN18_FK' and indid > 0

and indid < 255)

drop index NHAN_VIEN.CKBH_NHANVIEN18_FK go

if exists (select 1

from sysobjects

where id = object_id('NHAN_VIEN') and type = 'U')

drop table NHAN_VIEN go

if exists (select 1

from sysobjects

where id = object_id('NHOM_BAT_DONG_SAN') and type = 'U')

drop table NHOM_BAT_DONG_SAN go

if exists (select 1

from sysindexes

where id = object_id('THANH_TOAN') and name = 'CKBH_NHANVIEN15_FK' and indid > 0

and indid < 255)

drop index THANH_TOAN.CKBH_NHANVIEN15_FK go

from sysindexes

where id = object_id('THANH_TOAN') and name = 'CKBH_NHANVIEN17_FK' and indid > 0

and indid < 255)

drop index THANH_TOAN.CKBH_NHANVIEN17_FK go

if exists (select 1

from sysindexes

where id = object_id('THANH_TOAN') and name = 'CKBH_NHANVIEN14_FK' and indid > 0

and indid < 255)

drop index THANH_TOAN.CKBH_NHANVIEN14_FK go

if exists (select 1

from sysobjects

where id = object_id('THANH_TOAN') and type = 'U') (adsbygoogle = window.adsbygoogle || []).push({});

drop table THANH_TOAN go

if exists (select 1

from sysobjects

where id = object_id('TINH_THANH_PHO') and type = 'U')

drop table TINH_THANH_PHO go

if exists (select 1

from sysindexes

where id = object_id('VAY_VON') and name = 'CKBH_NHANVIEN20_FK' and indid > 0

and indid < 255)

drop index VAY_VON.CKBH_NHANVIEN20_FK go

if exists (select 1

from sysindexes

where id = object_id('VAY_VON') and name = 'CKBH_NHANVIEN19_FK' and indid > 0

and indid < 255)

drop index VAY_VON.CKBH_NHANVIEN19_FK go

if exists (select 1

where id = object_id('VAY_VON') and name = 'CKBH_NHANVIEN23_FK' and indid > 0

and indid < 255)

drop index VAY_VON.CKBH_NHANVIEN23_FK go

if exists (select 1

from sysobjects

where id = object_id('VAY_VON') and type = 'U')

drop table VAY_VON go

/*==============================================================*/ /* Table : BAT_DONG_SAN */

/*==============================================================*/ create table BAT_DONG_SAN (

BDS_ID int not null, NBDS_ID int not null, KV_ID int not null, BDS_MA nvarchar(15) null, BDS_DIACHI ntext not null, BDS_CHIEURONG decimal null, BDS_CHIEUDAI decimal null, BDS_MOTA ntext null, BDS_ANH nvarchar(50) null,

constraint PK_BAT_DONG_SAN primary key nonclustered (BDS_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN7_FK */

/*==============================================================*/ create index CKBH_NHANVIEN7_FK on BAT_DONG_SAN ( (adsbygoogle = window.adsbygoogle || []).push({});

NBDS_ID ASC ) go /*==============================================================*/ /* Index : CKBH_NHANVIEN8_FK */ /*==============================================================*/ create index CKBH_NHANVIEN8_FK on BAT_DONG_SAN (

KV_ID ASC ) go /*==============================================================*/ /* Table : CAP_NHAT_HO_SO */ /*==============================================================*/ create table CAP_NHAT_HO_SO (

CNHS_ID int not null, CKBH_ID int not null, CNHS_MA nvarchar(15) null,

CNHS_NGAYCAPNHAT smalldatetime null, CNHS_TENHOSO nvarchar(50) null, CNHS_NGAYTHONGBAO smalldatetime null,

constraint PK_CAP_NHAT_HO_SO primary key nonclustered (CNHS_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN12_FK */

/*==============================================================*/ create index CKBH_NHANVIEN12_FK on CAP_NHAT_HO_SO (

CKBH_ID ASC ) go /*==============================================================*/ /* Table : CHI_NHANH_NH */ /*==============================================================*/ create table CHI_NHANH_NH (

CNNH_ID int not null, NH_ID int not null, CNNH_MA nvarchar(15) null, CNNH_TEN nvarchar(50) null, BDS_DIACHI ntext null, KH_DIENTHOAI numeric(20) null,

constraint PK_CHI_NHANH_NH primary key nonclustered (CNNH_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN4_FK */

/*==============================================================*/ create index CKBH_NHANVIEN4_FK on CHI_NHANH_NH (

NH_ID ASC ) go /*==============================================================*/ /* Table : CHI_TIET_CHI_PHI_LE */ /*==============================================================*/ create table CHI_TIET_CHI_PHI_LE (

CPL_ID int not null, NV_ID int not null, CKBH_ID int not null, CPL_MA nvarchar(15) null,

CPL_NGAYCHITIEU smalldatetime null, CPL_TIENCHITIEU decimal null, CPL_MUDDICHCHITIEU ntext null,

constraint PK_CHI_TIET_CHI_PHI_LE primary key nonclustered (CPL_ID) ) go /*==============================================================*/ /* Index : CKBH_NHANVIEN13_FK */ /*==============================================================*/ create index CKBH_NHANVIEN13_FK on CHI_TIET_CHI_PHI_LE (

CKBH_ID ASC ) go /*==============================================================*/ /* Index : CKBH_NHANVIEN16_FK */ /*==============================================================*/ create index CKBH_NHANVIEN16_FK on CHI_TIET_CHI_PHI_LE (

NV_ID ASC ) go /*==============================================================*/ /* Table : CHU_KY_BAN_HANG */ /*==============================================================*/ create table CHU_KY_BAN_HANG (

CKBH_ID int not null, KH_ID int not null, BDS_ID int not null, CKBH_MA nvarchar(15) null,

CKBH_NGAYKETTHUC smalldatetime null, CKBH_NGAYDATHANG smalldatetime null,

CKBH_NGAYKETTHUCDATHANG smalldatetime null, CKBH_TRANGTHAITHANHTOAN bit null, CKBH_TRANGTHAIHOSO bit null,

CKBH_DOANHTHUTHUCTE decimal null, CKBH_DOANHTHUUOCLUONG decimal null, CKBH_CHIPHILE decimal null,

CKBH_HUEHONG decimal null,

constraint PK_CHU_KY_BAN_HANG primary key nonclustered (CKBH_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN3_FK */

/*==============================================================*/ create index CKBH_NHANVIEN3_FK on CHU_KY_BAN_HANG (

KH_ID ASC ) (adsbygoogle = window.adsbygoogle || []).push({});

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN22_FK */

/*==============================================================*/ create index CKBH_NHANVIEN22_FK on CHU_KY_BAN_HANG (

BDS_ID ASC ) go /*==============================================================*/ /* Table : CKBH_NHANVIEN */ /*==============================================================*/ create table CKBH_NHANVIEN (

NV_ID int not null, CKBH_ID int not null, VAI_TRO bit not null,

HUE_HONG_SO_HUU decimal null, TRANGTHAITHANHTOAN bit null,

constraint PK_CKBH_NHANVIEN primary key (NV_ID, CKBH_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN_FK */

/*==============================================================*/ create index CKBH_NHANVIEN_FK on CKBH_NHANVIEN (

NV_ID ASC ) go /*==============================================================*/ /* Index : CKBH_NHANVIEN2_FK */ /*==============================================================*/ create index CKBH_NHANVIEN2_FK on CKBH_NHANVIEN (

CKBH_ID ASC ) go /*==============================================================*/ /* Table : DON_BAN */ /*==============================================================*/ create table DON_BAN (

DG_ID int not null, BDS_ID int not null,

DG_KIEUKINHDOANH bit null, DG_GIA decimal null,

DG_DONVITINH nvarchar(50) null, DG_NGAY_XAC_NHAN smalldatetime null,

constraint PK_DON_BAN primary key nonclustered (DG_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN6_FK */

/*==============================================================*/ create index CKBH_NHANVIEN6_FK on DON_BAN (

BDS_ID ASC ) go /*==============================================================*/ /* Table : KET_QUA_CHU_KY */ /*==============================================================*/ create table KET_QUA_CHU_KY (

KQ_ID int not null, CKBH_ID int not null,

KQ_NGAYXACNHAN smalldatetime null, KQ_KETQUA smallint null,

KQ_LYDO ntext null,

constraint PK_KET_QUA_CHU_KY primary key nonclustered (KQ_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN9_FK */

/*==============================================================*/ create index CKBH_NHANVIEN9_FK on KET_QUA_CHU_KY (

CKBH_ID ASC ) go /*==============================================================*/ /* Table : KHACH_HANG */ /*==============================================================*/ create table KHACH_HANG (

KH_ID int not null, LKH_ID int not null, KH_MA nvarchar(15) null, KH_TEN nvarchar(50) null, KH_USER nvarchar(30) null, KH_PASS nvarchar(30) null, KH_EMAIL nvarchar(40) null, KH_DIENTHOAI numeric(20) null, KH_DIACHI ntext null,

constraint PK_KHACH_HANG primary key nonclustered (KH_ID) ) (adsbygoogle = window.adsbygoogle || []).push({});

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN11_FK */

/*==============================================================*/ create index CKBH_NHANVIEN11_FK on KHACH_HANG (

LKH_ID ASC )

/*==============================================================*/ /* Table : KHU_VUC */

/*==============================================================*/ create table KHU_VUC (

KV_ID int not null, TP_ID int not null, KV_TEN nvarchar(50) null,

constraint PK_KHU_VUC primary key nonclustered (KV_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN10_FK */

/*==============================================================*/ create index CKBH_NHANVIEN10_FK on KHU_VUC (

TP_ID ASC ) go /*==============================================================*/ /* Table : LOAI_KHACH_HANG */ /*==============================================================*/ create table LOAI_KHACH_HANG (

LKH_ID int not null, LKH_TEN nvarchar(50) null,

constraint PK_LOAI_KHACH_HANG primary key nonclustered (LKH_ID) )

go

/*==============================================================*/ /* Table : LOAI_NHAN_VIEN */

/*==============================================================*/ create table LOAI_NHAN_VIEN (

LNV_ID int not null, LNV_MA nvarchar(15) null, LNV_TEN nvarchar(50) null, LNV_NHIEMVU smallint null,

constraint PK_LOAI_NHAN_VIEN primary key nonclustered (LNV_ID) )

go

/*==============================================================*/ /* Table : LOAI_VAY_VON */

/*==============================================================*/ create table LOAI_VAY_VON (

LVV_ID int not null,

LVV_TENLOAIVAYVON nvarchar(50) null, LVV_NOIDUNGVAY ntext null,

constraint PK_LOAI_VAY_VON primary key nonclustered (LVV_ID) )

go

/*==============================================================*/ /* Table : NGANHANG_KHACHHANG */

/*==============================================================*/ create table NGANHANG_KHACHHANG (

NH_ID int not null, KH_ID int not null,

SO_TAI_KHOAN numeric(50) null, (adsbygoogle = window.adsbygoogle || []).push({});

constraint PK_NGANHANG_KHACHHANG primary key (NH_ID, KH_ID) )

go

/*==============================================================*/ /* Index : NGANHANG_KHACHHANG_FK */

/*==============================================================*/ create index NGANHANG_KHACHHANG_FK on NGANHANG_KHACHHANG ( NH_ID ASC ) go /*==============================================================*/ /* Index : NGANHANG_KHACHHANG2_FK */ /*==============================================================*/ create index NGANHANG_KHACHHANG2_FK on NGANHANG_KHACHHANG ( KH_ID ASC ) go /*==============================================================*/ /* Table : NGAN_HANG */ /*==============================================================*/ create table NGAN_HANG (

NH_ID int not null, NH_TEN nvarchar(50) null,

constraint PK_NGAN_HANG primary key nonclustered (NH_ID) )

go

/*==============================================================*/ /* Table : NHAN_TIEN_VAY */

/*==============================================================*/ create table NHAN_TIEN_VAY (

NT_ID int not null, VV_ID int not null,

NT_NGAYNHANDUKIEN smalldatetime null, NT_NGAYNHANTHUCTE smalldatetime null, NT_SOTIENNHAN decimal null,

constraint PK_NHAN_TIEN_VAY primary key nonclustered (NT_ID) )

/*==============================================================*/ /* Index : CKBH_NHANVIEN21_FK */

/*==============================================================*/ create index CKBH_NHANVIEN21_FK on NHAN_TIEN_VAY (

VV_ID ASC ) go /*==============================================================*/ /* Table : NHAN_VIEN */ /*==============================================================*/ create table NHAN_VIEN (

NV_ID int not null, LNV_ID int not null, NV_MA nvarchar(15) null, NV_TEN nvarchar(50) null, KH_USER nvarchar(30) null, KH_PASS nvarchar(30) null, KH_DIACHI ntext null, KH_EMAIL nvarchar(30) null, KH_DIENTHOAI numeric(20) null,

constraint PK_NHAN_VIEN primary key nonclustered (NV_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN18_FK */

/*==============================================================*/ create index CKBH_NHANVIEN18_FK on NHAN_VIEN (

LNV_ID ASC ) go /*==============================================================*/ /* Table : NHOM_BAT_DONG_SAN */ /*==============================================================*/ create table NHOM_BAT_DONG_SAN (

NBDS_ID int not null, NBDS_TEN nvarchar(50) null,

constraint PK_NHOM_BAT_DONG_SAN primary key nonclustered (NBDS_ID) )

go

/*==============================================================*/ /* Table : THANH_TOAN */

/*==============================================================*/ create table THANH_TOAN (

TT_ID int not null, NV_ID int not null, CNNH_ID int null,

CKBH_ID int not null, TT_MA nvarchar(15) null,

TT_NGAYTHANHTOANDUKIEN smalldatetime null, TT_NGAYTHANHTOAN smalldatetime null,

TT_TIENTHANHTOAN decimal null, TT_HINHTHUCTHANHTOAN bit null, (adsbygoogle = window.adsbygoogle || []).push({});

constraint PK_THANH_TOAN primary key nonclustered (TT_ID) )

go

/*==============================================================*/ /* Index : CKBH_NHANVIEN14_FK */

/*==============================================================*/ create index CKBH_NHANVIEN14_FK on THANH_TOAN (

CKBH_ID ASC ) go /*==============================================================*/ /* Index : CKBH_NHANVIEN17_FK */ /*==============================================================*/ create index CKBH_NHANVIEN17_FK on THANH_TOAN (

NV_ID ASC ) go /*==============================================================*/ /* Index : CKBH_NHANVIEN15_FK */ /*==============================================================*/ create index CKBH_NHANVIEN15_FK on THANH_TOAN (

CNNH_ID ASC ) go /*==============================================================*/ /* Table : TINH_THANH_PHO */ /*==============================================================*/ create table TINH_THANH_PHO (

TP_ID int not null, TP_TEN nvarchar(50) null,

constraint PK_TINH_THANH_PHO primary key nonclustered (TP_ID) )

go

/*==============================================================*/ /* Table : VAY_VON */

Một phần của tài liệu Xây dựng data web trợ giúp quản lý chu kỳ bán hàng thực hiện theo hợp đồng với công ty phần mềm ID (Trang 51)