Click here to Skip to main content
13,001,159 members (60,940 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all i am a beginner programmer and have a problem with a mySQL query. I have 2 tables 't1' and 't2'. There are 5 entries in t1 and for each entry in t1 there 5 entries in t2. How can i check if the entries in t2 are linked to entries in t1 using a mySQL query? Thanking you in advance.
Posted 27-Aug-12 1:43am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

It is no matter that both table having same record or how much record.
If there is some relation between table column is created then only you can say tables are linked
Like Primary key & foreign key

Or column from first table & second table are having some relation for eqality.
E.g first table Employee
column - empid empname depid
second table Dept
column - deptid deptname
Here two tables are linked with deptid

Suppose first table having only these two column
empid empname then there is no relation between two table.(I dont see such situation)
You should understand first what functionality you are providing then according to see database design. Then you get link between tables.
Please go through this link for relational design in database table.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170624.1 | Last Updated 27 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100