DROP TABLE Borrow;
DROP TABLE Available;
DROP TABLE Book;
DROP TABLE Library;
DROP TABLE Student;

CREATE TABLE Student (
ID VarChar(15) Primary Key,
SName VarChar(30),
SCity VarChar(30)
);
CREATE TABLE Book (
ISBN VarChar(15) Primary Key,
Title VarChar (30) NOT NULL,
Author VarChar (30)
);
CREATE TABLE Library (
LName VarChar(30) Primary Key,
City VarChar(30) NOT NULL
);
CREATE Table Available (
ISBN VarChar(15),
LName VarChar(30),
noOfCopies Integer NOT NULL,
Primary Key (ISBN, LName),
Foreign Key (ISBN) References Book(ISBN),
Foreign Key (LName) References
Library(LName)
);
CREATE TABLE Borrow (
ID VarChar(15),
LName VarChar(30),
ISBN VarChar(15),
Primary Key (ID, LName, ISBN),
Foreign Key(ID) References Student(ID),
Foreign Key (ISBN ,LName) References Available(ISBN ,LName)
);
