Solved

how to create relationships in mysql using phpMyAdmin

Posted on 2002-03-14
6
5,141 Views
Last Modified: 2010-08-05
Hai all,

I want to know how to create relationships between the tables in mysql using phpMyAdmin software.

Anyone who r familiar with it pls solve my problem

Thankyou
Manju

0
Comment
Question by:manju70
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 32

Expert Comment

by:Batalf
ID: 6867893
mySQL doesn't support physical relations between tables. It only support the syntax(create table.....references) to make it easy to transfer a db from an other db-system to mySQL.

But: mySQL is still a relational database management system(RDBMS), but the relations between tables are not physical. If I have 2 tables

"score"
ID int
studentID int
score varchar(5)

and the table "student"
ID int
firstname varchar(32)
lastname varchar(32),

they stand alone without a physical connection. But with the studentID in the table score I have constructed the tables as if there were a physical relation between them, and I could use SQL-querys as in other DB_systems.
0
 

Author Comment

by:manju70
ID: 6868432
At first I thank, for your comments.
but, if I wanted to load data in a foreign key field then how am I to ensure whether the corresponding primary key field is available in master table(like in Ms access ).

if mysql doesn't supports this features,is any other free software which supports it is available?????

thanks in advance
manju
0
 

Expert Comment

by:esnagel
ID: 6870102
If you have two tables:

users
~~~~~
userID
username
password

demographics
~~~~~~~~~~~~
userID
age
sex
race

Your SQL query would be:  "select * from users, demographics where users.userID=demographics.userID" to get the data from both tables

0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 5

Expert Comment

by:dkjariwala
ID: 6870559
but, if I wanted to load data in a foreign key field then how am I to ensure whether the corresponding
primary key field is available in master table(like in Ms access ).


You should be using JOINS to do this.

My friend esnagel has suggested you how do to same using LEFT JOIN.

But if you want more features Try PostGRE SQL.

http://www.at.postgresql.org/

JD
0
 

Accepted Solution

by:
Zuhair070699 earned 30 total points
ID: 6876027
I am using Mysql Manager program to do relationships between tables.

You can download full function 30 day trial version from here:

http://ems-hitech.com/mymanager/download.phtml
0
 
LVL 5

Expert Comment

by:dkjariwala
ID: 6876049
Zuhair

thats heck of a software !!!
JD
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question