To my opinion query should be like:
"SELECT PRODUCTS.product_id,PRODUCTS.product_name,ORDER_ITEMS.quantity FROM PRODUCTS,ORDER_ITEMS,ORDERS WHERE ORDERS.order_datetime BETWEEN '2018-01-01' AND '2018-12-31' AND ORDERS.order_status='COMPLETED' ORDER BY ORDER_ITEMS.quantity DESC LIMIT 10 " ;
explanation:
here,datetime clause will select date from 1 jan 2018 till 31 dec 2108 .and order by will display the most value in desc order and limit will used to display only 10 limited rows metadata
Figure 3-4 Sample Schema co CO PRODUCTS CUSTOMERS product_id customer_id product_name email_address unit_price full_name product_details product_image...
Table structure:
administrators = admin_id, email_address,
password, first_name, last_name
categories = category_id, category_name
customers = customer_id, email_address,
password, first_name, last_name, shipping_address_id,
billing_address_id
order_items = item_id, order_id, product_id,
item_price, discount_amount, quantity
orders = order_id, customer_id, order_date,
ship_amount, tax_amount, ship_date, ship_address_id, card_type,
card_number, card_expires, billing_address_id
products = product_id, category_id,
product_code, product_name, description, list_price,
discount_percent, date_added
5. Write a SELECT statement that uses regular expression functions to get the username and domain name parts of the email addresses in the Administrators table. Return...