Question

In: Computer Science

1) Design an efficient data storage scheme using Normalization steps we have outlined. 2) Create tables...

1) Design an efficient data storage scheme using Normalization steps we have outlined.

2) Create tables as per normalization steps we have discussed in your database

Submit the table creation script and the output of desc

Explain any thing you wish to explain.

Data below:

invoiceno, invoice_date, invoice_amount, vendor, vendor_phone, vendor_address, vendor_preferred_payment_method,  verification_date, verified_by, verifier_code, verifier_role_title, approval_date, approved_by, approver_code, approver_role_title, payment_date, payment_by, payer_code, payer_title
211,10/19/2019,2311.45,VIC,673-234-4001,"blah blah,nyc,ny",check:made payable to VIC:net 30d,10/20/2019,Shelley Cramer,SC,ECOM:Project manager,10/20/2019,Zack Swindler,ZS,Sales:Managing Director,10/21/2019,Cathy Zuppa, CZ, Finance:CPA
209,10/10/2019,28750.07,GRC,913-123-3489,"zing zing, Cool,CO",ACH:ABA23457892 FBO GRC:net 30d,10/10/2019,Zack Swindler,ZS,Sales:Managing Director,10/11/2019,Tiny Bulger, TB, COO,10/12/2019,Irwine Ladder,IL,Finance:CFO
203,10/4/2019,17000.45,NightCrawler,873-318-7777,"Blue Lagoon,Torch,AZ",check:made payable to NCH:net 60d,10/7/2019,Zack Swindler,ZS,Sales:Managing Director,10/8/2019,Shelley  Cramer, SC, ECOM:Project Manager,10/12/2019,Cathy Zuppa, CZ, Finance:CPA
181,10/1/2019,2311.45,VIC,673-234-4001,"blah blah,nyc,ny",check:made payable to VIC:net 60d,10/2/2019,Zack Swindler,ZS,Sales:Managing Director,10/3/2019,Martin Short,MS,Sales:Managing Director,10/21/2019,Cathy Zuppa, CZ, Finance:CPA

Use the 3 normalization forms.

Solutions

Expert Solution

Answer:- Below is the Normalization Steps For:-

invoiceno, invoice_date, invoice_amount, vendor, vendor_phone, vendor_address, vendor_preferred_payment_method,  verification_date, verified_by, verifier_code, verifier_role_title, approval_date, approved_by, approver_code, approver_role_title, payment_date, payment_by, payer_code, payer_title
211,10/19/2019,2311.45,VIC,673-234-4001,"blah blah,nyc,ny",check:made payable to VIC:net 30d,10/20/2019,Shelley Cramer,SC,ECOM:Project manager,10/20/2019,Zack Swindler,ZS,Sales:Managing Director,10/21/2019,Cathy Zuppa, CZ, Finance:CPA
209,10/10/2019,28750.07,GRC,913-123-3489,"zing zing, Cool,CO",ACH:ABA23457892 FBO GRC:net 30d,10/10/2019,Zack Swindler,ZS,Sales:Managing Director,10/11/2019,Tiny Bulger, TB, COO,10/12/2019,Irwine Ladder,IL,Finance:CFO
203,10/4/2019,17000.45,NightCrawler,873-318-7777,"Blue Lagoon,Torch,AZ",check:made payable to NCH:net 60d,10/7/2019,Zack Swindler,ZS,Sales:Managing Director,10/8/2019,Shelley  Cramer, SC, ECOM:Project Manager,10/12/2019,Cathy Zuppa, CZ, Finance:CPA
181,10/1/2019,2311.45,VIC,673-234-4001,"blah blah,nyc,ny",check:made payable to VIC:net 60d,10/2/2019,Zack Swindler,ZS,Sales:Managing Director,10/3/2019,Martin Short,MS,Sales:Managing Director,10/21/2019,Cathy Zuppa, CZ, Finance:CPA

Here are the most commonly used normal forms:

  • First normal form(1NF)
  • Second normal form(2NF)
  • Third normal form(3NF)
  • Boyce & Codd normal form (BCNF)

First normal form (1NF)

As per the rule of first normal form, an attribute (column) of a table cannot hold multiple values. It should hold only atomic values.

Example: Suppose a company wants to store the names and contact details of its employees. It creates a table that looks like this:

emp_id emp_name emp_address emp_mobile
101 Herschel New Delhi 8912312390
102 Jon Kanpur 8812121212

9900012222

103 Ron Chennai 7778881212
104 Lester Bangalore 9990000123

8123450987

Two employees (Jon & Lester) are having two mobile numbers so the company stored them in the same field as you can see in the table above.

This table is not in 1NF as the rule says “each attribute of a table must have atomic (single) values”, the emp_mobile values for employees Jon & Lester violates that rule.

To make the table complies with 1NF we should have the data like this:

emp_id emp_name emp_address emp_mobile
101 Herschel New Delhi 8912312390
102 Jon Kanpur 8812121212
102 Jon Kanpur 9900012222
103 Ron Chennai 7778881212
104 Lester Bangalore 9990000123
104 Lester Bangalore 8123450987

Second normal form (2NF)

A table is said to be in 2NF if both the following conditions hold:

  • Table is in 1NF (First normal form)
  • No non-prime attribute is dependent on the proper subset of any candidate key of table.

An attribute that is not part of any candidate key is known as non-prime attribute.

Example: Suppose a school wants to store the data of teachers and the subjects they teach. They create a table that looks like this: Since a teacher can teach more than one subjects, the table can have multiple rows for a same teacher.

teacher_id subject teacher_age
111 Maths 38
111 Physics 38
222 Biology 38
333 Physics 40
333 Chemistry 40

Candidate Keys: {teacher_id, subject}
Non prime attribute: teacher_age

The table is in 1 NF because each attribute has atomic values. However, it is not in 2NF because non prime attribute teacher_age is dependent on teacher_id alone which is a proper subset of candidate key. This violates the rule for 2NF as the rule says “no non-prime attribute is dependent on the proper subset of any candidate key of the table”.

To make the table complies with 2NF we can break it in two tables like this:
teacher_details table:

teacher_id teacher_age
111 38
222 38
333 40

teacher_subject table:

teacher_id subject
111 Maths
111 Physics
222 Biology
333 Physics
333 Chemistry

Now the tables comply with Second normal form (2NF).

Third Normal form (3NF)

A table design is said to be in 3NF if both the following conditions hold:

  • Table must be in 2NF
  • Transitive functional dependency of non-prime attribute on any super key should be removed.

An attribute that is not part of any candidate keyis known as non-prime attribute.

In other words 3NF can be explained like this: A table is in 3NF if it is in 2NF and for each functional dependency X-> Y at least one of the following conditions hold:

  • X is a super key of table
  • Y is a prime attribute of table

An attribute that is a part of one of the candidate keys is known as prime attribute.

Example: Suppose a company wants to store the complete address of each employee, they create a table named employee_details that looks like this:

emp_id emp_name emp_zip emp_state emp_city emp_district
1001 John 282005 UP Agra Dayal Bagh
1002 Ajeet 222008 TN Chennai M-City
1006 Lora 282007 TN Chennai Urrapakkam
1101 Lilly 292008 UK Pauri Bhagwan
1201 Steve 222999 MP Gwalior Ratan

Super keys: {emp_id}, {emp_id, emp_name}, {emp_id, emp_name, emp_zip}…so on
Candidate Keys: {emp_id}
Non-prime attributes: all attributes except emp_id are non-prime as they are not part of any candidate keys.

Here, emp_state, emp_city & emp_district dependent on emp_zip. And, emp_zip is dependent on emp_id that makes non-prime attributes (emp_state, emp_city & emp_district) transitively dependent on super key (emp_id). This violates the rule of 3NF.

To make this table complies with 3NF we have to break the table into two tables to remove the transitive dependency:

employee table:

emp_id emp_name emp_zip
1001 John 282005
1002 Ajeet 222008
1006 Lora 282007
1101 Lilly 292008
1201 Steve 222999

employee_zip table:

emp_zip emp_state emp_city emp_district
282005 UP Agra Dayal Bagh
222008 TN Chennai M-City
282007 TN Chennai Urrapakkam
292008 UK Pauri Bhagwan
222999 MP Gwalior Ratan

Related Solutions

Q1 (100%): Using data below, do the following: 1) Create the efficient frontier; 2) Calculate the...
Q1 (100%): Using data below, do the following: 1) Create the efficient frontier; 2) Calculate the optimal portfolio; 3) Draw the Capital Market Line. Note the line must be based on data, not your fine art skills. Security A Security B Portfolio Mean 0.09 0.15 Standard Deviation 0.20 0.33 Variance 0.04 0.11 Covariance 0.0095 Risk-free rate 5.20% please attach the exal work so i can downlond it
Using java you have to create a simple program that will allow for the storage of...
Using java you have to create a simple program that will allow for the storage of requests for money. Each request will consist of a person's name and dollar amount (US dollars). The business rules are straight forward. Each name should be a first and last name. The first letter of each element in the name should be capitalized. The dollar amount should be between 1 and 1000 dollars and include cents (2 decimals). You should include validations, but it...
Pivot Tables - Please explain how to acheive the following: Using the data below, create a...
Pivot Tables - Please explain how to acheive the following: Using the data below, create a Pivot Table that answers the question “Which salesperson sold the most in any particular month.” A manager wants to click on the Pivot Table and choose a month and have the name of that person appear with his or her amount for that month. Sales Data Salesperson May June July Aug. Sept. Oct. Albertson, Kathy $3,947.00 $557.00 $3,863.00 $1,117.00 $8,237.00 $8,690.00 Allenson, Carol $4,411.00...
1. Collect annual data to create data tables and graphs of the following: a. growth rates...
1. Collect annual data to create data tables and graphs of the following: a. growth rates of NGDP and RGDP for the years 2008-2018 b. CPI-All Urban Consumers (Current Series) and the inflation rate for the years 2008-2018 c. unemployment rate for the years 2008-2018 d. M1 and M2 for the years 2008-2018
-Using MySQL Workbench Data Modeler, create three (3) models from the tables below. Show Table 1...
-Using MySQL Workbench Data Modeler, create three (3) models from the tables below. Show Table 1 in 3rd Normal Form. Show Table 2 in 3rd Normal Form. Merge the 3rd Normal Forms of Table 1 and Table 2 into a single 3rd Normal Form model. Note that you only can model table and column names and data types. The data shown is for your reference to determine functional, partial, and transitive dependencies. -Provide a summary of the steps you took...
** Using Calculus** We have a client asking for our recommendations on which storage containers are...
** Using Calculus** We have a client asking for our recommendations on which storage containers are better for shipping and storing hazardous waste. Their requirements are as follows: The container should hold 50,000 cm3 (which is 50 liters); The sides of the container will be made from aluminum sheets with a thickness of 2 mm; The two bases of the container need to be thicker (for greater support) and will be made from aluminum sheets with a thickness of 6...
Task 2 (1 mark) Transformation of data stored in the relational tables into data stored in...
Task 2 (1 mark) Transformation of data stored in the relational tables into data stored in BSON collection.
2. In class we have seen that, in a perfectly competitive market, market equilibrium is efficient....
2. In class we have seen that, in a perfectly competitive market, market equilibrium is efficient. a. (5) What do economists mean by efficient? (i.e. Why do we characterize market equilibrium as efficient?) b. (5) What is missing in the concept of efficiency? Give an example of a market in which we might not be as concerned about maximizing efficiency.
1)what could be the different categories of collected data? 2)Identify the different data storage methods
1)what could be the different categories of collected data? 2)Identify the different data storage methods
Specifications: This project will have two data classes and a tester class. Design: Create a solution...
Specifications: This project will have two data classes and a tester class. Design: Create a solution for this programming task. You will need to have the following parts: Text file to store data between runs. Two classes that implement the given interfaces. You may add methods beyond those in the interfaces A tester class that tests all of the methods of the data classes. Here are the interfaces for your data classes: package project1; import java.util.ArrayList; public interface Person {...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT