Practice Center – select count

Exercise 1

Display the different states (column state) present in the table clients, without showing twice the same state.
Enter the corresponding query in the edit box below and click on the “Send” button underneath:


Exercise 2

Display the number of states (column state) for which the company had a revenue (column revenue) greater than 0 in year 2014 (column year). The revenues are recorded in the table sales. Be careful not to count any state twice.


Exercise 3

Display the different combinations of state, salesperson_id in the table clients, without showing twice the same combination of state, salesperson_id (no duplicate).


Exercise 4

Get the number of different states (column state) in the table clients (be careful not to count duplicates – for example if Kerala is appearing 3 times it counts only as one state).


Exercise 5

Get the number of entries in the table clients.


Exercise 6

Get the number of entries in the table salespersons.


 
Share on:

Something not clear? Ask your question here:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
 

Author:
Last udpated: March 1, 2016
Created: January 1, 2015