![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| hi, Is there a chane to put a table in a table in mysql ? I want to put this structure into mysql: Team name 1 Project 1 person 1 person 2 person 3 person 4 Project 2 person 1 person 2 person 3 Team name 2 Project 1 person 1 person 2 person 3 person 4 person 5 Project 2 person 1 person 2 person 3 person 4 Team name 3 Project 1 | |||
| Advertisements |
| | #2 | ||
| Piotr wrote: > hi, > Is there a chane to put a table in a table in mysql ? > I want to put this structure into mysql: > > Team name 1 > Project 1 > person 1 > person 2 > person 3 > person 4 > Project 2 > person 1 > person 2 > person 3 > Team name 2 > Project 1 > person 1 > person 2 > person 3 > person 4 > person 5 > Project 2 > person 1 > person 2 > person 3 > person 4 > Team name 3 > Project 1 > . > . > . > ..etc > > I want to be able to dispaly such persons list categorized by their project > which they are working at and by the team they do belong. > I thougt about making team tables which contain procetct tables which > contain partucular persons... > Is there any chance to do that ? Or maybe someone has a better idea how to > organize such structure. > thanks for any respons, > piotr > kefas(at)smk.gda.pl > > Hello, Poitr, Well, first of all, you need to rethink how relational databases work. You don't create one table "within" another. Rather, you create two tables and have a relationship between them. I'm not clear on whether each person and project is unique in your example, i.e. Team 1/Project 1/Person 1 is different from Team 1/Project 2/Person 1. Two ways - the first with 3 tables: Teams Id Name Other Info Projects Id Description Team Id Other Info Persons Id Name Project Id Other Info This allows a project to be assigned to a single team and a person to be assigned to a single project. For maximum flexibility, I think I would create 5 tables: Teams Id Name Other Info Projects Id Description Team Id Other Info Persons Id Name Other Info TeamProject TeamProjectId TeamId ProjectId ProejctPerson TeamProjectId PersonId This allows you to define your teams, projects and persons, assign any project to one or more teams and vice versa. Also, you could assign any person to one or more team projects, and vice versa. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== | |||
| | #3 | ||
| > I want to put this structure into mysql: <strucure snipped> This is what relional databases were built for. You want three main tables; one each for team, project, & people. Then linking tables so that you can include (according to your suggested structure) people in projects, and projects in teams. If it's ever going to be possible that you'll need more than one team working on a project then I'd suggest you switch it around and have "team" be a subsection of "project". Mark Stanton One small step for mankind... | |||
| | #5 | ||
| In postgreSQL and other object-relational databases you can do exactly what Piotr is describing. using table inheretance. I think that was his question. In this case creating project tables that inheret from the team table. -Jim "Piotr" <kefas@smk.gda.pl> wrote in message news:e2n5n0$l7u$1@news.task.gda.pl... > hi, > Is there a chane to put a table in a table in mysql ? > I want to put this structure into mysql: > > Team name 1 > Project 1 > person 1 > person 2 > person 3 > person 4 > Project 2 > person 1 > person 2 > person 3 > Team name 2 > Project 1 > person 1 > person 2 > person 3 > person 4 > person 5 > Project 2 > person 1 > person 2 > person 3 > person 4 > Team name 3 > Project 1 > . > . > . > ..etc > > I want to be able to dispaly such persons list categorized by their > project which they are working at and by the team they do belong. > I thougt about making team tables which contain procetct tables which > contain partucular persons... > Is there any chance to do that ? Or maybe someone has a better idea how to > organize such structure. > thanks for any respons, > piotr > kefas(at)smk.gda.pl > | |||
| Featured Websites | ||||
|
![]() |
| Tags: table |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot drop table | John Oliver | Database | 1 | 06-10-2007 12:22 AM |
| Best way to structure a table? | J Mox | Database | 13 | 05-31-2007 8:45 PM |
| help with multiple table join | Mike Easter | Database | 1 | 05-31-2007 8:45 PM |
| enum can't create table | paul | Database | 1 | 05-31-2007 8:41 PM |
| Table aliases | fireshark | Database | 5 | 07-16-2006 6:59 AM |
| Featured Websites | ||||
|