数据库建表语句备份(二)

info 数据库(个人项目)

1.book

 1 CREATE DATABASE /*!32312 IF NOT EXISTS*/`info` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;
 2 
 3 USE `info`;
 4 
 5 /*Table structure for table `book` */
 6 
 7 DROP TABLE IF EXISTS `book`;
 8 
 9 CREATE TABLE `book` (
10   `id` INT(10) NOT NULL AUTO_INCREMENT,
11   `bookid` VARCHAR(45) COLLATE utf8_bin NOT NULL,
12   `bookname` VARCHAR(45) COLLATE utf8_bin NOT NULL,
13   `bookauthor` VARCHAR(45) COLLATE utf8_bin NOT NULL,
14   `pressname` VARCHAR(45) COLLATE utf8_bin NOT NULL,
15   `availablenum` VARCHAR(45) COLLATE utf8_bin NOT NULL,
16   PRIMARY KEY (`bookid`,`id`),
17   KEY `id` (`id`)
18 ) ENGINE=INNODB AUTO_INCREMENT=781 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

2.borrowbook

 1 DROP TABLE IF EXISTS `borrowbook`;
 2 
 3 CREATE TABLE `borrowbook` (
 4   `id` INT(10) NOT NULL AUTO_INCREMENT,
 5   `bookid` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 6   `bookname` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 7   `bookauthor` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 8   `pressname` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 9   `borrownum` VARCHAR(45) COLLATE utf8_bin NOT NULL,
10   `availabledate` VARCHAR(45) COLLATE utf8_bin NOT NULL,
11   PRIMARY KEY (`id`,`bookid`)
12 ) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

3.login

1 DROP TABLE IF EXISTS `login`;
2 
3 CREATE TABLE `login` (
4   `id` INT(8) NOT NULL AUTO_INCREMENT,
5   `passname` VARCHAR(20) COLLATE utf8_bin NOT NULL,
6   `password` VARCHAR(20) COLLATE utf8_bin NOT NULL,
7   PRIMARY KEY (`id`)
8 ) ENGINE=INNODB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

4.population

 1 DROP TABLE IF EXISTS `population`;
 2 
 3 CREATE TABLE `population` (
 4   `residenceType` VARCHAR(100) NOT NULL,
 5   `housingType` VARCHAR(100) NOT NULL,
 6   `housingArea` VARCHAR(100) NOT NULL,
 7   `numberOfrooms` VARCHAR(100) NOT NULL,
 8   `nameOfhouseholder` VARCHAR(100) NOT NULL,
 9   `idCard` VARCHAR(100) NOT NULL,
10   `sex` VARCHAR(100) NOT NULL,
11   `nation` VARCHAR(100) NOT NULL,
12   `education` VARCHAR(100) NOT NULL,
13   PRIMARY KEY (`idCard`)
14 ) ENGINE=INNODB DEFAULT CHARSET=utf8;

5.student

1 DROP TABLE IF EXISTS `student`;
2 
3 CREATE TABLE `student` (
4   `studentid` VARCHAR(45) COLLATE utf8_bin NOT NULL,
5   `studentname` VARCHAR(45) COLLATE utf8_bin NOT NULL,
6   `studentsex` VARCHAR(45) COLLATE utf8_bin NOT NULL,
7   `studentcollege` VARCHAR(45) COLLATE utf8_bin NOT NULL,
8   PRIMARY KEY (`studentid`)
9 ) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

6.success1

 1 DROP TABLE IF EXISTS `success1`;
 2 
 3 CREATE TABLE `success1` (
 4   `id` INT(10) NOT NULL AUTO_INCREMENT,
 5   `课程` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 6   `老师姓名` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 7   `上课地点` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 8   `学生学号` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 9   PRIMARY KEY (`id`)
10 ) ENGINE=INNODB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

7.xinxi

 1 DROP TABLE IF EXISTS `xinxi`;
 2 
 3 CREATE TABLE `xinxi` (
 4   `name` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 5   `id` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 6   `idcard` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 7   `htype` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 8   `sex` VARCHAR(45) COLLATE utf8_bin NOT NULL,
 9   `nation` VARCHAR(45) COLLATE utf8_bin NOT NULL,
10   PRIMARY KEY (`id`)
11 ) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

 

上一篇:因为一个字符校对问题,我的大厂面试挂了


下一篇:【数据库】对不起navicat我投入了DataGrip的怀抱