设有Teachers表,该表的定义如下: CREATE TABLE Teachers( Tno CHAR(8) PRIMARY KEY, Tname VARCHAR(10) NOT NULL, Age TINYINT CHECK(Age BETWEEN 25 AND 65) ) 下列插入语句中,不能正确执行的是()。AINSERT INTO Teachers VALUES(’T100’,’张宏’,NULL)BINSERT INTO Teachers(Tno,Tname,Age) VALUES(’T100’,’张宏’,30)CINSERT INTO Teachers(Tno,Tname) VALUES(’T100’,’张宏’)DINSERT INTO Teachers VALUES(’T100’,’张宏’)
设有Teachers表,该表的定义如下: CREATE TABLE Teachers( Tno CHAR(8) PRIMARY KEY, Tname VARCHAR(10) NOT NULL, Age TINYINT CHECK(Age BETWEEN 25 AND 65) ) 下列插入语句中,不能正确执行的是()。
AINSERT INTO Teachers VALUES(’T100’,’张宏’,NULL)
BINSERT INTO Teachers(Tno,Tname,Age) VALUES(’T100’,’张宏’,30)
CINSERT INTO Teachers(Tno,Tname) VALUES(’T100’,’张宏’)
DINSERT INTO Teachers VALUES(’T100’,’张宏’)
参考解析
略
相关考题:
若用如下的SQL语句创建表S: CREATE TABLE S(S# CHAR(6)PRIMARY KEY, SNAME CHAR(8)NOT NULL,SEX CHAR(2),AGE INTEGER) 并且S表中已经有两行: (‘022345’,‘李明芳’,‘女’,23)和(‘021876’,‘张为’,‘男’,32) 今欲向S表插入新元组:Ⅰ.(‘022345’,‘彭明芳’,‘女’,23)Ⅱ.(‘020746’,‘杨云’,NULL,NULL)Ⅲ. (‘020721’,‘张为’,‘女’,21)哪一个(些)元组可以被成功插入?A.Ⅰ和ⅡB.Ⅰ和ⅢC.Ⅱ和ⅢD.全部
若用如下的SQL语句创建一个表student: CREATE TABLE student(N0 CHAR(20) NOT NULL, NAME CHAR(8) NOT NULL, SEX CHAR(2) , AGE INT) 可以插入到表中的是______。A.(‘1031’,‘曾华’,男,23)B.(‘1031’,‘曾华’,NULL,NULL)C.(NULL,‘曾华’,‘男’,‘23’)D.(‘1031’,‘NULL’,‘男’,23)
若用如下的SQL语句创建一个表S:CREATE TABLE S(S# char(16)NOT NULL;SNAME char(8)NOT NULL,SEX char(2),AGE integer)向表S中插入如下行时,哪一行可以被插入?A)(‘872476’,,‘小芳’,女,‘21’)B)(‘854231’ ,,,‘小明’,NULL,NULL)C)(NULL, ‘小强’,‘男’,65)D)(‘657123’,NULL,‘女’,20)
若用如下的SQL语句创建了一个表S: CREATE TABLE S(S#CHAR(6)NOTNULL, SNAME CHAR(8)NOT NULL,SEX CHAR(2),AGE INTEGER) 今向S表插入如下行时,( )行可以被插入。A.('991001','李明芳',女,'23')B.('990746','张为',NULL,NULL)C.(NULL,'陈道一','男',32)D.('992345',NULL,'女',25)
若用如下的SQL语句创建表S: CREATE TABLE S(S# CHAR(6)PRIMARYKEY, SNAME CHAR(8)NOT NULL,SEX CHAR(2),AGE INTEGER)上列各元组可插入S表的是______。Ⅰ.('022345','袁鸣明','男',25)Ⅱ.('020746','杨云',NULL,NULL)Ⅲ.('020721','张为','女',21)A.全部B.Ⅰ和ⅡC.Ⅰ和ⅢD.Ⅱ和Ⅲ
若用如下的SQL语句创建一个表S: CREATE TABLE S(S# char(16)NOT NULL; SNAME char(8)NOT NULL,SEX char(2),AGE integer) 向表S中插入如下行时,哪一行可以被插入?A.('991001','李明芳',女,'23')B.('990746','张民',NULL,NULL)C.(NULL,'陈道明','男',35)D.('992345',NULL,'女',25)
用如下的SQL语句创建了一个表S:CREATE TABLE S(SNO CHAR(6) NOT NULL,SNAME CHAR(8) NOT NULL,SEX CHAR(2),AGE INTEGER);现向S表插入如下行时,哪一行可以被插入A)(′991001′,′李明芳′,女,′23′)B)(′990746′,′张为′,NULL,NULL)C)(NULL,′陈道一′,′男′,32)D)(′992345′,NULL,′女′,25)A.(′991001′,′李明芳′,女,′23′)B.(′990746′,′张为′,NULL,NULL)C.(NULL,′陈道一′,′男′,32)D.(′992345′,NULL,′女′,25)
若用如下的SQL语句创建表S: CREATE TABLES (S# CHAR(6)PRIMARY KEY, SNAME CHAR(8)NOT NULL, SEX CHAR(2),AGE INTEGER) 并且S表中已经有两行: ('022345',‘李明芳’,‘女’,23)和('021876',‘张为’,‘男’,32) 今欲向S表插入新元组:( )。Ⅰ.('022345’,‘彭鸣明’,‘男’,25)Ⅱ.('020746',‘杨云’,NULL,NULL)Ⅲ.('020721',‘张为’,‘女’,21)A.全部B.Ⅰ和ⅡC.Ⅰ和ⅢD.Ⅱ和Ⅲ
如果学生表STUDENT是使用下面的SQL语句创建的CREATE TABLE STUDENT(SNO C(4) PRIMARY KEY NOT NULL,;SN C(8),;SEX C(2),;AGE N(2) CHECK(AGE>15 AND AGE<30))下面的SQL语句中可以正确执行的是A.INSERT INTO STUDENT(SNO,SEX,AGE)VALUES (“S9”,“男”,17)B.INSERT INTO STUDENT(SN,SEX,AGE)VALUES (“李安琦”,“男”,20)C.INSERT INTO STUDENT(SEX,AGE)VALUES (“男”,20)D.INSERT INTO STUDENT(SNO,SN)VALUES (“S9”,“安琦”,16)
若用如下的SQL语句创建一个表S: CREATE TABLE S(S# CHAR(6)NOT NULL,SNAME CHAR(8)NOT NULL, SEX CHAR(2),AGE INTEGER) 现向表中插入如下行时,可以被插入的是A.('991001','李四',女,'23')B.('990746','张三',NULL,NULL)C.(NULL,'王五','男',32)D.('992345',NULL,'女',25)
若用如下的SQL语句创建一个表S: CREATE TABLE S(S# char (16) NOT NULL; SNAME char (8)NOT NULL,SEX char (2),AGE integer) 向表S中插入如下行时,( )可以被插入。A.(‘991001’,‘李明芳’,女,‘23’)B.(‘990746’,‘张民’,NULL,NULL)C.(NULL,‘陈道明’,‘男’,35)D.(‘992345’, NULL,‘女’,25)
如果学生表STUDENT是使用下面的SQL语句创建的: CREATE TABLE STUDENT(SNO C(4)PRIMARY KEY NOT NULL. SN C(8), SEX C(2), AGE N(2)CHECK(AGE15 AND AGE25)) 下面的SQL语句中可以正确执行的是( )。A. INSERT INTO STUDENT(SN,SEX,AGE)VALUES(”王磊”,”男”,20)B. INSERT INTO STUDENT(SN0,SEX,AGE)VALUES(”S9”,”男”,17)C. INSERT INTO STUDENT(SEX,AGE)VALUES(”男”,20)D. INSERT INTO STUDENT(SN0,SN,AGE)VALUES(”S9”,”王磊”,14)
若某企业的数据库系统中有如下所示的员工关系和仓库关系,每个仓库可有多名员工,但只有一名负责人。员工关系(cmployee):仓库关系(warehouse):则创建仓库表结构的SQL语句为(58)。A.CREATE TABLE(employeeID CHAR(2)NOT NULL UNIQUE, name CHAR(30)NOT NULL, address CHAR(40), pricipallD CHAR(3));B.CREATE warehouse(warehouseD CHAR(2)PRIMARY KEY, name CHAR(30), address CHAR(40), pficipalID CHAR(3));C.CREATE TABLE warehouse(warehouselD CHAR(2)PRIMARY KEY, name CHAR(30)NOT NULL, address CHAR(40), pricipalID CHAR(3), FOREIGN KEY(priciPalID)REFERENCES employee(employeeID));D.CREATE TABLE warehouse(warehouselD CHAR(2), name CHAR(30)NOT NULL, address CHAR(40), pricipalID CHAR(3), PRIMARY KEY(warehouselD), FOREIGN KEY(employeeID)REFERENCES emplo
若用如下的SQL语句创建了一个表S: CREATE TABLES(S# CHAR(6)NOT NULL, SNAME CHAR (8) NOT NULL,SEX CHAR(2),AGE INTEGER) 今向S表插入如下行时,哪一行可以被插入? ( )。A.('991001',‘李明芳’,女,'23')B.('990746',“张为’,NULL,NULL)C.(NULL,‘陈道一’,‘男’,32)D.('992345',NULL,‘女’,25)
若用如下的SQL语句创建一个表S: CREATE TABLE S(S# char(10)NOT NULL: SNAME char(10)NOT NULL,SEX char(2),AGE integer) 今向表S中插入如下行时,可以被插入的是A.('441001','陈先明',女,'23')B.('440746','张亮',NULL,NULL)C.(NULL,'李国兵','男',35)D.('442345',NULL,'女',25)
建立一个学生信息表student,要求它由学号sno、姓名sname、性别sex、年龄age4个属性组成,其学号属性唯一,学号、姓名字段不能为空。下列语句正确的是A.CREATE TABLE student(sno char(5) NOT NULL sname char(8) NOT NULL sex char(1) age int);B.CREATE TABLE student (sno char(5) NOT NULL UNIQUE sname char(8) sex char(1) age int);C.CREATE TABLE (sno char(5) NOT NULL UNIQUE sname char(8) NOT NULL sex char(1) age int);D.CREATE TABLE student (sno char(5) NOT NULL UNIQUE sname char(8) NOT NULL sex char(1) age int);
设有职工关系Emp (Eno,Ename,Esex,EDno)和部门关系Dept (Dno,Dname, Daddr),创建这两个关系的SQL语句如下:CREATE TABLE Emp (Eno CHAR(4),Ename CHAR(8),Esex CHAR(1) CHECK(Esex IN ('M','F')),EDno CHAR(4) REFERENCES Dept (Dno),PRIMARY KEY (Eno));CREATE TABLE Dept (Dno CHAR(4) NOT NULL UNIQUE,Dname CHAR(20),Daddr CHAR(30));直接运行该语句,DBMS会报错,原因是(53)。若经过修改,上述两个表创建完毕之后(尚无数据),则下述语句中能被执行的是(54)。A.创建表Dept时没有指定主码B.创建表Dept时没有指定外码C.创建表Emp时,被参照表Dept尚未创建D.表Emp的外码EDno与被参照表Dept的主码Dno不同名
Given the following requirements:Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values ‘C‘, ‘H‘ and ‘N‘, and permits inserts only when a corresponding value for the employee‘s department exists in the DEPARTMENT table.Which of the following CREATE statements will successfully create this table?()A.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN (‘C‘,‘H‘,‘N‘)), );B.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES (‘C‘,‘H‘,‘N‘) );C.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN (‘C‘,‘H‘,‘N‘)), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );D.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN (‘C‘,‘H‘,‘N‘)) );
设有健身项目表,该表的定义如下:CREATE TABLE健身项目表(项目编号I PRIMARY KEY,;项目名称C(30)NOT NULL,;单价I NULL CHECK(单价>;=0))下列插入语句中,提示错误的是( )。A.INSERT INTO健身项目表(项目编号,项目名称,单价)VALUES(1,ˋ瑜伽ˊ,20)B.INSERT INTO健身项目表(项目编号,项目名称)VALUES(1,ˋ瑜伽ˊ)C.INSERT INTO健身项目表VALUES(1,ˋ瑜伽ˊ,NULL)D.INSERT INTO健身项目表(项目名称,单价)VALUES(ˋ瑜伽ˊ,20)
若用如下的SQL语句创建一个表S:CREATE TABLE S(S# char( l6)NOT NULL;SNAME char( 8)NOT NULL,SEX char( 2),AGE integer)向表S中插入如下行时,哪一行可以被插入?A.(′991001′,′李明芳′,女,′23′)B.(′990746′,′张民′,NULL,NULL)C.(NULL,′陈道明′,′男′,35)D.(′992345′,NULL,′女′,25)
若用如下的SQL语句创建表S, CREATE TABLES (S# CHAR(6)PRIMARY KEY, SNAME CHAR(8)NOT NULL,SEX CHAR(2),AGE INTEGER)下列各元组可插入S表的是______。Ⅰ.('022345','彭鸣明','男','25')Ⅱ.('020746','杨云',NULL,NULL)Ⅲ.('020721','张为','女','21')A.全部B.Ⅰ和ⅡC.Ⅰ和ⅢD.Ⅱ和Ⅲ
建立一个学生信息表student,要求它由学号sno,姓名sname,性别sex,年龄age,4个属性组成,其学号属性惟一,学号、姓名字段不能为空。下列语句正确的是A.CREATE TABLE student (sno char(5)NOT NULL sname char(8)NOT NULL sex char age int);B.CREATE TABLE student (sno char(5)NOT NULL UNIQUE sname char(8) sex char age int);C.CREATE TABLE (sno char(5)NOT NULL UNIQUE sname char(8)NOT NULL sex char age int);D.CREATE TABLE student (sno char(5)NOT NULL UNIQUE sname char(8)NOT NULL sex char age int);
如果学生表STUDENT是使用下面的SQL语句创建的:CREATE TABLE STUDENT(SNO C(4) PRIMARY KEY NOT NULL,,;SN C(8),;SEX C(2),;AGE N(2) CHECK(AGE>15 AND AGE<30))下面的SQL语句中可以正确执行的是( )。AA.BB.CC.DD.答案
若用如下的SQL语句创建表S: CREATE TABLE S(S#CHAR(6)PRIMARY KEY, SNAME CHAR(8)NOT NULL,SEX CHAR(2),AGE INTEGER) 并且S表中已经有两行: (‘022345’,‘李明芳’,‘女’,23)和(‘021876’,‘张为’,‘男’,32) 今欲向S表插入新元组:Ⅰ.(‘022345’,‘彭鸣明’,‘男’,25)Ⅱ.(‘020746’,‘杨云’,NULL,NULL)Ⅲ.(‘020721’,‘张为’,‘女’,21)可以被成功插入的是A.全部B.Ⅰ和ⅡC.Ⅰ和ⅢD.Ⅱ和Ⅲ
用下面的T-SOL语句建立- -个基本表:CREATE TABLE Student (Sno CHAR(4) PRIHART KEY,Sname CHAR(8)NOT MULL,Sex CHAR(2),Age INT)可以插入到表中的元组是( )。A.‘5021′,NULL,男,21B.‘5021′,‘刘祥′,NULL,NULLC.‘5021′,‘刘祥′,男,21D.NULL,‘刘祥′,NULL,21
Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()A、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );B、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );C、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );D、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );
单选题设有Teachers表,该表的定义如下: CREATE TABLE Teachers( Tno CHAR(8) PRIMARY KEY, Tname VARCHAR(10) NOT NULL, Age TINYINT CHECK(Age BETWEEN 25 AND 65) ) 下列插入语句中,不能正确执行的是()。AINSERT INTO Teachers VALUES(’T100’,’张宏’,NULL)BINSERT INTO Teachers(Tno,Tname,Age) VALUES(’T100’,’张宏’,30)CINSERT INTO Teachers(Tno,Tname) VALUES(’T100’,’张宏’)DINSERT INTO Teachers VALUES(’T100’,’张宏’)
单选题Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()ACREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );BCREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );CCREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );DCREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );