Question: Task 1 [6 marks] Oktomook Book Store Database A SQL script is a set of SQL commands saved as a SQL file. If you are
Task 1 [6 marks] Oktomook Book Store Database A SQL script is a set of SQL commands saved as a SQL file. If you are already running MySQL, you can execute a SQL script file using the source command or you can import it in Workbench. Write an SQL script that builds a database to match the relational model provided to you. These SQL statements in the script must be provided in the correct order. Marks will be awarded for the following: 1. Creating the database (1 mark) 2. Successfully creating new tables (1 mark) 3. Including all attributes (1 mark) 4. Including constraints (1 mark) 5. Correctly creating Primary Keys (1 mark) 6. Correctly creating Foreign Keys (1 mark) You are required to create a database for the fictitious book store Oktomook for Task 1. The database is based on the model below:
OKTOMOOK RELATIONAL MODEL
Branch (branchNumber, branchName, streetNo, streetName, branchCity, branchState, numberEmployees)
Publisher (publisherCode, publisherName, publisherCity, publisherState)
Author (authorID, firstName, lastName) Book (ISBN, title, publisherCode, genre, retailPrice, paperback)
Wrote (ISBN, authorID, sequenceNumber)
Inventory (ISBN, branchNumber, quantityInStock)
FOREIGN KEYS
Book(publisherCode) is dependent on Publisher (publisherCode)
Wrote (ISBN) is dependent on Book (ISBN)
Wrote (authorID) is dependent on Author (authorID)
Inventory (ISBN) is dependent on Book (ISBN)
Inventory (branchNumber) is dependent on Branch (branchNumber)
3 OTHER CONSTRAINTS
The domain of Publisher(state) is [QLD, VIC, NSW, WA, TAS, NT, SA].
The domain of Book(genre) is [Non-Fiction, Science Fiction, Fantasy, Crime, Mystery, Young Adult, Romance, General Fiction]
ISBN must be a 13-digit number and may begin with a zero.
The publisher name and book title are both mandatory.
Paperback must be either True or False.
The default quantity in stock is 0.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
