Previous Final Sub Queries
Previous Final Sub Queries
Find the seller name whose sold quantity is more than any seller who sold on 11th
December 2022.
6. Show the total price of each type of onion that was sold.
8. Find the seller name and ID whose name starts with "K".
Ans: SELECT *
FROM Invoice
WHERE Price BETWEEN 40 AND 190;
10. Find the sellers whose name contains "a" in the 3rd position.
Table 2
a. Find the number of students who registered on 15th February 2022.
b. Find the student names of those whose ages are more than the highest age (using
subquery).
c. Find the number of students who registered for the "Mobile App" competition.
e. Find the student IDs of students whose names start with "N".
f. Find the addresses of students who participate in the robotics competition (using
subquery).
g. Find the names of students whose age is greater than any age of the student who lives
in Mirpur (using subquery).
-- h. Find the addresses of students who participate in the robotics competition (using
subquery).
SELECT Address
FROM Student
WHERE StudentID IN (
SELECT StudentID
FROM Competition
WHERE CompetitionType = 'Robotics Competition'
);
-- i. Find the names of students whose age is greater than any age of the student who lives in
Mirpur (using subquery).
SELECT Name
FROM Student
WHERE Age > (
SELECT MAX(Age)
FROM Student
WHERE Address = 'Mirpur'
);