Advertisement

SQL select from multiple tables(two and more)

SQL select from multiple tables(two and more) Code and details:

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

query multiple tables sql,query multiple tables,mysql query 2 tables,mysql query 3 tables join,mysql joins,mysql joins tutorials,mysql joins explained,mysql joins tutorial for beginners,mysql joins with examples,mysql queries advanced,mysql query multiple tables,

Post a Comment

0 Comments