0% found this document useful (0 votes)
0 views3 pages

Database[1]

The document outlines the creation of a database library with several tables including publisher, book, book_author, library_branch, book_copies, book_loans, and borrower. Each table is defined with specific attributes and primary keys. The structure is designed to manage information related to books, authors, publishers, library branches, and borrowers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views3 pages

Database[1]

The document outlines the creation of a database library with several tables including publisher, book, book_author, library_branch, book_copies, book_loans, and borrower. Each table is defined with specific attributes and primary keys. The structure is designed to manage information related to books, authors, publishers, library branches, and borrowers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Create database library;

Use library;
Create table publisher(

 Name varchar(34) not null,


 Address varchar(56) not null,
 Phone int not null,
 Primary key (Name)
 );

Desc publisher;

Create table book(

 Bookid varchar(30) not null,


 Title varchar(30) not null,
 Publishername varchar(45) not null,
 Primary key (Bookid)
 );

Desc book;

Create table book_author(

 Bookid varchar(45) not null,


 Authorname varchar(45)not null,
 Primary key (Bookid)
 );

Desc book_author;
Create table library_branch(

 Branchid varchar(56) not null,


 Branchname varchar(45) not null,
 Address varchar(40) not null,
 Primary key (Branchid)
 );

Desc library_branch;

Create table book_copies(

 Bookid varchar(34) not null,


 Branchid varchar(56) not null,
 No_Of_Copies int not null,
 Primary keys (Bookid,Branchid)
 );

Desc book_copies;

Create table book_loans(

 Bookid varchar(56) not null,


 Branchid varchar(67) not null,
 Cardno varchar(45) not null,
 Dateout int not null,
 Duedate int not null,
 Primary keys
(Bookid,Branchid,Cardno)
 );

Desc book_loans;
Create table borrower(

 Cardno varchar(45) not null,


 Name varchar(34) not null,
 Address varchar(65)not null,
 Phone int not null,
 Primary key (Cardno)
 );

Desc borrower;

You might also like