943,923 Members | Top Members by Rank

Ad:
Oct 31st, 2008
0

DataBase Design Help

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
BeEasy is offline Offline
4 posts
since Feb 2008
Oct 31st, 2008
0

Re: DataBase Design Help

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
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Oct 31st, 2008
0

Re: DataBase Design Help

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. ?
Reputation Points: 27
Solved Threads: 29
Posting Whiz
timothybard is offline Offline
317 posts
since Mar 2007
Oct 31st, 2008
0

Re: DataBase Design Help

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.

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
Reputation Points: 10
Solved Threads: 1
Newbie Poster
BeEasy is offline Offline
4 posts
since Feb 2008
Oct 31st, 2008
0

Re: DataBase Design Help

Quote ...
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?
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Oct 31st, 2008
0

Re: DataBase Design Help

I not sure what you mean by this:

Quote ...
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.
Reputation Points: 27
Solved Threads: 29
Posting Whiz
timothybard is offline Offline
317 posts
since Mar 2007
Nov 4th, 2008
0

Re: DataBase Design Help

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

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
Reputation Points: 10
Solved Threads: 1
Newbie Poster
BeEasy is offline Offline
4 posts
since Feb 2008
Nov 4th, 2008
0

Re: DataBase Design Help

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
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 5th, 2008
0

Re: DataBase Design Help

Click to Expand / Collapse  Quote originally posted by BeEasy ...
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)
Reputation Points: 27
Solved Threads: 29
Posting Whiz
timothybard is offline Offline
317 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Database Design Forum Timeline: fixed required length for a field in database!
Next Thread in Database Design Forum Timeline: HELP figuring out a good 3rd year uni project title





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC