SQL Oracle給表新增字段說明

2021-09-19 01:25:47 字數 993 閱讀 4737

oracle、mysql、sqlserver建立表和給表和字段加注釋

一、oracle

--建立表

create table test (

id varchar2(200) primary key not null,

sort number,

name varchar(200)

)--欄位加注釋

comment on column test.id is 'id';

comment on column test.sort is '序號';

--表加注釋

comment on table test is '測試表'

二.mysql

--建立表

create table test (

id varchar(200) not null,

sort int(11) comment '排序',

name varchar(200) comment '名稱',

)

--表加注釋

alter table test comment ='測試表'

三.sqlserver

--建立表

create table test (

id varchar(200) primary key not null,

sort int,

name varchar(200),)

--給字段加注釋

exec sp_addextendedproperty n'test', n'序號', n'user', n'dbo', n'table', n'test', n'column', n'sort';

--表加注釋

execute sp_addextendedproperty n'test', n'測試表', n'user', n'dbo',n'table', n'test', null, null

Mysql 給表新增字段

第一步 drop table if exists city create table city id int 11 not null auto increment,name char 35 not null default countrycode char 3 not null default di...

SQL Oracle表中ID欄位的自動遞增

目標 實現向一張表中插入資料時,id欄位自動遞增。開始實驗 1 建立實驗表 createtable test id add id number 10 username varchar2 32 tel varchar2 11 create date datedefaultsysdate 2 建立序列 ...

Oracle給表和字段新增注釋

oracle給表和字段新增注釋。建立 學生資訊 資料表。建立 學生資訊 資料表 create table student info stu id int,學號 stu name varchar2 8 姓名 email varchar2 20 郵箱 char 2 性別 age int,年齡 class...