¡El poder de los datos!
¡El poder de los datos!
Introducción a las bases de datos relacionales
Buenas prácticas de bases de datos con SQL
Tipos de datos en SQL
¿Cómo crear una base de datos en SQL?
Práctica: Tu primera consulta en bases de datos
Historia y Evolución de SQL
Práctica: Creación de Tablas en SQL (CREATE TABLE)
Manipulación de Datos
Insertando Datos con SQL (INSERT)
Consultas y Selecciones en SQL (SELECT)
Práctica: SELECT en SQL
Actualización de Datos con SQL (UPDATE)
Eliminación de Datos con SQL (DELETE)
Práctica: CRUD con SQL
Manipulación Avanzada de Datos
Instalación de MySQL Server y MySQL Workbench
¿Qué es la cláusula WHERE de SQL?
Filtrar y Ordenar Datos en SQL (LIKE)
Práctica: Filtrar Datos con WHERE en SQL
Cláusulas de Comparación Textual en SQL (AND, NULL, IN, NOT)
Funciones de Aritmética Básica en SQL (COUNT, SUM, AVG)
Funciones de Aritmética Básica en SQL (MIN, MAX)
Agrupación de Datos
Agrupación de Datos en SQL: GROUP BY, HAVING y CASE para Análisis Avanzado
Práctica: Agrupamiento y Ordenamiento de Datos
Tipos de JOIN en SQL
¿Cómo funciona INNER JOIN, LEFT JOIN, RIGHT JOIN y FULL JOIN?
Práctica: LEFT JOIN en SQL
Transformación de Datos
Vistas Materializadas en SQL: Como optimizar tus consultas y reportes.
Práctica: Crear Vistas Materializadas en SQL
Optimización de Bases de Datos con SQL: CREATE INDEX y TRIGGER
Vistas Materializadas y Temporales en SQL
Expresiones de Tablas Comunes (CTE) en SQL
Procedimientos Almacenados
Procedimientos Almacenados en SQL
Procedimientos Almacenados en SQL: Gestión de Variables y Manejo de Excepciones
Administración de Base de Datos
Respaldos y Restauración de Bases de Datos
Seguridad en Bases de Datos SQL
Análisis de Datos Avanzados
Potenciando los Datos en la Nube: Data Science, Big Data, ML e AI
SQL para Análisis de Datos: Primeros pasos con Power BI
You don't have access to this class
Keep learning! Join and start boosting your career
How to filter names by the initial letter in a table?
To display only the information of names starting with the letter "C", we can use the reserved word LIKE
in SQL. For example, if we want to see the names starting with "C", the query would be:
SELECT * FROM table WHERE name LIKE 'C%';
This will display all names that start with "C".
To display information for people whose last name ends in "O", the SQL query would be:
SELECT * FROM table WHERE last name LIKE '%O';
This will select all last names ending with the letter "O".
If we need to display information for people who have the letter "A" anywhere in their name, the query would be:
SELECT * FROM table WHERE name LIKE '%A%';
This will select all names that contain the letter "A" in any position.
LIKE
operator in SQL?To filter last names ending in "Z", we use the following query:
SELECT * FROM table WHERE last name LIKE '%Z';
For example, last names such as Perez, Gonzalez, Lopez, and Martinez will be selected.
To display names that begin with the letter "J", we modify the query as follows:
SELECT * FROM table WHERE name LIKE 'J%';
This will select names such as Jimenez.
No, it is not necessary. In complex queries or Big Data analysis, it is better to specify only the necessary columns. For example, to show only the first and last name of people aged 20, we use:
SELECT first_first_name, last_name FROM table WHERE age = 20;
Although we do not show the age in the SELECT
, we use it in the WHERE
condition.
To show people whose last name contains the letter "O", the query would be:
SELECT * FROM table WHERE last name LIKE '%O%';
This will select last names such as Gonzalez, Lopez, and Rodriguez.
If we want to see names starting with "M", people in their 20's, and with last names containing "O", the query would be:
SELECT first_name, last_name FROM tableWHERE first_name LIKE 'M%' AND age = 20 AND last_name LIKE '%O%';
This will filter specific data based on multiple criteria, optimizing the query and improving system performance.
Practicing these queries on different tables will improve your SQL skills and optimize your queries for more efficient data analysis.
Contributions 67
Questions 1
Want to see more contributions, questions and answers from the community?