SQL 用户自定义类型

    技术2022-07-11  77

    什么是用户自定义类型呢?

    用户定义数据类型并不是真正的数据类型,它只是提供了一-种提高数据库内部元素 和基本数据类 型之间-致性的机制。

    语法

    drop type 自定义类型名 as table (<列定义>[表约束][,...])

    完整实例

    drop type student as table ( id char(10) not null primary key, name varchar(50) not null, gender char(2) not null )
    Processed: 0.017, SQL: 9