Jump to content

SQL Table

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Richmord

Richmord

    Newbie

  • Members
  • Pip
  • 3 posts
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

#2
Guest_NeedHelp_*

Guest_NeedHelp_*
  • Guests
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.

#3
Sergey.Net

Sergey.Net

    Newbie

  • Members
  • Pip
  • 8 posts
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