Question

Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display...

Problem 33, chapter 7 from Database Systems 13th edition by Coronel

Write a query to display the employee number, last name, email address, title, and

department name of each employee whose job title ends in the word “ASSOCIATE.”

Sort the output by department name and employee title

Problem 36, chapter 7 from Database Systems 13th edition by Coronel

Write a query to display the number of products within each base and type combination,

sorted by base and then by type

Problem 37, chapter 7 from Database Systems 13th edition by Coronel

Write a query to display the total inventory—that is, the sum of all products on hand

for each brand ID. Sort the output by brand ID in descending order

Problem 38, chapter 7 from Database Systems 13th edition by Coronel

Write a query to display the brand ID, brand name, and average price of products

of each brand. Sort the output by brand name. Results are shown with the average

price rounded to two decimal places

Problem 40, chapter 7 from Database Systems 13th edition by Coronel

Write a query to display the employee number, first name, last name, and largest

salary amount for each employee in department 200. Sort the output by largest salary

in descending order

Problem 41, chapter 7 from Database Systems 13th edition by Coronel

Write a query to display the customer code, first name, last name, and sum of all

invoice totals for customers with cumulative invoice totals greater than $1,500. Sort

the output by the sum of invoice totals in descending order

Problem 42, chapter 7 from Database Systems 13th edition by Coronel

Write a query to display the department number, department name, department

phone number, employee number, and last name of each department manager. Sort

the output by department name

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution

Problem 33

SELECT E.EMP_NUM, EMP_LNAME, EMP_EMAIL, EMP_TITLE, DEPT_NAME
FROM LGEMPLOYEE AS E, LGDEPARTMENT AS D
WHERE E.DEPT_NUM=D.DEPT_NUM AND
EMP_TITLE LIKE '*ASSOCIATE'
ORDER BY DEPT_NAME, EMP_TITLE;
---

Problem 36

SELECT PROD_BASE, PROD_TYPE, COUNT(*) AS NUMPRODUCTS

FROM LGPRODUCT

GROUP BY PROD_BASE, PROD_TYPE

ORDER BY PROD_BASE, PROD_TYPE;

---

Problem 37

SELECT BRAND_ID, SUM(POD_QOH) AS TOTALINVENTORY

FROM LGPRODUCT

GROUP BY BRAND_ID

ORDER BY BRAND_ID DESC;

---

Problem 38

SELECT P.BRAND_ID, BRAND_NAME, ROUND(AVG(PROD_PRICE),2) AS AVGPRICE

FROM LGBRAND AS B,LGPRODUCT AS P

WHERE B.BRAND_ID=P.BRAND_ID

GROUP BY P.BRAND_ID,BRAND_NAME

ORDER BY BRAND_NAME;

---

Problem 40

SELECT E.EMP_NUM, EMP_FNAME, EMP_LNAME, MAX(SAL_AMOUNT) AS LARGESTSALARY
FROM LGEMPLOYEE AS E, LGSALARY_HISTORY AS S

WHERE E.EMP_NUM=S.EMP_NUM AND DEPT_NUM=200
GROUP BY E.EMP_NUM, EMP_FNAME, EMP_LNAME
ORDER BY MAX(SAL_AMOUNT) DESC;

---

Problem 41

SELECT C.CUST_CODE, CUST_FNAME, CUST_LNAME, SUM(INV_TOTAL) AS TOTALINVOICES

FROM LGCUSTOMER AS C, LGINVOICE AS I

WHERE C.CUST_CODE=I.CUST_CODE

GROUP BY C.CUST_CODE, CUST_FNAME, CUST_LNAME

HAVING SUM(INV_TOTAL)>1500

ORDER BY SUM(INV_TOTAL) DESC;

---

Problem 42

SELECT D.DEPT_NUM, DEPT_NAME, DEPT_PHONE, D.EMP_NUM, EMP_LNAME
FROM LGDEPARTMENT AS D, LGEMPLOYEE AS E
WHERE D.EMP_NUM = E.EMP_NUM
ORDER BY DEPT_NAME;

---

ALL THE BEST

Add a comment
Know the answer?
Add Answer to:
Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • SQL query: Write an SQL query that will output the last name, employee id, hire date and department from the employee table. Pick only those employees whose department ID is specified in the employee...

    SQL query: Write an SQL query that will output the last name, employee id, hire date and department from the employee table. Pick only those employees whose department ID is specified in the employee table. If the employee id is 777, name is ABC and hire date is 01-JAN-2016, the output should look as follows - 'Stephen (Employee ID - 777) was hired on the 1st of January, 2016 – Department: 90'. Note - The date should not have preceding...

  • 1. Using the Sakila database, write a query that shows the first_name and last_name of actors...

    1. Using the Sakila database, write a query that shows the first_name and last_name of actors that have not appeared in a film. 2. Using the Sakila database, write a query that shows the film title and category name corresponding to the film. If the category is null, display “Unknown” rather than null. 3. Using the Sakila database, write a query that shows the number of films per rating that have special_features with commentaries. 4. Using the Sakila database, write...

  • Question 1 5 pts • Using the Sakila database, write a query that shows the first...

    Question 1 5 pts • Using the Sakila database, write a query that shows the first name and last_name of actors that have not appeared in a film. Question 2 5 pts Using the Sakila database, write a query that shows the film title and category name corresponding to the film. If the category is null,display "Unknown" rather than null. Question 3 5 pts • Using the Sakila database, write a query that shows the number of films per rating...

  • can someone solve these quick please and thank you! sql chapter 4 Query #1: List the...

    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...

  • Can you please write the MySQL Query sentences for the following items below? For example: SELECT...

    Can you please write the MySQL Query sentences for the following items below? For example: SELECT * FROM employees; Generate a list of salespeople sorted descending by hire date. Show the ID, first name, last name, hire date, and salary for each salesperson. Generate a list of customers whose last name begins with the letter “M.” Show the first and last names of these customers. Sort the list of customers descending by last name. C. Generate a list of customers...

  • Write a query to display author ID, author first, last name, and the number of subjects...

    Write a query to display author ID, author first, last name, and the number of subjects (book subject count) for authors who have published books in more than one subject area (book subject). CHECKOUT PATRON PK Pat ID FK1 Book Num FK2 Pat ID Check Out Date Check Due Date Check In Date Pat FName Pat LName Pat Type BOOK AUTHOR PK Au ID Book Title Book Year Book Cost Book Subject Au FName Au LName Au BirthYear FK1 Pat...

  • The Ch07_ConstructCo database stores data for a consultingcompany that tracks all charges to projects. The...

    The Ch07_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch07_ConstructCo database are shown in Figure P7.1.Note that the ASSIGNMENT table in Figure P7.1 stores the JOB_CHG_HOUR values as an attribute (ASSIGN_CHG_HR) to maintain historical accuracy of the data. The JOB_CHG_HOUR values are likely to change over time. In fact, a JOB_CHG_ HOUR change will be...

  • Please help me to solve Please, No handwriting COURSE; introduction to database Q- write a query ...

    Please help me to solve Please, No handwriting COURSE; introduction to database Q- write a query SQL by Using the info below A. Normalize the Tables (in 3NF at least) B. Create the Normalized Tables and Populate them with at least 5 Rows C. Write the Wholesale Management System requested Queries & Execute them VERY IMPORTANT Screenshots from MySQL (or any other software you use) of all the tables after queries result. - Database system for a Wholesale Management System...

  • Please refer to the following business scenarios: (i) Using SELECT statements of SQL, find the employee...

    Please refer to the following business scenarios: (i) Using SELECT statements of SQL, find the employee id, first name, last name, job title and email of all employees working in Asia (i.e. all countries coming from the region     ‘Asia’). This query must be implemented as a nested query! (ii) Using SELECT statements of SQL, find the employee id, first name, last name, job title and supervisor id of employees who had worked for more than 3 years and completed...

  • Design and write a class named Employee that inherits the Person class from the previous exercise...

    Design and write a class named Employee that inherits the Person class from the previous exercise and holds the following additional data: ID number, department and job title. Once you have completed the Employee class, write a Python program that creates three Employee objects to hold the following data: Name ID Number Department Job Title Phone Susan Meyers 47899 Accounting Vice President 212-555-1212 Mark Jones 39119 IT Programmer 212-555-2468 Joy Rogers 81774 Operations Engineer 212-555-9753 The Python program should store...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT