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)[3 points] Provide an organized view of the table to obtain the best overview of the orders. Give a
brief reason for your query.
(c)[3 points] Find the quantities ordered, the prices for each unit, and the sales values for order 10109
with orderline number 4, order 10100 with orderline number 2, and order 10101 with orderline number
Output all five attributes mentioned.
(d)[3 points] Determine which product lines can be found in the table.
(e)[3 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)[3 points] Determine the dates of order lines with a unit price between $77.77 and $111.11. Arrange
the dates in descending order.
(g)[3 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 0 obviously) for each
tuple.
(h)[3 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)[3 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)[3 points] Determine how many days have passed between the oldest order and the most recent order.
In the following, design and execute SQL queries

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!