dbms

Display all the details of all employees working in the company.

Contributor: Samriddhi [KMV (DU)]


Query 1 : Display all the details of all employees working in the company.

    select * from EMPLOYEE;

Query 2 : Display ssn, lname, fname, address of employees who work in department no 7.

    select SSN,LNAME,FNAME,ADDRESS 
    from EMPLOYEE 
    WHERE DNO=7;

Query 3 : Retrieve the birthdate and address of the employee whose name is ‘Franklin T. Wong’.

    select BDATE,ADDRESS 
    from EMPLOYEE 
    WHERE FNAME='Franklin' AND MINIT='T' AND LNAME='Wong';

Query 4 : Retrieve the name and salary of every employee.

    select FNAME,MINIT,LNAME,SALARY 
    from EMPLOYEE;





Query 5 : Retrieve all distinct salary values.

    select DISTINCT(SALARY) 
    from EMPLOYEE;

Query 6 : Retrieve all employee names whose address is in ‘Bellaire’.

    select FNAME,MINIT,LNAME 
    from EMPLOYEE 
    where ADDRESS like '%Bellaire%';

Query 7 : Retrieve all employees who were born during the 1950s.

    select FNAME,MINIT,LNAME 
    from EMPLOYEE 
    where BDATE like '%195%';

Query 8 : Retrieve all employees in department 5 whose salary is between 50,000 and 60,000(inclusive).

    select FNAME,MINIT,LNAME 
    from EMPLOYEE 
    where DNO=5 AND SALARY BETWEEN 50000 AND 60000;