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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started