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

email

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!