Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's some problem with the solution for questions 3.31 and 3.32 #16

Open
roseblooming opened this issue Mar 24, 2024 · 1 comment
Open

Comments

@roseblooming
Copy link

My answers are as follows:

    #3.31
    select ID,name
    from instructor
    where ID not in (
    	select ID
    	from teaches
    	where (course_id,sec_id,semester,year) in (
        	select course_id,sec_id,semester,year
        	from takes
        	where grade like 'A%'));
    #3.32
    select instructor.ID,name
    from (instructor natural join teaches) join takes 
    using (course_id,sec_id,semester,year)
    where grade is not null 
    and not exists (select *
                    from teaches join takes 
                    using (course_id,sec_id,semester,year)
                    where teaches.ID=instructor.ID 
                    and grade like 'A%')
@noahabe
Copy link
Owner

noahabe commented Mar 24, 2024

I will definitely look into it 🙏.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants