mysql(1) 库和表的处理

本文详细介绍了 MySQL 数据定义语言 (DDL) 如创建、修改和删除数据库及表,数据操作语言 (DML) 如插入、更新、删除记录,以及数据控制语言 (DCL) 如权限设置的基本语法和用例。

//第一天 mysql 分三类 
//ddl 库 表 列 索引 database table column index;
//dml 数据库完整性 表的增insert 删delete 改update 查 select ;
//dcl 权限设置 grant、revoke

//创建库-并给于编码格式 create database student charset utf8;

//修改库格式 alter database student charset utf8;
//删除库 dropdatabase student;

//却换使用库 use student;

//创建表 create table studenttable (id int(6) primary key, name varchar(16) not null );
//删除表 drop table studenttable;
//修改表 alter table studenttable rename students;

//查看表结构 desc students;

//添加表字段 alter table students add sex int(1);
//批量添加表字段 alter table students add (age int(3),address varchar(16));
//修改表字段 alter table students modify sex char(1);
//删除表字段 alter table students drop age;

转载于:https://www.cnblogs.com/a-long/p/4680131.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值