Presta atención porque en esta sección vas a hallar el hallazgo que buscas.Esta noticia ha sido analizado por nuestros especialistas para garantizar la calidad y exactitud de nuestro post.
Ejemplo 1: hojas de trucos de MySQL
MySQL cheatsheet, in pdf format :)
-> https://buggyprogrammer.com/mysql-cheatsheet-pdf/
Ejemplo 2: hoja de trucos de sql
# Finding Data Queries
# SELECT: used to select data from a database
SELECT * FROM table_name;
# DISTINCT: filters away duplicate values and returns rows of specified column
SELECT DISTINCT column_name;
# WHERE: used to filter records/rows
SELECT column1, column2 FROM table_name WHERE condition;
SELECT * FROM table_name WHERE condition1 AND condition2;
SELECT * FROM table_name WHERE condition1 OR condition2;
SELECT * FROM table_name WHERE NOT condition;
SELECT * FROM table_name WHERE condition1 AND (condition2 OR condition3);
SELECT * FROM table_name WHERE EXISTS (SELECT column_name FROM table_name WHERE condition);
# ORDER BY: used to sort the result-set in ascending or descending order
SELECT * FROM table_name ORDER BY column;
SELECT * FROM table_name ORDER BY column DESC;
SELECT * FROM table_name ORDER BY column1 ASC, column2 DESC;
SELECT TOP: used to specify the number of records to return from top of table
SELECT TOP number columns_names FROM table_name WHERE condition;
SELECT TOP percent columns_names FROM table_name WHERE condition;
# Not all database systems support SELECT TOP. The MySQL equivalent is the LIMIT clause
SELECT column_names FROM table_name LIMIT offset, count;
# LIKE: operator used in a WHERE clause to search for a specific pattern in a column
# % (percent sign) is a wildcard character that represents zero, one, or multiple characters
# _ (underscore) is a wildcard character that represents a single character
SELECT column_names FROM table_name WHERE column_name LIKE pattern;
LIKE ‘a%’ # (find any values that start with “a”)
LIKE ‘%a’ # (find any values that end with “a”)
LIKE ‘%or%’ # (find any values that have “or” in any position)
LIKE ‘_r%’ # (find any values that have “r” in the second position)
LIKE ‘a_%_%’ # (find any values that start with “a” and are at least 3 characters in length)
LIKE ‘[a-c]%’ # (find any values starting with “a”, “b”, or “c”
# See more in the source link
Ejemplo 3: hoja de trucos de mysql
SELECT * FROM table;
SELECT * FROM table1, table2;
SELECT field1, field2 FROM table1, table2;
SELECT ... FROM ... WHERE condition
SELECT ... FROM ... WHERE condition GROUPBY field;
SELECT ... FROM ... WHERE condition GROUPBY field HAVING condition2;
SELECT ... FROM ... WHERE condition ORDER BY field1, field2;
SELECT ... FROM ... WHERE condition ORDER BY field1, field2 DESC;
SELECT ... FROM ... WHERE condition LIMIT 10;
SELECT DISTINCT field1 FROM ...
SELECT DISTINCT field1, field2 FROM ...
Ejemplo 4: cheat seet traversy
INSERT INTO users (first_name, last_name, email, password, location, dept, is_admin, register_date) values ('Fred', 'Smith', '[email protected]', '123456', 'New York', 'design', 0, now()), ('Sara', 'Watson', '[email protected]', '123456', 'New York', 'design', 0, now()),('Will', 'Jackson', '[email protected]', '123456', 'Rhode Island', 'development', 1, now()),('Paula', 'Johnson', '[email protected]', '123456', 'Massachusetts', 'sales', 0, now()),('Tom', 'Spears', '[email protected]', '123456', 'Massachusetts', 'sales', 0, now());
Reseñas y calificaciones del artículo
Si conservas alguna vacilación y capacidad de aclarar nuestro división puedes ejecutar una referencia y con gusto lo interpretaremos.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)