学习mysql的第二天
来源:互联网 发布:网络系统安全技术的有 编辑:程序博客网 时间:2024/04/27 14:52
今天是学习mysql的第二天,又学到了很多知识。
首先学习了一下表的操作
use test \\进入数据库
创建数据表
create table if not exists test(
id int,
name varchar(32)
); \\ 正常方式创建
create table test2 like test; \\复制数据表结构
create table test3 select * from test; \\复制数据表结构和数据 可以把一个查询的结果集保持成一个表
查看数据表
show tables; \\查看数据库里面的所有表
show tables like 't%'; \\字符串匹配查询
show create table test; \\查看数据表结构 比较乱
show create table test\G \\查看数据表结构 比较乱
desc test; \\查看数据表结构 整齐
describe test; \\查看数据表结构 整齐
show columns from test; \\查看数据表结构 整齐
alter table test modify name varchar(64) not null default 'dd'; \\修改数据表字段属性
alter table test change name name2 varchar(128); \\修改数据表字段名称和属性
alter table test add tim int after id; \\添加数据表字段
alter table test drop tim; \\删除数据表字段
rename table test to test4; \\更改数据表名称
drop table if exists test4; \\删除数据表
- 学习mysql的第二天
- mysql学习 第二天
- 学习MySQL第二天---JDBC
- mysql学习第二天(DML语句的使用)
- 第二天的学习
- 学习的第二天
- 学习的第二天
- 第二天的学习
- 第二天的学习
- 第二天的学习
- MySQL学习第二天——理论知识
- MYSQL学习第二天---数据类型等
- Mysql学习第二课
- 第二天SL275的学习
- 学习struts的第二天
- 学习Android的第二天
- 学习Linux的第二天
- 学习JAVA的第二天
- VS 2012 下简单的C#程序
- c++中类实例化时候对基类的调用顺序
- java设计模式——模板方法模式
- 寒風的Cocos2dx之旅之基础1----创建场景
- Ehcache 整合Spring 使用页面、对象缓存
- 学习mysql的第二天
- 转载06:前端工程师学习进阶线路
- Linux查看程序端口占用情况
- 数据结构-单链队列操作算法
- Socket初学认识 ----- Socket模型
- mysql数据库优化技术(1)
- UVALive - 3135 Argus 优先队列
- cookie/session机制详解
- 两个小程序看C++继承和组合的构造顺序