Hey, so this is a question i got in my database class. we are supposed to use mysql for this. I have been working on it for about an 45 minutes now but just cant seem to get it right. Any and all help is greatly appreciated.
Write a query to display the employee’s last name, the territory’s territory description, and the region’s region description for each employee in the employee table. Sort the results by the employee’s last name.
Tables - Employees, territorydescription, regiondescription
Columns - lastname, territorydetails, region details, territoryid, regionid,
Answer:
Select
e.lastname,td.territorydetails,rd.regiondetails,rd.territoryid,rd.regionid
from Employees e
join territorydescription td on td.EmployeeID=e.EmployeeID
join regiondescription rd on rd.territoryid = td.territoryid
order by e.lastname.
Employee table will be linked with territorydescription table. I assumed Employee will be the foreign key.
Let me know in case if you have any questions. Thanks and all
the best.
Hey, so this is a question i got in my database class. we are supposed to...
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...
Hello, I need help answering all 8 of these questions for my BIS
422 class. I need the appropriate MySQL script to use for these
questions
Provide the SQL for the following data requests. Your SQL should
be written as a single script that can be pasted into MySQL and run
without edits. Make sure you use the proper notation for your
comments (see the practice solution for an example of the format).
There will be a 5% deduction for...
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...
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 to display products purchased by
customers in Germany that were not purchased by customers in the
US.
Customers PK Customer D CompanyName Contact Name Contact Title Address City State OrRegion PostalCode Country Phone char(5) varchar(40) varchar(30) varchar(30) varchar(60) varchar(15) varchar(15) varchar(10) varchar(15) varchar(24) varchar(24) Order Details Orders PK OrderID int FK CustomerlD char(5) FK Employeeld int...
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...
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 wants to make
sure that all orders are shipped within 10 days. Display any orders
that were not shipped within 10 days. Include the OrderID, the
OrderDate, and the number of days it took before the order was
shipped.
Customers PK Customer D CompanyName Contact Name Contact Title Address City State OrRegion PostalCode...
I am working on multi-table queries for my SQL class using a
premade database, which I have included screenshots of. I received
assistance and was able to complete a good number of the queries
but the bolded ones seem absolutely impossible to do??
How do I write a query for the bolded questions?? I've
scoured my textbook and notes and cannot get anything I try to
successfully produce results.
1. List all current reservations with the trip ID, customer’s
first...
Hey, so i am trying to have my program read a text file using a structure but i also want to be able to modify the results(I kinda have this part but it could be better). I cant seem to get it to read the file(all the values come up as 0 and i'm not sure why because in my other program where it wrote to the txt file the values are on the txt file) i copied and pasted...
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...