Join Introduction [MySQL]

September 15, 2016
Categorised in: Database Management System
- Joins tables
- Many forms:
- INNER JOIN (include only matching columns)
- OUTER JOIN (include all columns)
- LEFT OUTER JOIN
- NATURAL JOIN
- CONDITION JOIN
- “JOIN” means “INNER JOIN” in MySql.
Example of a Condition Join
Statement: JOIN the CountryLanguage and Language tables using the country code
SELECT CO.Name, L.language, L.percentage FROM Country CO JOIN CountryLanguage L ON CO.code = L.countrycode WHERE ...;
Example of Multiple Table Join
SELECT CO.name, C.*, L.language FROM Country CO JOIN CountryLanguage L ON CO.code = L.countrycode JOIN City C ON CO.code = C.countrycode WHERE ...; /* more conditions */
Pratik Kataria is currently learning Springboot and Hibernate.
Technologies known and worked on: C/C++, Java, Python, JavaScript, HTML, CSS, WordPress, Angular, Ionic, MongoDB, SQL and Android.
Softwares known and worked on: Adobe Photoshop, Adobe Illustrator and Adobe After Effects.