| | |
Help with database design?
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hi folks,
I’m planning on building a site somewhat similar to a web hosting directory and was hoping to get some input/advice on the database design from all you coding gurus
I’d like to have two different types of users: 1) hosts 2) normal users
Because of the this, I’ll need two seperate registration forms (with different fields). Will I require two tables in the db or can I combine them into one? I would also like to allow the host admin to be able to add/edit/delete users associated to that host.
What would be the best way to go about creating the database?
Thanks in advance
I’m planning on building a site somewhat similar to a web hosting directory and was hoping to get some input/advice on the database design from all you coding gurus
I’d like to have two different types of users: 1) hosts 2) normal users
Because of the this, I’ll need two seperate registration forms (with different fields). Will I require two tables in the db or can I combine them into one? I would also like to allow the host admin to be able to add/edit/delete users associated to that host.
What would be the best way to go about creating the database?
Thanks in advance
•
•
Join Date: Sep 2008
Posts: 339
Reputation:
Solved Threads: 27
It depends on how you want to pull the data if you want hosts items to see users items the put it all in one table if users and hosts will never see the same data then put in 2 different tables.
This depends on your relational design. As you mention information about your project, the hosts are "service providers" and the users are "service consumers/takers". You need to decide whether what relationship the hosts and users share. If a user can have content hosted on multiple hosts then there is clearly a many-to-many relationship between them, as hosts certainly can have multiple users.
Once you have decided this, you need take into consideration what attributes/information you would like to store for the hosts and the users. Each of these attributes would be fields/column in the tables. From what I understand, I don't think that hosts and users would share more than a few attributes and hence it is advisable to use two different tables for them.
>I would also like to allow the host admin to be able to add/edit/delete users associated to that host.
This is concept that you would have to implement in your coding.
Once you have decided this, you need take into consideration what attributes/information you would like to store for the hosts and the users. Each of these attributes would be fields/column in the tables. From what I understand, I don't think that hosts and users would share more than a few attributes and hence it is advisable to use two different tables for them.
>I would also like to allow the host admin to be able to add/edit/delete users associated to that host.
This is concept that you would have to implement in your coding.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
I've only learned one thing about DB design
store date and time as timestamps its a lot faster to compare numeric timestamps than text date/time stings
store date and time as timestamps its a lot faster to compare numeric timestamps than text date/time stings
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
![]() |
Similar Threads
- your ideas on database design??? (Database Design)
- Database design regarding two 'linking' tables (Database Design)
- Database Design for storing versions (Database Design)
- Database Design feedback (absolute beginner here :) (Database Design)
- Help with contact/mailing list database design... (Database Design)
- Database design - subtypes and instances of an entity (Database Design)
- Database Design - Supertypes and Subtypes (Database Design)
- Database Design Advice (MySQL)
Other Threads in the MySQL Forum
- Previous Thread: MySQL 1067 error, cant connect to database
- Next Thread: Performance Issue Using Full Text Search
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm data database design developer development distinct drupal dui ec2 email enter enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opensource oracle php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency






