Null values
Parte de la sección Fundamentos del Journey de SQL de Coddy — lección 12 de 72.
En el mundo real, podríamos tener campos sin valores. Un campo sin valor se llama null.
Podemos manipular nuestra consulta usando IS NULL o IS NOT NULL para obtener datos relevantes
Por ejemplo, la siguiente consulta devolverá todos los registros donde col1 no tiene valor:
SELECT *
FROM table1
WHERE col1 IS NULLDesafío
FácilTablas y columnas disponibles:
<strong>people</strong>:<strong>name</strong>
Obtén todos los nombres únicos sin valores NULL.
Hoja de referencia
Utiliza IS NULL y IS NOT NULL para filtrar registros basados en valores faltantes:
SELECT *
FROM table1
WHERE col1 IS NULLSELECT *
FROM table1
WHERE col1 IS NOT NULLPruébalo tú mismo
Esta lección incluye un breve cuestionario. Empieza la lección para responderlo y registrar tu progreso.
Todas las lecciones de Fundamentos
4More Keywords
The IN keywordThe BETWEEN keywordThe LIKE keywordThe AS keywordRecap - Cellphone Models2Conditions
Conditions BasicsThe AND keywordThe OR keywordThe NOT keywordMultiple Conditions CombinedParenthesisBooleans5Arithmetic Operations
Mathematical OperatorsMathematical ColumnsThe Modulo OperationThe ROUND() Function3Specific Return Format
Null valuesSort Results Part 1Sort Results Part 2Recap - Cyber Security FirmLimit number of recordsRecap - Vehicle Factory6Intro Challenges
Recap - Parliamentary ElectionRecap - Police Criminal ArrestRecap - Bar Beverage ContainerRecap - Engineer new columns