一个简单的选课表的定义问题,在线等!

qq675927952 2008-12-23 09:10:31

create database "选课系统" ;
--系(系号)

create table Department
(
Dept char(20) primary key
);

--学生(学号,姓名,性别,年龄,系别)
create table Student
(
Sno char(9) primary key,
Sname char(20) not null,
Ssex char(2) check(Ssex in ('男','女')),
Sage smallint check(Sage>=0 and Sage <= 150 ),
Dept char(20),
--constraint c1 check(Sage>=0 and Sage <= 150 ),
foreign key Dept references Department(Dept)

) ;

--课程(课程号,课程名,开课系,任课教师)
create table Course
(
Cno smallint primary key,
Cname char(20) not null,
Dept char(20) ,
Cteacher char(20) ,
foreign key Dept references Department(Dept)

);

--学习(学号,课程号,成绩)
create table SC
(
Sno char(9) not null,
Cno smallint not null,
Grade smallint check(Grade <=100 and Grade >=0),
primary key (Sno,Cno),
foreign key Sno references Student(Sno),
foreign key Cno references Course(Cno)
);



不知道怎么就是定义不了这三个表,
消息 102,级别 15,状态 1,第 18 行
'Dept' 附近有语法错误。
消息 102,级别 15,状态 1,第 29 行
'Dept' 附近有语法错误。
消息 102,级别 15,状态 1,第 40 行
'Sno' 附近有语法错误。
我是DBA,应该不是权限问题!感觉是外码的问题,
...全文
142 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bennyyyyy 2008-12-23
  • 打赏
  • 举报
回复
create database "选课系统" ;
--系(系号)

create table Department
(
Dept char(20) primary key
);

--学生(学号,姓名,性别,年龄,系别)
create table Student
(
Sno char(9) primary key,
Sname char(20) not null,
Ssex char(2) check(Ssex in ('男','女')),
Sage smallint check(Sage>=0 and Sage <= 150 ),
Dept char(20) foreign key references Department(Dept)
--constraint c1 check(Sage>=0 and Sage <= 150 ),
) ;

--课程(课程号,课程名,开课系,任课教师)
create table Course
(
Cno smallint primary key,
Cname char(20) not null,
Dept char(20) ,
Cteacher char(20) foreign key references Department(Dept)

);

--学习(学号,课程号,成绩)
create table SC
(
Sno char(9) not null foreign key references Student(Sno),
Cno smallint not null foreign key references Course(Cno),
Grade smallint check(Grade <=100 and Grade >=0),
primary key (Sno,Cno)
);

qq675927952 2008-12-23
  • 打赏
  • 举报
回复
太感谢了!
dawugui 2008-12-23
  • 打赏
  • 举报
回复
你少了扩号.

create table Department
(
Dept char(20) primary key
);
go
--学生(学号,姓名,性别,年龄,系别)
create table Student
(
Sno char(9) primary key,
Sname char(20) not null,
Ssex char(2) check(Ssex in ('男','女')),
Sage smallint check(Sage>=0 and Sage <= 150 ),
Dept char(20),
--constraint c1 check(Sage>=0 and Sage <= 150 ),
foreign key (Dept) references Department(Dept)

) ;
go
--课程(课程号,课程名,开课系,任课教师)
create table Course
(
Cno smallint primary key,
Cname char(20) not null,
Dept char(20) ,
Cteacher char(20) ,
foreign key (Dept) references Department(Dept)

);
go
--学习(学号,课程号,成绩)
create table SC
(
Sno char(9) not null,
Cno smallint not null,
Grade smallint check(Grade <=100 and Grade >=0),
primary key (Sno,Cno),
foreign key (Sno) references Student(Sno),
foreign key (Cno) references Course(Cno)
);
go
水族杰纶 2008-12-23
  • 打赏
  • 举报
回复
create database 选课系统
--系(系号)
create table Department
(
Dept char(20) primary key
);
go
--学生(学号,姓名,性别,年龄,系别)
create table Student
(
Sno char(9) primary key,
Sname char(20) not null,
Ssex char(2) check(Ssex in ('男','女')),
Sage smallint check(Sage>=0 and Sage <= 150 ),
Dept char(20),
--constraint c1 check(Sage>=0 and Sage <= 150 ),
foreign key references Department(Dept)

)
;

--课程(课程号,课程名,开课系,任课教师)
create table Course
(
Cno smallint primary key,
Cname char(20) not null,
Dept char(20) ,
Cteacher char(20) ,
foreign key references Department(Dept)

);

--学习(学号,课程号,成绩)
create table SC
(
Sno char(9) not null,
Cno smallint not null,
Grade smallint check(Grade <=100 and Grade >=0),
primary key (Sno,Cno),
foreign key references Student(Sno),
foreign key references Course(Cno)
);
dawugui 2008-12-23
  • 打赏
  • 举报
回复
你就是外键创立不了?
worlddba 2008-12-23
  • 打赏
  • 举报
回复
UP楼上的
内容概要:本文详细记录了对一个Android ARM64静态ELF文件中字符串加密机制的逆向分析过程。该ELF文件的所有字符串均被加密,无法通过常规strings命令或IDA直接识别。作者通过分析发现,加密字符串存储在.rodata段,其解密所需信息(包括密文地址、长度和16位密钥)保存在.data.rel.ro段的40字节描述符中。核心解密函数sub_10F408采用自反的双pass流密码算法,结合固定密钥KEY_TERM(由.data段24字节数据计算得出),实现字节级非线性、位置与长度相关的加密。文章还复现了完整的Python解密脚本,并揭示了该保护机制的本质为代码混淆而非强加密,最终成功批量解密全部956条字符串,暴露程序真实行为,如shell命令模板、设备标识篡改、网络重置等操作。此外,文中还提及未启用的自定义壳框架及其反dump设计。; 适合人群:具备逆向工程基础的安全研究人员、二进制分析人员及对ELF保护技术感兴趣的开发者。; 使用场景及目标:①学习ELF二进制中字符串加密的典型实现方式与逆向突破口;②掌握从结构识别、函数追踪到算法还原的完整逆向流程;③理解“绑定二进制”的完整性校验设计及其局限性;④实践编写IDAPython脚本自动化提取与解密敏感数据。; 阅读建议:此资源以实战案例驱动,不仅展示技术细节,更强调逆向思维与验证方法,建议读者结合IDA调试环境,逐步跟随文中步骤进行动态分析与算法验证,深入理解每一步的推理依据。

22,297

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧