SQL 数据基本定义功能 – 模式(Schema)
1.create schema
-
CREATE SCHEMA <schemaName> AUTHORIZATION <username>
-
eg: Create shcema "student_course" authorization sheepcore
-
CREATE SCHEMA <schemaName> AUTHORIZATION <username>
CREATE TABLE Tab1(attribute1 int, attribute2 char(10)…)
定义模式时,同时创建基本表
2.drop schema
- DROP SCHEMA <schemaName> <CASCADE|RESTRICT>
eg1: Drop schema "Student_Course" cascade 级联删除
eg2: Drop schema "Student_Course" restrict 限制删除