Question

implement in Oracle Sql please 5) Write a SELECT statement that answers this question: Which products...

implement in Oracle Sql please

5) Write a SELECT statement that answers this question: Which products have a list price that’s greater than the average list price for all products?

Return the product_name and list_price columns for each product.

Sort the results by the list_price column in descending sequence.

Homework Answers

Answer #1

Solution:

Query:

SELECT product_name, list_price
FROM products
WHERE list_price > (SELECT AVG (p.list_price)
ORDER BY list_price DESC;

Query with comments for explanation

/* SELECT statement that display productName and List price */
SELECT product_name, list_price

/* from all the products*/
FROM products

/* have a list price that’s greater than the average list price for all products*/
WHERE list_price > (SELECT AVG (p.list_price)

/* Return the product_name and list_price columns for each product */
FROM products p)

/*Sort the results by the list_price column indescending sequence */
ORDER BY list_price DESC;

Know the answer?
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
Similar Questions
in mysql 3. Write a SELECT statement that returns one row for each customer that has...
in mysql 3. Write a SELECT statement that returns one row for each customer that has orders with these columns:   The email_address column from the Customers table   The sum of the item price in the Order_Items table multiplied by the   quantity in the Order_Items table   The sum of the discount amount column in the Order_Items table   multiplied by the quantity in the Order_Items table   Sort the result set in descending sequence by the item price total for each customer.  
Write a SQL statement for the following query: Relational Schema: Part( P #, PName, Producer, Year,...
Write a SQL statement for the following query: Relational Schema: Part( P #, PName, Producer, Year, Price) (P# is the primary key) Customer( C#, CName, City) (C# is the primary key) Supply(S#, P#, C#, Quantity, Amount, Date) (S# is the primary key) Query: For each Apple product supplied to more than 10 different customers in Chicago in 2020, list product number, product name, total supply quantity, and total supply amount. Sort the result by product name.
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1....
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1. Write a SELECT statement that returns all columns from the Vendors table inner-joined with all columns from the Invoices table. 2. Write a SELECT statement that returns four columns: vendor_name vendor_name from the Vendors table invoice_number invoice_number from the Invoices table invoice_date invoice_date from the Invoices table balance_due invoice_total minus payment_total minus credit_total from the Invoices table The result set should have one row...
Which of the following statement is correct? Select one: a. All the answers are incorrect. b....
Which of the following statement is correct? Select one: a. All the answers are incorrect. b. A positive NPV means that the firm’s value will decrease if the project is adopted because the new project’s estimated return is lesst than the firm’s required rate of return. c. Reject the project if the IRR is greater than or equal to the required rate of return. d. Payback period is the discount rate that forces the NPV to equal zero. e. All...
A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a....
A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a. operator b. subquery c. alias d. view If a subquery returns list of values, which operator can be used in the outer query predicate? Select one: a. > b. < c. IN d. = Which query returns a list of all products with a price greater than or equal to the average product price? Select one: a. SELECT P_CODE,MAX(AVG(P_PRICE)) FROM PRODUCT GROUP BY P_CODE;...
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...
Question 1: Group by and Aggregates: Write SQL statements to answer the following questions using Assignment...
Question 1: Group by and Aggregates: Write SQL statements to answer the following questions using Assignment 4’s schema (Customer-Invoice-Line-Product-Vendor). Make sure that your SQL script runs without any errors. Submit your answers in a .SQL file. 1 (2 Points) - Find the count of distinctvendors thatsupplied products that are priced lowerthan 185? 2 (2 Points) - For each vendor, find their product that has the lowest product quantity. Your output should include vendor code, vendor name, product description and product...
***This is a complete question. Do not tag this as incomplete. Write SQL queries to the...
***This is a complete question. Do not tag this as incomplete. Write SQL queries to the below Relational Database. • Regarding the SQL queries: • Do not use SELECT * in any query. • Do not use any SQL features (including Nullif) that were not covered in this course. • Do not use subqueries IF joins can be used to answer a question. However, some questions may require the use of subqueries. The Movie Database Notes: TheaterNum, MovieNum, and ActorNum...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary to answer the queries that follow. Primary keys are underlined and foreign key fields have an asterisk at the end of the field. CUSTOMERS (CUST-NO, C-NAME, C-ADDRESS, BALANCE) SALESPERSONS (SP-NO, S-NAME, DATE-EMPLOYED, SALARY) SALES (INVOICE-NO, DATE, CUST-NO*, SP-NO*) a) List the salesperson name and salary for all sales to customers whose balance outstanding is greater than 20000. b) List the names and addresses of...
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table....
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table. SQL provides two different techniques for querying data from multiple tables: • The SQL subquery • The SQL join As you will learn, although both work with multiple tables, they are used for slightly different purposes. We used WMCRM database which is what we created in Lab 4. Here is the summary of the database schema (where schema is used in its meaning of...