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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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.

PK
PK
PK
FK
FK Region_ID
PK
FK
FK
PK
U
FK
PK
FK
FK
Legend
Tables provided
Tables you complete
Region_ID
Region_Name
FK
FK
Country_Code
Country_Name
Location ID
Street
City
State_Province
Postal Code
Country_ID
Department_ID
Department_Name
Manager_ID
Location_ID
Customer_ID
First Name
Middle Name
Last_Name
Email
Phone
Birth_Date
Gender
Location_ID
Order Number
Order Date
Order Total
Customer_ID
Sales_Person_ID
PK Order Item ID
Unit Price
Quantity
Order Number
ISBN
HOL_REGIONS
INTEGER
VARCHAR2(250)
HOL_COUNTRIES
CHAR(2)
VARCHAR2(250)
INTEGER
HOL_LOCATIONS
INTEGER
VARCHAR2(250)
VARCHAR2(250)
CHAR(2)
VARCHAR2(50)
INTEGER
HOL_DEPARTMENTS
INTEGER
VARCHAR2(250)
INTEGER
INTEGER
HOL_CUSTOMERS
INTEGER
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(50)
DATE
VARCHAR2(50)
INTEGER
HOL_ORDERS
INTEGER
DATE
NUMBER(18,2)
INTEGER
INTEGER
HOL_ORDER_ITEMS
INTEGER
NUMBER(12,2)
INTEGER
INTEGER
INTEGER
PK
FK
NN
U
PK
NN
NN
FK
FK
FK
PRIMARY KEY
FOREIGN KEY
NOT NULL
UNIQUE
Employee_ID
First Name
Middle Name
Last Name
Email
Phone
PK
NN
Hire Date
Current_Salary
Commision_Pct
FK
Bonus
Job_ID
PK Job ID
NN Job Title
Manager_ID
Department ID
PK Job_History_ID
FK
Employee_ID
Start Date
End Date
Job ID
Max_Salary
Min_Salary
FK
FK Department_ID
ISBN
Book Title
Book_Description
Book Price
Book Reviews
User_Rating
Book_Category_ID
HOL_EMPLOYEES
INTEGER
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(50)
DATE
NUMBER(12,2)
NUMBER(2,2)
NUMBER(12,2)
INTEGER
INTEGER
INTEGER
HOL_JOBS
INTEGER
VARCHAR2(250)
NUMBER(12,2)
NUMBER(12,2)
HOL_JOB_HISTORY
IDENTITY
INTEGER
DATE
DATE
INTEGER
INTEGER
HOL_BOOKS
INTEGER
VARCHAR2(250)
VARCHAR2(4000)
NUMBER(12,2)
INTEGER
NUMBER(4,2)
INTEGER
HOL_BOOK_CATEGORY
PK Book_Category_ID
NN Book_Category_Name
VARCHAR2(250)
Book_Category_Description VARCHAR2(4000)
INTEGER
Transcribed Image Text:PK PK PK FK FK Region_ID PK FK FK PK U FK PK FK FK Legend Tables provided Tables you complete Region_ID Region_Name FK FK Country_Code Country_Name Location ID Street City State_Province Postal Code Country_ID Department_ID Department_Name Manager_ID Location_ID Customer_ID First Name Middle Name Last_Name Email Phone Birth_Date Gender Location_ID Order Number Order Date Order Total Customer_ID Sales_Person_ID PK Order Item ID Unit Price Quantity Order Number ISBN HOL_REGIONS INTEGER VARCHAR2(250) HOL_COUNTRIES CHAR(2) VARCHAR2(250) INTEGER HOL_LOCATIONS INTEGER VARCHAR2(250) VARCHAR2(250) CHAR(2) VARCHAR2(50) INTEGER HOL_DEPARTMENTS INTEGER VARCHAR2(250) INTEGER INTEGER HOL_CUSTOMERS INTEGER VARCHAR2(250) VARCHAR2(250) VARCHAR2(250) VARCHAR2(250) VARCHAR2(50) DATE VARCHAR2(50) INTEGER HOL_ORDERS INTEGER DATE NUMBER(18,2) INTEGER INTEGER HOL_ORDER_ITEMS INTEGER NUMBER(12,2) INTEGER INTEGER INTEGER PK FK NN U PK NN NN FK FK FK PRIMARY KEY FOREIGN KEY NOT NULL UNIQUE Employee_ID First Name Middle Name Last Name Email Phone PK NN Hire Date Current_Salary Commision_Pct FK Bonus Job_ID PK Job ID NN Job Title Manager_ID Department ID PK Job_History_ID FK Employee_ID Start Date End Date Job ID Max_Salary Min_Salary FK FK Department_ID ISBN Book Title Book_Description Book Price Book Reviews User_Rating Book_Category_ID HOL_EMPLOYEES INTEGER VARCHAR2(250) VARCHAR2(250) VARCHAR2(250) VARCHAR2(250) VARCHAR2(50) DATE NUMBER(12,2) NUMBER(2,2) NUMBER(12,2) INTEGER INTEGER INTEGER HOL_JOBS INTEGER VARCHAR2(250) NUMBER(12,2) NUMBER(12,2) HOL_JOB_HISTORY IDENTITY INTEGER DATE DATE INTEGER INTEGER HOL_BOOKS INTEGER VARCHAR2(250) VARCHAR2(4000) NUMBER(12,2) INTEGER NUMBER(4,2) INTEGER HOL_BOOK_CATEGORY PK Book_Category_ID NN Book_Category_Name VARCHAR2(250) Book_Category_Description VARCHAR2(4000) INTEGER
#
HOL_REGIONS
PK Region ID
PK
HOL_JOBS
Job ID
HOL_CUSTOMERS
PK Customer ID
FK Location_ID
++
H
To HOL_LOCATIONS
DBMS 130: HOL Small Company ERD
HOL_COUNTRIES
PK Country ID
KFK Region_ID
HOL_JOB_HISTORY
PK Job History ID
FK Employee_ID
* FK Job_ID
FK Department_ID
HOL_ORDERS
PK Order_Number
KFK Customer_ID
++
++
PK
KFK
Location ID
Country_ID
HPK
FK
HOL_LOCATIONS
KFK
HOL EMPLOYEES
Employee ID
Department_ID
FK ISBN
Job_ID
HOL_ORDER_ITEMS
PK Order_Item_ID
FK Order_Number
++
HPK
- FK
HOL_DEPARTMENTS
HPK ISBN
Department ID
Location ID
HOL_BOOKS
FK Book_Category_ID
++
HOL_BOOK_CATEGORY
+ PK
Book Category ID
Transcribed Image Text:# HOL_REGIONS PK Region ID PK HOL_JOBS Job ID HOL_CUSTOMERS PK Customer ID FK Location_ID ++ H To HOL_LOCATIONS DBMS 130: HOL Small Company ERD HOL_COUNTRIES PK Country ID KFK Region_ID HOL_JOB_HISTORY PK Job History ID FK Employee_ID * FK Job_ID FK Department_ID HOL_ORDERS PK Order_Number KFK Customer_ID ++ ++ PK KFK Location ID Country_ID HPK FK HOL_LOCATIONS KFK HOL EMPLOYEES Employee ID Department_ID FK ISBN Job_ID HOL_ORDER_ITEMS PK Order_Item_ID FK Order_Number ++ HPK - FK HOL_DEPARTMENTS HPK ISBN Department ID Location ID HOL_BOOKS FK Book_Category_ID ++ HOL_BOOK_CATEGORY + PK Book Category ID
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
SQL Query
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education