Question: MySQL Q2.) (25 points) Use the om database for this question. Write a query that replicates the result set below, matching all data and format
MySQL


Q2.) (25 points) Use the om database for this question. Write a query that replicates the result set below, matching all data and format aspects, including column headers. For this question, you must use a UNION. Points will be deducted for using IFNULL, COALESCE, etc. CA order_date shipped_date customer_state customer_address customer_full_name 2014-08-02 Not yet shipped NY 828 S Broadway Justin Javen 2014-08-02 Not yet shipped CA 882 W Easton Wy Karina Lacy 2014-08-01 Not yet shipped OH 1555 W Lane Ave Korah Blanca 2014-07-21 2014-07-31 WI 11 E Rancho Madera Rd Yash Randall 2014-07-21 2014-07-28 AZ 789 E Mercy Ave Kyle Marissa 2014-07-19 2014-07-26 CA 3433 E Widget Ave Samuel Jacobsen 2014-07-12 2014-07-21 CA 2508 W Shaw Ave Thalia Neftaly 2014-07-11 2014-07-13 DC 2401 Wisconsin Ave NW Kirsten Story 2014-06-12 2014-06-19 AZ 789 E Mercy Ave Kyle Marissa 2014-06-07 2014-06-19 882 W Easton Wy Karina Lacy 2014-06-05 2014-06-08 CA 3433 E Widget Ave Samuel Jacobsen 2014-05-23 2014-06-02 MD 12345 E 67th Ave NW Anders Rohansen 2014-05-19 2014-06-02 MD 12345 E 67th Ave NW Anders Rohansen 2014-05-09 2014-05-11 2677 Industrial Circle Dr Marvin Quintin 2014-05-08 2014-05-18 NC Five Lakepointe Plaza, ... Erick Kaleigh 2014-05-05 2014-05-10 CA 3433 E Widget Ave Samuel Jacobsen 2014-05-04 2014-05-09 WI 11 E Rancho Madera Rd Yash Randall 2014-04-25 2014-05-04 NC Five Lakepointe Plaza, ... Erick Kaleigh 2014-04-25 2014-05-02 OH 3250 Spring Grove Ave Kaitlin Hostlery 2014-04-21 2014-04-27 1033 N Sycamore Ave. Dakota Baylee 2014-03-23 2014-04-03 CA 3433 E Widget Ave Samuel Jacobsen 2011 4 10 11 Rancho Maderand Vashandall The result set should only contain 47 rows. Only a subset is shown in this preview. OH CA | LAIT O order_details order_id INT item_id INT Oorder_qty INT Indexes . PRIMARY order_details_fk_items customers customer_id INT customer_first_name VARCHAR(50) customer_last_name VARCHAR(50) customer_address VARCHAR(255) customer_city VARCHAR(50) customer_state CHAR(2) customer_zip VARCHAR (20) customer_phone VARCHAR(30) customer_fax VARCHAR(30) Indexes items item_id INT title VARCHAR(50) artist VARCHAR(50) unit_price DECIMAL (9,2) Indexes + PRIMARY title_artist_una PRIMARY orders order_id INT customer_id INT order_date DATE shipped_date DATE Indexes PRIMARY orders_fk_customers Q2.) (25 points) Use the om database for this question. Write a query that replicates the result set below, matching all data and format aspects, including column headers. For this question, you must use a UNION. Points will be deducted for using IFNULL, COALESCE, etc. CA order_date shipped_date customer_state customer_address customer_full_name 2014-08-02 Not yet shipped NY 828 S Broadway Justin Javen 2014-08-02 Not yet shipped CA 882 W Easton Wy Karina Lacy 2014-08-01 Not yet shipped OH 1555 W Lane Ave Korah Blanca 2014-07-21 2014-07-31 WI 11 E Rancho Madera Rd Yash Randall 2014-07-21 2014-07-28 AZ 789 E Mercy Ave Kyle Marissa 2014-07-19 2014-07-26 CA 3433 E Widget Ave Samuel Jacobsen 2014-07-12 2014-07-21 CA 2508 W Shaw Ave Thalia Neftaly 2014-07-11 2014-07-13 DC 2401 Wisconsin Ave NW Kirsten Story 2014-06-12 2014-06-19 AZ 789 E Mercy Ave Kyle Marissa 2014-06-07 2014-06-19 882 W Easton Wy Karina Lacy 2014-06-05 2014-06-08 CA 3433 E Widget Ave Samuel Jacobsen 2014-05-23 2014-06-02 MD 12345 E 67th Ave NW Anders Rohansen 2014-05-19 2014-06-02 MD 12345 E 67th Ave NW Anders Rohansen 2014-05-09 2014-05-11 2677 Industrial Circle Dr Marvin Quintin 2014-05-08 2014-05-18 NC Five Lakepointe Plaza, ... Erick Kaleigh 2014-05-05 2014-05-10 CA 3433 E Widget Ave Samuel Jacobsen 2014-05-04 2014-05-09 WI 11 E Rancho Madera Rd Yash Randall 2014-04-25 2014-05-04 NC Five Lakepointe Plaza, ... Erick Kaleigh 2014-04-25 2014-05-02 OH 3250 Spring Grove Ave Kaitlin Hostlery 2014-04-21 2014-04-27 1033 N Sycamore Ave. Dakota Baylee 2014-03-23 2014-04-03 CA 3433 E Widget Ave Samuel Jacobsen 2011 4 10 11 Rancho Maderand Vashandall The result set should only contain 47 rows. Only a subset is shown in this preview. OH CA | LAIT O order_details order_id INT item_id INT Oorder_qty INT Indexes . PRIMARY order_details_fk_items customers customer_id INT customer_first_name VARCHAR(50) customer_last_name VARCHAR(50) customer_address VARCHAR(255) customer_city VARCHAR(50) customer_state CHAR(2) customer_zip VARCHAR (20) customer_phone VARCHAR(30) customer_fax VARCHAR(30) Indexes items item_id INT title VARCHAR(50) artist VARCHAR(50) unit_price DECIMAL (9,2) Indexes + PRIMARY title_artist_una PRIMARY orders order_id INT customer_id INT order_date DATE shipped_date DATE Indexes PRIMARY orders_fk_customers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
