Use the HOL Small Company ERD and HOL Small Company Details xlsx to complete the steps listed below. It is important to name the tables and columns exactly as they are shown in the ERD/xlsx. Failure to do so will cause future assignment to fail.
Use the HOL Small Company ERD and HOL Small Company Details xlsx to complete
the steps listed below.
It is important to name the tables and columns exactly as they are shown in the
ERD/xlsx.
Failure to do so will cause future assignment to fail.
*/
/*
()
Comments
1. At the beginning of your script, make single-line comments for your
name, the name of the assignment, and the date.
2. At the beginning of your script, make a multi-line comment that
describes the issues you had with this assignment.
*/
/* ()
Creating Tables
After the 5 DROP TABLE statements, complete the 5 CREATE TABLE statements
below to create the tables listed below.
Make sure you choose the appropriate data types.
Include NOT NULL and UNIQUE constraints.
DO NOT include key constraints (i.e., primary keys, foreign keys) in your
statements.
The table names are:
() HOL_CUSTOMERS
(6) HOL_BOOKS
(6) HOL_BOOK_CATEGORY
(6) HOL_ORDERS
(6) HOL_ORDER_ITEMS
*/
DROP TABLE HOL_ORDER_ITEMS;
DROP TABLE HOL_ORDERS;
DROP TABLE HOL_CUSTOMERS;
DROP TABLE HOL_BOOKS;
DROP TABLE HOL_BOOK_CATEGORY;
CREATE TABLE HOL_BOOK_CATEGORY
(
)
;
CREATE TABLE HOL_BOOKS
(
)
;
CREATE TABLE HOL_CUSTOMERS
(
)
;
CREATE TABLE HOL_ORDERS
(
)
;
CREATE TABLE HOL_ORDER_ITEMS
(
)
;
/*
Creating Constraints
*/
-- 1. ( )Make ALTER TABLE statements to add PRIMARY KEY constraints
-- to the tables you created above.
-- 2. () Make ALTER TABLE statements to add FOREIGN KEY constraints
-- to the tables you created above.
-- 3. () Make an ALTER TABLE statement to add a foreign key constraint
-- for the relationship between
-- the HOL_EMPLOYEES table (created in M01 HOL)
-- and
-- the HOL_ORDERS table created above.
-- Which column represents an "Employee" on the order in HOL_ORDERS?
-- 4. () Mae an ALTER TABLE statement to add
-- a unique constraint on the ORDER_ITEMS table
-- that includes both Order_Number and ISBN.



Trending now
This is a popular solution!
Step by step
Solved in 2 steps









