Hi,
I'm creating an application that has SQL database linked to it. This is my first app that uses SQL. So a bit confused about the table structure. It goes like this.
No. | Name | Phase | Start Date | End Date | Hrs | Completed
But one No.has 7 phases. So how do I go about creating the table? Please help!
Thanks
SQL Table
Started by Richmord, Jun 25 2007 12:26 PM
2 replies to this topic
#1
Posted 25 June 2007 - 12:26 PM
|
|
|
#2
Guest_NeedHelp_*
Posted 25 June 2007 - 01:52 PM
Guest_NeedHelp_*
What do you mean by phases?
Also, you should have a unique number that identifies each row like "id" or something. If you have more than one No. then you will need to make another table for the No and make a relational database.
Also, you should have a unique number that identifies each row like "id" or something. If you have more than one No. then you will need to make another table for the No and make a relational database.
#3
Posted 26 June 2007 - 06:08 AM
First table
Id | No | Name
Second table
Id | FirstTable_ID | Phase | Start Date | End Date | Hrs | Completed
And when you want to make a selection from these tables query will be
SELECT * FROM FrrstTable ft
INNER JOIN SecondTable st ON st.FirstTable_ID = ft.ID
Id | No | Name
Second table
Id | FirstTable_ID | Phase | Start Date | End Date | Hrs | Completed
And when you want to make a selection from these tables query will be
SELECT * FROM FrrstTable ft
INNER JOIN SecondTable st ON st.FirstTable_ID = ft.ID


Sign In
Create Account

Back to top









