There is a table employee with the following columns

fname : employee first name

minit : employee middle initial

lname : Employee last name

ssn : social security number

bdate : date of birth of the employee

address : address of the employee

sex : gender of the employee

salary : annual salary of the employee

super_ssn : social security number of the supervisor of the employee

dno : department number of the employee

Write a query to find the social security numbers of all employees who are either male or have salary less than 30000. Order the results on the basis of social security number in ascending order. Please note that the gender is denoted by either F or M.


select ssn

from employee

where sex='M' or salary<30000 order by ssn asc

select d.dependent_name

from dependent d, employee e

where d.essn=e.ssn and e.dno=5 order by d.dependent_name