MySQL Worksheet 5 : SELECT Commands for Class XII and Class XI

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

  1. Which of the following commands is used to retrieve data from a database?

    • a) INSERT
    • b) SELECT
    • c) UPDATE
    • d) DELETE
  2. 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.*;
  3. 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

  1. T/F: The SELECT statement can be used to retrieve data from multiple tables at once.

  2. T/F: The DISTINCT keyword is used to eliminate duplicate rows in the result set.

  3. T/F: You can use the SELECT command to modify data in a table.

Part C: Fill in the Blanks

  1. The SQL command to select only the "Name" and "Age" columns from the "Students" table is __________.

  2. To sort the results of a query in descending order, you would use the __________ keyword.

  3. The __________ clause is used to group rows that have the same values in specified columns.

Part D: Short Answer Questions

  1. Write the SQL command to retrieve all records from the "Products" table.

  2. Write the SQL command to count the number of rows in the "Orders" table.

  3. Explain the purpose of the WHERE clause in a SELECT statement.

Part E: Practical Application

  1. Write a command to select the "Email" column from the "Customers" table where the "City" is "New York".

  2. Write a command to retrieve all unique job titles from the "Employees" table.

  3. If you want to retrieve records from the "Sales" table, sorting them by "SaleDate" in ascending order, what command would you use?


Post a Comment

0 Comments