web programming

nathanqiu
createbooks.sql

drop table bookpatron; drop table patron; drop table book; ######################### # Create book table ######################### CREATE TABLE book ( barcode bigint NOT NULL , callno char(24) NOT NULL , title char(96) NOT NULL , pub char(48) NULL , binding char(16) NULL , onloan boolean NULL , price float NULL , PRIMARY KEY (barcode) ) ENGINE=MyISAM; ########################### # Create patron table ########################### CREATE TABLE patron ( pid int NOT NULL , lname char(48) NOT NULL , fname char(48) NOT NULL , type char(12) NULL , PRIMARY KEY (pid) ) ENGINE=MyISAM; ############################# # Create bookpatron table ############################# CREATE TABLE bookpatron ( barcode bigint NOT NULL , pid int NOT NULL , loandate date NOT NULL , returndate date NULL , media boolean NULL , PRIMARY KEY (barcode, pid, loandate) ) ENGINE=MyISAM;