简体   繁体   中英

Design Database Entity and Relations

I want to create website to organize events (Events Management), the event organizer will create tickets for the event.. so the idea behind this is to give organizer the ability to manage their crowd and capacity.

User can review and rate the event and write a comment, maybe also ticket cancellation and i need him have ability to browse events based on city or calendar.

So i designed my database like this but i think it needs for more enhancement before i continue. I really need your help.

User Table Id, Name, Email, Password, Gender, Mobile

Role Table RoleID, Name (here i mean id 1 for admin, 2 for organizer, 3 for user)

Event Table EventID, Name, Category, City, Date, Time, Description, Seats(Capacity)

Rating Table ID, Rating, Comment, EventID, UserID

there is relation between User and Role Tables N:1 there is relation between User and Event Tables M:N

How should I make relation for rating table? is it with two tables (USER & EVENT)? WHAT TYPE OF RELATION?

Any suggestion in all tables?

You can structure the database like this

  1. Role Table RoleId|RoleName
  2. User Table UserId| RoleId |Name|Email|Password|Gender|Mobile
  3. Event Table EventId| UserId |Name|Category|City|Date|Time|Description|Seats(Capacity)
  4. Rating Table RatingId| EventId | UserId |Comment

I have highlighted column names which are having foreign key relation. Let me know if this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM