Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions SQL/2_Advanced Select/02_The PADS/The PADS.mysql
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,21 @@ SELECT CONCAT('There are a total of ',COUNT(OCCUPATION),' ',LOWER(OCCUPATION),'s
FROM OCCUPATIONS
GROUP BY OCCUPATION
ORDER BY COUNT(OCCUPATION), OCCUPATION;

-- select case
-- when occupation ='doctor' then concat(name,'(D)')
-- when occupation = 'actor' then concat(name,'(A)')
-- when occupation = 'singer' then concat(name,'(S)')
-- else concat(name,'(P)')
-- end
-- from occupations
-- order by name;
-- select case
-- when occupation ='doctor' then concat('There are a total of ',count(occupation),' doctors.')
-- when occupation = 'actor' then concat('There are a total of ',count(occupation),' actors.')
-- when occupation = 'singer' then concat('There are a total of ',count(occupation),' singers.')
-- else concat('There are a total of ',count(occupation),' professors.')
-- end as h
-- from occupations
-- group by occupation
-- order by count(occupation), occupation;