Skip to content

Commit

Permalink
cheat-SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyush-linux committed Jul 16, 2024
1 parent f58222b commit 6c95a84
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cheat/sql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SQL



## Commands

```sh
\q # To quit the psql:
\l # List all databases
\dv # List all views:
\dt # Lists all tables in a current database.
\du # List all users
```

## Database

```sh
CREATE DATABASE [IF NOT EXISTS] db_name;
DROP DATABASE [IF EXISTS] db_name;

```

## Tabls

```sh
SELECT * FROM table_name;
```

0 comments on commit 6c95a84

Please sign in to comment.