Hi guys, I'm fairly new to PHP and mySQL, using a book to help me learn. I want to create a small site to help me improve my skills, but I'm a bit stuck on the database design part.
I want to be able to list various public companies and show the profits of the companies from the last 10 years.
For example:
Company Name // CEO // Founded // 2009 Profit // 2008 Profit // ... // 10 Year Average Profit
Apple // Steve Jobs // 1981 // $10.3 bn // $7.8 bn // ... // $3.58 bn
// = column separators :)
As far as I can tell, I need to have two tables in the database, one for the company data and one for the earnings:
Table 1: Company
- company_id
- Company Name
- CEO
- Founded
- Website
- Share Price
Table 2: Earnings
- earnings_id
- company_id
- Year
- Earnings
Bold = primary key for that table
My question is, is this the best setup for my tables? I guess I then need to learn a lot more about table joins to actually display the data in the format I gave above.