Answers for "nested select sql"

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
0

select in select sql

SELECT column1 = (SELECT column-name FROM table-name WHERE condition),       column-names  FROM table-name WEHRE condition
Posted by: Guest on November-20-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language