Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assignment Planning a Database Worksheet Which Table Should the Field be Placed

ID: 3853952 • Letter: A

Question

Assignment

Planning a Database Worksheet

Which Table Should the Field be Placed in?

How Should the Field be Designed? (e.g. text, 20 characters in length)

Primary Key or Foreign Key? In which table?

(PK: table, FK: table)

LastName

Size

OrderDate

Category

ProductDescription

FirstName

ZipCode

OrderDetailId

OrderID

CustomerID

State

HomePhone

Address

City

ProductID

Descrption

QuantityOrdered

NoInStock

CustomerSSN

Price

Using the list of tables below, determine which of the fields on the worksheet will go into which tables. Some items may appear in more than one table and may form a link between the two tables.

tblCustomer - information about customers

tblProduct - information about the product

tblOrder - information about orders

tblOrderDetail - Because relationships that you establish need to be one to many (or one to one), you will not be able to connect an order to many products without another table. This table is the Order Detail Table. This allows you to list several products ordered by the customer, the quantity, and indicate which order they are included in. Think of the Order table as the header portion of an order and the OrderDetail table as the line items on an order.

Fill in the remaining two columns for each of the fields.

Write a paragraph in which you support your reasoning for how you distributed the fields in your tables.

Once you have completed the assignment above, show the relationships among the tables. In order to do this, you will need to add the fields and draw the lines indicating the relationships. The Tables Worksheet will assist you in setting up the tables and their fields.

Which Table Should the Field be Placed in?

How Should the Field be Designed? (e.g. text, 20 characters in length)

Primary Key or Foreign Key? In which table?

(PK: table, FK: table)

LastName

Size

OrderDate

Category

ProductDescription

FirstName

ZipCode

OrderDetailId

OrderID

CustomerID

State

HomePhone

Address

City

ProductID

Descrption

QuantityOrdered

NoInStock

CustomerSSN

Price

Explanation / Answer

Which Table Should the Field be Placed in?

How Should the Field be Designed? (e.g. text, 20 characters in length)

Primary Key or Foreign Key? In which table?

(PK: table, FK: table)

LastName

tblCustomer

Text, 10 characters

Size

tblOrderDetail

Int, 5 Numbers

OrderDate

tblOrder

Date

Category

tblProduct

Text, 10 Characters

ProductDescription

tblProduct

Text, 20 Characters

FirstName

tblCustomer

Text, 10 Characters

ZipCode

tblCustomer

Int , 5 Numbers

OrderDetailId

tblOrderDetail

Int, 10 Numbers

PK: tblOrderDetail

OrderID

tblOrder

Int, 10 Numbers

PK: tblOrder FK: tblOrderDetail

CustomerID

tblCustomer

Int, 10 Numbers

PK: tblCustomer FK: tblProduct

State

tblCustomer

Text, 10 Characters

HomePhone

tblCustomer

Int, 10 Numbers

Address

tblCustomer

  Text, 20 Characters

City

tblCustomer

  Text, 10 Characters

ProductID

tblProduct

Int, 10 Numbers

PK: tblProduct FK: tblOrder

Descrption

tblOrder

   Text, 20 Characters

QuantityOrdered

tblOrderDetail

Int, 10 Numbers

NoInStock

tblProduct

Int, 5 Numbers

CustomerSSN

tblCustomer

Int, 10 Numbers

PK: tblCustomer

Price

tblOrder

Int, 5 Numbers

Here in this customer table would store the information of customer like ssn, id,firstname,lastname, phone,address,city,state,zipcode like this. By this information only the orders would get delivered unless it won't.

Then the product information should store the productid,productdescription,outofstock information, like this. By this it is easy to find the product and by linking the customer id this product table can exactly tell what product bought by which customer.

Then in the order table it store the order information like its price,orderid,description like this would give the order information by linking up with the productid as foreignkey

Then in the orderdetail it stores the complete detail like qty, size, orderdetailid etc. like this . By giving the orderid as foreign key it woukd be known easily get the details of all the orders, order details, who bought the products etc.

Which Table Should the Field be Placed in?

How Should the Field be Designed? (e.g. text, 20 characters in length)

Primary Key or Foreign Key? In which table?

(PK: table, FK: table)

LastName

tblCustomer

Text, 10 characters

Size

tblOrderDetail

Int, 5 Numbers

OrderDate

tblOrder

Date

Category

tblProduct

Text, 10 Characters

ProductDescription

tblProduct

Text, 20 Characters

FirstName

tblCustomer

Text, 10 Characters

ZipCode

tblCustomer

Int , 5 Numbers

OrderDetailId

tblOrderDetail

Int, 10 Numbers

PK: tblOrderDetail

OrderID

tblOrder

Int, 10 Numbers

PK: tblOrder FK: tblOrderDetail

CustomerID

tblCustomer

Int, 10 Numbers

PK: tblCustomer FK: tblProduct

State

tblCustomer

Text, 10 Characters

HomePhone

tblCustomer

Int, 10 Numbers

Address

tblCustomer

  Text, 20 Characters

City

tblCustomer

  Text, 10 Characters

ProductID

tblProduct

Int, 10 Numbers

PK: tblProduct FK: tblOrder

Descrption

tblOrder

   Text, 20 Characters

QuantityOrdered

tblOrderDetail

Int, 10 Numbers

NoInStock

tblProduct

Int, 5 Numbers

CustomerSSN

tblCustomer

Int, 10 Numbers

PK: tblCustomer

Price

tblOrder

Int, 5 Numbers

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote