Here’s a worksheet focused on the SELECT
commands in MySQL, suitable for Class XII students. This worksheet includes a variety of question types to help reinforce understanding.
MySQL Worksheet 5 : SELECT Commands
Name: ___________________
Date: ___________________
Part A: Multiple Choice Questions
Which of the following commands is used to retrieve data from a database?
- a) INSERT
- b) SELECT
- c) UPDATE
- d) DELETE
To select all columns from a table named "Employees", which command would you use?
- a) SELECT * FROM Employees;
- b) SELECT ALL FROM Employees;
- c) GET * FROM Employees;
- d) SELECT Employees.*;
Which clause is used to filter records in a SELECT statement?
- a) ORDER BY
- b) GROUP BY
- c) WHERE
- d) HAVING
Part B: True/False Questions
T/F: The SELECT statement can be used to retrieve data from multiple tables at once.
T/F: The DISTINCT keyword is used to eliminate duplicate rows in the result set.
T/F: You can use the SELECT command to modify data in a table.
Part C: Fill in the Blanks
The SQL command to select only the "Name" and "Age" columns from the "Students" table is __________.
To sort the results of a query in descending order, you would use the __________ keyword.
The __________ clause is used to group rows that have the same values in specified columns.
Part D: Short Answer Questions
Write the SQL command to retrieve all records from the "Products" table.
Write the SQL command to count the number of rows in the "Orders" table.
Explain the purpose of the WHERE clause in a SELECT statement.
Part E: Practical Application
Write a command to select the "Email" column from the "Customers" table where the "City" is "New York".
Write a command to retrieve all unique job titles from the "Employees" table.
If you want to retrieve records from the "Sales" table, sorting them by "SaleDate" in ascending order, what command would you use?
0 Comments
Please do note create link post in comment section