⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 choles.sql

📁 简单的选课系统 采用delphi书写 包含简单的管理功能以及学生 教师 管理员登陆
💻 SQL
字号:
--create database
use "master";
go
create database "choles";
go
use "choles";
go
--管理员表
create table [dbo].[管理员](
	[管理员账号][char](20) not null primary key,
	[密码][char](20) null,
	[姓名][char](20) null,
	[性别][char](2) null,
	[出生年月][datetime]null,
	[所在单位] [char] (50) NULL,
	[联系地址] [char] (80) NULL,
	[邮政编码] [char] (6) NULL,
	[电话1] [char] (15) NULL,
	[电话2] [char] (15) NULL,
	[备注] [text] NULL
)
go
--教师表
create table [dbo].[教师](
	[教师账号][char](20)not null primary key,
	[密码][char](20)not null,
	[姓名][char](20) null,
	[性别][char](2) null,
	[出生年月][datetime]null,
	[所在单位] [char] (50) NULL,
	[联系地址] [char] (80) NULL,
	[邮政编码] [char] (6) NULL,
	[电话1] [char] (15) NULL,
	[电话2] [char] (15) NULL,
	[备注] [text] NULL
)
go
--学生表
create table [dbo].[学生](
	[学生学号][char](10)not null primary key,
	[学生姓名][char](20)not null,
	[密码][char](20)not null,
	[性别][char](2) null,
	[出生年月][datetime]null,
	[所在学院] [char] (50) NULL,
	[联系电话][char](15) null,
	[备注] [text] NULL
)
go
--申请开课列表
create table [dbo].[申请开课列表](
	[课程号][char](10)not null primary key,
	[开课教师][char](20)not null,
	[课程名][char](20)not null,
	[课容量][char](3)not null
)
go
--课程列表
create table [dbo].[课程列表](
	[课程号][char](10)not null primary key,
	[开课教师][char](20)not null,
	[课程名][char](20)not null,
	[课容量][char](3)not null,
	foreign key([开课教师]) referances 教师([姓名])
		on delete cascade
)
go
--选课表
create table [dbo].[选课表](
	[课程号][char](10)not null,
	[学生学号][char](10)not null,
	primary key([课程号],[学生学号]);
	foreign key([学生学号]) referances 学生([学生学号])
		on delete cascade,
	foreign key([课程号]) referances 课程列表([课程号])
		on delete cascade
)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -