数据库一些建表语句

时间:2021-03-02 08:18:23


CREATE DATABASE lovoinfo DEFAULT CHARSET=utf8;
USE lovoinfo;

CREATE TABLE lovotaecher(
sid INT PRIMARY KEY AUTO_INCREMENT,
sname VARCHAR(100) NOT NULL,
smobile BIGINT,
sqq BIGINT
)DEFAULT CHARSET=utf8;

INSERT INTO lovotaecher VALUES
(NULL, '李丽',13000345678,'256329152'),
(NULL, '吴裙',13004345678,'912379268'),
(NULL, '吴昊',13670345678,'234465824'),
(NULL, '刘莉',13006745678,'123255768');

 

 

USE lovoinfo;
CREATE TABLE lovoclass(
sid INT PRIMARY KEY AUTO_INCREMENT,
sname VARCHAR (100) NOT NULL,
ssj DATE,
sxh VARCHAR (50),
sbz VARCHAR (250)
)DEFAULT CHARSET=utf8;


INSERT INTO lovoclass VALUES
(NULL, 'PG31','2017-01-01','李丽','7'),
(NULL, 'PG32','2017-01-02','吴裙','7'),
(NULL, 'PG33','2017-01-03','吴昊','7'),
(NULL, 'PG34','2017-01-04','刘莉','7');

 

 

use lovoinfo;
CREATE TABLE lovostudent(
sid INT PRIMARY KEY AUTO_INCREMENT,
sname VARCHAR(100) NOT NULL,
ssex varchar (7) NULL,
sxh varchar (50),
ssr date,
smobile BIGINT,
saddress varchar(500) NULL
)DEFAULT CHARSET=utf8;


INSERT INTO lovostudent VALUES
(NULL, '李丽','女','PG31','1992-03-15','13100345678','四川省成都市天府新区1'),
(NULL, '王丽','男','PG31','1993-03-15','13212335678','四川省成都市天府新区2'),
(NULL, '赵军','女','PG31','1994-03-15','13310345678','四川省成都市天府新区3'),
(NULL, '吴裙','女','PG31','1995-03-15','13400345678','四川省成都市天府新区4'),
(NULL, '吴昊','男','PG31','1996-03-15','13570345678','四川省成都市天府新区5'),
(NULL, '刘梨','男','PG31','1997-03-15','13606745678','四川省成都市天府新区5'),
(NULL, '飒军','男','PG31','1998-03-15','13706745678','四川省成都市天府新区6'),
(NULL, '王红','男','PG31','1999-03-15','13806745678','四川省成都市天府新区7');