Answers for "sql nested select"

SQL
1

sql nested select

SELECT * FROM students WHERE notes > ( SELECT AVG(notes) FROM students );

SELECT * FROM students WHERE class_id = (
    SELECT id FROM classes WHERE number_of_students = (
        SELECT MAX(number_of_students) FROM classes
    )
);

SELECT subject, MAX(salary_by_subject.avg_salary) AS max_salary
FROM (
    SELECT subject, AVG(monthly_salary) AS avg_salary
    FROM teachers
    GROUP BY subject
) salary_by_subject;
Posted by: Guest on April-20-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language