Question: In the following, design and execute SQL queries for some colloquial queries and tasks. ( b ) [ 3 points ] Provide an organized view
In the following, design and execute SQL queries for some colloquial queries and tasks.
b points Provide an organized view of the table to obtain the best overview of the orders. Give a
brief reason for your query.
c points Find the quantities ordered, the prices for each unit, and the sales values for order
with orderline number order with orderline number and order with orderline number
Output all five attributes mentioned.
d points Determine which product lines can be found in the table.
e points Determine how many different product lines can be found in the table and keep the result
under the new attribute "Total Number of Product Lines".
f points Determine the dates of order lines with a unit price between $ and $ Arrange
the dates in descending order.
g points The sales values in the table are the result of the product of the price of each unit and the
quantity ordered. Check for each tuple that the stored sales values are correct. For this, show the
stored sales value, the computed sales value, and their difference that should be obviously for each
tuple.
h points Find the numbers of orders where the first name of the contact person begins with Ro
Output the first name of the contact person too.
i points Compute the average sales value, the minimum sales value, the maximum sales value, and
the sum of all sales of those order lines that do not have customers from Germany. Provide meaningful
names for the computed values. Round each value to two decimal places.
j points Determine how many days have passed between the oldest order and the most recent order.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
