Question
Need to use relational algebra - so like this notation for example LName='Rockwood Lake' ( Phone, SID (CatchReport) LName (Swim)) Cannot use phrases like HAVING,
Need to use relational algebra
- so like this notation for example LName='Rockwood Lake' ( Phone, SID (CatchReport) LName (Swim))
Cannot use phrases like HAVING, ELSE GROUP BY only relation algebra
Selection, Projection, Cartesian product, Union, and Set Difference, Join, Natural Join, Set difference, Division, Aggregation
Schema: Member(MName, Phone, Street, MCity, Province, Postal)
CaughtReport(Phone, TagID, Date, Time, BID, SwimID, Weight, Condition)
Pound(PName, PCity)
PoundGround(PName, PoundGroundID, Location, NickName)
breed(BID, BName, Descriptions)
Q1. Based on the number of dogs caught, are there more labs, bulldogs or more GermanSheps in all pounds located in Guelph? The result should be displayed in the same row like: labs. bulldogs GermanSheps
Q2. Find the member(s) who never caught dogs in pounds located outside their own city (where they live). For this question, assume that a member never catches any dogs in a pound if they never submitted any catch report for that pound. Note that this includes member who has never caught dogs (never submitted any catch report). Your result should display the names of the members, their phones and cities.
Q3. Find out how many times Lilly Collins and Emily Blunt caught some labs on the same day
Q4. Find the pound with the highest average number of dogs caught per person. Say, over the years, John caught 9 dogs in Guelph Pound and Katty caught 123. The average number of dogs caught per person for Guelph Pound is 66. You need to find the name of the pound with the highest average.
Q5. Find the pair of members who catch dogs together most frequently (submitted some catch report on the same day and in the same Poundground most frequently). If John and Kate Caught dogs in Pound 10 on Jan 10, 2021, this is considered catching together once regardless how many catch reports being submitted on that day. Be aware of duplicates. Duplicates should be removed, including the same two persons but in different orders. For example, (Cameron Diaz, Helen Mirren) and (Helen Mirren, Cameron Diaz) are considered the same pair. Your result should display their names.
Thanks!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started