数据库最常用语句


创建数据库
create database 表名

创建表
create table 表名(
id number(10) primary key not null,
name varchar(10) not null
);

insert into 表名 values(1,'周坤')                  插入数据

select * from 表名                                       查询数据

update 表名 set id=3 where name='lili'       修改数据

delete from 表名 where id=1                       删除数据

alter table csbiao2 add constraint su_ahlmh foreign key(id) references csbiao3(id);         外键

                  外键表                               外键名称          字段名                    另一个表字段名

posted on 2022-02-16 11:37  东郭夏  阅读(47)  评论(0)    收藏  举报