day1_安装及建立数据库和表

 
 
#第一份数据库及表
create database library; use library; create table book( id int primary key, book_name char(50) ); create table reader( id int primary key, reader_name char(50) );

1、安装用的是虚拟机  Ubuntu16.04 LTS;

2、MySQL语法不区分大小写,以分号 “ ;”结尾表示一条语句完结,回车表示换行 ;

3、int(10)等语句10个字符,不是字节;

4、基本语句:

  create database <数据库名>;

  use <数据库名字>;

  show databases;

    create table<表名>; 

  insert into employee(id,name,phone) values(01,'Tom',110110110);

  insert into employee values(02,'Jack',119119119);

  insert into employee(id,name) values(03,'Rose');

猜你喜欢

转载自www.cnblogs.com/tay1987/p/12731902.html
今日推荐