Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL extreme newbie question

Status
Not open for further replies.

lowtide

Programmer
May 17, 1999
24
US
I know this is very basic but I am new to database programming and under pressure to create a database for a client within the next month and make it efficient. I understand how to create the database and how to access it dynamically (I will be using PHP). I just want to make sure the initial setup is the best way to do it. What I have is a headline and news database for a college sports department. I want to be able to query the database for the information that will be used in for each sport and also a combined query to show headlines of the top stories on the main page. Would it be better to create one big table with a field for the name of the sport or seperate tables for each sport. If I create seperate tables how do use the join function to query more than two of the tables to find the latest 5 headlines for all of the sports to be displayed on the mainpage. Sorry for the length of this post, it's the simplest explaination I could come up with.<br>
Thanks<br>
Perry Lowe
 
A sport is a type of the same class of data. Store easily defined types in separate tables so that your main table can access them in a field called sport. You can classify further by having types of data class 'news' in another field ie injuries, results etc. By defining your classes it means you get all the data accurately and more quickly. For example a query on the sports field <br>
= 'basketball' will not pick up 'ladies basketball' unless you tell it to. You can also use the sub table to create a menu for your PHP forms. <br>
<br>
To query across tables is not much different to 2 tables just add 'left join XXX on XXX' add nauseum. Be careful what you ask for with left joins.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top