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

Basic Mysql Sql

时间:2014-07-13 19:07:23      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:style   strong   new   sql   re   ar   

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

Basic Mysql Sql

标签:style   strong   new   sql   re   ar   

原文地址:http://www.cnblogs.com/Exile223001/p/3841220.html

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