-
Notifications
You must be signed in to change notification settings - Fork 0
/
sql_reference.json
24 lines (24 loc) · 963 Bytes
/
sql_reference.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;",
"rename": "ALTER DATABASE database_name RENAME TO new_name;"
},
"table": {
"create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;",
"rename": "ALTER TABLE table_name RENAME TO new_name;"
},
"row": {
"insert": "INSERT INTO table_name(columns) VALUES(values);",
"update": "UPDATE table_name SET column_name = new_value WHERE condition;",
"delete": "DELETE FROM table_name WHERE condition;"
},
"column": {
"add": "ALTER TABLE table_name ADD COLUMN column_name;",
"drop": "ALTER TABLE table_name DROP COLUMN column_name;",
"rename": "ALTER TABLE table_name RENAME COLUMN column_name TO new_name;",
"primary_key": "ALTER TABLE table_name ADD PRIMARY KEY(column_name);",
"foreign_key": "ALTER TABLE table_name ADD FOREIGN KEY(column_name) REFERENCES table_name(column_name);"
}
}