SQL commands1
SQL commands1
SQL EXERCISE -1
Table: STATIONARY
Table: CONSUMER
SQL COMMANDS:
Output:
distinct Company
ABC
XYZ
CAM
Output:
S_ID StationaryName Company Price
DP01 Dot Pen ABC 10
GP02 Gel Pen ABC 15
5. To display the ConsumerName, Address from table Consumer and Company and
Price from table Stationary with their corresponding matching S_ID
SQL EXERCISE -2
TABLE : WORKER
TABLE : PAYLEVEL
SQL COMMANDS:
1. To display the details of all the WORKERS in descending order of their DOJ.
Output:
Output:
NAME DESIG
RadheShyam Supervisor
Ameen Ahmed Mechanic
Sanya Clerk
Sarsa Supervisor
3. To display the number of workers whose PAY+ALLOWANCE is more than 30000 for
every PLEVEL.
Output:
COUNT(*)
2
2
4. To increase the ALLOWANCE by 1000 where the pay is greater than 20000.
Output:
2 rows affected
Output:
COUNT(*) DESIG
2 Supervisor
2 Operator
1 Mechanic
1 Clerk