Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In the queries, you must use the constructions listed below at least once. If a given construction is not used, 2 points will be deducted for each unused construction (each individual construction = 2 points):
- ● Correlated Subquery
- ● Operations on result set
- ● JOIN Statement
- ● ANY/ALL Statement
- ● EXISTS Statement
- 1. Without using ORDER BY and FETCH, find the three most recent orders. Sort them by date.
- 2. Display the amount of time that has passed since each order was placed until today. Name the column "Time".
- 3. For each item, calculate the total amount paid for it across all orders. Take into account the quantity of items in each order.
- 4. Display order data in the format: Order date, status name, customer's last name. Sort the data in descending order by date and in ascending order by the customer's last name.
- 5. List the number of orders for each item. Display the name and availability of each item. Exclude items that were ordered in less than two orders.
- 6. Find the item that has been ordered the most times without using FETCH and ROWNUM.
- 7. Find the item that has never been ordered.
- 8. List the names of items that have an average price lower than the average price of the item with ID 4.
- 9. List unique orders that include both the 'Jacket' item and an item starting with the letter 'T'.
- 10. Provide the earliest order among orders with the same status without using FETCH and ROWNUM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement