Best database structure for this example

lightingever's picture

They have: 39 posts

Joined: Sep 2010

Hi!

I need to create a database of users who will be identified by the following fields: id (primary key), username, password, role.

The role field would be a number that I'm going to use to show information only to certain users (if a user has role 3 he can see information entered by users of level 1, 2 and 3 but not info entered by users of role 4).

Do you think it's better to keep a single table or is it better to split it into 2 tables, the first one containing the fields id, username and password and the second one containing id and role?

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

The only reason to split it into another table would be if it were a one-to-many relationship. It doesn't look like a user would have more than one role, so having it all in the same table is best.

They have: 1 posts

Joined: Oct 2010

Database is it permits the maintenance of a related set of files or tables that can provide information to several different users. So how do these database structures differ? you might ask. That’s a good question. Read on and find out.

LIST DATABASES.— List databases link records together through the use of pointers. The pointer is a data element in one record (normally the master record) that points to the actual disk location of another logically related record, as illustrated in figure 3-7

401k Retirement Plan | Small Business 401k

stokes1900's picture

They have: 55 posts

Joined: Oct 2010

the database wlii not like to be huge and large so you can store all fields with in single table

They have: 3 posts

Joined: Apr 2011

Im a first year college student, I just need your help on giving me an idea of what business will be my focus on making of a good database and im begging to include the tables or another fields for that business that I will include in my database system using MS ACCESS 2007.. Im hoping that you can help me. thank you and God Bless!!! =)

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.