Powered by SQLite. Use strftime('%Y', date) instead of EXTRACT. Type queries in the practice editors below and click ▶ Run.
customers
customer_idINTEGER PK
nameTEXT
emailTEXT
cityTEXT
signup_dateTEXT (YYYY-MM-DD)
segmentTEXT
phone_numberTEXT (nullable)
orders
order_idINTEGER PK
customer_idINTEGER FK→customers
product_idINTEGER FK→products
order_dateTEXT (YYYY-MM-DD)
total_amountREAL
statusTEXT (completed/refunded/cancelled)
regionTEXT (North/South/East/West)
categoryTEXT
quantityINTEGER
products
product_idINTEGER PK
product_nameTEXT
categoryTEXT
priceREAL
statusTEXT (active/discontinued)
selling_priceREAL
cost_priceREAL
order_items
item_idINTEGER PK
order_idINTEGER FK→orders
product_idINTEGER FK→products
product_nameTEXT
unit_priceREAL
quantityINTEGER
retail_orders
order_idINTEGER PK
customer_nameTEXT
categoryTEXT
quantityINTEGER
unit_priceREAL
order_dateTEXT
regionTEXT
statusTEXT
employees
employee_idINTEGER PK
nameTEXT
departmentTEXT
salaryREAL
hire_dateTEXT (YYYY-MM-DD)
department_idINTEGER FK→departments
departments
dept_idINTEGER PK
dept_nameTEXT