自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 MySQL数据库索引操作

1、主索引create table test2(id int primary key); (列级约束)create table test3(id int, primary key(id));(表级约束)(更推荐第一种)2、创建普通索引(属性值可以重复)create index idx_name on test (name);show index from test;3、创建唯一索引(属性值不能重复,比较适合候选码)create unique index idx_..

2022-05-07 17:01:39 589

原创 MySQL数据库增添改删数据

DDL(表结构):create alter dropDML(表内容):insert update delete(添加、修改、删除)DQL:select * from 表名(*代表所有的字段)(投影操作) select * from 表名 where id=10 (选择操作)添加:1、为表添加数据insert into 表名(字段1,字段2,…) values(值1,值2,…)注意:字段和值要一一对应insert into test(id...

2022-05-04 20:30:19 998

原创 MySQL数据库增改等操作

(小tips:此篇文章表均与上篇文章表相关联)1、增加列 alter table student -> add ssex char(2) not null(add为表添加新的字段) -> ;2、更改列的默认值 alter table student -> alter ssex set default '男'(set default为表中字段设置默认值) -> ;3、给表重命名test改成tes...

2022-04-28 20:49:38 1928

原创 MySQL数据库创建表

1、创建表test use demo create table test(id int(11),name varchar(50)); desc:描述(是个动词) 表里的名字和字段名必须有意义 create table student(sno char(11) primary key,sname varchar(20) not null); ...

2022-04-28 20:20:57 16445

原创 MySQL数据库的基本操作一

1、连接数据库 最后一种方式最佳:先输入mysql -u root -p回车后再输入密码2、创建数据库: create database 数据库名称(以字母,数字,下划线组成的字符串,但不要以数字开头)3、查看数据库: show databases;4、查看字符集: show variables like ‘character%’;5、查看端口号: show variables like ‘port’;6、查看数据存储路径:...

2022-04-28 19:57:35 484

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除