mirror of
https://github.com/robindhole/fundamentals.git
synced 2025-03-15 23:19:56 +00:00
1.7 KiB
1.7 KiB
Queries
Aggregation
- Get the maximum IQ in all students (Try without aggregation first).
- Get the maximum IQ in all students (With aggregation).
- Get the oldest batch from the batches table.
- Fetch the number of batches that start with the word
Jedi
.
- Get the average IQ of all students (Without using
AVG
)
- Get the average IQ of students in all batches.
- Find the average IQ of students in each batch.
- Find the total number of students in each batch.
- Get the total number of batches taught by each instructor.
- Find the average IQ of students in batches with batch ID
1
and2
.
- Find count of students that are part of batches that have average IQ greater than
120
.
Built-in Functions
- Get the average IQ of all the students rounded to the nearest integer.
- Find all batches whose name is longer than 10 characters.
- Find all batches whose name's first 10 characters contains the string
sher
- Get all batches that have started on a Sunday
- Get all batches that have been running for more than 10 years
- Print the name and the instructor's id for each batch. If no instructor is assigned, print
NO INSTRUCTOR
.
- Print the name and IQ of each student. If the IQ of the student is less than 100, print
LOW IQ
instead.
- For each student print the name and their IQ category.
IQ | Category |
---|---|
< 100 | LOW IQ |
100 - 150 | MEDIUM |
> 150 | HIGH |