Leakbali
w3 Tutorial, Web Tutorial
Register   Login
Share

MySQL Join 


Thus far we have only been getting data from one table at a time. This is fine for simple tasks, but in most real world MySQL usage you will often need to get data from multiple tables in a single query.

The act of joining in MySQL refers to smashing two or more tables into a single table. This means everything you have learned so far can be applied after you've created this new, joined table.

MySQL Join Table

We like to show examples and code before we explain anything in detail, so here is how you would combine two tables into one using MySQL. The two tables we will be using relate to a families eating habits.

person Table

NameAge
Putu21
Made18
Nyoman20
Ketut17

food Table

MealName
Ayam BetutuPutu
Tipat CantokMade
Nasi JinggoNyoman
LawarKetut
The important thing to note here is that the column Name contains information that can tie these two tables together. In the "person" table, the Name column contains all of the person and their respective ages. In the "food" table the Name column contains the person who enjoys that dish.

It's only through a shared column relationship such as this that tables can be joined together, so remember this when creating tables you wish to have interact with each other.
More Tutorial
  1. MYSQL - MySQL Join
  2. MYSQL - MySQL Join Example

References

About Us

Home
About Us
Contact Us
Sitemap

Tools

Google PageRank
Alexa Rank
Keywords Density

Accounts

Register Account
Login
Valid XHTML 1.0 TransitionalValid CSS!
Web Directory


2006 - 2012 © Leakbali.com - Free Web Tutorial, Free Web Articles, Web Sharing, Source Codes, Web References