General Note: Here we have pulled in the data from a sample database. You can download it from the following link and use it for practicing Click Here For Sample Database

Operator Meaning
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
<> Not equal to

The best example for the operators are E-Commerce sites like Amazon, Flipkart,  etc. In those sites they have some options like price (check box), if you check the appropriate box it will show the filtered mobile list. If you want to have the list of mobiles which are in sub 10,000 range, then check the following query


Select mobile_name,price,type,sim_type,brand_name from mobile_sales_details where price<10000

mobile_name     price       type        sim_type    brand_name
--------------  ----------  ----------  ----------  ----------
Moto E (Black)  6999        Smartphone  Dual        Motorola  
Asus Zenfone 4  5999        Smartphone  Dual        Asus      
Asus Zenfone 5  9999        Smartphone  dual        Asus      
Samsung Galaxy  8206        Smartphone  Dual        Samsung   
Samsung Galaxy  7599        Smartphone  Dual        Samsung   
Samsung Galaxy  8214        Smartphone  Dual        Samsung   
Samsung Galaxy  9610        Smartphone  Dual        Samsung   
Samsung GT 120  1299        Ordinary    Single      Samsung   
Samsung Guru 1  1399        Ordinary    Single      Samsung   
Samsung Guru E  1450        Ordinary    Dual        Samsung   
Nokia 105 (Bla  1249        Ordinary    Single      Nokia     
Nokia Lumia 63  9479        Smartphone  Dual        Nokia     
Nokia 206 (Bla  3689        Ordinary    Dual        Nokia     
Nokia 220 (Bla  3299        Ordinary    Dual        Nokia     
Sony Xperia E   6150        Smartphone  Single      Sony      
Micromax Canva  8340        Smartphone  Dual        Micromax

The following query will return a table of mobiles which are in super 10,000 range


Select mobile_name,price,type,sim_type,brand_name from mobile_sales_details where price>10000

mobile_name             price       type        sim_type    brand_name
----------------------  ----------  ----------  ----------  ----------
Moto X (16 GB) (Black)  23999       Smartphone  Single      Motorola  
Moto G (Black  with 16  13999       Smartphone  Dual        Motorola  
Asus Zenfone 5 A501CG   12999       Smartphone  Dual        Asus      
Asus Zenfone 6 A600CG   16999       Smartphone  Dual        Asus      
Alcatel Onetouch Idol   16999       Smartphone  Dual        Alcatel   
Samsung Galaxy Core I8  11795       Smartphone  Dual        Samsung   
Samsung Galaxy Grand 2  18990       Smartphone  Dual        Samsung   
Samsung Galaxy Grand N  14010       Smartphone  Dual        Samsung   
Samsung I8552 - Galaxy  15999       Smartphone  Dual        Samsung   
Samsung Galaxy S4 Mini  24730       Smartphone  Dual        Samsung   
Samsung Galaxy S5 (Cha  54300       Smartphone  Single      Samsung   
Samsung Galaxy S4 I950  28071       Smartphone  Single      Samsung   
Samsung Galaxy S3 (Mar  31850       Smartphone  Single      Samsung   
Samsung Galaxy Grand D  19000       Smartphone  Dual        Samsung   

Greater than(>) ,less than(<) operator skip the value mention in condition. If you want to include them in list just use greater than or equal to (>=) and less than or equal to (<=)correspondingly The following query will return list of mobile phones which are greater than or equal to 15,990


Select mobile_name,price,type,sim_type,brand_name from mobile_sales_details where price>=15990


mobile_name             price       type        sim_type    brand_name
----------------------  ----------  ----------  ----------  ----------
Moto X (16 GB) (Black)  23999       Smartphone  Single      Motorola  
Asus Zenfone 6 A600CG   16999       Smartphone  Dual        Asus      
Alcatel Onetouch Idol   16999       Smartphone  Dual        Alcatel   
Samsung Galaxy Grand 2  18990       Smartphone  Dual        Samsung   
Samsung I8552 - Galaxy  15999       Smartphone  Dual        Samsung   
Samsung Galaxy S4 Mini  24730       Smartphone  Dual        Samsung   
Samsung Galaxy S5 (Cha  54300       Smartphone  Single      Samsung   
Samsung Galaxy S4 I950  28071       Smartphone  Single      Samsung   
Samsung Galaxy S3 (Mar  31850       Smartphone  Single      Samsung   
Samsung Galaxy Grand D  19000       Smartphone  Dual        Samsung   
Nokia Lumia 1320 (Blac  17190       Smartphone  Single      Nokia     
Nokia Lumia 625 (Black  16500       Smartphone  Single      Nokia     
Apple iPhone 5S (Gold   43199       Smartphone  Single      Apple     
Apple iPhone 4S (White  21712       Smartphone  Single      Apple     

The following query will return list of mobile phones which has price less than or equal to 15,990


Select mobile_name,price,type,sim_type,brand_name from mobile_sales_details where price<=15990

mobile_name                 price       type        sim_type    brand_name
--------------------------  ----------  ----------  ----------  ----------
Moto G (Black  with 16 GB)  13999       Smartphone  Dual        Motorola  
Moto E (Black)              6999        Smartphone  Dual        Motorola  
Asus Zenfone 4 A400CG (Bla  5999        Smartphone  Dual        Asus      
Asus Zenfone 5 A501CG (Bla  9999        Smartphone  dual        Asus      
Asus Zenfone 5 A501CG (Bla  12999       Smartphone  Dual        Asus      
Samsung Galaxy S Duos 2 S7  8206        Smartphone  Dual        Samsung   
Samsung Galaxy Star Pro S7  7599        Smartphone  Dual        Samsung   
Samsung Galaxy S Duos 2 S7  8214        Smartphone  Dual        Samsung   
Samsung Galaxy Core I8262   11795       Smartphone  Dual        Samsung   
Samsung Galaxy Trend S7392  9610        Smartphone  Dual        Samsung   
Samsung Galaxy Grand Neo G  14010       Smartphone  Dual        Samsung   
Samsung GT 1200 R/I/M       1299        Ordinary    Single      Samsung   
Samsung Guru 1200 (Black)   1399        Ordinary    Single      Samsung   
Samsung Guru E1207T (Black  1450        Ordinary    Dual        Samsung   
Nokia Lumia 520 (Black)     11289       Smartphone  Single      Nokia     
Nokia 105 (Black)           1249        Ordinary    Single      Nokia     
Nokia Lumia 630 Dual SIM (  9479        Smartphone  Dual        Nokia     
Nokia XL (Bright Orange)    11999       Ordinary    Dual        Nokia     
Nokia 206 (Black  with Dua  3689        Ordinary    Dual        Nokia     
Nokia 220 (Black)           3299        Ordinary    Dual        Nokia     
Sony Xperia E (Black)       6150        Smartphone  Single      Sony      
Sony Xperia M Dual (Black)  14990       Smartphone  Dual        Sony      
Sony Xperia M (Black)       13990       Smartphone  Single      Sony      

The following query will return list of mobiles with the price not equal to 15,990. So it will return all the records except mobiles whose price is 15,990


Select mobile_name,price,type,sim_type,brand_name from mobile_sales_details where price<>15990


mobile_name             price       type        sim_type    brand_name
----------------------  ----------  ----------  ----------  ----------
Moto X (16 GB) (Black)  23999       Smartphone  Single      Motorola  
Moto G (Black  with 16  13999       Smartphone  Dual        Motorola  
Moto E (Black)          6999        Smartphone  Dual        Motorola  
Asus Zenfone 4 A400CG   5999        Smartphone  Dual        Asus      
Asus Zenfone 5 A501CG   9999        Smartphone  dual        Asus      
Asus Zenfone 5 A501CG   12999       Smartphone  Dual        Asus      
Asus Zenfone 6 A600CG   16999       Smartphone  Dual        Asus      
Alcatel Onetouch Idol   16999       Smartphone  Dual        Alcatel   
Samsung Galaxy S Duos   8206        Smartphone  Dual        Samsung   
Samsung Galaxy Star Pr  7599        Smartphone  Dual        Samsung   
Samsung Galaxy S Duos   8214        Smartphone  Dual        Samsung   
Samsung Galaxy Core I8  11795       Smartphone  Dual        Samsung   
Samsung Galaxy Grand 2  18990       Smartphone  Dual        Samsung   
Samsung Galaxy Trend S  9610        Smartphone  Dual        Samsung   
Samsung Galaxy Grand N  14010       Smartphone  Dual        Samsung   
Samsung I8552 - Galaxy  15999       Smartphone  Dual        Samsung   
Samsung Galaxy S4 Mini  24730       Smartphone  Dual        Samsung   
Samsung GT 1200 R/I/M   1299        Ordinary    Single      Samsung   
Samsung Guru 1200 (Bla  1399        Ordinary    Single      Samsung   
Samsung Galaxy S5 (Cha  54300       Smartphone  Single      Samsung   
Samsung Galaxy S4 I950  28071       Smartphone  Single      Samsung   
Samsung Guru E1207T (B  1450        Ordinary    Dual        Samsung   
Samsung Galaxy S3 (Mar  31850       Smartphone  Single      Samsung   
Samsung Galaxy Grand D  19000       Smartphone  Dual        Samsung   
Nokia Lumia 520 (Black  11289       Smartphone  Single      Nokia     

If you want to get list of mobiles which does not fall under smartphone type, check the following query


Select mobile_name,price, sim_type,brand_name from mobile_sales_details where type <> ’Smartphone’



mobile_name            price       sim_type    brand_name
---------------------  ----------  ----------  ----------
Samsung GT 1200 R/I/M  1299        Single      Samsung   
Samsung Guru 1200 (Bl  1399        Single      Samsung   
Samsung Guru E1207T (  1450        Dual        Samsung   
Nokia 105 (Black)      1249        Single      Nokia     
Nokia XL (Bright Oran  11999       Dual        Nokia     
Nokia 206 (Black  wit  3689        Dual        Nokia     
Nokia 220 (Black)      3299        Dual        Nokia     
Micromax Bolt X101i (  882         Dual        Micromax  
Lava Arc 12i (Grey)    1210        Dual        Lava