当前位置: 代码迷 >> 综合 >> Master in SQL -- Define a schema for your DBMS
  详细解决方案

Master in SQL -- Define a schema for your DBMS

热度:14   发布时间:2023-12-27 14:41:46.0

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 限制删除
  相关解决方案