Hello SQL

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

-- SELECT CUSTOMERS COMING FROM INDIA, CHINA AND USA --
-- AFTER CHECKING TJE LOGICAL MODEL, THE USER TABLE HAVE ALL THE INFORMATION WE NEED--
/*select *
from Users
where Location like '%China%' 
 or 
 Location like '%India%' 
 or 
 Location like '%USA%'
 */
 
 --REWRITE BY USING CASE THEN--
/* select Id, Location, 'country coming from'=
 case when location like '%India%' then 'coming from India'
       when location like '%China%' then 'coming from China'
       when location like '%USA%' then 'coming from USA'
       when location is null then 'no location information'
       ELSE 'coming from other countries'
       end
from Users
*/

-- generate a frequency distribution table--
select count(Id),Reputation
from Users
group by Reputation

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results