当前位置:网站首页>11. Table and library management
11. Table and library management
2022-04-23 07:40:00 【Ah Dai cloth clothes cool】
11. Management of tables and libraries
One . Create data table
create table t_student
(
id int primary key auto_increment,
name varchar(10) not null,
age int,
sex varchar(8) not null default ' Woman ',
address varchar(100),
height double,
birthday date
)charset=utf8;
Two . Add data
insert into t_student (name,age,sex,birthday,height)
values (' Fan Tingting ',18,' Woman ','1998-12-4',170.6);
insert into t_student(name,age,sex)
values(null,10,' male ');
insert into t_student
values(null,' Cheng Rui ',19,' male ',' nanjing ',176.6,now())
3、 ... and . Modify data sheet
1. Add columns
alter table t_student add weight double;
2. Modify column type
alter table t_student modify name varchar(250);
3. Change column names
alter table t_student change sex gender varchar(8);
4. Modify the name of the table
alter table t_student rename student;
rename table student to t_student;
Four . Delete table
drop table if exists user;
5、 ... and . Truncation table
truncate table emp;
6、 ... and . Create a library
create database if not exists shop charset utf8;
7、 ... and . Delete Library
drop database if exists shop;
版权声明
本文为[Ah Dai cloth clothes cool]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230622239183.html
边栏推荐
- Take you to travel in space, and American photography technology provides comprehensive technical support for aerospace creative applet
- Reflect on the limitations of event bus and the design and implementation of communication mechanism in component development process
- Failed to install Tui editor, quick solution
- The difference between null and undefined
- 可视化常见问题解决方案(七)画图刻度设置解决方案
- 后台管理系统框架,总有你想要的
- [CodeForces - 208E] Blood Cousins(k代兄弟问题)
- 什么是闭包?
- 超级宝典&编程指南(红蓝宝书)-读书笔记
- [LNOI2014]LCA——树链剖分——多点LCA深度和问题
猜你喜欢
数据分析入门 | kaggle泰坦尼克任务(三)—>探索数据分析
Discussion on the outline of short video technology
保洁阿姨都能看懂的中国剩余定理和扩展中国剩余定理
FSM有限状态机
Discussion on frame construction and technology selection of short video platform
自定义时间格式(YYYY-MM-DD HH:mm:ss 星期X)
ES6之箭头函数细谈
如何判断点是否在多边形内(包含复杂多边形或者多边形数量很多的情况)
简易随机点名抽奖(js下编写)
学习笔记6-几种深度学习卷积神经网络的总结
随机推荐
关于素数的不到100个秘密
Failed to install Tui editor, quick solution
9.常用函数
经典套路:一类字符串计数的DP问题
Discussion on frame construction and technology selection of short video platform
开发板如何ping通百度
反思 | Android 音视频缓存机制的系统性设计
Discussion on arrow function of ES6
理解补码的要点
简单易懂的子集dp
On BFC (block formatting context)
3.排序语句
嵌入式相关面经(一)
积性函数前缀和——杜教筛
Applet Wx Previewmedia related problem solving - Daily stepping on the pit
技术小白的第一篇(表达自己)
【自我激励系列】到底是什么真正阻碍了你?
数论之拓展欧几里得
如何SQL 语句UNION实现当一个表中的一列内容为空时则取另一个表的另一列
什么是闭包?