Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You must design a database file with tables & fields, relationships, queries, and reports as given below. 1) Tables: Fields (keys in yellow, foreign keys

You must design a database file with tables & fields, relationships, queries, and reports as given below.

1) Tables: Fields (keys in yellow, foreign keys in blue, both key & foreign key in green)

  • Supplier: Id (AutoNumber), LastName (short text, field size 30), FirstName (short text, field size 30), Email (Short Text, field size 30), PrimaryPhone (Short Text with 000-000-0000 input mask)

  • Distributor: Id (Number), LastName (short text, field size 30), FirstName(short text, field size 30), Supplier (Number), Email (Short Text, field size 30), PrimaryPhone (short text with 000-000-0000 input mask), SecondaryPhone (short Text with 000-000-0000 input mask)

  • Customer: Code (Number), Name (short text, field size 30), UserId (short text), PrimaryPhone (short text with 000-000-0000 input mask), StreetAddress (short text), ZipCode (Number with 00000 input mask), City (short text), State(short text)

  • Item: UPC (Number), Name (short text, field size 50), Supplier (Number), UnitPrice (Number), Sent (yes/no, default value: no), Paid (yes/no, default value: no)

  • Transaction: InvoiceNumber (AutoNumber), Supplier (Number), Distributor (Number), Customer (Number), Date (Date/Time with Short Date format), Amount (Number)

  • TransactionElement (note that this table's key is two fields): Item (Number), InvoiceNumber (Number), Quantity (Number), Amount (Number)

2) Relationships: Link all foreign key fields to their original tables

  • Distributor.Supplier, Item.Supplier, and Transaction.Supplier to Supplier.Id
  • Transaction.Distributor to Distributor.Id
  • Transaction.Customer to Customer.Code
  • TransactionElement.InvoiceNumber to Transaction.InvoiceNumber
  • TransactionElement.Item to Item.UPC

3) Queries:

  • Select all Transactions where Supplier.Id = 123
  • Select all TransactionElements where TransactionElement.Quantity >= 1000
  • Select all Items where Supplier.Id = 765
  • Select all Items that have been paid but not yet sent (i.e, Paid = "yes" but Sent = "no")
  • Select all Distributors where Supplier.Id = 234 and LastName = James
  • Select all Customers where Name = Chang and UserId = abc123
  • Select all Transactions from February 2020 where the Distributor was named John Adams and the Customers user id was zwy098

4) Reports:

  • For all Distributors, show their LastName, FirstName, Email, and PrimaryPhone (only). The list should be sorted in ascending order by LastName and then FirstName
  • For all Customers, show their Name, UserId, StreetAddress, and ZipCode. The list should be grouped by ZipCode, and within each zip code, customers should be sorted in ascending order by Name

Please just do 2,3,4.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Window Functions For Data Analysis And Beyond

Authors: Itzik Ben Gan

2nd Edition

0135861446, 978-0135861448

More Books

Students also viewed these Databases questions

Question

How We Listen?

Answered: 1 week ago