Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Which of the following queries displays the sum of all employee salaries for those employees not making commission, for each job, including only those sums greater than 2500?
a) select job, sum(Sal) from Emp where sum(Sal) > 2500 and comm is null;
b) select job, sum(Sal) from Emp where comm is null group by job having sum(Sal) > 2500;
c) select job, sum(Sal) from Emp where sum(Sal) > 2500 and comm is null group by job;
d) select job, sum(Sal) from Emp group by job having sum(Sal) > 2500 and comm is not null;
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Using the ERD above, formulate queries to satisfy the following questions. Do not include NULL values.: What are the last names and emails of all customer who made purchases in the store? What are the names of each albums and the artist who created it? What are the total number of unique customers for each state, ordered alphabetically by state? Which states have more than 10 unique customers? What are the names of the artists who made an album containing the substring "symphony" in the album title? What are the names of all artists who performed MPEG (video or audio) tracks in either the "Brazilian Music" or the "Grunge" playlists? How many artists published at least 10 MPEG tracks? What is the total length of each playlist in hours? List the playlist id and name of only those playlists that are longer than 2 hours, along with the length in hours rounded to two decimals.arrow_forwardGiven the table PRODUCT(ProductID, ProductName, ProductClass, ProductWeight, ProductStyle, ProductColor, ProductPrice). Note: ProductWeight and ProductPrice are numeric fields, and the other attributes are character fields, i.e., store text. Write a SQL query to display the product class whose average price is at least 50arrow_forward4) Display the firstname, lastname of the employees and the customerID that the employee served. Arrange the results by the last name. 5) Write a query to the Name of the Product and the corresponding name of the supplier of that Product for all the products that start with a “P”. 6) Write a SQL query to output the product name and the quantity of the Orders of that product for those orders with more than 70 quantity. (hint: don’t have to use GROUP BY) I need help figuring out the SQL quereys for the questions above using table joining methodarrow_forward
- Lab #9 – Joining Data From Multiple Tables List the order number and order date for every order that was placed by Mary Nelson and that contains an order line for an iron. Use an INTERSECT operator. Lab #10 – Sub Queries Find the sales rep number, last name, and first name for every sales rep who represents at least one customer with a credit limit of $2000. List the order number and order date for every order that was placed by Mary Nelson and that contains an order line for an iron. Down below are the tables ORDER_LINE ORLN_ORDER_NUMBER ORLN_PART_NUMBER ORLN_NUMBER_ORDERED ORLN_QUOTED_PRICE ORDER_TABLE ORDR_ORDER_NUMBER ORDR_ORDER_DATE ORDR_CUSTOMER_NUMBER CUSTOMER CUST_NUMBER CUST_LAST CUST_FIRST CUST_STREET CUST_CITY CUST_STATE CUST_ZIP_CODE CUST_BALANCE CUST_CREDIT_LIMIT CUST_SALES_REP_NUM PART PART_NUMBER PART_DESCRIPTION UNITS_ON_HAND…arrow_forwardWrite the SQL code that will produce the results shown as below. Write the SQL code to calculate the ASSIGN_CHARGE values in the ASSIGNMENT table. Note that ASSIGN_CHARGE is a derived attribute that is calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS. Write the SQL code that will yield the total number of hours worked for each employee and the total charges stemming from those hours worked. The result is shown as below.arrow_forwardwhich type of joins is not supported by SQL Inner joins Right Joins Full Joins left joinsarrow_forward
- query no 2 is select avg(CustBal) from Customer where CusState='WA' GROUP BY city. Here aggregate function avg is used to calculate average of customer balance.next where statement is used to filter the customer who live in Washington state and at last group by clause is used to show the balance city wise.arrow_forwardFind the output of the following query based on the table given below. SELECT AVG(fees), course_id FROM student GROUP BY course_id ORDER BY course_id DESC: Table Name: student Course_id Coursename Fees 1001 C++ 3000 1002 MATHS for IT 2000 1002 MATHS for IT 4000 O a. 1002. 3000, 1500, 1001 O b. 4000, 1002, 3000, 1001 O. 2000, 1002. 1500, 1001 O d. 3000,1002. 3000, 1001arrow_forwardProblem 53 LargeCo is planning a new promotion in Alabama (AL) and wants to know about the largest purchases made by customers in that state. Write a query to display the customer code, customer first name, last name, full address, invoice date, and invoice total of the largest purchase made by each customer in Alabama. Be certain to include any customers in Alabama who have never made a purchase; their invoice dates should be NULL and the invoice totals should display as 0. Sort the results by customer last name and then first name (Partial result are shown in Figure P7.53).arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education