Question

Normalize the following table: ProductId          ProductName    ProductPrice     OrderId OrderDate        ShippingDate    C

Normalize the following table:

ProductId         

ProductName   

ProductPrice    

OrderId

OrderDate       

ShippingDate   

CustomerID      

CustomerFirstName           

CustomerLastName

Once normalized, insert enough data into the tables.

Use foreign keys to link the tables accordingly.

Use Excel to show the steps in you how you created the three normal forms.

Create the resulted tables into MySQL with the data you selected

Add the functionality of JOIN and build a FULLTEXT search to this normalized database.

Use PHP and MySQL to add a new record to each table in this database and display them in a website.

Build a small login system that will access some data from this database and show the retrieved information in an HTML document.

Create a signup form registration with a secured PHP login system on a website.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Normalization :

Normalization helps to decompose large and complex table into simple and smaller form.
After normalization redundancy will be removed and data consistency will maintained.

Example :Consider schema given in the question

First Normal Form (1NF) :

1NF says all the columns in the table should be automic in nature.
No duplicate columns and repeating group of columns are allowed in 1NF.

Given table is in the 1NF because all columns are automic in nature and no duplicate and multivalued columns exists.

Second Normal Form (2NF) :

2NF says table should be in the 1NF.
In 2NF partial dependency is not allowed.
Partial dependency means non key column should depends upon primary key column.

Here above schema needs to normalize into 2NF to remove partial dependency.Need to identify new tables like

Customer :This table stores customer details.
Product:This table stores product details
Order :This table stores order details.

Below are tables in 2NF.

1.Table Name :Customer

Description :This table stores customer details like CustomerID ,CustomerFirstName and CustomerLastName.

Schema :Customer (CustomerID ,CustomerFirstName ,CustomerLastName)

FD:CustomerID ==> CustomerFirstName and CustomerLastName

2.Table Name :Product

Description :This table stores product details like ProductID ,ProductName and ProductPrice.

Schema :Product(ProductID ,ProductName ,ProductPrice)

FD:ProductID ==>ProductName ,ProductPrice

3.Table Name :Order

Description :This table stores order details like OrderId,OrderDate and ShippingDate .

Schema :Order(OrderId,OrderDate ,ShippingDate)

FD:OrderId ==>OrderDate ,ShippingDate

Third Normal Form (3NF):

3NF says table should be in the 2NF.
In 3NF transitive dependency is not allowed.
Transitive dependency means non key column in the table should depends on non key column in the table.

Here above table needs to normalize into 3NF to remove transitive dependency.Below are tables in 3NF.

1.Table Name :Customer

Description :This table stores customer details like CustomerID ,CustomerFirstName and CustomerLastName.

Schema :Customer (CustomerID ,CustomerFirstName ,CustomerLastName)

FD:CustomerID ==> CustomerFirstName and CustomerLastName

2.Table Name :Product

Description :This table stores product details like ProductID ,ProductName and ProductPrice.

Schema :Product(ProductID ,ProductName ,ProductPrice)

FD:ProductID ==>ProductName ,ProductPrice

3.Table Name :Order

Description :This table stores order details like OrderId,OrderDate and ShippingDate , along with customer details.

Schema :Order(OrderId,OrderDate ,ShippingDate,CustomerID)

FD:OrderId,CustomerID ==>OrderDate ,ShippingDate

4.Table Name :OrderDetails

Description :This table stores order details like OrderId and ProductID.

NOTE :This table is formed because an order can have any number of product and orderID is primary key in order table so which can not be duplicate in order table but as orderID is foreign key in OrderDetails which can be duplicate.

Schema :OrderDetails(OrderId,ProductID)

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

Tables in MYSQL :

1.Table Name :Customer

create TABLE customer(
CustomerID int primary key,
CustomerFirstName varchar(20) not null,
CustomerLastName varchar(20) not null
);

2.Table Name :Product

create TABLE product(
ProductID int primary key,
ProductName varchar(20) not null,
ProductPrice decimal(6,2) not null
);

3.Table Name :Order

create TABLE `order`(
OrderID int primary key,
OrderDate date not null,
ShippingDate date not null,
customerID int not null,
foreign key (customerID) REFERENCES customer (customerID)
);

4.Table Name :OrderDetails

create TABLE orderDetails(
OrderID int,
ProductID int not null,
primary key (OrderID,ProductID),
foreign key (OrderID) REFERENCES `order` (OrderID),
foreign key (ProductID) REFERENCES product (ProductID)
);

Add a comment
Know the answer?
Add Answer to:
Normalize the following table: ProductId          ProductName    ProductPrice     OrderId OrderDate        ShippingDate    C
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Normalize the following table: ProductId          ProductName    ProductPrice     OrderId OrderDate        ShippingDate    CustomerID       CustomerFirstName            CustomerLastName Once normalized, insert...

    Normalize the following table: ProductId          ProductName    ProductPrice     OrderId OrderDate        ShippingDate    CustomerID       CustomerFirstName            CustomerLastName Once normalized, insert enough data into the tables. Use foreign keys to link the tables accordingly. Use Excel to show the steps in you how you created the three normal forms. Create the resulted tables into MySQL with the data you selected Add the functionality of JOIN and build a FULLTEXT search to this normalized database. Use PHP and MySQL to add a new record to each...

  • Customer (CustomerId, CustomerName) Employee (EmployeeId, EmployeeName, Salary, SupervisorId) Product(ProductId, ProductName, ListPrice) Orders (OrderId, OrderDate, CustomerId, EmployeeId,...

    Customer (CustomerId, CustomerName) Employee (EmployeeId, EmployeeName, Salary, SupervisorId) Product(ProductId, ProductName, ListPrice) Orders (OrderId, OrderDate, CustomerId, EmployeeId, Total) OrderedProduct (OrderId, ProductId, Quantity, Price) Write the code to complete the methods in OrderJDBC.java (look for TODO items). <---**IN BOLD** throughout code. /* OrderJDBC.java - A JDBC program for accessing and updating an order database on MySQL. */ import java.io.File; import java.math.BigDecimal; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.Scanner; /** * An application for...

  • Create a list of several elements you think should make up a login page. Make sure to obtain instructor approval for the...

    Create a list of several elements you think should make up a login page. Make sure to obtain instructor approval for the elements of your login page. Consider the execution flow to capture the user interaction. Execute this assignment according to the following guidelines: 1.In MySQL, build the necessary tables to store the information required during the log in process. 2.In PHP, write the functions that will enable the capturing of user input and store in the database. 3.In HTML,...

  • The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind...

    The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind Traders, which imports and exports specialty foods from around the world. Here is the schema of the database: Products (ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued); Suppliers (SupplierID, CompanyName, ContactName , ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage); Categories (CategoryID, CategoryName, Description, Picture); Orders (OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia,  Freight, ShipName,ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry); Order_details (ID, OrderID,...

  • Chapter 2 How to use the Management Studio Before you start the exercises... Before you start...

    Chapter 2 How to use the Management Studio Before you start the exercises... Before you start these exercises, you need to install SQL Server and the SQL Server Management Studio. The procedures for doing both of these tasks are provided in appendix A of the book. In addition, you'll need to get the Exercise Starts directory from your instructor. This directory contains some script files that you need to do these exercises. Exercises In these exercises, you'll use SQL Server...

  • Tables: Create table Item(                 ItemId                 char(5) constraint itmid_unique primar

    Tables: Create table Item(                 ItemId                 char(5) constraint itmid_unique primary key,                 Decription           varchar2(30),                 Unitcost               number(7,2)); Create table Customer(                 custID                   char(5) constraint cid.unique primary key,                 custName          varchar2(20),                 address                                varchar2(50)); Create table Orderdata( orderID                char(5) constraint oid_uniq primary key,                 orderdate           date,                 shipdate              date,                 ItemId                  char(5) references Item.ItemId,                 No_of_items     number(4),                 Unitcost               number(7,2),                 Order_total        number(7,2),                 custID                   char(5) references customer.custID); Insert Into Item values(‘A123’,’Pencil’,2.5); Insert Into Item values(‘B123’,’Pen’,15); Insert Into...

  • 4. Write SQL data definition commands for each of the following queries: a. How would you add an attribute, Class, to the Student table? b. How would you remove the Registration table? c. How would you change the FacultyName field from 25 characters

    Problems and Exercises 1 through 9 are based on the dass scheduling 3NF relations along with some sample data shown in Figure 6-11. Not shown in this figure are data for an ASSIGNMENT relation, which represents a many-to-many relationship between faculty and sections.4. Write SQL data definition commands for each of the following queries:a. How would you add an attribute, Class, to the Student table?b. How would you remove the Registration table?c. How would you change the FacultyName field from...

  • Guidelines: The final project (Project 3) is an individual project. It requires writing an individual report...

    Guidelines: The final project (Project 3) is an individual project. It requires writing an individual report and a presentation. Your manager at the VPF wants your help to answer the following questions and form your reply as a complete report. The report should be between 5 and 7 single spaced pages in addition to the cover page, table of contents, statement of Academic Honesty, reference page, and any other diagrams or appendices that will enhance your report. Note: Use the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT