您的位置:首页 > 博客中心 > 数据库 >

Basic Mysql Sql

时间:2022-03-10 17:59

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

热门排行

今日推荐

热门手游