Professional Documents
Culture Documents
2. Display details of those authors whose name is either Ali or Rida or Javed
without using comparison/relational operator.
SELECT * FROM `author` WHERE `Name` IN ('ali','rida','javed')
3. Display details of all those authors whose salary is less than 25000 or salary
greater than 30000 using between operator.
SELECT * FROM `employee` WHERE `salary` NOT BETWEEN 25000 AND 30000
4. Display details of all those male authors who are living in isb or lhr.
SELECT * FROM `author` WHERE `Gender` = 'male' AND `City` IN ('isb','lhr')
5. Display details of all those employees whose fname is neither akram nor asif
nor ahmed without using in operator.
SELECT * FROM `employee` WHERE `fname` != 'akram' AND `fname` != 'asif' AND `fname` !
='ahmed'
6. Display details of all those employees whose lname starts with a and whose
fname second letter is a vowel character i.e. (a,e,i,o,u).
SELECT * FROM `employee` WHERE `lname` LIKE 'a%' AND `fname` LIKE '_[a-u]%'
7. Display details of all those authors whose name contains less than 5
characters.
SELECT * FROM `author` WHERE length (Name) <5
9. Display details of all authors in such a way that female authors are shown
before the male authors.
SELECT * FROM `author` ORDER BY `Gender` ASC
12. Display details of all those authors whose age is less than equal to 50 and
age is greater than equal to 20 without using relational operators i.e. (>=, <=)
SELECT * FROM `author` WHERE `Age` BETWEEN 20 AND 50
14. Display details of all those employees whose salary is between 20000 and
30000 without using between operator.
SELECT * FROM `employee` WHERE `salary`>=20000 AND `salary`<=30000
15. Display details of all those authors whose city is either rwp or isb using in
operator, in such a way that youngest author should be shown at the top.
SELECT * FROM `author` WHERE `City` IN ('rwp','isb') ORDER BY `Age`