摘要:
一、创建表时添加约束 #1.创建列级约束 语法: 直接在字段名和类型后面追加约束类型 只支持默认,非空,主键,唯一 use students #使用某个数据库 creat table stu_info ( id int primary key,#主键 stuname varchar(20) not 阅读全文
摘要:
1.表的删除 drop table 表名 drop table if exist author ; 2.表的复制 #1.复制表的结构 creat table 新表 like 要复制的表 creat table copy like author; #2.复制表的结构和数据 creat table 新表 阅读全文
摘要:
一、库的创建 语法: creat database 库名 ; #案例:创建库books creat database if not exists books ; 二、库的修改 #案例:将books库换名 rename database books to 新库名 #更改库的字符集 alter data 阅读全文
摘要:
方式一、 语法: 1.单表删除 delete from 表名 where 筛选条件 #案例:删除手机号9结尾的女生信息 delete from beauty where phone like '%9' ; select * from beauty 方式二、 语法 不允许+where等,只能全删 tr 阅读全文
摘要:
一、修改记录 update 表名 set 列 = 新值 , 列 = 新值 , ... where 筛选条件 #1.修改单表的记录 #案例一、修改beauty表中姓唐的电话号码为138998899 update beauty set phone = '138998899' where name lik 阅读全文