If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Design Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-04, 13:24
scumbaliah scumbaliah is offline
Registered User
 
Join Date: Dec 2004
Posts: 2
Design Question

I have a database with the following tables:

tblAdmin (admin table, one admin per project)
username
password
tblProject (projects table)
project_name
admin (FK references tblAdmin.username)
tblAccounts (several accounts per project)
username
password
project_name (FK references tblProjects.project_name)
How do I create the database so that each project will have an admin AND verify that each admin user has an account in the projects table (so any admin can also log in as a user).

I must first create the admin table so that the projects table can reference it as a foreign key...then I create the projects table...then I create the accounts table. But my problem is that the usernames/passwords for the tblAccounts aren't forced to be in sync with the tblAdmin usernames/passwords.

What is the best way to design the database to avoid redundancy of usernames/passwords?

Thanks,
Steve
Reply With Quote
  #2 (permalink)  
Old 12-09-04, 13:33
nanc nanc is offline
Registered User
 
Join Date: Dec 2004
Posts: 9
1] In tblProject there should be SAME name [username] as in admin ( I think you know that...)

2] If you don't want both username & Password sync with eachother, then you have to do nothing. both will be treated as a separate columns/data.
===go ahead, you are fine====
-Nanc
Reply With Quote
  #3 (permalink)  
Old 12-09-04, 15:18
scumbaliah scumbaliah is offline
Registered User
 
Join Date: Dec 2004
Posts: 2
I DO want the usernames/passwords in sync...but the problem is that they're in two separate tables. How do I keep them in sync when they're in two separate tables?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On