get relationship foreign key count

select essn as SSN, count(essn) as COUNT from dependent group by SSN having count(essn) > 0;

nested queries

	-- get all items placed by an employee
select * from Mega_Refrigerator where emp_id = (select employee_id from Employees where name = 'Oompa_loompa_1)';
 
-- get number of employees that can purchase 10 of the highest cost item
select count(*) from Employees where salary > (select max(item_cost) * 10* from Mega_Refrigerator)