0% found this document useful (0 votes)
2 views1 page

SQL

The document contains four sets of SQL queries categorized as Set A, Set B, Set C, and Set D. Each set includes various operations such as SELECT, UPDATE, and GROUP BY on different tables like FACULTY, COURSES, EMPLOYEE, TRANSACTION, and ITEMS. The queries focus on retrieving data based on specific conditions, updating records, and aggregating information.

Uploaded by

prasoon4646
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)
2 views1 page

SQL

The document contains four sets of SQL queries categorized as Set A, Set B, Set C, and Set D. Each set includes various operations such as SELECT, UPDATE, and GROUP BY on different tables like FACULTY, COURSES, EMPLOYEE, TRANSACTION, and ITEMS. The queries focus on retrieving data based on specific conditions, updating records, and aggregating information.

Uploaded by

prasoon4646
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/ 1

Set A

1. SELECT * FROM FACULTY WHERE SALARY>12000;


2. SELECT * FROM COURSES WHERE FEES BETWEEN 15000 AND 50000;
3. UPDATE COURSES SET FEES= FEES + 500 WHERE CNAME=”SYSTEM DESIGN”;
4. SELECT * FROM FACULTY NATURAL JOIN COURSES WHERE FNAME=”SULEKHA” ORDER BY
CNAME DESC;

Set B

1. SELECT AVG(SALARY) FROM EMPLOYEE GROUP BY DEPTID;


2. SELECT NAME,DEPTNAME FROM EMPLOYEE E, DEPARTMENT D WHERE E.DEPTID=D.DEPTID
AND SALARY>5000;
3. SELECT NAME FROM EMPLOYEE WHERE SALARY IS NULL ORDER BY NAME;
4. SELECT DISTINCT DEPTID FROM EMPLOYEE;

SET C

1. SELECT * FROM TRANSACTION WHERE TYPE=”CREDIT”;


2. SELECT CNO,AMOUNT FROM TRANSACTION WHERE DOT LIKE ‘2017-09%’;
3. SELECT MAX(DOT) FROM TRANSACTION WHERE CNO=103;
4. SELECT * FROM CUSTOMER ORDER BY CNAME;

SET D

1. SELECT INAME FROM ITEMS ORDER BY INAME;


2. SELECT INAME,PRICE FROM ITEMS WHERE PRICE BETWEEN 10000 AND 22000;
3. SELECT TCODE,COUNT(TCODE) FROM ITEMS GROUP BY TCODE;
4. UPDATE ITEMS SET PRICE=PRICE+500 WHERE QTY<100;

You might also like