EER Exercises
EER Exercises
Database Systems
Exercises
2. You have just moved to Washington, D.C., to work for the U.S. House of
Representatives (the “House”) as a database specialist. For your first
job, they want you to design a database to keep track of votes taken in
the House. (A counterpart to you working for the U.S. Senate is
designing a similar database for tracking votes in the Senate.) The
database will track votes taken in the House during the current two-
year congressional session. It should record each U.S. state (for
instance, Texas) with its name, number of representatives, and region in
which the state is located (northeast, mid-atlantic, midwest, and so
forth). Each congress-creature, er, I mean representative, in the House
is to be described by his or her name, the district (by district number)
that he or she represents, the year when he or she was first elected,
and the political party to which he or she belongs (for instance,
Republican, Democrat, Independent, Green, Reform, Other). The
database should track each bill (legislation) with its name, the date on
which its vote was taken, whether the bill passed or failed (so the
domain is yes and no), and its sponsors (the representatives who
proposed the bill). The database should track how each representative
voted on each bill (yes, no, abstain, absent). a. Design an entity-
relationship (E-R) schema diagram for the above enterprise. Be careful
to ensure that each of the attributes would be restricted to legal
values (no pun. . .). State clearly any assumptions that you make. Also
state any business rules—logic to which the database should adhere—
that are not captured in your E-R diagram.
The Bill entity box represents the collection of all bills that come to
the floor of the house. A representative votes on each bill, so he or she
votes on many bills. And, of course, each bill is voted on by many
representatives. So the rel-ship votes is properly many-
many.