Home Skills SQL for Data Analysis (Beginner) Set Operations and Subqueries Practice Free practice · Interactive SQL · medium
Practice Stack current and retired products
Use UNION ALL to stack active products labeled Current above inactive products labeled Retired. Return product_name and catalog_status, sorted by product_name.
Table relationships employees.manager_id→ employees.employee_idorders.customer_id→ customers.customer_idorders.sales_rep_id→ employees.employee_idorder_items.order_id→ orders.order_idorder_items.product_id→ products.product_id
customers Customer profile fields used for account reporting.
6 rows Grain One row per customer
customer_idTEXT PK customer_nameTEXT cityTEXT state_codeTEXT segmentTEXT signup_dateTEXT Preview source rows employees Sales employees and their reporting relationships.
5 rows Grain One row per employee
employee_idTEXT PK employee_nameTEXT regionTEXT manager_idTEXT FK Preview source rows products Products available in the fictional US service catalog.
4 rows Grain One row per product
product_idTEXT PK product_nameTEXT categoryTEXT active_flagINTEGER Preview source rows orders Order-level dates, statuses, owners, and USD amounts.
7 rows Grain One row per order
order_idTEXT PK customer_idTEXT FK order_dateTEXT statusTEXT sales_rep_idTEXT FK order_amountREAL Preview source rows order_items Product lines belonging to customer orders.
7 rows Grain One row per product on an order
order_idTEXT FK product_idTEXT FK quantityINTEGER unit_priceREAL discount_pctREAL Preview source rows SQL query Run query Reset query Changes to this practice database are never saved.
Show hint
Ready to check your work? Edit the starter query, run it, then compare your result with the task.
Check Work