-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary.sql
More file actions
36 lines (27 loc) · 784 Bytes
/
library.sql
File metadata and controls
36 lines (27 loc) · 784 Bytes
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
use database;
drop table if exists books;
create table books(
bookId int unsigned not null auto_increment,
name varchar(150) not null,
author varchar(50) not null,
edition varchar(25) null,
available boolean not null,
primary key (bookId));
drop table if exists members;
create table members(
memberId int unsigned not null auto_increment,
firstName varchar(25) not null,
lastName varchar(25) not null,
phone varchar(25) not null,
resident boolean not null,
lateFeesDue decimal not null,
booksOut int not null,
primary key (memberId));
drop table if exists borrows;
create table borrows(
borrowId int unsigned not null auto_increment,
memberId int unsigned not null,
bookId int unsigned not null,
dateBorrowed date not null,
dateReturned date null,
primary key (borrowId));