/*
Navicat MySQL Data Transfer

Source Server         : MySQL
Source Server Version : 50605
Source Host           : localhost:3306
Source Database       : xxgl

Target Server Type    : MYSQL
Target Server Version : 50605
File Encoding         : 65001

Date: 2018-12-24 08:22:56
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for cour
-- ----------------------------
DROP TABLE IF EXISTS `cour`;
CREATE TABLE `cour` (
  `C_no` char(3) CHARACTER SET gbk NOT NULL,
  `c_name` varchar(20) CHARACTER SET gbk DEFAULT NULL,
  `C_book` varchar(50) CHARACTER SET gbk DEFAULT NULL,
  `c_ct` int(11) DEFAULT NULL,
  `c_pno` char(3) CHARACTER SET gbk DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of cour
-- ----------------------------
INSERT INTO `cour` VALUES ('101', '计算机原理', '《计算机原理》', '2', '102');
INSERT INTO `cour` VALUES ('102', '计算方法', '《大学计算方法》', '2', '106');
INSERT INTO `cour` VALUES ('103', '操作系统', '《计算机操作系统》', '3', '106');
INSERT INTO `cour` VALUES ('104', '数据库原理及应用', '《数据库应用技术》', '4', '101');
INSERT INTO `cour` VALUES ('105', '网络基础', '《计算机网络（三级）》', '2', '104');
INSERT INTO `cour` VALUES ('106', '高等数学', '《高等数学》', '5', null);
INSERT INTO `cour` VALUES ('107', '英语', '《大学英语（第二册）》', '5', null);
INSERT INTO `cour` VALUES ('108', 'PB程序设计', '《PB程序设计基础》', '4', null);

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `C_no` char(3) NOT NULL,
  `c_name` varchar(20) DEFAULT NULL,
  `C_book` varchar(50) DEFAULT NULL,
  `c_ct` int(11) DEFAULT NULL,
  `c_pno` char(3) DEFAULT NULL,
  PRIMARY KEY (`C_no`),
  UNIQUE KEY `c_name` (`c_name`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;

-- ----------------------------
-- Records of course
-- ----------------------------
INSERT INTO `course` VALUES ('101', '计算机原理', '《计算机原理》', '2', '102');
INSERT INTO `course` VALUES ('102', '计算方法', '《大学计算方法》', '2', '106');
INSERT INTO `course` VALUES ('103', '操作系统', '《计算机操作系统》', '3', '106');
INSERT INTO `course` VALUES ('104', '数据库原理及应用', '《数据库应用技术》', '4', '101');
INSERT INTO `course` VALUES ('105', '网络基础', '《计算机网络（三级）》', '2', '104');
INSERT INTO `course` VALUES ('106', '高等数学', '《高等数学》', '5', null);
INSERT INTO `course` VALUES ('107', '英语', '《大学英语（第二册）》', '5', null);
INSERT INTO `course` VALUES ('108', 'PB程序设计', '《PB程序设计基础》', '4', null);

-- ----------------------------
-- Table structure for dept
-- ----------------------------
DROP TABLE IF EXISTS `dept`;
CREATE TABLE `dept` (
  `D_no` char(10) NOT NULL,
  `D_name` char(30) NOT NULL,
  `D_office` varchar(50) DEFAULT '办公楼',
  PRIMARY KEY (`D_name`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;

-- ----------------------------
-- Records of dept
-- ----------------------------
INSERT INTO `dept` VALUES ('102', '经贸', '办公楼323');
INSERT INTO `dept` VALUES ('103', '土木工程', '办公楼321');
INSERT INTO `dept` VALUES ('101', '信息', '办公楼422');

-- ----------------------------
-- Table structure for sc
-- ----------------------------
DROP TABLE IF EXISTS `sc`;
CREATE TABLE `sc` (
  `sc_no` int(11) NOT NULL AUTO_INCREMENT,
  `S_no` char(6) NOT NULL,
  `C_no` char(3) NOT NULL,
  `SC_sco` decimal(4,1) DEFAULT '60.0',
  PRIMARY KEY (`sc_no`),
  KEY `sc_fk1` (`S_no`),
  KEY `sc_fk2` (`C_no`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=gbk;

-- ----------------------------
-- Records of sc
-- ----------------------------
INSERT INTO `sc` VALUES ('1', '020202', '103', '55.0');
INSERT INTO `sc` VALUES ('2', '020202', '108', '80.0');
INSERT INTO `sc` VALUES ('3', '020203', '103', '57.0');
INSERT INTO `sc` VALUES ('4', '020101', '101', '90.0');
INSERT INTO `sc` VALUES ('5', '020101', '102', '92.0');
INSERT INTO `sc` VALUES ('6', '020101', '107', '93.0');
INSERT INTO `sc` VALUES ('7', '020102', '101', '58.0');
INSERT INTO `sc` VALUES ('8', '020102', '102', '63.0');
INSERT INTO `sc` VALUES ('9', '020104', '107', '76.0');
INSERT INTO `sc` VALUES ('10', '020102', '103', '55.0');
INSERT INTO `sc` VALUES ('11', '020102', '108', '80.0');
INSERT INTO `sc` VALUES ('12', '020103', '103', '57.0');
INSERT INTO `sc` VALUES ('13', '020104', '103', '71.0');

-- ----------------------------
-- Table structure for stu
-- ----------------------------
DROP TABLE IF EXISTS `stu`;
CREATE TABLE `stu` (
  `S_no` char(6) NOT NULL,
  `s_name` char(8) DEFAULT NULL,
  `S_sex` enum('女','男') NOT NULL DEFAULT '女',
  `s_birth` date DEFAULT NULL,
  `S_class` char(10) NOT NULL,
  `s_dept` char(30) DEFAULT NULL,
  `S_cour` varchar(10) DEFAULT NULL,
  `S_tel` char(11) DEFAULT NULL,
  PRIMARY KEY (`S_no`),
  UNIQUE KEY `S_1` (`s_name`),
  KEY `s_fk` (`s_dept`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;

-- ----------------------------
-- Records of stu
-- ----------------------------
