sql语句中constraint是什么意思啊create table 成绩(学号 char(11) references 学员信息(学号) not null,课程 int references 课程(编号) not null,考次 int constraint PK_成绩 primary key(学号,课程,考次) not null,成绩 decim

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/27 19:31:39
sql语句中constraint是什么意思啊create table 成绩(学号 char(11) references 学员信息(学号) not null,课程 int references 课程(编号) not null,考次 int constraint PK_成绩 primary key(学号,课程,考次) not null,成绩 decim

sql语句中constraint是什么意思啊create table 成绩(学号 char(11) references 学员信息(学号) not null,课程 int references 课程(编号) not null,考次 int constraint PK_成绩 primary key(学号,课程,考次) not null,成绩 decim
sql语句中constraint是什么意思啊
create table 成绩
(
学号 char(11) references 学员信息(学号) not null,
课程 int references 课程(编号) not null,
考次 int constraint PK_成绩 primary key(学号,课程,考次) not null,
成绩 decimal(5,2)default(0) not null
)
这是一个建表的SQL语句
constraint PK_成绩 primary key(学号,课程,考次)这句的意义
decimal的意思,括号里的(5,2)又是什么?

sql语句中constraint是什么意思啊create table 成绩(学号 char(11) references 学员信息(学号) not null,课程 int references 课程(编号) not null,考次 int constraint PK_成绩 primary key(学号,课程,考次) not null,成绩 decim
这条语句的意思是:
创建表,表名为“成绩”,表中包含4个字段,其中
“学号”字段为char(字符)类型,宽度为11,同时,对该字段建立foreign key(外部键)约束,参照“学员信息”表的“学号”字段,并且不允许空值;
“课程”字段为int(整数)类型,同时,对该字段建立foreign key(外部键)约束,参照“课程”表的“编号”字段,并且不允许空值;
“考次”字段为int(整数)类型,同时,对该字段建立约束名为“PK_成绩”的primary key(主键)约束,该主键是复合主键,同时作用在学号、课程和考次3个字段上,并且不允许空值;
“成绩”字段为decimal(带固定精度和小数位数的数值数据)类型,总宽度为5位,小数位数为2,同时,对该字段建立default(默认)约束,默认值为0,并且不允许空值

sql语句中DISTINCT是什么意思 integer是什么意思?SQL语句中 sql语句中constraint是什么意思啊create table 成绩(学号 char(11) references 学员信息(学号) not null,课程 int references 课程(编号) not null,考次 int constraint PK_成绩 primary key(学号,课程,考次) not null,成绩 decim SQL中begin end 怎么用着条语句? sql语句中什么时候用commit? sql 语句中commit的作用 T-SQL语句中中括号([])的用法是什么,什么时候该用 CREATE TABLE 教师 (教师编号 integer,姓名 text,constraint [index] primary key (教师编号)); 请问这CREATE TABLE 教师 (教师编号 integer,姓名 text,constraint [index] primary key (教师编号)); 请问这个sql语句有什 SELECT ROUND(TO_NUMBER(sysdate - LAST_LOGIN_TIME) * 24 ) timdif,LOGIN_FAIL_C 这句sql语句是什么意呢? oracle sql 语句中where条件中 1=1 count(*)和count(1)的区别是什么?在查询的sql语句中,两者有什么区别? SQL中WHERE 表名 LIKE 'CHEF%'OR UP>$70这句语句意思是什么,其中LIKE与OR用法 ORACLE中between…and...是SQL语句中的吗?还是仅限于SQL*PLUS里? 数据库中两个数相除怎么写SQL语句 sql语句中year(getdate())-year(birthday)=22是什么意思? sql语句 decimal(18, drop table if exists address_book;这句SQL语句是什么意思我备份的SQL语句中有这么一行, 这条sql语句是什么意思CONSTRAINT fk_join_uid FOREIGN KEY (join_uid) REFERENCES users (u_id),//FOREIGN KEY (join_uid):代表当前表的字段//users (u_id)代表另一张表的字段那么users是主表.join_uid是从表,对么?我知道这