The document contains SQL code to create 20 tables for a library database and define relationships between the tables through foreign keys. The tables created include tables for publishers, authors, book categories, books, borrowing slips, member cards, invoices, discounts, employees, and others. Foreign keys are defined to link the tables together and enforce referential integrity of data.
Test Bank For Concepts of Database Management 10th Edition Lisa Friedrichsen Joseph J Adamski Lisa Ruffolo Ellen Monk Joy L Starks Philip J Pratt Mary Z Last
The document contains SQL code to create 20 tables for a library database and define relationships between the tables through foreign keys. The tables created include tables for publishers, authors, book categories, books, borrowing slips, member cards, invoices, discounts, employees, and others. Foreign keys are defined to link the tables together and enforce referential integrity of data.
The document contains SQL code to create 20 tables for a library database and define relationships between the tables through foreign keys. The tables created include tables for publishers, authors, book categories, books, borrowing slips, member cards, invoices, discounts, employees, and others. Foreign keys are defined to link the tables together and enforce referential integrity of data.
The document contains SQL code to create 20 tables for a library database and define relationships between the tables through foreign keys. The tables created include tables for publishers, authors, book categories, books, borrowing slips, member cards, invoices, discounts, employees, and others. Foreign keys are defined to link the tables together and enforce referential integrity of data.
( [MATHE] Char(1) NOT NULL, [CHUVU] Char(1) NULL, [MANHANVIEN] Varchar(10) NOT NULL, Primary Key ([MATHE],[MANHANVIEN]) ) go
Create table [THONGTINXUATBAN]
( [MANXB] Varchar(10) NOT NULL, [MASACH] Varchar(10) NOT NULL, [LANXUATBAN] Varchar(10) NULL, [NGAYXUATBAN] Datetime NULL, [SOLUONG] Integer NULL, Primary Key ([MANXB],[MASACH]) ) go
Create table [CHITIETPHIEUMUON]
( [MASACH] Varchar(10) NOT NULL, [MAPHIEU] Varchar(10) NOT NULL, [NGAYMUON] Datetime NULL, [NGAYTRA] Datetime NULL, [SOLUONG] Integer NULL, [DONGIA] Integer NULL, Primary Key ([MASACH],[MAPHIEU]) ) go
Create table [CHITIETHOADON]
( [MAHOADON] Varchar(10) NOT NULL, [MASACH] Varchar(10) NOT NULL, [NGAYLAP] Datetime NULL, [SOLUONG] Integer NULL, [DONGIA] Integer NULL, Primary Key ([MAHOADON],[MASACH]) ) go
Alter table [THONGTINXUATBAN] add foreign key([MANXB]) references [NHAXUATBAN]
([MANXB]) on update no action on delete no action go Alter table [SACH] add foreign key([MATACGIA]) references [TACGIA] ([MATACGIA]) on update no action on delete no action go Alter table [SACH] add foreign key([MATHELOAI]) references [THELOAI] ([MATHELOAI]) on update no action on delete no action go Alter table [THONGTINXUATBAN] add foreign key([MASACH]) references [SACH] ([MASACH]) on update no action on delete no action go Alter table [CHITIETPHIEUMUON] add foreign key([MASACH]) references [SACH] ([MASACH]) on update no action on delete no action go Alter table [CHITIETHOADON] add foreign key([MASACH]) references [SACH] ([MASACH]) on update no action on delete no action go Alter table [CHITIETPHIEUMUON] add foreign key([MAPHIEU]) references [PHIEUMUON] ([MAPHIEU]) on update no action on delete no action go Alter table [PHIEUMUON] add foreign key([MADOCGIA]) references [DOCGIA] ([MADOCGIA]) on update no action on delete no action go Alter table [THETHANHVIEN] add foreign key([MADOCGIA]) references [DOCGIA] ([MADOCGIA]) on update no action on delete no action go Alter table [HOADON] add foreign key([MADOCGIA]) references [DOCGIA] ([MADOCGIA]) on update no action on delete no action go Alter table [CHITIETHOADON] add foreign key([MAHOADON]) references [HOADON] ([MAHOADON]) on update no action on delete no action go Alter table [HOADON] add foreign key([MAKM]) references [KHUYENMAI] ([MAKM]) on update no action on delete no action go Alter table [PHIEUMUON] add foreign key([MANHANVIEN]) references [NHANVIEN] ([MANHANVIEN]) on update no action on delete no action go Alter table [HOADON] add foreign key([MANHANVIEN]) references [NHANVIEN] ([MANHANVIEN]) on update no action on delete no action go Alter table [THENV] add foreign key([MANHANVIEN]) references [NHANVIEN] ([MANHANVIEN]) on update no action on delete no action go Alter table [PHIEUPHAT] add foreign key([MASACH],[MAPHIEU]) references [CHITIETPHIEUMUON] ([MASACH],[MAPHIEU]) on update no action on delete no action go
Test Bank For Concepts of Database Management 10th Edition Lisa Friedrichsen Joseph J Adamski Lisa Ruffolo Ellen Monk Joy L Starks Philip J Pratt Mary Z Last