create table Student
(
sno varchar2(
3) not null, sname varchar2(
8) not null, ssex varchar2(
2) not null, sbirthday date,
sclass varchar2(
5)
)
;
-- Add comments to the table
comment on table Student
is
'学生表';
-- Add comments to the columns
comment on column Student.sno
is
'学号(主建)';
comment on column Student.sname
is
'学生姓名';
comment on column Student.ssex
is
'性别';
comment on column Student.sbirthday
is
'生日';
comment on column Student.sclass
is
'班级';
二、数据操作语言 DML:添加(insert into)、修改(update set)、删除表中的数据。(delete)
1.数据的添加:insert into 表名(字段名) values(对应的数据)
--增加数据
insert into student(sno,sname,ssex) values(
'102','张三','男');
--或者这样写
insert into student values(
'102','张三','男',sysdate,'95033');
2.数据的修改:update 表名 set 修改的的字段 wiere 条件
--数据的修改
update student set ssex
='女' where sno='102';
--如果不加where,便是修改整个表某列的属性
--对某一列数据的加减
update student set sclass
=sclass+1;
update 表名 set 列名
=列名+1 where 条件