Basic Mysql Sql

时间:2014-07-13 19:07:23   收藏:0   阅读:298

1. DataBases

  a.show databases;

  b.create database mydatabase;

  c.use mydatabase;

2.Tables

  a.show tables;

  b.create table if not exists mytable

   (

     SN int(4)  unsigned not null default 0 primary key,

     Name varchar(20) not null default ‘‘,

     Level int(4) unsigned not null default 0,

     unique key index_a(Name)

   );

  c.insert into mytable(SN,Name,Level) values(1,‘a‘,11) on duplicate key update Level=111;

  d.select * from tables;

  e.update mytable set Level=100 where Name=‘a‘;

 

Basic Mysql Sql,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!