Computer scienceFundamentalsSQL and DatabasesDBMSMySQLOptimization

Writing Efficient SQL Queries

Coding time

Report a typo

Write a query to retrieve the names of all students in the Gryffindor faculty who have received a mark of 5 or higher in any subject.

The result table should require:

  1. students names

Here is the plan for your query:

  • Break down the query into smaller parts to make it more manageable.
  • Use INNER JOIN to join the 'students' and 'faculty_name' tables.
  • Use an EXISTS subquery to check for marks of 5 or higher.

Write an SQL statement





___

Create a free account to access the full topic