Skip to content

Commit b8f782a

Browse files
committed
postgres doc
1 parent 4f657f4 commit b8f782a

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

postgresql.md

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# PostgreSQL online editor
2+
Write, Run & Share PostgreSQL queries online using OneCompiler's PostgreSQL online editor and compiler for free. It's one of the robust, feature-rich online editor and compiler for PostgreSQL. Getting started with the OneCompiler's PostgreSQL editor is really simple and pretty fast. The editor shows sample boilerplate code when you choose database as 'PostgreSQL' and start writing queries to learn and test online without worrying about tedious process of installation.
3+
4+
# About PostgreSQL
5+
6+
PostgreSQL is a open source relational database system and is also knows as Postgres.
7+
8+
### Key Features:
9+
10+
* Postgres is not only free and open-source but also it is highly extensible.
11+
* Custom Data types and funtions from various programming languaues can be introduced and the good part is compiling entire database is not required.
12+
* ACID(Atomicity, Consistency, Isolation, Durability) compliant.
13+
* First DBMS which implemented Multi-version concurrency control (MVCC) feature.
14+
* It's the default database server for MacOS.
15+
* It supports all major operating systems like Linux, Windows, OpenBSD,FreeBSD etc.
16+
17+
# Syntax help
18+
19+
## 1. CREATE
20+
CREATE command is used to create a table, schema or an index.
21+
#### Syntax:
22+
```sql
23+
CREATE TABLE table_name (
24+
column1 datatype,
25+
column2 datatype,
26+
....);
27+
```
28+
## 2. ALTER
29+
ALTER command is used to add, modify or delete columns or constraints from the database table.
30+
31+
#### Syntax
32+
```sql
33+
ALTER TABLE Table_name ADD column_name datatype;
34+
```
35+
## 3. TRUNCATE:
36+
TRUNCATE command is used to delete the data present in the table but this will not delete the table.
37+
#### Syntax
38+
```sql
39+
TRUNCATE table table_name;
40+
```
41+
## 4. DROP
42+
DROP command is used to delete the table along with its data.
43+
44+
#### Syntax
45+
```sql
46+
DROP TABLE table_name;
47+
```
48+
## 5. RENAME
49+
RENAME command is used to rename the table name.
50+
51+
#### Syntax
52+
```sql
53+
ALTER TABLE table_name1 RENAME to new_table_name1;
54+
```
55+
56+
## 6. INSERT
57+
INSERT Statement is used to insert new records into the database table.
58+
#### Syntax
59+
```sql
60+
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
61+
```
62+
63+
## 7. SELECT
64+
Select statement is used to select data from database tables.
65+
66+
#### Syntax:
67+
```sql
68+
SELECT column1, column2, ...
69+
FROM table_name;
70+
```
71+
## 8. UPDATE
72+
UPDATE statement is used to modify the existing values of records present in the database table.
73+
74+
#### Syntax
75+
```sql
76+
UPDATE table_name
77+
SET column1 = value1, column2 = value2, ...
78+
WHERE condition;
79+
```
80+
## 9. DELETE
81+
DELETE statement is used to delete the existing records present in the database table.
82+
83+
#### Syntax
84+
```sql
85+
DELETE FROM table_name where condition;
86+
```

0 commit comments

Comments
 (0)