3.
To displav the firstname, Lastname and Total salary of all clerks from table
WORKERSand DESIG where Total Salary is calculated as salary+benefits..
SOURCE CODE:
mysql> select FIRSTNAME,LASTNAME,SALARY+BENEFITS from WORKERS,DESIG where
DESIGNATION="Clerk";
30 | P a ge
32
SCREENSHOT:
mysql> select firstname lastname, salary+benefits from workers, desig where designation = "clerk";
lastname salary+benefits
SAM 5ee00
SAM 550e0
SAM 62200
Sarah 5eeee
Sarah 55eee
Sarah 62000
Manlla
Manila 62000
George 5e000
George 55ee0
George 62000
Mary
Mary 55000
Mary 62000
Robert
Bobet
Henry
Henry 55080
Henry 62000
Ronny
Ronny 55000
Ronny 62000
Pat 58000
Pat 550e0
Pat 62808|
rows in set (8.01 sec)
[Link] display the minimum salary among managers and clerks from table DESIG
SOURCE CODE:
mysql> select max(SALARY) from DESIG where DESIGNATION="Manager" or DESIGNATION="Clerk":
32
SCREENSHOT:
sql> select max(salary) from desig where designation = "nanager" or designation = clerk";
nax(salary) |
750e0 |
row in set (0.01 sec)
[Link] display the Firstname, salary where designation is of managers and clerks from
table DESIG and WORKERS.
SOURCE CODE: 32
mysql> select FIRSTNAME,SALARY from WORKERS,DESIG where DESIGNATION ="Manager"and
wORKERS.w_ID=DESIG.W_ID;
31 | Page
SCREENSHOT:
ysql> select firstname, salary from workers,desig where designation "nanager and workers.N_ID=desig.W_ID;
**************.***
firstname | salary
CAM
Manila 70808
George 75008
rows in set (0.00 sec)
[Link] movie id, movie name and production cost for all the movies with greater
than 150000 and less than 1000000.
SOURCE CODE:
mysql> select Movie_ID,MovieName,ProductionCost from MOVIE where ProductionCost150000;
SCREENSHOT:
mysql> select Movie ID, MovieName , ProductionCost from
| Movie_ID MovieName ProductionCost
MØ03 Looop Lapeta 250000
MO04 Badhai Ho 720000
rows in set (0.e1 sec)
[Link] a queryto displaytoday's date into [Link] fromat.
SOURCE CODE:
mysql> select concat(day(now(),concat(' , month(now()),concat('.year(now())Y "Date" :
SCREENSHOT:
mysql> select concat (day (now() ) , concat (".',year(now() ) ) ) ""Date"
"Date
13.2024 |
row in set (.00 sec)