Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* IVY TECH COMMUNITY COLLEGE DBMS130 M02 Hands-On Lab Assignment Constructing the Database */ /* (5 points) After completing your SQL below, upload your Script

/* IVY TECH COMMUNITY COLLEGE DBMS130  M02 Hands-On Lab Assignment Constructing the Database */ /* (5 points) After completing your SQL below, upload your Script and Run it until all errors are resolved. I WILL GRADE this script directly in APEX. You will be adding DB Objects to the HOL DB that were not added in the HOL M01 scripts. 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. */ /* (5 points) Comments 1. At the beginning of your script, write single-line comments for your name, the name of the assignment, and the date. 2. At the beginning of your script, write a multi-line comment that describes the issues you had with this assignment. */ /* (30 points) 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: (6 points) 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 ( ) ; /* (20 points) Creating Constraints */ -- 1. (5 points) Write ALTER TABLE statements to add PRIMARY KEY constraints -- to the tables you created above. -- 2. (5) Write ALTER TABLE statements to add FOREIGN KEY constraints -- to the tables you created above. -- 3. (5) Write 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. (5) Write an ALTER TABLE statement to add -- a unique constraint on the ORDER_ITEMS table -- that includes both Order_Number and ISBN./* IVY TECH COMMUNITY COLLEGE DBMS130  M02 Hands-On Lab Assignment Constructing the Database */ /* (5 points) After completing your SQL below, upload your Script and Run it until all errors are resolved. I WILL GRADE this script directly in APEX. You will be adding DB Objects to the HOL DB that were not added in the HOL M01 scripts. 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. */ /* (5 points) Comments 1. At the beginning of your script, write single-line comments for your name, the name of the assignment, and the date. 2. At the beginning of your script, write a multi-line comment that describes the issues you had with this assignment. */ /* (30 points) 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: (6 points) 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 ( ) ; /* (20 points) Creating Constraints */ -- 1. (5 points) Write ALTER TABLE statements to add PRIMARY KEY constraints -- to the tables you created above. -- 2. (5) Write ALTER TABLE statements to add FOREIGN KEY constraints -- to the tables you created above. -- 3. (5) Write 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. (5) Write an ALTER TABLE statement to add -- a unique constraint on the ORDER_ITEMS table -- that includes both Order_Number and ISBN.

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Which account has a normal debit balance

Answered: 1 week ago

Question

2. What potential barriers would you encourage Samuel to avoid?

Answered: 1 week ago