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
时间: 2024-10-10 06:18:59