Database of the [Score Management System] written a long time ago

Source: Internet
Author: User

I saw a garbled problem on the forum today. I suddenly remembered that MySQL (6.xis used here, and the engine type must be specified) should be used to create a database, and the character set type should be specified during table creation.

 

 

Create Database dultscore default Character Set GBK
;

Use dultscore;
Create Table scorelogin (
Sl_num char (6) Not null primary key,
Sl_name char (10) Not null,
Sl_pass char (16) not null,
Sl_permession int not null
) Engine = MyISAM

Default Character Set GBK
;

Insert into scorelogin values ('admin', 3 );

Create Table Collage
(
Coll_id int not null auto_increment primary key,
Coll_name varchar (30) not null
) Engine = MyISAM
Default Character Set GBK;

Create Table professional
(
Pro_id int not null auto_increment primary key,
Pro_name varchar (30) not null,
Coll_name varchar (30) not null
 
) Engine = MyISAM
Default Character Set GBK;

Create Table semester
(
Semester char (26) not null primary key
) Engine = MyISAM
Default Character Set GBK;

Create Table schoolyear
(
Schoolyear char (4) not null primary key
) Engine = MyISAM
Default Character Set GBK;

Create Table Course
(
Courseid char (6) Not null primary key,
Coursename char (4) not null,
Courseright int not null,
Coursetype int not null
) Engine = MyISAM
Default Character Set GBK;

Create Table prosemester
(
Prosemid int not null auto_increment primary key,
Prosemcollname varchar (30) not null,
Prosemproname varchar (30) not null,
Prosemsemester char (26) not null,
Prosemschoolyear char (4) not null
) Engine = MyISAM
Default Character Set GBK;

Create Table semesterteacher
(
Semtea_id int not null auto_increment primary key,
Semtea_prosem_id int not null,
Semtea_teachernum char (6) Not null,
Semtea_class char (4) not null
) Engine = MyISAM
Default Character Set GBK;

Create Table semestercourse
(

Semcour_prosem_id int not null,
Semcour_courseid char (6) Not null,
Primary Key (semcour_prosem_id, semcour_courseid)

) Engine = MyISAM
Default Character Set GBK;

Create Table semesterstudent
(
Semstu_prosem_id int not null,
Semstu_stunum char (9) Not null,
Semstu_stuname varchar (8) Not null,
Semstu_stuclass char (4) not null,
Semstu_stusta int default 1 not null,
Primary Key (semstu_prosem_id, semstu_stunum)

) Engine = MyISAM
Default Character Set GBK;

Create Table semesterresults
(
Semres_semtea_id int not null,
Semres_prosem_id int not null,
Semres_stuclass char (4) not null,
Semres_stunum char (9) Not null,
Semres_courseid char (6) Not null,
Semres_semresscore char (1) not null,
Primary Key (semres_semtea_id, semres_stunum, semres_courseid)
) Engine = MyISAM
Default Character Set GBK;

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.