We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4
1.
Display all the details of all employees working in
the company. SELECT * FROM EMPLOYEE;
2. Display ssn, lname, fname, address of employees
who work in department no 7 SELECT SSN,FNAME,LNAME,ADDRESS FROM EMPLOYEE WHERE DNO=7;
3. Retrieve the birthdate and address of the
employee whose name is 'Franklin T. SELECT BDATE,ADDRESS FROM EMPLOYEE WHERE FNAME='FRANKLIN' AND MINIT='T';
4. Retrieve the name and salary of every employee
SELECT CONCAT_WS(" ",FNAME,MINIT,LNAME)AS NAME,SALARY FROM EMPLOYEE; 5. Retrieve all distinct salary values SELECT DISTINCT SALARY FROM EMPLOYEE;
6. Retrieve all employee names whose address is in
‘Bellaire’ Wong' SELECT CONCAT_WS(" ",FNAME,MINIT,LNAME)AS NAME FROM EMPLOYEE WHERE ADDRESS LIKE'%BELLAIRE%';
7. Retrieve all employees who were born during the
1950s SELECT COUNT(*) FROM EMPLOYEE WHERE YEAR(BDATE) BETWEEN 1950 AND 1959; 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;
9.Retrieve the names of all employees who do not
have supervisors SELECT CONCAT_WS(" ",FNAME,MINIT,LNAME)AS NAME FROM EMPLOYEE WHERE SUPER_SSN IS NULL;
9. Retrieve SSN and department name for all
employees SELECT SSN,DNAME FROM EMPLOYEE,DEPARTMENT WHERE EMPLOYEE.DNO=DEPARTMENT.DNUMBER;
11.Retrieve the name and address of all
employees who work for the 'Research' department. SELECT CONCAT_WS(" ",FNAME,MINIT,LNAME)AS NAME ,ADDRESS FROM EMPLOYEE,DEPARTMENT WHERE DNAME='RESEARCH' AND EMPLOYEE.DNO=DEPARTMENT.DNUMBER;