Solved by verified expert:The instructions are on the word document. Follow the instrucyions and complete theassignment. Let me know if you have any questions. Thank you again!pinkbike42
how_to_complete_assignments.docx
global_foods_homework_creating_tables_from_erd_dl_class_fall_2017.docx
global_foods_data_1_.zip
Unformatted Attachment Preview
When creating tables, copy and paste the following into the document:
Create table new_table
(column_name datatype constraint_if_needed,
column_name datatype constraint_if_needed,
column_name datatype constraint_if_needed,
constraint,
constraint);
describe new_table;
show results from the statement. (That is the structure of the new table from the describe.)
When inserting records, copy and paste the following into the document:
Select *
from new_table;
show result set. (That is all the records you added to the table.)
Global Foods Homework Creating tables from ERD & Table instance
charts using SQL code – Steps 1 and 2.
Note: We will add F_ to the tables when we create them below.
Note: Subtypes will
become optional fields
in the table, until we
put in the check
constraints in a later
assignment.
Name of Table:
Key Type
PK,FK
PK
F_STAFF
Optionality * or
o
Column Name
Column Data Type
(NUMBER, VARCHAR2, DATE)
*
STAFF_ID
NUMBER(5)
*
FIRST_NAME
VARCHAR2(20)
*
Last_name
VARCHAR2(20)
*
DOB
DATE
*
SALARY
NUMBER (8,2)
(SUBTYPE)
O
NUMBER(5,2)
(SUBTYPE)
O
OVERTIME_RATE
TRAINING
STAFF_TYPE
MANAGER_ID
Manager_Budget
Target_Revenue
NUMBER(8,2)
NUMBER(8,2)
*
FK
*
(SUBTYPE)
O (subtype needs to be optional)
(SUBTYPE)
O(subtype needs to be optional)
Name of Table:
Key Type
VARCHAR2(20)
VARCHAR2(1)
NUMBER(5)
F_SHIFTS – (fill in the chart with the fields or keys needed from the diagram above)
Optionality
* or o
PK,FK
Column Name
Column
Data Type
(NUMBER,VARCHAR2, DATE)
*
Number(5)
*
VARCHAR2(15)
Name: F_SHIFT_ASSIGN –this table has a composite PK, so put all 3 fields in the primary key constraint. (fill
in the missing fields in the Table Instance Chart Below)
Key type optionality Column Name
Column Data Type
( * or o)
(Varchar2,number,date)
PK,FK
STAFF_ID
Number(5)
PK,FK
Number(5)
PK
SHIFT_DATE
DATE
Composite Primary Key Example – must be done at the table level (at the end of the code):
constraint constraint_name Primary Key (column_name, column_name, column_name)
F_ORDERS (fill in the missing fields in the Table Instance Chart Below)
Key type
(PK,FK)
Optionality
( * or o)
Column Name
Column Data Type
Varchar2,number,date
PK
*
*
*
ORDER_ID
ORDER_DATE
NUMBER(6)
DATE
NUMBER(5)
FK
Foreign Key will always live in the CHILD tables (where the crows feet are) Example below
CONSTRAINT F_ORDERS_STAFF_FK FOREIGN KEY (STAFF_ID)
REFERENCES STAFF (STAFF_ID)
F_FOOD_ITEMS – (fill in the missing fields in the Table Instance Chart Below)
Key type
(PK,FK)
Optionality
( * or o)
Column Name
Column Data Type
(Varchar2,number,date)
PK
NUMBER(4)
*
*
PRICE
F_ORDERLINE
VARCHAR2(60)
NUMBER(5,2)
(fill in the missing fields in the Table Instance Chart Below)
Key type
(PK,FK)
* or Column name
o
Column Data Type
PK,FK
PK,FK
*
*
*
NUMBER(6)
NUMBER(4)
NUMBER(4)
ORDER_ID
QTY
(Varchar2,number,date)
Now, complete Step 3 – Importing Records
TURN IN:
1. This assignment with Table Instance Charts filled in.
2. The word or notepad document with the items in it that were listed in the What to Turn into
Blackboard document,
…
Purchase answer to see full
attachment
You will get a plagiarism-free paper and you can get an originality report upon request.
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more