Search
 
SCRIPT & CODE EXAMPLE
 

SQL

cheatsheet for sql

Guys, are you looking for SQL cheatsheet, in pdf format :)
 -> https://buggyprogrammer.com/sql-cheatsheet/
Comment

SQL CHEATSHEET

BEST PDF SQL CHEATSHEET please upvote :')                                                                                      '
https://learnsql.com/blog/sql-basics-cheat-sheet/sql-basics-cheat-sheet-letter.pdf
Comment

sql cheat sheet

# 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
Comment

sql cheat sheet

Comment

PREVIOUS NEXT
Code Example
Sql :: SQL Modify Column in a Table -PostgreSQL 
Sql :: osx stop mysql service 
Sql :: sql character index 
Sql :: Converting mysql tables to charset utf8mb4 
Sql :: mysql date equals to current_date plus days 
Sql :: orcale index size 
Sql :: query distinct 
Sql :: postgresql grant owner to user 
Sql :: commit in sql 
Sql :: groupby error in mysql 
Sql :: 11:04:35 PM [mysql] Error: MySQL shutdown unexpectedly. 11:04:35 PM [mysql] This may be due to a blocked port, missing dependencies, 
Sql :: setval max id postgresql sequence 
Sql :: sqlserver add column 
Sql :: oracle dependencies table 
Sql :: unique key in ms sql server 
Sql :: mysql select date from datetime 
Sql :: sql delete column 
Sql :: creating table in sql 
Sql :: insert in to table sql 
Sql :: sql query to select data between two dates 
Sql :: all tables and views oracle 
Sql :: how to run sql server on mac 
Sql :: SQL Avoid Duplicates in INSERT INTO SELECT 
Sql :: mysql with 
Sql :: Write an SQL query to print details of the Workers whose SALARY lies between 100000 and 500000. 
Sql :: uninstall mysql ubuntu 18.04 stackoverflow 
Sql :: error 1054 mysql 
Sql :: convert html to plain text in sql server 
Sql :: oracle error compilation line 
Sql :: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =