SCHEMA
- Create Schema
CREATE SCHEMA schema_name;
- Rename Schema
ALTER SCHEMA schema_name RENAME to schema_name_new- Drop Schema
DROP SCHEMA schema_name;DATABASE
- Create DataBase
Create DATABASE database_name;- Rename DataBase
ALTER DATABASE database_name RENAME to database_name_new;- Drop DataBase
DROP DATABASE database_nameTABLE
- Create Table
CREATE TABLE table_name(col1 text,
col2 text,
PRIMARY KEY(col1)
);
- Create table in a schema
CREATE TABLE schema_name.table_name(col1 text,
col2 text,
PRIMARY KEY(col1)
);
No comments:
Post a Comment