MySQL Database basic Practice--the course practice of engineering database of Jiaotong University

Source: Internet
Author: User

=========================
1. Creating databases and Tables
=========================

A total of 6 tables, Student information table, class information table, Teacher information table, curriculum, selection of curriculum, teachers schedule

#班级信息表class, the structure is as follows

Field name

Field type

Constraint conditions

Field meaning description

Classno

varchar (6)

Primary Key

Class number

ClassName

Varchar (20)

NOT NULL

Class name

Classspecial

VARCHAR2 (20)

Affiliated Professional

Classdept

VARCHAR2 (20)

Affiliated Department

#学生基本信息表student, the structure is as follows:

Field name

Field type

Constraint conditions

Field meaning description

Sno

Number (8)

Primary Key

School Number

Sname

VARCHAR2 (8)

NOT NULL

Name

Ssex

VARCHAR2 (2)

' Male ' or ' female '

Gender

Sbirthday

Date

Date of birth

Classno

varchar (6)

Foreign Key

Class number

#教师信息表teacher, the structure is as follows:

Field name

Field type

Constraint conditions

Field meaning description

Tno

Number (6)

Primary Key

Teacher Number

Tname

VARCHAR2 (8)

NOT NULL

Name of teacher

Tsex

VARCHAR2 (2)

' Male ' or ' female '

Gender

Tbirthday

Date

Date of birth

Ttitle

VARCHAR2 (10)

Title

#课程信息表course, the structure is as follows:

Field name

Field type

Constraint conditions

Field meaning description

Cno

Number (6)

Primary Key

Course Number

CName

VARCHAR2 (30)

NOT NULL

Course Name

Score

Number (6,2)

Credits

#选修课程信息表sc, the structure is as follows:

Field name

Field type

Constraint conditions

Field meaning description

Sno

Number (8)

Foreign Key

School Number

Cno

Number (6)

Foreign Key

Course Number

Grade

Number (6,1)

Results

#教师任课情况表teaching, the structure is as follows:

Field name

Field type

Constraint conditions

Field meaning description

Tno

Number (6)

Foreign Key

Teacher Number

Cno

Number (6)

Foreign Key

Course Number

MySQL Database basic Practice--the course practice of engineering database of Jiaotong University

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.