forked from nooraintahir/Library-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.sql
56 lines (48 loc) · 2.05 KB
/
database.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
51
52
53
54
CREATE TABLE borrower(
bid int,
name VARCHAR(50),
pass VARCHAR(50),
email VARCHAR(50),
phone int,
libcard boolean,
PRIMARY KEY (bid)
);
create table librarian(
lid int,
name VARCHAR(50),
pass VARCHAR(50),
PRIMARY KEY (lid)
);
create table book(
bookid int,
title VARCHAR(50),
author VARCHAR(50),
borrowed boolean,
PRIMARY KEY (bookid)
);
create table borrowed(
bookid int,
userid int
);
INSERT INTO borrower VALUES (101, 'John Smith', 'pas123', '[email protected]', 0331555123, true);
INSERT INTO borrower VALUES (102, 'Jane Doe', 'abc123', '[email protected]', 0301555567, true);
INSERT INTO borrower VALUES (103, 'Bob Johnson', 'passw0rd', '[email protected]', 0300555987, false);
INSERT INTO borrower VALUES (104, 'Sara', 'ilovecake', '[email protected]', 0302555432, true);
INSERT INTO borrower VALUES (105, 'Jack Brown', 'brownie', '[email protected]', 0300555876, true);
INSERT INTO borrower VALUES (106, 'Emily Davis', 'password456', '[email protected]', 0333555345, false);
INSERT INTO borrower VALUES (107, 'David Lee', 'dlee123', '[email protected]', 0333555789, true);
INSERT INTO librarian VALUES (110, 'John ', 'John101');
INSERT INTO librarian VALUES (122, 'Jones', 'sm134');
INSERT INTO librarian VALUES (133, 'Lara', 'La678');
INSERT INTO book VALUES (1, 'The Great Gatsby', 'F. Scott Fitzgerald', false);
INSERT INTO book VALUES (2, 'To Kill a Mockingbird', 'Harper Lee', true);
INSERT INTO book VALUES (3, '1984', 'George Orwell', false);
INSERT INTO book VALUES (4, 'Pride and Prejudice', 'Jane Austen', false);
INSERT INTO book VALUES (5, 'The Catcher in the Rye', 'J.D. Salinger', false);
INSERT INTO book VALUES (6, 'The Lord of the Rings', 'J.R.R. Tolkien', true);
INSERT INTO book VALUES (7, 'The Hitchhiker''s Guide to the Galaxy', 'Douglas Adams', true);
INSERT INTO book VALUES (8, 'Harry Potter and the Philosopher''s Stone', 'J.K. Rowling', false);
INSERT INTO book VALUES (9, 'The Hobbit', 'J.R.R. Tolkien', false);
INSERT INTO borrowed VALUES (6, 102);
INSERT INTO borrowed VALUES (4, 101);
INSERT INTO borrowed VALUES (7, 104);