标签:
重点内容修改下列脚本mysql_practice.sql,进行练习mysql基本操作:
show databases; create database if not exists `HA`; use HA; create table if not exists student (id int, name char(40), age int); show create table student \G; desc student; create table student2 (id int(20), name char(40), age int) ENGINE=InnoDB DEFAULT CHARSET=utf8; show columns from student2; drop table student2; alter table student rename students; show tables; alter table students modify id int(10); show fields from students; alter table students modify id int(20) primary key; show fields from students; alter table students change name stname char(20); desc students; alter table students add sex enum(‘M‘,‘W‘); desc students; alter table students add uid int(10) first; desc students; alter table students add address char(50) after age; desc students; alter table students drop address; insert into students values(1,1,‘liqiang‘,22,‘M‘); insert into students(uid,id) values(2,2); select * from students; select uid,id from students; select * from HA.students \G; show tables; drop table if exists students; show tables; show databases; drop database if exists `HA`; show databases;
标签:
原文地址:http://www.cnblogs.com/xianren2016/p/5572309.html