Example Database to Design

Here my intention is illustrate the CRUD operations of Mongoose with an example application database. Lets see what I am want to design

A Small database for Gaming Concept with this assumption, " A user will play some games, game related data auditing will be done, for that I need these tables"
  1. A users collection to hold user information like (userid(pk),password,balancechips,state,emailid)
  2. A address collection to hold user Address information like (userid(fk of users table),city,state,country..)
  3. A games collection to hold Game Details like (gameid(pk),gamename,minbet,maxbet...)
  4. A loginsession collection to hold user login details means when he/she logged in etc details with fields(userid(fk of users),sessionid,logintime,logouttime,totalbet,totalwin...)
  5. A gameplaylogs collection to game play details means which played with what bet etc (userid(fk of users),sessionid(fk of loginsession),betamount,winamount,timeofplay...)

See this ER diagram

Copyright © 2018-2020 TutorialToUs. All rights reserved.