Skip to content

Latest commit

 

History

History
99 lines (53 loc) · 1.53 KB

07-subqueries-functions-worksheet.md

File metadata and controls

99 lines (53 loc) · 1.53 KB

Queries

Sub-queries

  1. Get all the students whose IQ is greater than the average IQ.
  1. Get all the students whose IQ is greater than the highest IQ of the batch_id 2 students.
  1. Get all the students whose IQ is greater than all the IQs of the batch_id 2 students.
  1. Find all the students who are in batches that start with the word Jedi (Without JOIN)
  1. Find all the students whose IQ is greater than the average IQ of their batch.
  1. Get all the instructors that have at least one batch (Without using joins)
  1. Print all the names, batch ID and average IQ of the batch for each student

Built-in Functions

  1. Get the average IQ of all the students rounded to the nearest integer.
  1. Find all batches whose name is longer than 10 characters.
  1. Find all batches whose name's first 10 characters contains the string sher
  1. Get all batches that have started on a Sunday
  1. Get all batches that have been running for more than 10 years
  1. Print the name and the instructor's id for each batch. If no instructor is assigned, print NO INSTRUCTOR.
  1. Print the name and IQ of each student. If the IQ of the student is less than 100, print LOW IQ instead.
  1. For each student print the name and their IQ category.
IQ Category
< 100 LOW IQ
100 - 150 MEDIUM
> 150 HIGH