Answered step by step
Verified Expert Solution
Question
1 Approved Answer
. Open a text editor to begin writing your SQL script that will contain your SQL statements. ( You may use any program that allow
Open a text editor to begin writing your SQL script that will contain your SQL statements. You may use
any program that allow you to create sql files eg Notepad, Wordpad, Notes, TextEdit, Notepad
etc.
Name the file MHOLLastNameFirstName.sql eg MHOLDoeJohn.sql
Complete steps BD below.
Save the statements in your script in the order in which the tables should be created based on the
foreign key constraints
Execute your script to ensure it runs without errors. If your code produces errors, work to resolve them
before submitting.
Save the script and upload it as your submission.
Points will be deducted if a sql file is not submitted. Your script should contain CREATE TABLE
statements, ALTER TABLE statements primary key, foreign key, unique key multiline
comment, and singleline comments.
B Creating Tables points
Write CREATE TABLE statements to create the tables listed below. Do not include constraints ie
primary keys, foreign keys in your statements. Make sure you choose the appropriate data types and
do not forget to set the columns marked as mandatory in the diagram as NOT NULL in your statement.
CUSTOMERS
BOOKS
BOOKCATEGORY
ORDERS
ORDER ITEMS
C Creating Constraints points
Write ALTER TABLE statements to add primary key constraints to the tables you created in step The
constraints you create should match the primary keys displayed in the ERD.
Write ALTER TABLE statements to add foreign key constraints to the tables you created in step The
constraints you create should match the foreign keys displayed in the ERD.
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