mysql join simple example for beginners
Frequent SQL commands select
Example Query from 3 tables
SELECT *
FROM girls B, couple C, boys A
where C.boy = A.id
AND C.girl = B.id
Example Query from 2 tables
SELECT *
FROM boys A, girls B
where B.id = A.relation
Example Query from 2 tables with a join
SELECT A.name, B.name
FROM boys A
INNER JOIN girls B
ON A.relation = B.id
Example Query from 2 tables with a join and union
SELECT A.name, B.name
FROM boys A
LEFT OUTER JOIN girls B
ON A.relation = B.id
UNION
SELECT A.name, B.name
FROM boys A
Right OUTER JOIN girls B
ON A.relation = B.id
Example Query from 3 tables with a join
SELECT *
FROM couple d
INNER JOIN boys a ON d.boy = a.id
INNER JOIN girls b ON b.id = d.girl
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Code store
Socials
Facebook:
Facebook:
Twitter:
Discord:
If you really find this channel useful and enjoy the content, you're welcome to support me and this channel with a small donation via PayPal.
PayPal donation
0 Comments