Question
Write the full SQL query to create a database called Library, with the following table/s: BOOK: Field Name Data Type Size Relation Book_ID varchar 15
Write the full SQL query to create a database called "Library", with the following table/s:
BOOK:
Field Name | Data Type | Size | Relation |
Book_ID | varchar | 15 | NOT NULL - PRIMARY KEY |
Title | varchar | 100 | NOT NULL |
Authors | varchar | 50 | NOT NULL |
Volume | Integer |
| NOT NULL |
ISBN | varchar | 50 | NOT NULL |
ISSN | varchar | 50 | NOT NULL |
Language | varchar | 50 | NOT NULL |
Publisher | integer |
| NOT NULL - foreign key, reference table Publishers |
Year | integer |
| NOT NULL |
PUBLISHER:
Field Name | Data Type | Size | Relation |
publisher_ID | integer |
| NOT NULL - PRIMARY KEY |
publisher | varchar | 50 | NOT NULL |
USER:
Field Name | Data Type | Size | Relation |
user_ID | varchar | 15 | NOT NULL - PRIMARY KEY |
First_name | varchar | 50 | NOT NULL |
Last_name | varchar | 50 | NOT NULL |
phone | varchar | 10 | NOT NULL |
| varchar | 50 | NOT NULL |
BORROW:
Field Name | Data Type | Size | Relation |
Borrower_ID | varchar | 15 | NOT NULL - PRIMARY KEY |
Book_ID | varchar | 15 | NOT NULL - foreign key, references table BOOK |
Borrowed_From_Date | datetime |
| NOT NULL |
Borrowed_To_Date | datetime |
| NOT NULL |
Actual_Return_Date | datetime |
| NOT NULL |
Issued_By | varchar | 50 | NOT NULL |
FINES:
Field Name | Data Type | Size | Relation |
user_ID | varchar | 15 | NOT NULL - foreign key, references table USER |
Book_ID | varchar | 15 | NOT NULL - foreign key, references table BOOK |
Amount | decimal | (18,2) | NOT NULL |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started