belong to Chennai, the SELECT command is used in the following way : SELECT Admno, Name, Place FROM Student WHERE Place = ῾Chennai᾿; Admno Name Place Ashish Chennai Abinandh Chennai Revathi Chennai Hema Chennai SELECT Admno, Name, Age FROM Student WHERE Age >= ; Admno Name Age Adarsh Ayush Abinandh Revathi Devika The relational operators like =, <, <=, >, >=, <> can be used to compare two values in the SELECT command used with WHERE clause. The logical operaors OR, AND and NOT 12th Computer Chapter - - Structured Query Language can also be used to connect search conditions in the WHERE clause. For example : SELECT Admno, Name, Age, Place FROM Student WHERE (Age>= AND Place = ῾ Delhi᾿); Admno Name Age Place Adarsh Delhi Ayush Delhi The SELECT command can also be used in the following ways: SELECT Admno, Name, Age, Place FROM Student WHERE (Age>= OR Place =῾Delhi᾿); SELECT Admno, Name, Place FROM Student WHERE (NOT Place =῾Delhi᾿); . .
. BETWEEN and NOT BETWEEN Keywords The BETWEEN keyword defines a range of values the record must fall into to make the condition true. The range may include an upper value and a lower value between which the criteria must fall into. SELECT Admno, Name, Age, Gender FROM Student WHERE Age BETWEEN AND ; Admno Name Age Gender Adarsh M Ayush M Abinandh M Revathi F Devika F The NOT BETWEEN is reverse of the BETWEEN operator where the records not satisfying the condition are displayed.
SELECT Admno, Name, Age FROM Student WHERE Age NOT BETWEEN AND ; Admno Name Age Ashish Akshith Hema . . . IN Keyword The IN keyword is used to specify a list of values which must be matched with the record values.
In other words it is used to compare a column with more than one value. It is similar to an OR condition.