SQL Join Queries Tutorial
Joining tables in SQL MySQL JOINS: In this tutorial, you are going to learn how to use different types of joins on tables. Below you will find different types of join queries with examples. Types of JOINS in SQL INNER JOIN OUTER JOIN LEFT OUTER JOIN RIGHT OUTER JOIN SELF JOIN INNER JOIN – Returns only all common rows from both the tables TOC Create following tables in order to test the query Use the queries below to create tables in MySQL: Query -T1 -- -- Table structure for table `t1` -- CREATE TABLE IF NOT EXISTS `t1` ( `sno` int ( 11 ) NOT NULL AUTO_INCREMENT, `sname` varchar ( 30 ) NOT NULL , PRIMARY KEY (`sno`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 4 ; -- -- Dumping data for table `t1` -- INSERT INTO `t1` (`sno`, `sname`) VALUES ( 1 , 'AAA' ), ( 2 , 'BBB' ), ( 3 , 'CCC' ); Query -T2...