Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

 
Share this answer
 
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
http://www.w3schools.com/sql/sql_foreignkey.asp

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.
http://parallel.vub.ac.be/documentation/database/tutor/
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900