Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update The PADS.mysql #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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;