Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PLEASE WRITE AN ANSWER IN MYSQL WORKBENCH Use a subquery and outer query to dete

ID: 3727902 • Letter: P

Question

PLEASE WRITE AN ANSWER IN MYSQL WORKBENCH

Use a subquery and outer query to determine the last_name, first_name, and email address of all customers with credit_cards that expire in 2013 or 2014 as shown in the orders table.

orders table:

Table: customers

Columns:

int(11)

order_id int(11) AI PK customer_id int(11) order_date datetime ship_amount decimal(10,2) tax_amount decimal(10,2) ship_date datetime ship_address_id int(11) card_type varchar(50) card_number char(16) card_expires char(7) billing_address_id int(11)

Explanation / Answer

SELECT cust.last_name, cust.first_name, cust.email_address
FROM customers cust
WHERE cust.customer_id =
(
SELECT customer_id FROM orders WHERE
card_expires != 2013 AND card_expires != 2014
);

**Comment for any further queries.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote