Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Multiple - choice exam: select the answer that best answers the question. Each question is worn 5 - points. You get 1 - point for

Multiple-choice exam: select the answer that best answers the question. Each question is worn
5-points. You get 1-point for leaving the answer blank. If no answer is appropriate, write your own (the e answer).
For the below questions, use the following schema definition.
customer (cid, name, email, dob) ordr (oid, cid, tim)
ordritem(oid, pid, qty)
product (pid, name, price)
It's a schema for a store: customer table has customer information, ordr has order information (links to customer via cad), and ordritem (inks to ordr via old) has order line-iters and quantity and link to products via pid.
1. Find customer id of John Doc.
(a) select cid from customer where name=' John Doe'
(b) select name from customer where fname=' John' and Iname='Doe'
(c) select * from customer where name=' John Doe'
(d) select cid from customer where fname= John' and Iname='Doe'
(e) Other:
2. Find name and price of product 42.
(a) select pid, price from product where pid=42
(b) select name, price from product having pid=42
(c) select * from product with pid=42
(d) select name, price from product where pid=42
(c) Other:
3. Find customer id for order 42.
(a) select cid from customer a inner join ordr b on (cid) where oid=42
(b) select cid from customer a
left outer join ordr b using(cid) where oid=42
(c) select cid from ordr where oid=42
(d) select name, cid, dob from ordr where oid=42
(e) Other:
4. Find customer name for order 42.
(a) select * from ordr a
natural inner join customer b using a.cid=b.cid where oid=42
(b) select name from ordr a
inner join customer b on a.cid=b.cid where oid=42

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

More Books

Students also viewed these Databases questions