mysql practical
mysql practical
Products
Ans:
v)
vi)
2) Write the queries for the questions i to iii and find the output for iv to vi with reference to the
below tables.
Students
Feecollection
Ans:
v)
vi)
3) Write the queries for the questions i to iii and find the output for iv to vi with reference to the
below tables.
Employees
Ans:
i) SELECT * FROM EMPLOYEES WHERE DOJ> ‘2021-12-31’;
ii) SELECT DEPT,COUNT(DEPT) FROM EMPLOYEES GROUP BY DEPT;
iii) SELECT DEPT,MAX(SALARY) FROM EMPLOYEES GROUP BY DEPT;
iv)
v)
vi)
4) Write the queries for the questions i to iii and find the output for iv to vi with reference to the
below tables
Games
Players
i) Display the game type and average number of game played in each type.
ii) Display prize money, name of the game and name of the players from the table Games
and Players.
iii) Display the unique games.
iv) SELECT GAMENAME,TYPE FROM GAMES WHERE PRIZEMONEY IS NULL;
v) SELECT TYPE,MAX(PRIZEMONEY),MIN(PRIZEMONEY) FROM GAMES GROUP BY TYPE;
vi) SELECT DISTINCT GCODE FROM PLAYERS;
Ans:
v)
vi)
5) Write the queries for the questions i to iii and find the output for iv to vi with reference to the
below tables
Rental
Ans:
v)
vi)