DataBase Design Help

Reply

Join Date: Feb 2008
Posts: 4
Reputation: BeEasy is an unknown quantity at this point 
Solved Threads: 1
BeEasy BeEasy is offline Offline
Newbie Poster

DataBase Design Help

 
0
  #1
Oct 31st, 2008
Hi

I'am doing an online cinema ticket reservation system

and i have face a problem with the database design

i have these entities: Movie, Branch, Hall, Seat, Admin and customer

there is a relationship between the admin and all other entities except the customer which is the admin can add or update info in these entities

as far as i know the relationship can be between two entities or three!!

how can i draw the relationship between the admin and the related entities??

Thanks in advance
Last edited by BeEasy; Oct 31st, 2008 at 12:41 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: DataBase Design Help

 
0
  #2
Oct 31st, 2008
When you say there is a relationship between the admin and the other entities, what do you mean?

They are allowed to edit as far as UPDATES, INSERTS, and DELETES or do you mean the admins are the owners of the movie hall? And just to be sure, hall means movie hall?

i would say to do it like this

admin -> hall -> branch -> movie -> seat -> customer
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: DataBase Design Help

 
0
  #3
Oct 31st, 2008
If the admin is just a list of people who can add, modify and delete records and is used only for database security/management purposes, then the admin entity would not have a relationship to the other entities in the diagram.

However, if you want to track, say, the admin who made the most recent change to a record in a database, then you could add an AdminID foreign key to each entity.

Lastly, as mentioned by dickersonka, if the admin actually owes or is responsible for a particular Hall, then you would have admin related directly to Hall.

I guess my real question is, are admins used simply to administer the database or are admins responsible for individual halls, branches, movies, etc. ?
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 4
Reputation: BeEasy is an unknown quantity at this point 
Solved Threads: 1
BeEasy BeEasy is offline Offline
Newbie Poster

Re: DataBase Design Help

 
0
  #4
Oct 31st, 2008
Originally Posted by dickersonka View Post
When you say there is a relationship between the admin and the other entities, what do you mean?

They are allowed to edit as far as UPDATES, INSERTS, and DELETES or do you mean the admins are the owners of the movie hall? And just to be sure, hall means movie hall?

i would say to do it like this

admin -> hall -> branch -> movie -> seat -> customer
Thanks for your reply first

I mean that the admin can edit or update let's say the admin can add new movie or add new hall for example

The hall is the movie hall.

Originally Posted by timothybard View Post
If the admin is just a list of people who can add, modify and delete records and is used only for database security/management purposes, then the admin entity would not have a relationship to the other entities in the diagram.

However, if you want to track, say, the admin who made the most recent change to a record in a database, then you could add an AdminID foreign key to each entity.

Lastly, as mentioned by dickersonka, if the admin actually owes or is responsible for a particular Hall, then you would have admin related directly to Hall.

I guess my real question is, are admins used simply to administer the database or are admins responsible for individual halls, branches, movies, etc. ?
Thanks for your reply

i want to keep track of the records edited by admins and thats the idea... i will have the admin Id as foreign key in the entities....

My question is here...should i create a single relationship which is edit or update and link all the related entities together???

or draw multiple relationships that have the same action which is edit or update between the admin entity and the other entities??

and as i said before....the admin is just the database adminstrator and there is no individual admin.

Thanks alot
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: DataBase Design Help

 
0
  #5
Oct 31st, 2008
and as i said before....the admin is just the database adminstrator and there is no individual admin.
hmmm, still not perfectly clear to me, maybe tim understands a little more

are you meaning admin is a database user(windows / sql user account) or there is a table you are wanting called admin that has user credentials for an administrator?
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: DataBase Design Help

 
0
  #6
Oct 31st, 2008
I not sure what you mean by this:

My question is here...should i create a single relationship which is edit or update and link all the related entities together???

or draw multiple relationships that have the same action which is edit or update between the admin entity and the other entities??
However, let me make a few comments and see if they help:

For databases I've used in the past, there is a text field in each of the tables called "Updated By". Each time a record is updated, the field is updated to show the name of the person who made the update.

I've also used databases that makes copies of all updated records in a separate table so you can see the history of all the updates that have been made.

Lastly, you can't control who can make updates to a database simply by adding an admin entity to the database and adding relationships; you will need to program the database to lookup the current user and see if they are in the admin table; if they are not, the database must be programmed to not allow the user to make the changes.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 4
Reputation: BeEasy is an unknown quantity at this point 
Solved Threads: 1
BeEasy BeEasy is offline Offline
Newbie Poster

Re: DataBase Design Help

 
0
  #7
Nov 4th, 2008
Originally Posted by dickersonka View Post
hmmm, still not perfectly clear to me, maybe tim understands a little more

are you meaning admin is a database user(windows / sql user account) or there is a table you are wanting called admin that has user credentials for an administrator?
the admin is one of the users of the system

i need his id as a foreign key in the related entites such as movie entity

so i must make a relation between the admin entity and the others

thanks for reply

Originally Posted by timothybard View Post
I not sure what you mean by this:



However, let me make a few comments and see if they help:

For databases I've used in the past, there is a text field in each of the tables called "Updated By". Each time a record is updated, the field is updated to show the name of the person who made the update.

I've also used databases that makes copies of all updated records in a separate table so you can see the history of all the updates that have been made.

Lastly, you can't control who can make updates to a database simply by adding an admin entity to the database and adding relationships; you will need to program the database to lookup the current user and see if they are in the admin table; if they are not, the database must be programmed to not allow the user to make the changes.
Your comment is very useful and thanks alot for sharing with me

but as i said the admin is the system administrator his job to modify or add new movie details or new branch details...i need his id as a foriegn key in the other tables so it will be recorded with each updated record.
also this modifying in the database in a seprate page that cannot be viewed by other users


my question is in the ERD.....can i make more than three connection to one relationship.??

thanks for your replies
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: DataBase Design Help

 
0
  #8
Nov 4th, 2008
then just as tim said, add an AdminId column to each table that will be modified by that user and record this id as the user

these will have 1 to many (admin can have multiple relationships to hall, branch, movie)
(1..x)
admin ------> hall
admin ------> branch
admin ------> movie

hall -> branch -> movie -> seat -> customer

then we will have the same structure as before
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: DataBase Design Help

 
0
  #9
Nov 5th, 2008
Originally Posted by BeEasy View Post
my question is in the ERD.....can i make more than three connection to one relationship.??
Each entity (table) in an ERD can have more than one connection (i.e., be related to more than one entity)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC