sql插入数据,更新数据,删除数据

来源:互联网 发布:windows自带软件 编辑:程序博客网 时间:2024/05/23 19:18

1、向数据表中插入数据。

(1)插入一整行数据:

insert into table_name values("所有的行")

(2)插入部分数值

insert into table(id,name...) values()

(3)一次插入多行数据

insert into table values(=------------------------),(-------------------------------)

(4)从查询处理的表中插入到数据中

insert into table() select ------------------------------


2、更新数据表  update

update  table set  key = value  where ------;


3、删除数据

删除行

delete from talbe where -----


4、主键

唯一的标识某条数据。


5、创建表

create table 表名 (字段名称,类型,是否为空)


6、更新表

alter table

(1)更新表,增加lie

alter table xxx add 列名称  列属性。

alter table xxx  alter 列名 列类型