Question

In: Computer Science

This is a simple list table of a company trying to keep track of parts that...

This is a simple list table of a company trying to keep track of parts that they sell and orders that came in purchasing those parts (in other words, not a database but a flat one table file). You will design a database for this company so that they won’t be relying on a simple 1 table list system to keep track of their data. Looking at the table below, produce the 3NF of the data.

OrderNum

OrderDate

PartNum

Description

NumOrdered

QuotedPrice

21608

10/20/2010

AT94

Iron

11

$21.95

21610

10/20/2010

DR93

Gas Range

1

$495.00

21610

10/20/2010

DW11

Washer

1

$399.99

21613

10/21/2010

KL62

Dryer

4

$329.95

21614

10/21/2010

KT03

Dishwasher

2

$595.00

21617

10/23/2010

BV06

Home Gym

2

$794.95

21617

10/23/2010

CD52

Microwave Oven

4

$150.00

21619

10/23/2010

DR93

Gas Range

1

$495.00

21523

10/23/2010

KV29

Treadmill

2

Create the database in an actual database application (i.e Microsoft Access, MySQL or Oracle, etc.). You must use SQL commands to create the tables in the database (i.e Create Table command). Submit the SQL commands with the completed database as part of the assignment. The tables should be populated with records from the scenario you chose.

Solutions

Expert Solution

Consider the relation given

FIrst Normal Form (1NF) :

  • This relation is in the first normal form because all columns are atomic in nature
  • each column contains single value '
  • and each row has same number of olumns

Second Normal Form (2NF) :

  • This table contains partial dependency that needs to remove by making new table like
    • Part :Part table store part details like PartNum , Description
    • Orders :This table stores order details likeIron orderNum and OrderDate

Below are tables in 2NF

1.Table Name :Part

Schema :Part (PartNum , Description )

FD :PartNum==>Description

Below is the table data

PartNum Description
AT94 Iron
DR93 Gas Range
DW11 Washer
KL62 Dryer
KT03 Dishwasher
BV06 Home Gym
CD52 Microwave Oven
KV29 Treadmill

2.Table Name :Orders

Schema :Orders(OrderNum , OrderDate)

FD :OrderNum==>OrderDate

Below is the table data

OrderNum OrderDate
21608 10/20/2010
21610 10/20/2010
21613 10/21/2010
21614 10/21/2010
21617 10/23/2010
21619 10/23/2010
21523 10/23/2010

Third Normal Form (3NF) :

  • Above tables contains transitive dependency hence above tables needs to normalize into 3NF

Below are tables in 3NF

1.Table Name :Part

Schema :Part (PartNum , Description )

FD :PartNum==>Description

Below is the table data

PartNum Description
AT94 Iron
DR93 Gas Range
DW11 Washer
KL62 Dryer
KT03 Dishwasher
BV06 Home Gym
CD52 Microwave Oven
KV29 Treadmill

2.Table Name :Orders

Schema :Orders(OrderNum , OrderDate)

FD :OrderNum==>OrderDate

Below is the table data

OrderNum OrderDate
21608 10/20/2010
21610 10/20/2010
21613 10/21/2010
21614 10/21/2010
21617 10/23/2010
21619 10/23/2010
21523 10/23/2010

3.Table Name :OrderDetails

Schema :OrderDetails(OrderNum , PartNum,NumOrdered,QuotedPrice)

FD :OrderNum,PartNum==>NumOrdered,QuotedPrice

Below is the table data

OrderNum PartNum NumOrdered QuotedPrice
21608 AT94 11 $21.95
21610 DR93 1 $495.00
21610 DW11 1 $399.99
21613 KL62 4 $329.95
21614 KT03 2 $595.00
21617 BV06 2 $794.95
21617 CD52 4 $150.00
21619 DR93 1 $495.00
21523 KV29 2

============================================

Below ae tables in MySQL :

1.Table Name :Part
create table Part(
PartNum varchar(20) Primary key,
Description varchar(100));

/*inserting records into Part Table*/
insert into Part values ('AT94','Iron');
insert into Part values ('DR93','Gas Range');
insert into Part values ('DW11','Washer');
insert into Part values ('KL62','Dryer');
insert into Part values ('KT03','Dishwasher');
insert into Part values ('BV06','Home Gym');
insert into Part values ('CD52','Microwave Oven');
insert into Part values ('KV29','Treadmill');

/*selecting records from Part*/
select * from part;

Screen in MySQL :

***********************************************

2.Table Name :Order
create table Orders(
OrderNum int Primary key,
OrderDate Date);

/*inserting records into Orders Table*/
insert into Orders values (21608,'2010/10/20');
insert into Orders values (21610,'2010/10/20');
insert into Orders values (21613,'2010/10/21');
insert into Orders values (21614,'2010/10/21');
insert into Orders values (21617,'2010/10/23');
insert into Orders values (21619,'2010/10/23');
insert into Orders values (21523,'2010/10/23');

/*selecting records from Orders*/
select * from Orders;

Screen in MySQL :

**********************************************

3.Table Name :OrderDetails
create table OrderDetails(
OrderNum int ,
PartNum varchar(20),
NumOrdered int,
QuotedPrice decimal(6,2));

/*inserting records into OrderDetails Table*/
insert into OrderDetails values (21608,'AT94',11,21.95);
insert into OrderDetails values (21610,'DR93',1,495.00);
insert into OrderDetails values (21610,'DW11',1,399.99);
insert into OrderDetails values (21613,'KL62',4,329.95);
insert into OrderDetails values (21614,'KT03',2,595.00);
insert into OrderDetails values (21617,'BV06',2,794.95);
insert into OrderDetails values (21617,'CD52',4   ,150.00);
insert into OrderDetails values (21619,'DR93',1,495.00);
insert into OrderDetails values (21523,'KV29',2,null);


/*selecting records from OrderDetails*/
select * from OrderDetails;

Screen in MySQL :


Related Solutions

Problem statement: You are tasked with writing a simple program that will keep track of items...
Problem statement: You are tasked with writing a simple program that will keep track of items sold by a retail store. We need to keep track of the stock (or number of specific products available for sale). Requirements: The program will now be broken up into methods and store all the inventory in an ArrayList object. The program will be able to run a report for all inventory details as well as a report for items that are low in...
Problem statement: You are tasked with writing a simple program that will keep track of items...
Problem statement: You are tasked with writing a simple program that will keep track of items sold by a retail store. We need to keep track of the stock (or number of specific products available for sale). Requirements: The Food and Book items should inherit all the properties of the Product item in the previous assignment. Foods cannot be added to the inventory without an expiration date. Implement a toString method for Product, Food, and Book. Grading details: Correct usage...
A law firm proposed the following table to keep track the information about cases and the...
A law firm proposed the following table to keep track the information about cases and the lawyers who handle the cases: CASE (caseNumber, caseDescription, lawyerInCharge, caseAssistant, beginningdate, endingDate, lawyerRate, accumulatedHours, clientsName., clientPhone, clientAdress, clientType, laywerPhone, caseResultDescription, clientCurrentPayment, paymentMethod, salary, bonus) Among above attributes, caseNumber, is the ID of the case lawyerInCharge is the name of the lawyer (a single person) who in charge of the case. NOTE : There may be also several staffs in the firm serve as the...
You will be building a linked list. Make sure to keep track of both the head...
You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. PlaylistNode.h - Class declaration PlaylistNode.cpp - Class definition main.cpp - main() function Build the PlaylistNode class per the following specifications. Note: Some functions can initially be function stubs (empty functions), to be completed in later steps. Default constructor (1 pt) Parameterized constructor (1 pt) Public member functions InsertAfter() - Mutator (1 pt) SetNext() - Mutator...
Using c++ Design a system to keep track of employee data. The system should keep track...
Using c++ Design a system to keep track of employee data. The system should keep track of an employee’s name, ID number and hourly pay rate in a class called Employee. You may also store any additional data you may need, (hint: you need something extra). This data is stored in a file (user selectable) with the id number, hourly pay rate, and the employee’s full name (example): 17 5.25 Daniel Katz 18 6.75 John F. Jones Start your main...
Use C++ please You will be building a linked list. Make sure to keep track of...
Use C++ please You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. PlaylistNode.h - Class declaration PlaylistNode.cpp - Class definition main.cpp - main() function Build the PlaylistNode class per the following specifications. Note: Some functions can initially be function stubs (empty functions), to be completed in later steps. Default constructor (1 pt) Parameterized constructor (1 pt) Public member functions InsertAfter() - Mutator (1 pt)...
You are tasked to design an application to keep track of sales for your company. Sales...
You are tasked to design an application to keep track of sales for your company. Sales should be tracked for two types of accounts: supplies and services. Complete the following:     Create a UML class diagram for the Account inheritance hierarchy. Your subclasses should be Supplies and Services.     All sales accounts will have an account ID (accountId).     You will need attributes to keep track of the number of hours (numberOfHours) and rate per hour of services provided (ratePerHour)....
A small company is expanding into new offices spread across three buildings. To keep track of...
A small company is expanding into new offices spread across three buildings. To keep track of office furniture, computers, and printers, the company would like a database to keep track of everything. Each piece of office furniture, computer, or printer is given an identification number. Each item (which is either a piece of furniture, a computer, or a printer) is placed in a room of one of three buildings. The building manager is responsible for the items in their building....
USE PYTHON-LIST Q1 - You need to keep track of book titles. Write code using function(s)...
USE PYTHON-LIST Q1 - You need to keep track of book titles. Write code using function(s) that will allow the user to do the following. 1. Add book titles to the list. 2. Delete book titles anywhere in the list by value. 3. Delete a book by position. Note: if you wish to display the booklist as a vertical number booklist , that is ok (that is also a hint) 4. Insert book titles anywhere in the list. 5. Clear...
We are introduced to the magnetic field as a way to keep track of the force...
We are introduced to the magnetic field as a way to keep track of the force that arises from lenght contraction in special relativity. A moving distribution of charge becomes more dense in the right frame. So in a way, the magnetic field is just the E-field. However, when I glance over the physics of permanent magnets, it is said that their magnetic field arises from the integral sum of their electrons with aligned spin(which generates a magnetic moment).Spin is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT