Skip to content

Commit 7783feb

Browse files
committed
Querying data from multiple tables
1 parent 28af451 commit 7783feb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

mysql-queries.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,17 @@ In database management, an aggregate function is a function where the values of
4242
| 07. |SELECT c1 FROM t ORDER BY c1LIMIT n OFFSET offset|Select data in column c1 from a table named t and skip offset of rows and return the next n rows|
4343
| 08. |SELECT c1, aggregate(c2) FROM t GROUP BY c1|Select data in column c1 from a table named t and group rows using an aggregate function |
4444
| 09. |SELECT c1, aggregate(c2) FROM t GROUP BY c1 HAVING condition|Select data in column c1 from a table named t and group rows using an aggregate function and filter these groups using ‘HAVING’ clause|
45+
46+
47+
#### Querying data from multiple tables
48+
49+
|Sl.No|Query | Description |
50+
|-----|-----------------|---------------------------------------------------|
51+
| 01. |SELECT c1, c2 FROM t1 INNER JOIN t2 on condition|Select columns c1 and c2 from a table named t1 and perform an inner join between t1 and t2 |
52+
| 02. |SELECT c1, c2 FROM t1 LEFT JOIN t2 on condition|Select columns c1 and c2 from a table named t1 and perform a left join between t1 and t2|
53+
| 03. |SELECT c1, c2 FROM t1 RIGHT JOIN t2 on condition|Select columns c1 and c2 from a table named t1 and perform a right join between t1 and t2|
54+
| 04. |SELECT c1, c2 FROM t1 FULL OUTER JOIN t2 on condition|Select columns c1 and c2 from a table named t1 and perform a full outer join between t1 and t2|
55+
| 05. |SELECT c1, c2 FROM t1 CROSS JOIN t2 |Select columns c1 and c2 from a table named t1 and produce a Cartesian product of rows in tables|
56+
| 06. |SELECT c1, c2 FROM t1, t2 |Same as above - Select columns c1 and c2 from a table named t1 and produce a Cartesian product of rows in tables|
57+
| 07. |SELECT c1, c2 FROM t1 A INNER JOIN t2 B on condition |Select columns c1 and c2 from a table named t1 and joint it to itself using an INNER JOIN clause|
58+

0 commit comments

Comments
 (0)