Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!