Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL stored procedures MoveVotes(Precinct, Timestamp, Candidate, Number_of_Moved_Votes) a) Precinct - one of the existing precincts b) Timestamp must be existing timestamp. If Timestamp does not

SQL stored procedures

MoveVotes(Precinct, Timestamp, Candidate, Number_of_Moved_Votes)

a) Precinct - one of the existing precincts

b) Timestamp must be existing timestamp. If Timestamp does not appear in Penna than MoveVotes should display a message "Unknown Timestamp".

c) The Number_of_Moved_Votes parameter (always positive integer) shows the number of votes to be moved from the Candidate to another candidate and it cannot be larger than number of votes that the Candidate has at the Timestamp. If this is the case MoveVotes () should display a message "Not enough votes".

d) Of course if CoreCandidate is neither Trump nor Biden, MoveVotes() should say "Wrong Candidate".

Just as stated before each exception should lead to a message "wrong candidate name", "wrong precinct name' or not existing timestamp (this time we will not approximate like in API1()).

MoveVotes() should move the Number_of_Moved_Votes from CoreCandidate to another candidate (there are only two) and do it not just for this Timestamp (the first parameter) but also for all T>Timestamp, that is all future timestamps in the given precinct. For example MoveVotes(Red Hill, 2020-11-06 15:38:36,'Trump',100) will remove 100 votes from Trump and move it to Biden at 2020-11-06 15:38:36 and all future timestamps after that in the Red Hill precinct.

File:  Penna(id,
Timestamp,
state,
locality,
precinct,
geo,
totalvotes, Biden , Trump,
filestamp)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intermediate Microeconomics

Authors: Hal R. Varian

9th edition

978-0393123975, 393123979, 393123960, 978-0393919677, 393919676, 978-0393123968

More Books

Students also viewed these Databases questions

Question

What is capital structure, and why is it important to a company?

Answered: 1 week ago

Question

What is a social role? (p. 30)

Answered: 1 week ago