(function openLouie() { let louie = document.getElementById("Dropdown-Toggle-14"); louie.classList = "host-toggle w-dropdown-toggle w--open"; console.log(louie); })();

Subquery in FROM clause 

A subquery with FROM clause acts similar to a gradeorary table that has been generated during the execution of a query then lost afterwards.

Subquery in SELECT clause

Subquery in WHERE clause

Use a subquery to filter the result set. For example this will return all students with a grade equal to the highest graded student.

Correlated Subqueries

Correlated (might be known as Synchronized or Coordinated) Subqueries are the queries that make references to the current row of their outer query:

Filter query results using query on different table

This query selects all students not on the prefects table.

You can get the same results with a LEFT JOIN.

Subqueries in FROM clause

You are able to use subqueries to create a gradeorary table and use it in the FROM clause of an "outer" query

The above finds students from the grades table whose exam grade variation is greater than 20. 

Subqueries in WHERE clause

The following example finds students (from the students example) whose participation is below the average grade (obtained via a sub-qquery):

Simplicity Meets High Performance

Free edition subscription
Keep your work
No credit card required to try