Skip to content

Commit

Permalink
Added cheatsheet for Week 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Versnel committed Feb 4, 2018
1 parent 3d251cd commit b1b0c32
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions SQL-CHEATSHEET.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SQL Cheatsheet

## Queries

### Specify what information to extract

```sql
SELECT column
```

## From which table

```sql
FROM table
```

## Only extract rows where the condition holds

(Used with an operator: `>, <, >=, <=, =, <>, BETWEEN, LIKE, IN`)
```sql
WHERE column = 'value'
```

## Combining `WHERE` clauses:

(Used with: `AND, OR`)
```sql
WHERE column = 'value' OR
column = 'other value'
```

## Aggregating results:

(Used with: `SUM, COUNT, MIN, MAX, AVG`)
```sql
SELECT SUM(column)
FROM table
```

## Aliasing tables

```sql
SELECT column AS alias
FROM table
```

0 comments on commit b1b0c32

Please sign in to comment.