Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[ 1 2 : 4 8 PM , 1 2 / 1 6 / 2 0 2 3 ] + 1 ( 9 1 7

[12:48 PM,12/16/2023]+1(917)647-7680: 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:
[12:49 PM,12/16/2023]+1(917)647-7680: 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

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_2

Step: 3

blur-text-image_3

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

How can you use a balance sheet for personal financial planning?

Answered: 1 week ago

Question

What are the application procedures?

Answered: 1 week ago

Question

To what microcultural groups do you belong?

Answered: 1 week ago