We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- SQL
- Advanced Select
- The PADS
- Discussions
The PADS
The PADS
Sort by
recency
|
5593 Discussions
|
Please Login in order to post a comment
EASIEST WAY OF WRITING THIS QUERY DYNAMICALLY!!
SELECT NAME || '(' || SUBSTR(OCCUPATION, 1, 1) || ')' FROM OCCUPATIONS ORDER BY NAME;
SELECT
'There are a total of ' || COUNT(STAR) || ' ' || LOWER(OCCUPATION) || 's.' FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY COUNT(STAR) ASC, OCCUPATION ASC;
EASIEST Query:
SELECT CONCAT(name, '(', LEFT(occupation,1), ')') FROM occupations ORDER BY name SELECT CONCAT('There are a total of ', COUNT(occupation), ' ', LOWER(occupation), 's.') FROM occupations GROUP BY occupation ORDER BY COUNT(occupation), occupation
SELECT concat(name, '(',left(occupation, 1),')') from occupations order by name; select concat('There are a total of ', count(),' ', lower(occupation),'s.') from occupations group by occupation order by count() asc, occupation asc;