Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is 2 brief SQL Database Question(Use join) 1. We need to mail an invoice to each one of our customers. Create a query that

This is 2 brief SQL Database Question(Use join)

1. We need to mail an invoice to each one of our customers. Create a query that contains the First Name, Last Name, and full mailing address information (Street, City, State, Zip Code). Make sure to use billing addresses and not shipping addresses.

These are the columns for the Customers table:

AddressID(PK), CustomerID(FK), Line1, Line2, City, State, ZipCode, Phone, Disabled

These are the columns for the Addresses table:

CustomerID(PK), EmailAddress, Password, FirstName, LastName, ShippingAddressID, BillingAddressID

2. Our company needs to generate a list of customer sales. Create a query for the report that shows the first and last name of the customer, the date of the order, the name of the product they ordered, the price of the item, and the quantity. Sort the result set by the customers last name. Demonstrate the use of aliases for the tables.

These are the columns for the Addresses table:

CustomerID(PK), EmailAddress, Password, FirstName, LastName, ShippingAddressID, BillingAddressID

These are the columns for the Products table:

ProductID(PK), CategoryID(FK), ProductCode, ProductName, Description, ListPrice,DiscountPercent, DateAdded

These are the columns for the Orderitems table:

ItemID(PK), OrderID(FK), ProductID(FK), ItemPrice, DiscountAmount, Quantity

These are the columns for the Orders table:

OrderID(PK) CustomerID(FK), OrderDate, ShipAmount, TaxAmount, ShipDate, ShipAddressID, CardType, CardNumber, CardExpires, BillingAddressID

Thanks

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_2

Step: 3

blur-text-image_3

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

LO1 Understand risk management and identify its components.

Answered: 1 week ago