You are on page 1of 7

1.

Write a query to display all rows of the Event table

SELECT * FROM EVENT;

2. Write a query to select Name, Phone, Email from the Par cipant table

SELECT Name, Phone, Email FROM PARTICIPANT;


3. Write a query to display rows of the Organiser table where Loca on is “Vile Parle”

SELECT * FROM ORGANISER WHERE LOCATION IN 'Vile Parle';

4. Write a query to select all rows from Organiser table where Loca on is “Bandra” AND type is
College

SELECT * FROM ORGANISER WHERE LOCATION IN 'Bandra' AND TYPE in 'College';

5. Write a query to select all rows in Organiser table where Loca on is “Bandra” OR Type is College

SELECT * FROM ORGANISER WHERE LOCATION IN 'Bandra' OR TYPE in 'College';

6. Write a query to calculate average fees of all the events

SELECT AVG(Fees) AS Average_Fees FROM EVENT;


7. Write a query to select all the dis nct names from the Community table

SELECT DISTINCT Name FROM COMMUNITY;

8. Write a query to display all rows from Event and Order By Fees

SELECT * FROM EVENT ORDER BY FEES;

9. Write a query to select all columns from the Organiser table where email contains “tsec”

SELECT * FROM ORGANISER WHERE EMAIL LIKE '%tsec%';


Write a query to select all columns from Community table where name contains “Bootcamp”

SELECT * FROM COMMUNITY WHERE name LIKE '%Bootcamp%';

10. Write a query to select Name, Email, Role from Par cipant Table and unions it with the entries
from the Speaker Table
SELECT Name, EMAIL, 'Par cipant' AS Role FROM PARTICIPANT
UNION
SELECT Name, EMAIL, 'Speaker' AS Role FROM SPEAKER;
11. Write a query to display the common Loca ons in the Event & Community tables

SELECT Loca on FROM EVENT


INTERSECT
SELECT Loca on FROM COMMUNITY;

12. Write a query to display the loca ons from par cipants except “Bandra”
SELECT LOCATION FROM PARTICIPANT
MINUS
SELECT LOCATION FROM COMMUNITY WHERE LOCATION IN 'Bandra';

15. Write a query to calculate the Minimum Fess from all of the records of Event Table
SELECT MIN(Fees) AS min_fee FROM EVENT;
16. Write a query to calculate the Maximum Fess from all of the records of Event Table

SELECT MAX(Fees) AS max_fee FROM EVENT;

17. Write a query to calculate the Average Dura on from all of the records of Event Table

SELECT AVG(Dura on) AS Average_Dura on FROM EVENT;

18. Write a query to calculate the Sum of Fess from all of the records of Event Table

SELECT SUM(Fees) AS Total_Fees FROM EVENT;

19. Write a query to calculate the Count of all the rows in the Community Table

SELECT COUNT (*) AS COUNT FROM COMMUNITY;

20. Write a query to select the count of ID from the Event Table and Group By Loca on

SELECT COUNT(ID), Loca on


FROM EVENT
GROUP BY Loca on;
21. Write a query to select the Count of ID from the Event Table Having Loca on “Andheri”

SELECT COUNT(ID), Loca on


FROM EVENT HAVING LOCATION IN ('Andheri')
GROUP BY Loca on;

22. Write a query to select loca on from the Event table where Loca on is “Panvel”

SELECT LOCATION FROM EVENT WHERE LOCATION = 'PANVEL';

You might also like