- SELECT - Fetch specific column(s) from a table
SELECT - Buscar coluna (s) específica (s) de uma tabela
SELECT column_name1
, column_name2, ...
FROM table_name;
- SELECT - Fetch all columns from a table
SELECT - busca todas as colunas de uma tabela
SELECT *
FROM table_name;
- SELECT DISTINCT - Selects only the DISTINCT column values from the table.
SELECT DISTINCT - Seleciona apenas os valores da coluna DISTINCT da tabela
SELECT DISTINCT column_name1
FROM table_name;
- SELECT COUNT(DISTINCT) - lists the number of different (distinct) value in the table column.
COUNT (DISTINCT) - lista o número de valores diferentes na coluna da tabela
SELECT COUNT(DISTINCT column_name)
FROM table_name;
- WHERE - Fetch records based on text field(s) in where clause
WHERE - Buscar registros com base no (s) campo (s) de texto na cláusula where
SELECT * FROM table_name
WHERE column_name = 'text_value';
- WHERE - Fetch records based on numeric field(s) in where clause
WHERE - Buscar registros com base em campo (s) numérico (s) na cláusula where
SELECT * FROM table_name
WHERE column_name = numeric_value;
- AND operator in WHERE clause
Operador AND na cláusula WHERE
SELECT * FROM table_name
WHERE column_name1 = numeric_value
AND column_name2 = numeric_value;
- OR operator in WHERE clause
Operador OR na cláusula WHERE
SELECT * FROM table_name
WHERE column_name1 = numeric_value
OR column_name2 = numeric_value;
- NOT operator in WHERE clause
Operador NOT na cláusula WHERE
SELECT * FROM table_name
WHERE NOT column_name = numeric_value;
- AND/OR operator in WHERE clause
Operador AND/OR na cláusula WHERE
SELECT * FROM table_name
WHERE column_name1 = numeric_value1
AND (column_name2 = numeric_value2
OR column_name3 = numeric_value3);
- ORDER BY - Sort the record in ascending order
ORDER BY - Classifica o registro em ordem crescente
SELECT *
FROM table_name
ORDER BY column_name;
- ORDER BY - Sort the record in descending order
ORDER BY - Classifica o registro em ordem decrescente
SELECT *
FROM table_name
ORDER BY column_name DESC;
- ORDER BY - Sort the record in ascending order by multiple columns
ORDER BY - Classifica o registro em ordem crescente por várias colunas
SELECT * FROM table_name
ORDER BY column_name1
, column_name2;
- ORDER BY - Sort the record in descending order by multiple columns
ORDER BY - Classifica o registro em ordem decrescente por várias colunas
SELECT *
FROM table_name
ORDER BY column_name1 DESC,
column_name2 DESC;
- INSERT INTO - Insert data into all columns in a row
INSERT INTO - Insere dados em todas as colunas em uma linha
INSERT INTO table_name
VALUES ('text_value1'
, 'text_value2',numeric_value
, 'text_value3');
- INSERT INTO - Insert data into specific column in a row
INSERT INTO - Insere dados em uma coluna específica em uma linha
INSERT INTO table_name (column_name1
, column_name2
, column_name3)
VALUES (numeric_value1
, numeric_value2
, 'text_value3');
- IS NULL - Fetch null column rows in a table
IS NULL - busca linhas de colunas nulas em uma tabela
SELECT *
FROM table_name
WHERE column_name IS NULL;
- IS NOT NULL - Fetch not null column rows in a table
IS NOT NULL - busca linhas de coluna não nulas em uma tabela
SELECT *
FROM table_name
WHERE column_name IS NOT NULL;
- UPDATE - Update single or multiple row in a table using where clause
UPDATE - Atualizar linha única ou múltipla em uma tabela usando a cláusula Where
UPDATE table_name
SET column_name1 = value1
, column_name2 = value2
WHERE column_name = value;
- UPDATE - Update all row in a table
UPDATE - Atualizar linha única ou múltipla em uma tabela usando a cláusula Where
UPDATE table_name
SET column_name = value;
- DELETE - Delete single or multiple rows in a table
DELETE - Excluir uma ou várias linhas em uma tabela
DELETE FROM table_name
WHERE column_name = 'text_value';
- DELETE - Delete all row in a table
DELETE - Exclui todas as linhas de uma tabela
DELETE FROM table_name;