Very Easy

Filter students by name I

Select all students in the students table with the first name 'Mike'. Order the results by student_id in ascending order.

SCHEMA

students

+------------+------------+-----------+-----+------------+
| student_id | first_name | last_name | age | class_code |
+------------+------------+-----------+-----+------------+
| 1          | Mike       | Chaplin   | 12  | 7A         |
| 2          | Emily      | Jackson   | 12  | 7A         |
| 3          | Robert     | Jackson   | 12  | 7A         |
| ...        | ...        | ...       | ... | ...        |
+------------+------------+-----------+-----+------------+


EXPECTED OUTPUT
+------------+------------+------------+-----+------------+
| student_id | first_name | last_name  | age | class_code |
+------------+------------+------------+-----+------------+
| 1          | Mike       | Chaplin    | 12  | 7A         |
| 5          | Mike       | Tydaughter | 11  | 7A         |
| 37         | Mike       | Chen       | 11  | 7B         |
| ...        | ...        | ...        | ... | ...        |
+------------+------------+------------+-----+------------+

Use the WHERE keyword to apply filters to your query. For example, running a query like:

SELECT *
FROM students
WHERE student_id = 4

would return all rows in the students table where the student_id is equal to 4.

SELECT * FROM students WHERE first_name = 'Mike' ORDER BY student_id ASC

  • This field is required.