一,数据库操作
1.创建数据库 student
create database if not exists student default charset utf8
2.删除数据库student
drop database student;
** 二.数据表操作**
1.创建数据表:
CREATE TABLE students (
student_id VARCHAR (10) PRIMARY KEY NOT NULL,
student_name VARCHAR (20) NOT NULL,
student_sex VARCHAR (2),
student_age INTEGER (3),
dept_id VARCHAR (2),
class_id VARCHAR (8)
) default charset=utf8;
2,查看表结构
desc students;
查看建表语句
show create table students\G --查看建表的语句