0% found this document useful (0 votes)
44 views2 pages

Consulta Multiples Tablas

The document discusses inner joins in SQL queries to retrieve data from multiple tables. An example query is provided that uses an inner join to select the buyer_name, buyer_id, and qty columns from the buyers and sales tables where the buyers.buyer_id and sales.buyer_id columns match. The result set combines the matched rows and displays the buyer information alongside the associated quantities from the sales table.

Uploaded by

juan992276377
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views2 pages

Consulta Multiples Tablas

The document discusses inner joins in SQL queries to retrieve data from multiple tables. An example query is provided that uses an inner join to select the buyer_name, buyer_id, and qty columns from the buyers and sales tables where the buyers.buyer_id and sales.buyer_id columns match. The result set combines the matched rows and displays the buyer information alongside the associated quantities from the sales table.

Uploaded by

juan992276377
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Consultas a Mltiples Tablas

Inner Joins
USE Neptuno SELECT buyer_name, sales.buyer_id, qty FROM buyers INNER JOIN sales ON buyers.buyer_id = sales.buyer_id

buyers
buyer_name buyer_id Adam Barr Sean Chai Eva Corets Erin OMelia 1 2 3 4 1 1 4 3

sales
buyer_id prod_id 2 3 1 5 qty 15 5 37 11

Result
buyer_name buyer_id Adam Barr Adam Barr Erin OMelia Eva Corets Erin OMelia 1 1 4 3 4 qty 15 5 37 11 1003

1003

You might also like