SlideShare une entreprise Scribd logo
1  sur  4
Inner JOIN permite enlazar dos tablas
Usando JOIN permite enlazar o unir 2 tablas y como con es el INNER, pero en la consulta más tablas
ON usamos para unir los datos de las columnas (condición de unión)
Use tenebrosaOLTP………. BASE DE DATOS
Sin alias su función en la consulta es escribir todo completo la consulta
SELECT documento,tipodoc,nombre,cliente.cliente,personal FROM documento INNER JOIN cliente ON documento.cliente=cliente.cliente
Use tenebrosaOLTP………. BASE DE DATOS
Con alias su función es agilizar la consulta en escribir solo una letra inicial de cada tabla que estamos uniendo en la consulta
SELECT d.documento,d.tipodoc, c.nombre,c.cliente,d.personal FROM documento d INNER JOIN cliente c ON d.cliente=c.cliente
Conocer los clientes que no han comprado nada (EN ESTE CASO CLIENTE ESTA ANTES DE JOIN A LA IZQUIERDA)
SELECT C.nombre, C.direccion, D.fecha, D.documento
FROM cliente c LEFT JOIN Documento D ON D.cliente=C.cliente WHERE D.Fecha IS NULL
QUEREMOS CONOCER LOS CLIENTES QUE NUNCA HAN PEDIDO (EN ESTE CASO CLIENTE ESTA DESPUES DE JOIN A LA DERECHA)
SELECT c.cliente, c.nombre, p.pedido, p.fecha, p.formapago
FROM pedido P RIGHT JOIN cliente C ON C.cliente = P.cliente WHERE P.pedido IS NULL
algunas Gestion II Consultas.docx
algunas Gestion II Consultas.docx
algunas Gestion II Consultas.docx

Contenu connexe

Dernier

MÍNIMO COMÚN MÚLTIPLO, MÁXIMO COMÚN DIVISOR.pptx
MÍNIMO COMÚN MÚLTIPLO, MÁXIMO COMÚN DIVISOR.pptxMÍNIMO COMÚN MÚLTIPLO, MÁXIMO COMÚN DIVISOR.pptx
MÍNIMO COMÚN MÚLTIPLO, MÁXIMO COMÚN DIVISOR.pptxCristianCastro978067
 
Los más ricos administradores de fondo de cobertura (1968-2024).pdf
Los más ricos administradores de fondo de cobertura (1968-2024).pdfLos más ricos administradores de fondo de cobertura (1968-2024).pdf
Los más ricos administradores de fondo de cobertura (1968-2024).pdfJC Díaz Herrera
 
Panorama Sociodemográfico de México 2020: GUANAJUATO
Panorama Sociodemográfico de México 2020: GUANAJUATOPanorama Sociodemográfico de México 2020: GUANAJUATO
Panorama Sociodemográfico de México 2020: GUANAJUATOJuan Carlos Fonseca Mata
 
llllllllllllllllllllllllllllllllllllllllllllllllllllllllll
llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
llllllllllllllllllllllllllllllllllllllllllllllllllllllllllJulietaCarbajalOsis
 
COMUNICADO PARA TODO TIPO DE REUNIONES .
COMUNICADO PARA TODO TIPO DE REUNIONES .COMUNICADO PARA TODO TIPO DE REUNIONES .
COMUNICADO PARA TODO TIPO DE REUNIONES .GIANELAKAINACHALLCOJ2
 
Las familias más ricas del sionismo en el siglo XXI.pdf
Las familias más ricas del sionismo en el siglo XXI.pdfLas familias más ricas del sionismo en el siglo XXI.pdf
Las familias más ricas del sionismo en el siglo XXI.pdfJC Díaz Herrera
 
Tipos de Educacion en diferentes partes del mundo.pptx
Tipos de Educacion en diferentes partes del mundo.pptxTipos de Educacion en diferentes partes del mundo.pptx
Tipos de Educacion en diferentes partes del mundo.pptxMiguelPerz4
 
INFORME DE EVALUACIÓN DE LOS REQUERIMIENTOS.pdf
INFORME DE EVALUACIÓN DE LOS REQUERIMIENTOS.pdfINFORME DE EVALUACIÓN DE LOS REQUERIMIENTOS.pdf
INFORME DE EVALUACIÓN DE LOS REQUERIMIENTOS.pdfMiguelGomez900779
 
Los primeros 60 países por IDH en el año (2024).pdf
Los primeros 60 países por IDH en el año (2024).pdfLos primeros 60 países por IDH en el año (2024).pdf
Los primeros 60 países por IDH en el año (2024).pdfJC Díaz Herrera
 
CNEB-CURRICULO NACIONAL DE EDUCACION BASICA
CNEB-CURRICULO NACIONAL DE EDUCACION BASICACNEB-CURRICULO NACIONAL DE EDUCACION BASICA
CNEB-CURRICULO NACIONAL DE EDUCACION BASICAYOSHELINSARAIMAMANIS2
 
PIB PERÚ datos y análisis de los últimos años
PIB PERÚ datos y análisis de los últimos añosPIB PERÚ datos y análisis de los últimos años
PIB PERÚ datos y análisis de los últimos añosEstefaniaRojas54
 
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
 
presentacion de conjuntos para primaria.ppt
presentacion de conjuntos para primaria.pptpresentacion de conjuntos para primaria.ppt
presentacion de conjuntos para primaria.pptMelina Alama Visitacion
 
Triptico-del-Bullying qué es, cómo detectarlo, donde acudir
Triptico-del-Bullying qué es, cómo detectarlo, donde acudirTriptico-del-Bullying qué es, cómo detectarlo, donde acudir
Triptico-del-Bullying qué es, cómo detectarlo, donde acudirluis809799
 
Listas de Fundamentos de Programación 2024
Listas de Fundamentos de Programación 2024Listas de Fundamentos de Programación 2024
Listas de Fundamentos de Programación 2024AndrsReinosoSnchez1
 
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
 
Gestión Logística maria palmira guti cabajal
Gestión Logística maria palmira guti cabajalGestión Logística maria palmira guti cabajal
Gestión Logística maria palmira guti cabajalMarcosAlvarezSalinas
 
Qué es un Histograma estadístico teoria y problema
Qué es un Histograma estadístico teoria y problemaQué es un Histograma estadístico teoria y problema
Qué es un Histograma estadístico teoria y problemaJoellyAlejandraRodrg
 
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
 
Evolución de la fortuna de la familia Slim (1994-2024).pdf
Evolución de la fortuna de la familia Slim (1994-2024).pdfEvolución de la fortuna de la familia Slim (1994-2024).pdf
Evolución de la fortuna de la familia Slim (1994-2024).pdfJC Díaz Herrera
 

Dernier (20)

MÍNIMO COMÚN MÚLTIPLO, MÁXIMO COMÚN DIVISOR.pptx
MÍNIMO COMÚN MÚLTIPLO, MÁXIMO COMÚN DIVISOR.pptxMÍNIMO COMÚN MÚLTIPLO, MÁXIMO COMÚN DIVISOR.pptx
MÍNIMO COMÚN MÚLTIPLO, MÁXIMO COMÚN DIVISOR.pptx
 
Los más ricos administradores de fondo de cobertura (1968-2024).pdf
Los más ricos administradores de fondo de cobertura (1968-2024).pdfLos más ricos administradores de fondo de cobertura (1968-2024).pdf
Los más ricos administradores de fondo de cobertura (1968-2024).pdf
 
Panorama Sociodemográfico de México 2020: GUANAJUATO
Panorama Sociodemográfico de México 2020: GUANAJUATOPanorama Sociodemográfico de México 2020: GUANAJUATO
Panorama Sociodemográfico de México 2020: GUANAJUATO
 
llllllllllllllllllllllllllllllllllllllllllllllllllllllllll
llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
llllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 
COMUNICADO PARA TODO TIPO DE REUNIONES .
COMUNICADO PARA TODO TIPO DE REUNIONES .COMUNICADO PARA TODO TIPO DE REUNIONES .
COMUNICADO PARA TODO TIPO DE REUNIONES .
 
Las familias más ricas del sionismo en el siglo XXI.pdf
Las familias más ricas del sionismo en el siglo XXI.pdfLas familias más ricas del sionismo en el siglo XXI.pdf
Las familias más ricas del sionismo en el siglo XXI.pdf
 
Tipos de Educacion en diferentes partes del mundo.pptx
Tipos de Educacion en diferentes partes del mundo.pptxTipos de Educacion en diferentes partes del mundo.pptx
Tipos de Educacion en diferentes partes del mundo.pptx
 
INFORME DE EVALUACIÓN DE LOS REQUERIMIENTOS.pdf
INFORME DE EVALUACIÓN DE LOS REQUERIMIENTOS.pdfINFORME DE EVALUACIÓN DE LOS REQUERIMIENTOS.pdf
INFORME DE EVALUACIÓN DE LOS REQUERIMIENTOS.pdf
 
Los primeros 60 países por IDH en el año (2024).pdf
Los primeros 60 países por IDH en el año (2024).pdfLos primeros 60 países por IDH en el año (2024).pdf
Los primeros 60 países por IDH en el año (2024).pdf
 
CNEB-CURRICULO NACIONAL DE EDUCACION BASICA
CNEB-CURRICULO NACIONAL DE EDUCACION BASICACNEB-CURRICULO NACIONAL DE EDUCACION BASICA
CNEB-CURRICULO NACIONAL DE EDUCACION BASICA
 
PIB PERÚ datos y análisis de los últimos años
PIB PERÚ datos y análisis de los últimos añosPIB PERÚ datos y análisis de los últimos años
PIB PERÚ datos y análisis de los últimos años
 
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
 
presentacion de conjuntos para primaria.ppt
presentacion de conjuntos para primaria.pptpresentacion de conjuntos para primaria.ppt
presentacion de conjuntos para primaria.ppt
 
Triptico-del-Bullying qué es, cómo detectarlo, donde acudir
Triptico-del-Bullying qué es, cómo detectarlo, donde acudirTriptico-del-Bullying qué es, cómo detectarlo, donde acudir
Triptico-del-Bullying qué es, cómo detectarlo, donde acudir
 
Listas de Fundamentos de Programación 2024
Listas de Fundamentos de Programación 2024Listas de Fundamentos de Programación 2024
Listas de Fundamentos de Programación 2024
 
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
 
Gestión Logística maria palmira guti cabajal
Gestión Logística maria palmira guti cabajalGestión Logística maria palmira guti cabajal
Gestión Logística maria palmira guti cabajal
 
Qué es un Histograma estadístico teoria y problema
Qué es un Histograma estadístico teoria y problemaQué es un Histograma estadístico teoria y problema
Qué es un Histograma estadístico teoria y problema
 
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
 
Evolución de la fortuna de la familia Slim (1994-2024).pdf
Evolución de la fortuna de la familia Slim (1994-2024).pdfEvolución de la fortuna de la familia Slim (1994-2024).pdf
Evolución de la fortuna de la familia Slim (1994-2024).pdf
 

En vedette

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
 

En vedette (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...
 

algunas Gestion II Consultas.docx

  • 1. Inner JOIN permite enlazar dos tablas Usando JOIN permite enlazar o unir 2 tablas y como con es el INNER, pero en la consulta más tablas ON usamos para unir los datos de las columnas (condición de unión) Use tenebrosaOLTP………. BASE DE DATOS Sin alias su función en la consulta es escribir todo completo la consulta SELECT documento,tipodoc,nombre,cliente.cliente,personal FROM documento INNER JOIN cliente ON documento.cliente=cliente.cliente Use tenebrosaOLTP………. BASE DE DATOS Con alias su función es agilizar la consulta en escribir solo una letra inicial de cada tabla que estamos uniendo en la consulta SELECT d.documento,d.tipodoc, c.nombre,c.cliente,d.personal FROM documento d INNER JOIN cliente c ON d.cliente=c.cliente Conocer los clientes que no han comprado nada (EN ESTE CASO CLIENTE ESTA ANTES DE JOIN A LA IZQUIERDA) SELECT C.nombre, C.direccion, D.fecha, D.documento FROM cliente c LEFT JOIN Documento D ON D.cliente=C.cliente WHERE D.Fecha IS NULL QUEREMOS CONOCER LOS CLIENTES QUE NUNCA HAN PEDIDO (EN ESTE CASO CLIENTE ESTA DESPUES DE JOIN A LA DERECHA) SELECT c.cliente, c.nombre, p.pedido, p.fecha, p.formapago FROM pedido P RIGHT JOIN cliente C ON C.cliente = P.cliente WHERE P.pedido IS NULL