The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 313 Weeks Ago, 5 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Please write the SQL code in the SQL Server 2012 Express Management Studio for each question (SSMS). You will use SSMS to code and TEST each one.
Â
The database files are attached.
Â
***Remember when using 2 or more tables you must join the tables together. The number of joins you
will use is the number of tables -1. In other words, if you use 2 tables you will have 1 join statement, 3
tables you will use 2 joins etc. ***
Â
1. Using EXPLICIT Join syntax, list the CustomerID, Contact Name, Address, City, State (region) and
Postal code from the Customers table along with the orderId, and Orderdate from the orders
table for orders placed in July 2014
2. Using the IMPLICIT join syntax recreate the code from Question 1
3. Write a query that returns the following columns:
CustomerId, Company name from the Customers Table
Order ID from the Orders Table.
Show all customers regardless of whether they have any orders.
Sort the results by Order ID.
4. NorthWind traders wants to know the following information about their orders for products
supplied by Supplier number 12 and fulfilled by employee number 2
a. The first and last name of the employee who took the order
b. The customer name (company name) of the customer who placed the order
c. The ordered and the shipped and required date.
d. The product Id and Product name of the item(s) ordered
e. The ID and name of the supplier
f. The shipper Id and company name.
Sort the output by order date then by customer ID. Since several of the fields use the
same name use column aliases where needed to differentiate between the columns
with the same names
5. List the Orderid, customerID, orderdate, unitprice and Quantity for all orders with a quantity
under 12 . Use Correlation names.
6. Use the UNION keyword to return 2 columns from the Customers table, Company name and
country. If the Country is USA the country value should be "Inside USA". Otherwise the country
value should be "Outside USA"
7. List all employees and their job. Show employee name and the job description
8. Write a select query that lists the ordered, employee ID and customer Id for all orders shipped
prior to January 1st 2014. Show each order id only once.
Attachments:
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly