Challenge: Unmatched Records Report
Завдання
Swipe to start coding
Write a SQL query that uses FULL OUTER JOIN to list all customers and all orders, showing which customers do not have any orders and which orders do not have a matching customer.
- Join the
customersandorderstables using aFULL OUTER JOINon thecustomer_idfield. - Select the
customer_idandnamefrom thecustomerstable, and theorder_idandorder_datefrom theorderstable. - Add a column named
match_statusthat indicates:'Customer without orders'if the customer has no matching order.'Order without customer'if the order has no matching customer.'Matched'if both customer and order exist.
- Order the results so that unmatched records appear first, followed by matched records.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 6
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Чудово!
Completion показник покращився до 4.76
Challenge: Unmatched Records Report
Свайпніть щоб показати меню
Завдання
Swipe to start coding
Write a SQL query that uses FULL OUTER JOIN to list all customers and all orders, showing which customers do not have any orders and which orders do not have a matching customer.
- Join the
customersandorderstables using aFULL OUTER JOINon thecustomer_idfield. - Select the
customer_idandnamefrom thecustomerstable, and theorder_idandorder_datefrom theorderstable. - Add a column named
match_statusthat indicates:'Customer without orders'if the customer has no matching order.'Order without customer'if the order has no matching customer.'Matched'if both customer and order exist.
- Order the results so that unmatched records appear first, followed by matched records.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 6
single