1. Trang chủ
  2. » Công Nghệ Thông Tin

Giáo trình SQL bài 18

4 202 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 4
Dung lượng 105,65 KB

Nội dung

W09_FD_Lab04_Libary.doc Lab 04 Library Database Create Database Library Note: Save to file Library_DB.sql Create tables – Priamry Key – Foreign Key • • Table Structure: Publisher Field Name Name Address Phone Data Type VARCHAR(20) VARCHAR(30) VARCHAR(10) Null NOT NULL Book Field Name Book_ID Ttile Publisher_Name Data Type SMALLINT VARCHAR(30) VARCHAR(20) Null NOT NULL NOT NULL W09_FD_Lab04_Libary.doc • • • • • Library_Branch Field Name Branch_ID Branch_Name Address Data Type SMALLINT VARCHAR(20) VARCHAR(30) Null NOT NULL NOT NULL Book_Authors Field Name Book_ID Author_Name Data Type SMALLINT VARCHAR(20) Null – PK NOT NULL NOT NULL Borrower Field Name Card_NO Name Adress Phone Data Type SMALLINT VARCHAR(20) VARCHAR(30) VARCHAR(10) Null – PK NOT NULL Book_Copies Field Name Book_ID Branch_ID No_Of_Copies Data Type SMALLINT SMALLINT SMALLINT Null – PK NOT NULL NOT NULL Book_Loans Field Name Book_ID Branch_ID Card_NO Date_Out Due_Date Data Type SMALLINT SMALLINT SMALLINT DATETIME DATETIME Null – PK NOT NULL NOT NULL NOT NULL Note: Save to file Library_Tab.sql W09_FD_Lab04_Libary.doc Insert Data • Publisher Name Address Phone Amazing Books 9012 Great Rd 333-3333 Plume 1234 Cool Ave 555-5555 Random House 5678 Neat St 444-4444 • Book Book_ID Title Publisher_Name The Lost Tribe Random House Farook Random House Carrie Plume The Dark Tower VII Plume Red Dawn Amazing Books Zepplin Amazing Books • Library_Branch Branch_ID Branch_Name Address Sharpstown 4321 Wonder Road Central 9876 Flower St • Book_Authors Book_ID Author_Name Master Nook Jardumba Nartangula Stephen King Stephen King John Smith Yasunori Mitsugi • Borrower Card_No Name Address Phone John Doe 1234 Plain St 532-2432 Jane Doe 1234 Plain St 532-2432 Mike Jackson 1111 nowhere 222-2222 • Book_Copies Book_ID Branch_ID No_Of_Copies 1 10 10 10 2 10 10 10 10 10 10 10 10 W09_FD_Lab04_Libary.doc • Book_Loans Book_ID Branch_ID Card_No Date_Out Due_Date 1 12/15/2005 NULL 11/24/2005 NULL 2 12/15/2005 NULL 2 11/24/2005 NULL 3 12/15/2005 NULL 3 11/24/2005 NULL 1 12/15/2005 NULL 11/24/2005 NULL 12/15/2005 NULL 2 11/24/2005 NULL 12/15/2005 NULL 11/19/2009 NULL Note: Save to file Library_Data.sql ... SMALLINT DATETIME DATETIME Null – PK NOT NULL NOT NULL NOT NULL Note: Save to file Library_Tab .sql W09_FD_Lab04_Libary.doc Insert Data • Publisher Name Address Phone Amazing Books 9012 Great... 12/15/2005 NULL 2 11/24/2005 NULL 12/15/2005 NULL 11/19/2009 NULL Note: Save to file Library_Data .sql

Ngày đăng: 03/12/2015, 06:45

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN