Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions

Question

Explain the different types of marketing strategies.

Answered: 1 week ago