SlideShare una empresa de Scribd logo
1 de 7
Funciones de números y
caracteres
LUIS EDUARDO SANTILLAN 6 “A”
Base de Datos I
 Funciones SQL
Existen dos tipos de funciones:
Funciones a nivel de fila. Tipos:
Carácter
Número
Fecha
Conversión
Funciones a nivel de grupo. Tipos:
Manipulan grupos de filas y devuelven un resultado por cada uno de ellos.
 Funciones de Caracteres
De manipulación de caracteres:
CONCAT
SUBSTR
LENGTH
INSTR
LPAD Y RPAD
De conversión:
LOWER , UPPER e INITCAP
 Funciones de conversión caracteres
LOWER: Convierte a minúsculas.
UPPER: Convierte a mayúsculas.
INITCAP:Convierte la primera letra de cada palabra en mayúsculas, y el resto en
minúscula.
Atención: Usar una función de conversión dentro de la cláusula WHERE puede ser
altamente ineficiente porque si la columna afectada forma parte de un índice
éste lo
desactiva, provocando un bajo rendimiento.
 Funciones manipulación caracteres
CONCAT: Concatena dos valores.
SUBSTR: Extrae una subcadena.
LENGTH: Devuelve la longitud de la cadena.
INSTR: Devuelve la posición de un carácter o subcadena.
LPAD: Justifica a la derecha la cadena.
RPAD: Justifica a la izquierda la cadena.
 Funciones Numéricas
ROUND (columna | expresión, n)
Redondea a n posiciones decimales. Si se omite n, no se redondea con decimales.
Si n es negativo, los números a la izquierda del punto decimal se redondean a
decenas, centenas
TRUNC (columna | expresión, n)
Trunca en la enésima posición decimal. Si se omite n, sin lugares decimales. Si n
es negativo, los números a la izquierda del punto decimal se truncan a cero.
MOD (m, n)
Devuelve el resto de la división de m por n.

Más contenido relacionado

Último

Escucha tu Cerebro en Nuevos Escenarios PE3 Ccesa007.pdf
Escucha tu Cerebro en Nuevos Escenarios  PE3  Ccesa007.pdfEscucha tu Cerebro en Nuevos Escenarios  PE3  Ccesa007.pdf
Escucha tu Cerebro en Nuevos Escenarios PE3 Ccesa007.pdf
Demetrio Ccesa Rayme
 
Estrategia Nacional de Refuerzo Escolar SJA Ccesa007.pdf
Estrategia Nacional de Refuerzo Escolar  SJA  Ccesa007.pdfEstrategia Nacional de Refuerzo Escolar  SJA  Ccesa007.pdf
Estrategia Nacional de Refuerzo Escolar SJA Ccesa007.pdf
Demetrio Ccesa Rayme
 

Último (20)

Época colonial: vestimenta, costumbres y juegos de la época
Época colonial: vestimenta, costumbres y juegos de la épocaÉpoca colonial: vestimenta, costumbres y juegos de la época
Época colonial: vestimenta, costumbres y juegos de la época
 
Escucha tu Cerebro en Nuevos Escenarios PE3 Ccesa007.pdf
Escucha tu Cerebro en Nuevos Escenarios  PE3  Ccesa007.pdfEscucha tu Cerebro en Nuevos Escenarios  PE3  Ccesa007.pdf
Escucha tu Cerebro en Nuevos Escenarios PE3 Ccesa007.pdf
 
TEMA EGIPTO.pdf. Presentación civilización
TEMA EGIPTO.pdf. Presentación civilizaciónTEMA EGIPTO.pdf. Presentación civilización
TEMA EGIPTO.pdf. Presentación civilización
 
Sesión de clase Motivados por la esperanza.pdf
Sesión de clase Motivados por la esperanza.pdfSesión de clase Motivados por la esperanza.pdf
Sesión de clase Motivados por la esperanza.pdf
 
ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLA
ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLAACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLA
ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLA
 
Diapositivas unidad de trabajo 7 sobre Coloración temporal y semipermanente
Diapositivas unidad de trabajo 7 sobre Coloración temporal y semipermanenteDiapositivas unidad de trabajo 7 sobre Coloración temporal y semipermanente
Diapositivas unidad de trabajo 7 sobre Coloración temporal y semipermanente
 
3. ELEMENTOS QUE SE EMPLEAN EN LAS ESTRUCTURAS.pptx
3. ELEMENTOS QUE SE EMPLEAN EN LAS ESTRUCTURAS.pptx3. ELEMENTOS QUE SE EMPLEAN EN LAS ESTRUCTURAS.pptx
3. ELEMENTOS QUE SE EMPLEAN EN LAS ESTRUCTURAS.pptx
 
Realitat o fake news? – Què causa el canvi climàtic? - La desertització
Realitat o fake news? – Què causa el canvi climàtic? - La desertitzacióRealitat o fake news? – Què causa el canvi climàtic? - La desertització
Realitat o fake news? – Què causa el canvi climàtic? - La desertització
 
Botiquin del amor - Plantillas digitales.pdf
Botiquin del amor - Plantillas digitales.pdfBotiquin del amor - Plantillas digitales.pdf
Botiquin del amor - Plantillas digitales.pdf
 
Estrategia Nacional de Refuerzo Escolar SJA Ccesa007.pdf
Estrategia Nacional de Refuerzo Escolar  SJA  Ccesa007.pdfEstrategia Nacional de Refuerzo Escolar  SJA  Ccesa007.pdf
Estrategia Nacional de Refuerzo Escolar SJA Ccesa007.pdf
 
tema 6 2eso 2024. Ciencias Sociales. El final de la Edad Media en la Penínsul...
tema 6 2eso 2024. Ciencias Sociales. El final de la Edad Media en la Penínsul...tema 6 2eso 2024. Ciencias Sociales. El final de la Edad Media en la Penínsul...
tema 6 2eso 2024. Ciencias Sociales. El final de la Edad Media en la Penínsul...
 
SESION DE APRENDIZAJE PARA3ER GRADO -EL SISTEMA DIGESTIVO
SESION DE APRENDIZAJE PARA3ER GRADO -EL SISTEMA DIGESTIVOSESION DE APRENDIZAJE PARA3ER GRADO -EL SISTEMA DIGESTIVO
SESION DE APRENDIZAJE PARA3ER GRADO -EL SISTEMA DIGESTIVO
 
El Futuro de la Educacion Digital JS1 Ccesa007.pdf
El Futuro de la Educacion Digital  JS1  Ccesa007.pdfEl Futuro de la Educacion Digital  JS1  Ccesa007.pdf
El Futuro de la Educacion Digital JS1 Ccesa007.pdf
 
Evaluación de los Factores Externos de la Organización.
Evaluación de los Factores Externos de la Organización.Evaluación de los Factores Externos de la Organización.
Evaluación de los Factores Externos de la Organización.
 
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesis
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesisnovelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesis
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesis
 
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docx
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docxcuadernillo_cuentos_de_los_valores_elprofe20 (1).docx
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docx
 
4. MATERIALES QUE SE EMPLEAN EN LAS ESTRUCTURAS.pptx
4. MATERIALES QUE SE EMPLEAN EN LAS ESTRUCTURAS.pptx4. MATERIALES QUE SE EMPLEAN EN LAS ESTRUCTURAS.pptx
4. MATERIALES QUE SE EMPLEAN EN LAS ESTRUCTURAS.pptx
 
Realitat o fake news? – Què causa el canvi climàtic? - Modificacions dels pat...
Realitat o fake news? – Què causa el canvi climàtic? - Modificacions dels pat...Realitat o fake news? – Què causa el canvi climàtic? - Modificacions dels pat...
Realitat o fake news? – Què causa el canvi climàtic? - Modificacions dels pat...
 
ACERTIJO CÁLCULOS MATEMÁGICOS EN LA CARRERA OLÍMPICA. Por JAVIER SOLIS NOYOLA
ACERTIJO CÁLCULOS MATEMÁGICOS EN LA CARRERA OLÍMPICA. Por JAVIER SOLIS NOYOLAACERTIJO CÁLCULOS MATEMÁGICOS EN LA CARRERA OLÍMPICA. Por JAVIER SOLIS NOYOLA
ACERTIJO CÁLCULOS MATEMÁGICOS EN LA CARRERA OLÍMPICA. Por JAVIER SOLIS NOYOLA
 
Síndrome piramidal 2024 según alvarez, farrera y wuani
Síndrome piramidal 2024 según alvarez, farrera y wuaniSíndrome piramidal 2024 según alvarez, farrera y wuani
Síndrome piramidal 2024 según alvarez, farrera y wuani
 

Destacado

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
ThinkNow
 
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
Kurio // The Social Media Age(ncy)
 

Destacado (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Funciones num caraceres-bdd1

  • 1. Funciones de números y caracteres LUIS EDUARDO SANTILLAN 6 “A” Base de Datos I
  • 2.
  • 3.  Funciones SQL Existen dos tipos de funciones: Funciones a nivel de fila. Tipos: Carácter Número Fecha Conversión Funciones a nivel de grupo. Tipos: Manipulan grupos de filas y devuelven un resultado por cada uno de ellos.
  • 4.  Funciones de Caracteres De manipulación de caracteres: CONCAT SUBSTR LENGTH INSTR LPAD Y RPAD De conversión: LOWER , UPPER e INITCAP
  • 5.  Funciones de conversión caracteres LOWER: Convierte a minúsculas. UPPER: Convierte a mayúsculas. INITCAP:Convierte la primera letra de cada palabra en mayúsculas, y el resto en minúscula. Atención: Usar una función de conversión dentro de la cláusula WHERE puede ser altamente ineficiente porque si la columna afectada forma parte de un índice éste lo desactiva, provocando un bajo rendimiento.
  • 6.  Funciones manipulación caracteres CONCAT: Concatena dos valores. SUBSTR: Extrae una subcadena. LENGTH: Devuelve la longitud de la cadena. INSTR: Devuelve la posición de un carácter o subcadena. LPAD: Justifica a la derecha la cadena. RPAD: Justifica a la izquierda la cadena.
  • 7.  Funciones Numéricas ROUND (columna | expresión, n) Redondea a n posiciones decimales. Si se omite n, no se redondea con decimales. Si n es negativo, los números a la izquierda del punto decimal se redondean a decenas, centenas TRUNC (columna | expresión, n) Trunca en la enésima posición decimal. Si se omite n, sin lugares decimales. Si n es negativo, los números a la izquierda del punto decimal se truncan a cero. MOD (m, n) Devuelve el resto de la división de m por n.