Use the Northwind and Hospital data models diagrams to answer the following questions
1.) HOSPITAL: Write a query to list the name and assignment History for employee #12345. The assigmnet history is to include the department name and also the number of months the employee served in that assignment. (Do not worry about the fact that this cannot be calculated for the current assignment, at least with what we know now). For one bonus point describe what logic might allow you to calculate the length of the employee's current assignment, but don't worry to write the code.
2.) NORTHWIND: Write a user defined function that will accept as inputs a product ID and which will return the most recent date on which that product was ordered. Then write a query (not a stored procedure) that will list all product names, the value of inventory on hand (unit price x units in stock), and the last time the product was ordered by using the UDF you wrote.
1. Hospital Schedule Diagram Below

2. NORTHWIND Diagram Below


Use the Northwind and Hospital data models diagrams to answer the following questions 1.) HOSPITAL: Write...
Create the following SQL Server queries that access the
Northwind database
Same as problem 3 but, limit the list to all customers who
placed 3 or more orders.
The product id, product name, last date that the product was
ordered for all items in the Grains/Cereals category. (Hint: Use
MAX)
The product ID, product name, and number of distinct customers
who ordered that product in 1996
Thank you.
Categories Customers Employees Order Details Orders Products Shippers 9 CategoryID CategoryName Description...
Questions are based on the Northwind database.
a. A data dictionary (Excel file) that describes each of the
tables. (Attached in question)
b. Write good, clean SQL that answers the
following questions.
c. Separate your queries as I have
done in the following example. End each query with a semicolon (;)
and insert the word "go" between each query. Queries can span
multiple lines if required.
Select CustomerID from Customers;
go
Select Count(*) from Employees;
go
Select max(productID) from Products;
18. Produce...
ARTIST(ArtistID, LastName, FirstName, Gender, YearofBirth, Address, PhoneNumber, Email, ArtistType) NEWSITEM(NewsItemID, Source, Content) ARTISTNEWS(ArtistID, NewsItemID, Date) ArtistID references ARTIST(ArtistID) NewsItemID references NEWSITEM(NewsItemID) CONTRACTEDARTIST(ArtistID, AManagerID) ArtistID references ARTIST(ArtistID) AManagerID references ARTISTMANAGER(AManagerID) SAMPLE(SampleID, SampleContent, ArtistID) ArtistID references ARTIST(ArtistID) PROSPECTIVEARTIST(ArtistID) ArtistID references ARTIST(ArtistID) RECOMMENDATION(RecommendationID, Summary, QualityEvaluation, Original, ReceivedDate, CreatedDate, ArtistID, SourceID) ArtistID references PROSPECTIVEARTIST(ArtistID) SourceID references SOURCE(SourceID) SOURCE(SourceID, Name, Type, Quality) ARTISTCOMMITMENT(ACommitmentID, StartDate, StartTime, EndDate, EndTime, ArtistID, CommitmentType) ArtistID references CONTRACTEDARTIST(ArtistID) PERSONALC(ACommitmentID, Firmness) ACommitmentID...
The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind Traders, which imports and exports specialty foods from around the world. Here is the schema of the database: Products (ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued); Suppliers (SupplierID, CompanyName, ContactName , ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage); Categories (CategoryID, CategoryName, Description, Picture); Orders (OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia, Freight, ShipName,ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry); Order_details (ID, OrderID,...
can someone solve these quick
please and thank you!
sql chapter 4
Query #1: List the company name, contact name, contact title and
the phone number for customers who HAVE NOT put in an order. Use an
outer join.
Query #2: Create a listing displaying the employee first name,
last name and the full name (First name space Last Name) of the
person they report to (Supervisor). This is a self-join. If an
employee does not report to anyone then...
Using the database: Write SQL queries for each of the questions
below.
1. Find the media type which
has 100 or more tracks. Print the name of such media type. Number
of rows returned in the result = 3
A) Find the playlists which have one or more tracks that have
never been purchased in California (CA). Print the Id, and the name
of such playlists. Number of rows returned in the result = 18
B) Find the customers who...
Question for SQL in MS SQL Server Management Studio (Please
don't use where clause for Joins use from clause)
Need to Create a Query because Northwind Traders has decided to
increase their retail prices. Write a query that shows the product
name, the current price, and the new price. Make sure the new price
is listed to 2 decimal points. Follow below guidelines on new
retail price:
a. If the
category is beverages or dairy products, increase the price by...
Hi, I'm trying to do my
homework for my SQL Server class I keep getting stuck on the
questions 1-5 I found out like how the format need to be
I'm just stuck on implanting the code in.
Auntie B's Antic ERD CUSTOMER OWNER PEOPLE PeoplelD CustomerSince CHARITY Peopleld FirstName LastName Address City State Zip Phone CellPhone EMail PeopleType CharityID Name Address City State WORKERS PeoplelD HireDate TermDate SSN ip Phone ContactID ORDERS OrderlD OrderDate CustomerlD EmployeelD DONATION DonationID DonationDate...
Please answer the question following this tables. Use this
tables to answer database management questions.
2. List the complete Session table (all rows and all
columns).
4. List the last name and first name of every therapist not
located in Palm Rivers.
6. List the session number and patient number for every therapy
that lasted 60 minutes.
8. List the TherapyCode and description for all therapies that
are billed in 15-minute units. Sort them in order by
description.
10. Currently,...
1,List the first and last name of the donators that donated in
December 2009.
2. List the ID's of the volunteers that have not worked.
3. List the ID, first name, and last name of any employees who
works in the Finance department.
4. List all the different prices suppliers have for 'Tasty Meat'
product.
5. Select the store ID and store phone number for all stores in
'St.Paul'.
6. List the member first and last name, address, city, zip...