AlisdairO / pgexercises

PostgreSQL Exercises web site code
Other
400 stars 62 forks source link

Guests are falsely counted as member in Members1 #54

Closed corneliusroemer closed 3 years ago

corneliusroemer commented 4 years ago

Question Find the total number of members who have made at least one booking.

Model Answer select count(distinct memid) from cd.bookings

Problem This counts the guest user with memid=0 as a member, this is logically wrong, since a guest is by definition not a member. Either question has to be reworded or model answer updated with where memid != 0

AlisdairO commented 3 years ago

Thanks - corrected in 866793fc26272cbdcbb06aada2338a5ab2f13cb1