You are on page 1of 3

C S D LIU NHP XUT VT T

M t bng li: Mt cng ty kinh doanh cc loi vt t: Gch, thp, xi mng v.v Cc nhn vin trong cng ty c nhim v cp nht vt trn my tnh. Khi xut vt t th t cp nht li s lng tn vi qui tc ngy xut phi sau ngy giao v s lng xut phi nh hn hoc bng s lng giao. Mi nhn vin c phn quyn khc nhau a trn RoleId.

C s d liu gm cc table sau: a. Table SalesUser Type Field

Name

Constraint
Primary key FK

Username Password UserID

nvarchar(50) nvarchar(50) Int

b. Table InfoUser Type Field

Name

Constraint
Primary key (t tng)

UserID Ho Ten Diachi Ngaysinh Luong Cmnd Sdt Ghichu

int nvarchar(50) nvarchar(50) nvarchar(100) DateTime int varchar(9) varchar(11) Nvarchar(100)

>=1000000, <=9000000

c. Table Vt t

Field Name
Mavt Tenvt Dvt int

Type

Constraint
Primary key (t tng) Unique

nvarchar(50) nvarchar(50)

Makho

int

FK

d. Table Kho

Field Name
Makho Tenkho Diachi int

Type

Constraint
Primary key (t tng) Unique

nvarchar(50) nvarchar(50)

e. Table Nhp vt t Type Field

Constraint
Primary key Primary key Primary key >0 >0

Name
UserID Mavt Ngaynhap Soluong_nhap Dongia int int Datetime Int int

Soluongton int >=0 Kha chnh: UserID+ Mavt+ Ngaynhap f. Table Xut vt t Type Field

Constraint
Primary key Primary key Primary key >0

Name
UserID Mavt Ngayxuat Soluong_xuat int int Datetime Int

Dongia int >0 Kha chnh: UserID+ Mavt+ Ngayxuat g. Table Role

Field Name
Roleid int

Type

Constraint
Primary key (t tng)

Rolename

nvarchar(50)

Unique

Diagram

You might also like