-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate tables.sql
50 lines (34 loc) · 1.03 KB
/
create tables.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CREATE TABLE Member(
membershipId VARCHAR(7) NOT NULL,
Name VARCHAR(25),
eMail VARCHAR(25),
faculty VARCHAR(15),
phoneNumber VARCHAR(8),
PRIMARY KEY (membershipId));
CREATE TABLE Book(
accessionNo VARCHAR(10) NOT NULL,
ISBN VARCHAR(25),
PRIMARY KEY (accessionNo));
CREATE TABLE Author(
ISBN VARCHAR(25) NOT NULL,
authorName VARCHAR(50));
CREATE TABLE ISBN(
ISBN VARCHAR(25) NOT NULL,
publisherYear SMALLINT,
publisher VARCHAR(50),
title VARCHAR(100),
PRIMARY KEY (ISBN));
CREATE TABLE Borrow(
accessionNo VARCHAR(10) NOT NULL,
membershipId VARCHAR(7) NOT NULL,
returnDate DATE,
PRIMARY KEY( accessionNo , membershipId));
CREATE TABLE Reservation(
accessionNo VARCHAR(10) NOT NULL,
membershipId VARCHAR(7) NOT NULL,
reserveDate DATE,
PRIMARY KEY( accessionNo , membershipId));
CREATE TABLE Fine(
membershipId VARCHAR(7) NOT NULL,
paymentDate DATE,
paymentAmount SMALLINT);