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
|
5547 Discussions
|
Please Login in order to post a comment
--Why below code is showing wrong ? select Name + CASE WHEN Occupation = 'Doctor' THEN '(D)' WHEN Occupation = 'Actor' THEN '(A)' WHEN Occupation = 'Singer' THEN '(S)' WHEN Occupation = 'Professor' THEN '(P)' ELSE '' END AS NamewithAbbrebiation from OCCUPATIONS ORDER BY Name Asc
select 'There are a total of '+CAST(count(*) AS VARCHAR(10))+' '+Occupation+'s.' from OCCUPATIONS group by Occupation
SELECT CONCAT(name, '(', LEFT(occupation, 1), ')') AS output FROM OCCUPATIONS ORDER BY name asc; SELECT CONCAT('There are a total of ', COUNT(), ' ', LOWER(occupation), 's.') AS result FROM OCCUPATIONS GROUP BY occupation ORDER BY COUNT(), LOWER(occupation);
SELECT CONCAT(Name ,'(',LEFT(Occupation,1),')') FROM OCCUPATIONS ORDER BY Name ASC;
SELECT CONCAT('There are a total of ',COUNT(Occupation),' ',LOWER(Occupation),'s.') FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(Occupation) ASC, LOWER(Occupation) ASC;
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(occupation) asc, lower(occupation) asc;
SELECT CONCAT(Name ,'(',LEFT(Occupation,1),')') FROM OCCUPATIONS ORDER BY Name ASC; SELECT CONCAT('There are a total of ',COUNT(Occupation),' ',LOWER(Occupation),'s.') FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(Occupation) ASC, LOWER(Occupation) ASC;