0% found this document useful (0 votes)
5 views4 pages

Company (1-11)

Uploaded by

rudrakshwhig
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
5 views4 pages

Company (1-11)

Uploaded by

rudrakshwhig
Copyright
© © All Rights Reserved
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;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy