Day 6

Quiz

1: How many rows would a two-table join produce without a condition in the WHERE clause if one table had 50,000 rows and the other had 100?
A1: 5,000,000.
2: What type of join appears in the following SELECT statement?
select e.name, e.employee_id, ep.salary
from employee_tbl e,
     employee_pay_tbl ep
where e.employee_id = ep.employee_id;
A2: An equi-join.
3: Will the following SELECT statements work?
  1. select name, employee_id, salary
    from employee_tbl e,
         employee_pay_tbl ep
    where employee_id = employee_id
      and name like '%MITH';
    
  2. select e.name, e.employee_id, ep.salary
    from employee_tbl e,
         employee_pay_tbl ep
    where name like '%MITH';
    
  3.  select e.name, e.employee_id, ep.salary from employee_tbl e, employee_pay_tbl ep where e.employee_id = ep.employee_id ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.