Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following relations: customer(id, firstName, lastName, address, email) orders(id, customerID, orderDate, shipDate) Which SQL statement retrieves orders for the customer with a customer id

Consider the following relations:

customer(id, firstName, lastName, address, email) orders(id, customerID, orderDate, shipDate)

Which SQL statement retrieves orders for the customer with a customer id of 1205 where the records only contain the order id, orderDate, shipDate, customer firstName, customer lastName, and customer email and the records are ordered by orderDate ascending?

A. SELECT * FROM orders, customer WHERE customerID = customer.id AND customerID = 1205 ORDER BY orderDate ASC;
B. SELECT id, orderDate, shipDate, firstName, lastName, email FROM orders INNER JOIN customer ON customerID = id WHERE customerID = 1205 ORDER BY orderDate ASC;
C. SELECT orders.id, orders.orderDate, orders.shipDate, customer.firstName, customer.lastName, customer.email FROM orders INNER JOIN customer ON orders.customerID = customer.id WHERE orders.customerID = 1205 ORDER BY orders.orderDate ASC;
D. SELECT LIMIT(orders.id, orders.orderDate, orders.shipDate, customer.firstName, customer.lastName, customer.email) FROM orders INNER JOIN customer ON orders.customerID = customer.id WHERE orders.customerID = 1205 ORDER BY orders.orderDate ASC;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions