![]() | |
Project 4: Assigned: Wed Oct 02 2024 In this project, you'll add some tables and practice joined searches on them. As always, you can test your code with this tester script, though it does not contain all the tests that I will use. Part 0, 10 points: Add a new table, factoids, which will store interesting facts about the lakes of lakeland. It must have these fields: Part 1, 10 points: Create another table, factoid_votes, for feedback on the factoids. We'll pretend that some users have been up- or downvoting them, and each record will be one of those votes. It needs these fields: Part 2, 20 points: Write a Python function, cast_vote, that modifies the factoid_votes table. cast_vote(db_connection, factoid_id, value, username) should add/change the vote for that user on the specified factoid. Part 3, 10 points: Now let's write some search queries that use the JOIN operator. First write a function, get_factoids_and_votes_query() that returns a record for each vote of each factoid, listing both the factoid and the vote and the user who voted for it (as well as any other fields you'd like to include). Part 4, 10 points: Write another join query, get_gator_sightings_and_lake_area_query(), which returns a record of each recorded gator sighting as well as the surface area of the lake. Each record in the result should look like: Part 5, 20 points: Write another join query, get_worst_gators_query(), which returns a record for each lake and the highest number of gators spotted in that lake. (If there haven't been any sightings there, the highest number of gators should be 0.) Part 6, 10 points: Write another join query, get_worst_gators_per_acre_query(), which returns a record for each lake and the highest number of gators spotted per acre. (If there haven't been any sightings there, the highest number of gators should still be 0.) Part 7, 10 points: Write another join query, get_total_factoid_score_query(), which returns a record for each factoid (the text) and the total score from votes. Submitting your Project: Choose a team name that no other team will choose. Then make sure all your code is in a file labelled with your team name, followed by |