Computer Webmaster Gaming Console Graphics Forum

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.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > Database
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

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.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-10-2007, 12:22 AM   #1
Piotr
 
Piotr's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default table in a table

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
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 06-10-2007, 12:22 AM   #2
Jerry Stuckle
 
Jerry Stuckle's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default table in a table

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
==================
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-10-2007, 12:22 AM   #3
Usenet
 
Usenet's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default table in a table

> 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...


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-10-2007, 12:23 AM   #4
Usenet
 
Usenet's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default table in a table

That was supposed to be "relational" ... bloomin' "a" key's not
working properly :-(

Mark

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-10-2007, 12:23 AM   #5
Jim Morrissey
 
Jim Morrissey's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default table in a table

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
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags:




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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




All times are GMT +1. The time now is 11:43 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98