This entity describes a bet placed by a gambler on a game with a book. It details amount, time, date, and winning information. Candidate keys: betID Primary key: Strong/Weak Entity: Weak Fields to be indexed: BetID, Date Name betID amount time date type win Description An value. A positive number Time of bet Date of bet Bet type Did the bet win? Domain/Type 32 bit Unsigned Integer 32 bit Unsigned Double Time Date String Boolean Range 0 … 2^32 0.00 … 10,000.00 Current time only Current Date only Money line, spread, or totals 0 or 1 Default Value None None Current time Current Date None null Nullable? No No No No No Yes Unique? Yes No No No No No Single or Multiple Value Single Multiple Multiple Multiple Multiple Multiple Simple or Composite Simple Simple Composite Composite Simple Simple Game
This entity describes a match between two teams. Candidate keys: gameID Primary key: gameID Strong/Weak Entity: Weak Fields to be indexed: gameID, Date Name gameID homeScore awayScore time date gameType weather Description An value. A positive number A positive number Time of bet Date of bet What type of game is this? Weather forcast for the game Domain/Type 32 bit Unsigned Integer 32 bit Unsigned Integer 32 bit Unsigned Integer Time Date String String Range 0 … 2^32 0 … 999 0 … 999 Current time only Current Date only regular season, playoff, Any char array Default Value None null null Current time Current Date None null Nullable? No Yes Yes No No No Yes Unique? Yes No No No No No No Single or Multiple Value Single Multiple Multiple Multiple Multiple Multiple Multiple Simple or Composite Simple Simple Simple Composite Composite Simple Composite Team
This entity provides information on the teams that are bet upon. Candidate keys: teamID, teamName Primary key: teamID Strong/Weak Entity: Strong Fields to be indexed: teamID Name teamID teamName city State record streak Description An value. The team’s name The team’s city The team’s The team’s record A number of consecutive wins or losses Domain/Type 32 bit Unsigned Integer String String String String 32 bit int Value Range 0 … 2^32 Any char array Any char array Any char array 0-0-0 to 16-16-16 -16 … 16 Default Value None None None None 0-0-0 0 Nullable? No No No No No No Unique? Yes Yes No No No No Single or Multiple Value Single Single Multiple Multiple Multiple Multiple Simple or Composite Simple Simple Simple Simple Composite Simple Book This entity describes an entity that accepts bets, sets odds, and pays winnings
Candidate keys: bookID, bookName Primary key: bookID Strong/Weak Entity: Strong Fields to be indexed: bookID Name bookID bookName address bank Description An value. The book’s name (casino or otherwise) User’s address The book’s available assets Domain/Type 32 bit Unsigned Integer String String 32 bit Unsigned Int Value Range 0 … 2^32 Any char array Any Char array 0 … 2^32 Default Value None None None None Nullable? No No No No Unique? Yes Yes Yes No Single or Multiple Value Single Single Single Multiple Simple or Composite Simple Simple Composite Simple Relationship Set Description Gambles: This ternary relationship is between the gambler, the bet, and the game. Every bet must have one gambler and one game. Whenever a gambler creates a bet on a game, this relationship is created. This links the userID with the betID and the gameID. Mapping cardinality: M..M..M Descriptive teamID Participation constraint: mandatory for Bet, optional for gambler and game Held_By:
bookID Domain: unsigned integer: 0 to 2^32-1. Cannot be NULL. Constraints Foreign key: userID, bookID. Must exist in their respective relations and be NOT NULL. Business Rule: each employee must have a position and bookID to determine access rights. Candidate Keys userID Bet Attributes Domain: unsigned integer: 0 to 2^32-1. Cannot be NULL. bookID Domain: unsigned integer: 0 to 2^32-1. Cannot be NULL.
Constraints Foreign key: bookID, gameID, and teamID collectively make a unique key. They must all exist in their respective reference relations. Business Rule: if a bet type is “point spread” this record will be referenced to determine if they have won or not. This information will also be displayed to the users. Candidate Keys bookID, gameID, and teamID E-R Database to Relational Database Conversion Users(userID, userName, fullName, Address, emailAddress, password) userID userName fullName Address emailAddress password 1 Nkott0 Kott, Nicholas 1920 Hugo St., Bakersfield, CA, 93308 Nkott0@gmail.com Alfred0 2 SawCat Cat, Sawyer 1922 Hugo St., Bakersfield, CA, 93308 1e8gn54 3 Mialicious Cat, Mia 2000 Hugo St., Bakersfield, CA, 93308 Mialicious@gmail.com Randumb1
4 FrankC Caliendo, Frank 2100 Truxtun Ave., Saint Clair, MI, 48079 FrankC@yahoo.net 123456 5 DrWang Wang, Huaqing 4200 Camino Media, Bakersfield, CA, 12345 hwang@cs.csubak.edu fluffydog 6 JCardenas Cardenas, Jorge 999 Dr., San Deigo, CA, 10000 JCardenas@kern.co.ca.us 3l337one 7 TRutledge Rutledge, Thomas 777 Luck St., Las Vegas, NV, 77777 TRutledge@kern.co.ca.us 8008ies 8 SySamat Sy, Samat 123 Fake St., Austin, TX, 56560 SySamat@kern.co.ca.us 1ang2dt 9 TVanMetre Van Metre, Tom 688 Green Ave., ID, 88809 TVanMetre@kern.co.ca.us 45f98fdhg9 10 PiersonJiu Jiu, Pierson 45247 Golden Gate Pkwy., San Francisco, CA, 91240 PiersonJiu@kern.co.ca.us Pazz7432 11 Mialing Cart, Mart 4000 Hugo St., Bakersfield, CA, 93309 Randsfgh 12 UglyOrg Brown, Orge 5500 Truxtun Ave., Saint Clair, MI, 48079 haaaar@yahoo.net 1j4788g 13 OtherPer Van, Big 200 Camino Bakersfield, CA, 12345 hoolahut@austin.edu blueish 14 Obamakin Obama, Barak 999 Olive Dr., SomeCity, D.C., 10000 Theprez@usa.gov Freeh3alth