SQL stored procedures MoveVotes(Precinct, Timestamp, Candidate, Number_of_Moved_Votes) a) Precinct - one of the existing precincts b) Timestamp
Question:
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)