6 Star 0 Fork 0

Arakkoa/ITProject

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
newstudentmanage.sql 6.72 KB
一键复制 编辑 原始数据 按行查看 历史
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: studentmanage
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `account`
--
use mysql;
DROP TABLE IF EXISTS `account`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `account` (
`account_num` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`isSuperAdmin` tinyint(1) NOT NULL,
PRIMARY KEY (`account_num`),
UNIQUE KEY `account_num_UNIQUE` (`account_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `account`
--
LOCK TABLES `account` WRITE;
/*!40000 ALTER TABLE `account` DISABLE KEYS */;
/*!40000 ALTER TABLE `account` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `teacher`
--
DROP TABLE IF EXISTS `teacher`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `teacher` (
`teacher_id` varchar(100) NOT NULL,
`teacher_name` varchar(100) NOT NULL,
PRIMARY KEY (`teacher_id`),
UNIQUE KEY `teacher_id_UNIQUE` (`teacher_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `teacher`
--
LOCK TABLES `teacher` WRITE;
/*!40000 ALTER TABLE `teacher` DISABLE KEYS */;
/*!40000 ALTER TABLE `teacher` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `classgrade`
--
DROP TABLE IF EXISTS `classgrade`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `classgrade` (
`class_id` varchar(100) NOT NULL,
`grade` int NOT NULL,
`class_count` int NOT NULL,
`headTeacher_id` varchar(100) DEFAULT NULL,
PRIMARY KEY (`class_id`),
UNIQUE KEY `headteacher_id_UNIQUE` (`headteacher_id`),
UNIQUE KEY `class_id_UNIQUE` (`class_id`),
CHECK (grade>0 and grade<9999 and class_count>=0 and class_count<100),
CONSTRAINT `headTeacher_id` FOREIGN KEY (`headTeacher_id`) REFERENCES `teacher` (`teacher_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `classgrade`
--
LOCK TABLES `classgrade` WRITE;
/*!40000 ALTER TABLE `classgrade` DISABLE KEYS */;
/*!40000 ALTER TABLE `classgrade` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `class_teacher`
--
DROP TABLE IF EXISTS `class_teacher`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `class_teacher` (
`class_id` varchar(100) NOT NULL,
`teacher_id` varchar(100) NOT NULL,
PRIMARY KEY (`class_id`,`teacher_id`),
CONSTRAINT `class_id2` FOREIGN KEY (`class_id`) REFERENCES `classgrade` (`class_id`),
CONSTRAINT `teacher_id2` FOREIGN KEY (`teacher_id`) REFERENCES `teacher` (`teacher_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `class_teacher`
--
LOCK TABLES `class_teacher` WRITE;
/*!40000 ALTER TABLE `class_teacher` DISABLE KEYS */;
/*!40000 ALTER TABLE `class_teacher` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `student`
--
DROP TABLE IF EXISTS `student`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `student` (
`student_id` varchar(100) NOT NULL,
`student_name` varchar(100) NOT NULL,
`student_tel` varchar(100) NOT NULL,
`student_office` varchar(100) NOT NULL,
`student_photo` varchar(100) NOT NULL,
`student_gender` tinyint(1) NOT NULL,
`student_age` int NOT NULL,
`student_seat` int NOT NULL,
`student_introduction` varchar(500) DEFAULT NULL,
`student_hometown` varchar(100) NOT NULL,
`student_politicalStatus` varchar(100) NOT NULL,
`student_birthday` date NOT NULL,
`ID` varchar(100) NOT NULL,
`class_id` varchar(100) NOT NULL,
PRIMARY KEY (`student_id`),
UNIQUE KEY `student_id_UNIQUE` (`student_id`),
UNIQUE KEY `student_tel_UNIQUE` (`student_tel`),
UNIQUE KEY `ID_UNIQUE` (`ID`),
KEY `class_id_student_idx` (`class_id`),
CHECK(student_age>0),
CONSTRAINT `class_id_student` FOREIGN KEY (`class_id`) REFERENCES `classgrade` (`class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `student`
--
LOCK TABLES `student` WRITE;
/*!40000 ALTER TABLE `student` DISABLE KEYS */;
/*!40000 ALTER TABLE `student` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `teacher_account`
--
DROP TABLE IF EXISTS `teacher_account`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `teacher_account` (
`teacher_id` varchar(100) NOT NULL,
`account_num` varchar(100) NOT NULL,
PRIMARY KEY (`teacher_id`,`Account_num`),
UNIQUE KEY `teacher_id_UNIQUE` (`teacher_id`),
UNIQUE KEY `account_num_UNIQUE` (`account_num`),
CONSTRAINT `Account_num` FOREIGN KEY (`account_num`) REFERENCES `account` (`account_num`),
CONSTRAINT `teacher_id` FOREIGN KEY (`teacher_id`) REFERENCES `teacher` (`teacher_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `teacher_account`
--
LOCK TABLES `teacher_account` WRITE;
/*!40000 ALTER TABLE `teacher_account` DISABLE KEYS */;
/*!40000 ALTER TABLE `teacher_account` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-11-14 23:46:43
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/Arakkoa/itproject.git
[email protected]:Arakkoa/itproject.git
Arakkoa
itproject
ITProject
master

搜索帮助