SlideShare una empresa de Scribd logo
1 de 8
Diplomado
Base de Datos en SQL Server
Docente:
Ing. Marino Junior Dicent Gil
Módulo IV:
Relación de Múltiples Tablas
Diplomado SQL Server
Relación de Múltiples Tablas
Cláusula JOIN
Left Join / Right Join
Full Join
Diplomado SQL Server
Relación de Múltiples Tablas
Diplomado SQL Server
Las combinaciones internas se realizan mediante la
instrucción INNER JOIN. Devuelven únicamente aquellos
registros/filas que tienen valores idénticos en los dos
campos que se comparan para unir ambas tablas. Es decir
aquellas que tienen elementos en las dos tablas,
identificados éstos por el campo de relación.
Su sintaxis es:
FROM Tabla1 [INNER] JOIN Tabla2
ON Condiciones_Vinculos_Tablas
Relación de Múltiples Tablas – INNER JOIN
Diplomado SQL Server
Se obtienen todas las filas de la tabla colocada a la
izquierda, aunque no tengan correspondencia en la tabla de
la derecha.
Su sintaxis es:
SELECT T1.Col1, T1.Col2, T2.Col7
FROM Tabla1 T1 LEFT JOIN Tabla2 T2
ON T1.Col1 = T2.Col1
Relación de Múltiples Tablas – LEFT JOIN
Diplomado SQL Server
Usando RIGHT JOIN se obtienen todas las filas de la tabla de
la derecha, aunque no tengan correspondencia en la tabla
de la izquierda.
Su sintaxis es:
SELECT T1.Col1, T1.Col2, T2.Col7
FROM Tabla1 T1 RIGHT JOIN Tabla2
T2 ON T1.Col1 = T2.Col1
Relación de Múltiples Tablas – RIGHT JOIN
Diplomado SQL Server
Se obtienen todas las filas en ambas tablas, aunque no
tengan correspondencia en la otra tabla. Es decir, todos los
registros de A y de B aunque no haya correspondencia entre
ellos, rellenando con nulos los campos que falten.
Su sintaxis es:
SELECT T1.Col1, T1.Col2, T2.Col7
FROM Tabla1 T1 FULL JOIN Tabla2 T2
ON T1.Col1 = T2.Col1
Relación de Múltiples Tablas – FULL JOIN
Dicent & Mendoza (2018)
Cierre y Agradecimientos

Más contenido relacionado

Último

Unidad 3 Elementos y compuestos. Física y química
Unidad 3 Elementos y compuestos. Física y químicaUnidad 3 Elementos y compuestos. Física y química
Unidad 3 Elementos y compuestos. Física y químicaSilvia García
 
Familias más ricas de países de AL en inicio de su hegemonía (2024).pdf
Familias más ricas de países de AL en inicio de su hegemonía (2024).pdfFamilias más ricas de países de AL en inicio de su hegemonía (2024).pdf
Familias más ricas de países de AL en inicio de su hegemonía (2024).pdfJC Díaz Herrera
 
Biografías y Cuadro compartivo_Cuautle Ocelotl Angel Efren.pdf.pdf
Biografías y Cuadro compartivo_Cuautle Ocelotl Angel Efren.pdf.pdfBiografías y Cuadro compartivo_Cuautle Ocelotl Angel Efren.pdf.pdf
Biografías y Cuadro compartivo_Cuautle Ocelotl Angel Efren.pdf.pdfANGELEFRENCUAUTLEOCE
 
triptico-de-las-drogas en la adolescencia
triptico-de-las-drogas en la adolescenciatriptico-de-las-drogas en la adolescencia
triptico-de-las-drogas en la adolescenciaferg6120
 
Posiciones de México en el PNB PPA per cápita (1982-2024).pdf
Posiciones de México en el PNB PPA per cápita (1982-2024).pdfPosiciones de México en el PNB PPA per cápita (1982-2024).pdf
Posiciones de México en el PNB PPA per cápita (1982-2024).pdfJC Díaz Herrera
 
Familias_más_ricas_de_AL_en_la_historia.pdf
Familias_más_ricas_de_AL_en_la_historia.pdfFamilias_más_ricas_de_AL_en_la_historia.pdf
Familias_más_ricas_de_AL_en_la_historia.pdfJC Díaz Herrera
 
SUNEDU - Superintendencia Nacional de Educación superior Universitaria
SUNEDU - Superintendencia Nacional de Educación superior UniversitariaSUNEDU - Superintendencia Nacional de Educación superior Universitaria
SUNEDU - Superintendencia Nacional de Educación superior Universitariachayananazcosimeon
 
2 PROCESO ESTADISTICO PARA LA INVESTIGACION.pdf
2 PROCESO ESTADISTICO PARA LA INVESTIGACION.pdf2 PROCESO ESTADISTICO PARA LA INVESTIGACION.pdf
2 PROCESO ESTADISTICO PARA LA INVESTIGACION.pdfAnaBelindaArmellonHi
 
La importancia de las pruebas de producto para tu empresa
La importancia de las pruebas de producto para tu empresaLa importancia de las pruebas de producto para tu empresa
La importancia de las pruebas de producto para tu empresamerca6
 
Posiciones en el IDH global de EUA (1950-2024).pdf
Posiciones en el IDH global de EUA (1950-2024).pdfPosiciones en el IDH global de EUA (1950-2024).pdf
Posiciones en el IDH global de EUA (1950-2024).pdfJC Díaz Herrera
 
Industria musical de EUA vs Industria musical Corea del Sur (2024).pdf
Industria musical de EUA vs Industria musical Corea del Sur (2024).pdfIndustria musical de EUA vs Industria musical Corea del Sur (2024).pdf
Industria musical de EUA vs Industria musical Corea del Sur (2024).pdfJC Díaz Herrera
 
PANTEÓN DE Paris en historia de la arquitectura
PANTEÓN DE Paris en historia de la arquitecturaPANTEÓN DE Paris en historia de la arquitectura
PANTEÓN DE Paris en historia de la arquitecturaRosaHurtado26
 
Reducción de la pobreza en Sexenio de AMLO (2018-2024).pdf
Reducción de la pobreza en Sexenio de AMLO (2018-2024).pdfReducción de la pobreza en Sexenio de AMLO (2018-2024).pdf
Reducción de la pobreza en Sexenio de AMLO (2018-2024).pdfJC Díaz Herrera
 
Las marcas automotrices con más ventas de vehículos (2024).pdf
Las marcas automotrices con más ventas de vehículos (2024).pdfLas marcas automotrices con más ventas de vehículos (2024).pdf
Las marcas automotrices con más ventas de vehículos (2024).pdfJC Díaz Herrera
 
Análisis de datos en acción: Optimizando el crecimiento de Cyclistic
Análisis de datos en acción: Optimizando el crecimiento de CyclisticAnálisis de datos en acción: Optimizando el crecimiento de Cyclistic
Análisis de datos en acción: Optimizando el crecimiento de CyclisticJamithGarcia1
 
Cuáles son las características biológicas que están marcadas en tu individual...
Cuáles son las características biológicas que están marcadas en tu individual...Cuáles son las características biológicas que están marcadas en tu individual...
Cuáles son las características biológicas que están marcadas en tu individual...israel garcia
 
Novelas Turcas vs Series de EUA en audiencia (2024).pdf
Novelas Turcas vs Series de EUA en audiencia  (2024).pdfNovelas Turcas vs Series de EUA en audiencia  (2024).pdf
Novelas Turcas vs Series de EUA en audiencia (2024).pdfJC Díaz Herrera
 
Posiciones_del_sionismo_en_los_imperios globales de la humanidad (2024).pdf
Posiciones_del_sionismo_en_los_imperios globales de la humanidad (2024).pdfPosiciones_del_sionismo_en_los_imperios globales de la humanidad (2024).pdf
Posiciones_del_sionismo_en_los_imperios globales de la humanidad (2024).pdfJC Díaz Herrera
 
REPORTE DE INCIDENCIA DELICTIVA MARZO 2024.pdf
REPORTE DE INCIDENCIA DELICTIVA MARZO 2024.pdfREPORTE DE INCIDENCIA DELICTIVA MARZO 2024.pdf
REPORTE DE INCIDENCIA DELICTIVA MARZO 2024.pdfIrapuatoCmovamos
 
Premios_nobel_por_grupo_racial_ (2024).pdf
Premios_nobel_por_grupo_racial_ (2024).pdfPremios_nobel_por_grupo_racial_ (2024).pdf
Premios_nobel_por_grupo_racial_ (2024).pdfJC Díaz Herrera
 

Último (20)

Unidad 3 Elementos y compuestos. Física y química
Unidad 3 Elementos y compuestos. Física y químicaUnidad 3 Elementos y compuestos. Física y química
Unidad 3 Elementos y compuestos. Física y química
 
Familias más ricas de países de AL en inicio de su hegemonía (2024).pdf
Familias más ricas de países de AL en inicio de su hegemonía (2024).pdfFamilias más ricas de países de AL en inicio de su hegemonía (2024).pdf
Familias más ricas de países de AL en inicio de su hegemonía (2024).pdf
 
Biografías y Cuadro compartivo_Cuautle Ocelotl Angel Efren.pdf.pdf
Biografías y Cuadro compartivo_Cuautle Ocelotl Angel Efren.pdf.pdfBiografías y Cuadro compartivo_Cuautle Ocelotl Angel Efren.pdf.pdf
Biografías y Cuadro compartivo_Cuautle Ocelotl Angel Efren.pdf.pdf
 
triptico-de-las-drogas en la adolescencia
triptico-de-las-drogas en la adolescenciatriptico-de-las-drogas en la adolescencia
triptico-de-las-drogas en la adolescencia
 
Posiciones de México en el PNB PPA per cápita (1982-2024).pdf
Posiciones de México en el PNB PPA per cápita (1982-2024).pdfPosiciones de México en el PNB PPA per cápita (1982-2024).pdf
Posiciones de México en el PNB PPA per cápita (1982-2024).pdf
 
Familias_más_ricas_de_AL_en_la_historia.pdf
Familias_más_ricas_de_AL_en_la_historia.pdfFamilias_más_ricas_de_AL_en_la_historia.pdf
Familias_más_ricas_de_AL_en_la_historia.pdf
 
SUNEDU - Superintendencia Nacional de Educación superior Universitaria
SUNEDU - Superintendencia Nacional de Educación superior UniversitariaSUNEDU - Superintendencia Nacional de Educación superior Universitaria
SUNEDU - Superintendencia Nacional de Educación superior Universitaria
 
2 PROCESO ESTADISTICO PARA LA INVESTIGACION.pdf
2 PROCESO ESTADISTICO PARA LA INVESTIGACION.pdf2 PROCESO ESTADISTICO PARA LA INVESTIGACION.pdf
2 PROCESO ESTADISTICO PARA LA INVESTIGACION.pdf
 
La importancia de las pruebas de producto para tu empresa
La importancia de las pruebas de producto para tu empresaLa importancia de las pruebas de producto para tu empresa
La importancia de las pruebas de producto para tu empresa
 
Posiciones en el IDH global de EUA (1950-2024).pdf
Posiciones en el IDH global de EUA (1950-2024).pdfPosiciones en el IDH global de EUA (1950-2024).pdf
Posiciones en el IDH global de EUA (1950-2024).pdf
 
Industria musical de EUA vs Industria musical Corea del Sur (2024).pdf
Industria musical de EUA vs Industria musical Corea del Sur (2024).pdfIndustria musical de EUA vs Industria musical Corea del Sur (2024).pdf
Industria musical de EUA vs Industria musical Corea del Sur (2024).pdf
 
PANTEÓN DE Paris en historia de la arquitectura
PANTEÓN DE Paris en historia de la arquitecturaPANTEÓN DE Paris en historia de la arquitectura
PANTEÓN DE Paris en historia de la arquitectura
 
Reducción de la pobreza en Sexenio de AMLO (2018-2024).pdf
Reducción de la pobreza en Sexenio de AMLO (2018-2024).pdfReducción de la pobreza en Sexenio de AMLO (2018-2024).pdf
Reducción de la pobreza en Sexenio de AMLO (2018-2024).pdf
 
Las marcas automotrices con más ventas de vehículos (2024).pdf
Las marcas automotrices con más ventas de vehículos (2024).pdfLas marcas automotrices con más ventas de vehículos (2024).pdf
Las marcas automotrices con más ventas de vehículos (2024).pdf
 
Análisis de datos en acción: Optimizando el crecimiento de Cyclistic
Análisis de datos en acción: Optimizando el crecimiento de CyclisticAnálisis de datos en acción: Optimizando el crecimiento de Cyclistic
Análisis de datos en acción: Optimizando el crecimiento de Cyclistic
 
Cuáles son las características biológicas que están marcadas en tu individual...
Cuáles son las características biológicas que están marcadas en tu individual...Cuáles son las características biológicas que están marcadas en tu individual...
Cuáles son las características biológicas que están marcadas en tu individual...
 
Novelas Turcas vs Series de EUA en audiencia (2024).pdf
Novelas Turcas vs Series de EUA en audiencia  (2024).pdfNovelas Turcas vs Series de EUA en audiencia  (2024).pdf
Novelas Turcas vs Series de EUA en audiencia (2024).pdf
 
Posiciones_del_sionismo_en_los_imperios globales de la humanidad (2024).pdf
Posiciones_del_sionismo_en_los_imperios globales de la humanidad (2024).pdfPosiciones_del_sionismo_en_los_imperios globales de la humanidad (2024).pdf
Posiciones_del_sionismo_en_los_imperios globales de la humanidad (2024).pdf
 
REPORTE DE INCIDENCIA DELICTIVA MARZO 2024.pdf
REPORTE DE INCIDENCIA DELICTIVA MARZO 2024.pdfREPORTE DE INCIDENCIA DELICTIVA MARZO 2024.pdf
REPORTE DE INCIDENCIA DELICTIVA MARZO 2024.pdf
 
Premios_nobel_por_grupo_racial_ (2024).pdf
Premios_nobel_por_grupo_racial_ (2024).pdfPremios_nobel_por_grupo_racial_ (2024).pdf
Premios_nobel_por_grupo_racial_ (2024).pdf
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Diplomado SQL Server Relación de Múltiples Tablas Cláusula JOIN

  • 1. Diplomado Base de Datos en SQL Server Docente: Ing. Marino Junior Dicent Gil
  • 2. Módulo IV: Relación de Múltiples Tablas Diplomado SQL Server Relación de Múltiples Tablas Cláusula JOIN Left Join / Right Join Full Join
  • 3. Diplomado SQL Server Relación de Múltiples Tablas
  • 4. Diplomado SQL Server Las combinaciones internas se realizan mediante la instrucción INNER JOIN. Devuelven únicamente aquellos registros/filas que tienen valores idénticos en los dos campos que se comparan para unir ambas tablas. Es decir aquellas que tienen elementos en las dos tablas, identificados éstos por el campo de relación. Su sintaxis es: FROM Tabla1 [INNER] JOIN Tabla2 ON Condiciones_Vinculos_Tablas Relación de Múltiples Tablas – INNER JOIN
  • 5. Diplomado SQL Server Se obtienen todas las filas de la tabla colocada a la izquierda, aunque no tengan correspondencia en la tabla de la derecha. Su sintaxis es: SELECT T1.Col1, T1.Col2, T2.Col7 FROM Tabla1 T1 LEFT JOIN Tabla2 T2 ON T1.Col1 = T2.Col1 Relación de Múltiples Tablas – LEFT JOIN
  • 6. Diplomado SQL Server Usando RIGHT JOIN se obtienen todas las filas de la tabla de la derecha, aunque no tengan correspondencia en la tabla de la izquierda. Su sintaxis es: SELECT T1.Col1, T1.Col2, T2.Col7 FROM Tabla1 T1 RIGHT JOIN Tabla2 T2 ON T1.Col1 = T2.Col1 Relación de Múltiples Tablas – RIGHT JOIN
  • 7. Diplomado SQL Server Se obtienen todas las filas en ambas tablas, aunque no tengan correspondencia en la otra tabla. Es decir, todos los registros de A y de B aunque no haya correspondencia entre ellos, rellenando con nulos los campos que falten. Su sintaxis es: SELECT T1.Col1, T1.Col2, T2.Col7 FROM Tabla1 T1 FULL JOIN Tabla2 T2 ON T1.Col1 = T2.Col1 Relación de Múltiples Tablas – FULL JOIN
  • 8. Dicent & Mendoza (2018) Cierre y Agradecimientos