Question

In: Computer Science

Consider the following relation and convert to the normal form indicated. Make sure your Primary Key...

Consider the following relation and convert to the normal form indicated. Make sure your Primary Key and its attribute(s) is/are underlined for full credit. Also indicate foreign keys using (FK) if any.

0NF:

ORDER[order_num, date, SSN, cust_name, phone, email, (SKU, item_name, price)]

Notes:An order has only one customer, but a customer can place many orders. Each order can have multiple items.  

1NF:

2NF:

3NF:

Solutions

Expert Solution

Answer : Relations in 3NF :

ORDER[order_num, date, SSN] with primary key order_num and foreign key SSN
CUSTOMER[SSN, cust_name, phone, email] with primary key SSN
ITEM[SKU, item_name, price] with primary key SKU
ORDER_ITEMS[SKU, order_num] with primary key {SKU, order_num} amd foreign key order_num

Explanation :

Converting to 1NF : The ORDER relation is in 0NF. Each order has one customer but can have multiple items. So, the relation is not in 1NF. It can be converted to 1NF using decomposition as shown below :

ORDER[order_num, date, SSN, cust_name, phone, email] with primary key order_num
ORDER_ITEMS[SKU, item_name, price, order_num] with primary key {SKU, order_num}
as the item and order_num is unique for each order

The relation above has following functional dependencies :
ORDER :
order_num -> date, SSN
SSN -> cust_name, phone, email
ORDER_ITEMS :
SKU -> item_name, price

Converting 2NF : The relations in 2NF can not have partial functional dependencies. In above relations, there is a partial dependency : SKU -> item_name, price. This functional dependency can be removed using decomposition as shown below :
ITEM[SKU, item_name, price] with primary key SKU
ORDER_ITEMS[SKU, order_num] with primary key {SKU, order_num} amd foreign key order_num
ORDER[order_num, date, SSN, cust_name, phone, email] with primary key order_num

Above relations are in 2NF.

Converting to 3NF : The relation is in 3NF if it is in 2NF and there are no transitive dependencies. Above tables are in 2NF. There is a transitive dependency in relation ORDER : SSN -> cust_name, phone, email. It can be removed using decomposition :
ORDER[order_num, date, SSN] with primary key order_num and foreign key SSN
CUSTOMER[SSN, cust_name, phone, email] with primary key SSN
ITEM[SKU, item_name, price] with primary key SKU
ORDER_ITEMS[SKU, order_num] with primary key {SKU, order_num} amd foreign key order_num

Above relations are in 3NF.


Related Solutions

Convert this into Chomsky normal form, where each rule is in the form: A --> BC...
Convert this into Chomsky normal form, where each rule is in the form: A --> BC or A --> a A --> A + B | B B --> B x C | C C --> (A) | 5
Find the indicated area under the curve of the standard normal​ distribution; then convert it to...
Find the indicated area under the curve of the standard normal​ distribution; then convert it to a percentage and fill in the blank. About ________​% of the area is between z = -3.5 and z = 3.5 ​(or within 3.5 standard deviations of the​ mean).
convert the following grammar to Chomsky Normal Form S -> D0S1 | 1 D -> F0D1...
convert the following grammar to Chomsky Normal Form S -> D0S1 | 1 D -> F0D1 | 0 | e | FG F -> SF | DD | S G -> GK | DG
Create the following tables. The underlined bold column names are the primary keys. Make sure to...
Create the following tables. The underlined bold column names are the primary keys. Make sure to specify the primary and foreign key constraints in your create table statements. customer: (cus_code:integer, cus_lname:varchar(20), cus_fname:varchar(20), cus_initial:char, cus_areacode:integer,cus_phone:integer). invoice: (inv_number:integer, cus_code:integer, inv_date:date,                   foreign key cus_code references customer(cus_code)) vendor:(vend_code:integer,vend_name:varchar(30),vend_contact:varchar(30),vend_areacode:integer,vend_phone:integer) product:(prod_code:integer, prod_desc:varchar(50), prod_price:integer, prod_quant:integer,vend_code:integer, foreign key (vend_code) referenecs Vendor(vend_code)) line: (inv_number:integer, prod_code:integer ,line_units:integer, foreign key (inv_number) references Invoice(inv_number), foreign key (prod_code) references Product (prod_code) )
Find the indicated area under the curve of the standard normal distribution, then convert it to a percentage and fill in the blank.
Find the indicated area under the curve of the standard normal distribution, then convert it to a percentage and fill in the blank. About _____% of the area is between z=?2.2 and z=2.2 (or within 2.2 standard deviations of the mean). About?____% of the area is between z=?2.2 and z=2.2 (or within 2.2 standard deviations of the mean). (Round to two decimal places as needed.)?
Write an essay describing California's unique primary system. In your essay, make sure to discuss how...
Write an essay describing California's unique primary system. In your essay, make sure to discuss how the system works, the reasons why California reformed its primary system in 2010, and the possible drawbacks associated with the system. Your essay must be informed by the following two articles, which are available from the course homepage: "Here's How California’s 'Jungle Primary' System Works" (The New York Times) "Making Sense of California's Top-Two Primary System" (KQED News) Response length requirement: 350 words or...
Q3. Convert the conceptual database into a relational database schema. Identify the primary key and foreign...
Q3. Convert the conceptual database into a relational database schema. Identify the primary key and foreign key constraints. Q4. Show all the functional dependencies that should hold among the attributes. Q5. Design relation schemas for the database that are each in 3NF. Specify the primary and foreign key attributes of each relation. Hi expert! Can you help me with the above questions? I'm not asking you to solve my questions but want to find what each questions actually requires me...
Make sure to include comments that explain all your steps (starts with #) Make sure to...
Make sure to include comments that explain all your steps (starts with #) Make sure to include comments that explain all your steps (starts with #) Write a program that prompts the user for a string (a sentence, a word list, single words etc.), counts the number of times each word appears and outputs the total word count and unique word count in a sorted order from high to low. The program should: Display a message stating its goal Prompt...
Normalize the following relations. Show possible candidate/primary keys and the functional dependencies. Explain the normal form...
Normalize the following relations. Show possible candidate/primary keys and the functional dependencies. Explain the normal form in which the relation is currently in (based on the sample data) and how do you break the relations to get 3rd Normal Form. Show the new relations obtained after normalization and underline the candidate/primary key in each new relation and italic the foreign key. Relation 1: COLLEGE PARKING TICKET (STID, LName, FName, PhoneNo, StateLic, LicNo, Ticket#, Date, Code, Fine) (Illustrated with sample data)...
Convert the logical statement ~(P || ~R) || (Q -> R) to conjunctive normal form. Please...
Convert the logical statement ~(P || ~R) || (Q -> R) to conjunctive normal form. Please explain the steps!!
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT