Question: Please simply select the correct letter. 1.Which result set does the following left join produce? select p.Prod_ID, Color, Price from products as p left join

Please simply select the correct letter.

1.Which result set does the following left join produce?

select p.Prod_ID, Color, Price from products as p left join saleitems as s on p.Prod_ID=s.Prod_ID;

products

Prod_ID Color
1 Blue
2 Red
3 Red
4 Green
5 Blue

saleitems

Prod_ID Price
1 12.99
4 45.99
6 99.99

a. Result Set 1
Prod_ID Color Price
1 Blue 12.99
2 Red .
3 Red .
4 Green 45.99
5 Blue .
b. Result Set 2
Prod_ID Color Price
1 Blue 12.99
2 Red .
3 Red .
4 Green 45.99
5 Blue .
6 99.99

2. The widgets table stores information about the most popular items sold in a hardware store. The locations table stores information about the location of some of the items in the store. Which query produces the result set that is shown below?

widgets

ID Type
89 FL
46 UI
47 TA
92 QY

locations

ID Bin
1 B98
46 B63
74 B02
85 B98
99 B02

Results

ID Type Bin
46 UI B63
47 TA
89 FL
92 QY

a.
select coalesce(w.ID, I.ID) as ID, Type, Bin from widgets as w left join locations as I on w.ID = I.ID order by w.ID;
b.
select coalesce(w.ID, I.ID) as ID, Type, Bin from widgets as w right join locations as I on w.ID = I.ID order by w.ID;

3. Which syntax is appropriate for a self-join on the employees table?

display

a.
select e1.ID, e1.Name as EmpName, e2.Name as ManagerName from employees inner join employees on ID = ID;
b.
select e1.ID, e1.Name as EmpName, e2.Name as ManagerName from employees as e1 and employees as e2 on e1.ID = e2.ID;
c.
select e1.ID, e1.Name as EmpName, e2.Name as ManagerName from employees as e1 inner join employees as e2 on e1.ID = e2.ID;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!