Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
7-Display last name of employees whose manager is KING.8-Display last name, salary and job title of all employees who earns more than the lowest salary. (Employees andJobs)9-Display all employees including King, who has no manager. Order the results by the employee number.10-Display the name and hire date of any employee hired after employee Davis
Task 3:
The InstantRide Finance team wants to know the average discount amounts for each car in the
InstantRide. Calculate the average discount amount as monetary value for the travels where a
discount is applied. You need to create a subquery over the TRAVELS table to retrieve CAR_ID
and DISCOUNT_AMOUNT, calculated with 2 decimals using the ROUND function.
To calculate the DISCOUNT_AMOUNT , multiply the TRAVEL PRICE by the TRAVEL_DISCOUNT
where the TRAVEL_DISCOUNT value is not NULL. Round the result to 2 decimals.
Then you can use this subquery to get the CAR_ID and AVG of DISCOUNT_AMOUNT values, once
again using the ROUND function on the average results. Group the results by the CAR_ID. Use
CAR ID and DISCOUNT_AMOUNT as column aliases and return it back to the Finance team.
QUESTION 2
Exercise: Create a statement that will show the sum of all the payments received on or after 2018-08-01. The new column
should be titled recent payments_received
Hint: If you did this correctly, you will have one column (and one row) showing the following amount 59755.88
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
- Item ItemlD ItemName Section Price Sold CustomerNo ITI01 Tshirt Garments 25 CI ITI02 Handbag Accessories 7 12 C2 ITI03 Socks Garments 20 C1 IT104 Bracelet Accessories 5 5C3 IT105 Blanket Décor 12 9 C2 IT106 Pillow Décor 10 32 C4 3. 1.arrow_forwardHow about this 3) Prompt the user to search for the student id by the student's name.arrow_forward9. Write a SELECT statement that uses aggregate window functions to calculate the total due for all vendors and the total due for each vendor. Return 3 Columns: The vendor id from the Invoices table. The balance due (invoice_total-payment_total-credit_total) for each invoice in the invoices table with a balance greater than 0. The total balance due for all vendors in the Invoices table. Modify the column that contains the balance due for each vendor so it contains a cumulative total by balance due.arrow_forward
- Create this form please. Randomarrow_forwardThe Horse table has the following columns: ID - integer, primary key RegisteredName - variable-length string Breed - variable-length string Height - decimal number BirthDate - date Write a SELECT statement to select the registered name and height for only horses that have an above average height. Order the results by height (ascending). Hint: Use a subquery to find the average height.arrow_forwardWrite a Select statement that returns the Trading_Symbol column and the Num_Shares column only from the rows where Selling_Price is greater than Purchase_Price and Num_Shares is greater than 100. The results should be sorted bythe Num_Shares column in ascending order.arrow_forward
- Please give me correct solution.arrow_forwardCreate a sequence according to following criteria:1) Create an ascending sequence called id_seq, starting from 10, incrementing by 10, minimum value 10, maximum value 100. The sequence returns 10 once it reaches 100 because of the CYCLE option.2) Get the next value of the sequence and the current value of the sequencearrow_forwardThe Horse table has the following columns: ID - integer, primary key RegisteredName - variable-length string Breed - variable-length string Height - decimal number BirthDate - date Write a SELECT statement to select the registered name and height for only horses that have an above average height. Order the results by height (ascending).arrow_forward
- QUESTION 15 use the follwoing picture to answer the question Write a select statement which should display the ITEM_SIZE, COLOR, CURR_PRICE of ORDERID = 1058. (you need to join the tables)arrow_forwardThe Horse table has the following columns: ID - integer, primary key RegisteredName - variable-length string Breed - variable-length string Height - decimal number BirthDate - date Write a SELECT statement to select the registered name, height, and birth date for only horses that have a height between 15.0 and 16.0 (inclusive) or have a birth date on or after January 1, 2020. -- Your SELECT statement goes hereSELECT *FROM HorseWHERE (Height >= '15.0' AND Height <= '16.0') OR BirthDate >= '2020-01-01';arrow_forwardhe Horse table has the following columns: ID - integer, primary key RegisteredName - variable-length string Breed - variable-length string Height - decimal number BirthDate - date Write a SELECT statement to select the registered name, height, and birth date for only horses that have a height between 15.0 and 16.0 (inclusive) or have a birth date on or after January 1, 2020.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- COMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE LNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY