码迷,mamicode.com
首页 > 数据库 > 详细

mysql 语句

时间:2016-12-02 18:49:01      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:sql 语句   mod   var   har   odi   alter   database   character   rac   

create DATABASE if not exists test_mysql CHARACTER SET utf8;

use test_mysql;

create table if not EXISTS user (
id int(11) not null auto_increment COMMENT ‘自增ID‘,
name VARCHAR(100) not null comment ‘name‘,
age int(4) not null DEFAULT 0 comment ‘age‘,
primary key (id, name)
)
auto_increment=1;

desc user;

show create table user;

show table status like ‘user‘;

select * from user;

ALTER table user modify name VARCHAR(100) not null DEFAULT ‘‘
ALTER table user change name new_name VARCHAR(50) not null DEFAULT ‘‘
ALTER table user add (address VARCHAR(50) not null)
alter table user drop address

TRUNCATE table user;

 

mysql 语句

标签:sql 语句   mod   var   har   odi   alter   database   character   rac   

原文地址:http://www.cnblogs.com/kaishan1990/p/6126615.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!