May 2020
Beginner
564 pages
14h 9m
English
This section will help you better understand how to use a correlated subquery in the WHERE clause:
You can execute the following query using a correlated subquery with EXISTS:
USE lahmansbaseballdb; SELECT f.playerid, f.yearid, f.teamid, posFROM fielding fWHERE EXISTS(SELECT 1 FROM salaries s WHERE salary < 200000 AND salary IS NOT NULL AND (f.playerid = s.playerid AND f.teamid = s.teamid AND f.yearid = s.yearid))ORDER BY f.playerid;
The preceding query returns the results ...
Read now
Unlock full access