The code selects all the rows in the Student_Information table that have an equal advisor ID and equal gender value (M or F), and whichever value is greater. The salary value is then compared against the range of 15000 to 20000 to select those rows.

    select std.roll_number,
    from student_information std, faculty_information fi
    where std.advisor = fi.employee_id and (fi.gender = 'M' and fi.salary > 15000 or fi.gender = 'F' and fi.salary > 20000)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.