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

sql example 1 -- create

时间:2015-06-14 12:11:26      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

sql example 1 – create

sql example 1 – create

  • database 操作
    create dateabase test;
    use test;
    
    show databases;
    show create database test;
    drop database test;
    
    create database if not exists test;
    drop database test;
    
    create database if not exists test character set gbk;
    alter database test character set utf8;
    
  • table 操作
    use test;
    create table user1 (
    id int not null,
    username varchar(20) not null
    );
    
    show tables;
    desc user1;
    show columns from user1;
    select * from user1;
    
    show create table user1;
    drop table user1;
    
    create table user1 (
    id int(11) NOT NULL,
    username varchar(20) NOT NULL
    ) ENGINE=InnoDB default charset=gtk;
    
    show create table user1;
    alter table user1 character set utf8;
    

sql example 1 -- create

标签:

原文地址:http://www.cnblogs.com/sunznx/p/4574725.html

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