Sub-queries and views worksheet¶
Sub-queries¶
- Get all the students whose IQ is greater than the average IQ.
- Get all the students whose IQ is greater than the highest IQ of the batch_id
2students.
- Get all the students whose IQ is greater than
allthe IQs of the batch_id2students.
- Find all the students who are in batches that start with the word
Jedi(Without JOIN)
- Find all the students whose IQ is greater than the average IQ of their batch.
- Get all the instructors that have at least one batch (Without using joins)
- Print all the names, batch ID and average IQ of the batch for each student
Views¶
- Create a view that shows the students and their batches.
- Create a view that shows the students and their batches, but only for batches that start with the word
Jedi.