如果学生表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
A.B
B.C
C.D
D.答案
第1题:
根据SQL标准,删除表student中对字段sno的唯一性约束,应该使用下面哪条语句? ()
A drop sno from table student
B alter table student drop sno
C alter table student drop unique(sno)
D alter table student drop sno unique
第2题:
如果学生表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)
第3题:
如果学生表student是使用下面的SQL谙句创建的: CREATE TABLE student(学号C(6)PRIMARY KEY NOT NULL,姓名C(8),性别C(2),年龄N(2) CHECK(年龄>15 AND年龄<30,)) 则下面的SQL语句中可以正确执行的是( )。
A. INSERT INTO student(学号,性别,年龄)VALUES(”0542”,”李雷”,”男”,17)
B. INSERT INTO student(学号,性别,年龄)VALUES(”李雷”,”男”,20)
C. INSERT INTO student(学号,性别,年龄)VALUES(”女”,25)
D. INSERT INTO student(学号,性别,年龄)VALUES(”0897”,”安宁”,”女”,30)
第4题:
建立一个学生信息表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);
第5题:
若用如下的SQL语句创建一个student表: CREATE TABLE student( N0 C(4)NOT NULL, NAME C(8)NOT NULL, SEX C(2), AGE N(2) ) 可以插入到student表中的是
A.('1031','曾华',男,23)
B.('1031','曾华',NULL,NULL)
C.(NULL,'曾华','男','23')
D.('1031',NULL,'男',23)
第6题:
如果学生表student是使用下面的SQL语句创建的
CREATE TABLE student(学号C(4)PRIMARY KEY NOT NULL,;
姓名C(8),;
性别C(2),;
年龄N(2)CHECK(年龄>1 5 AND年龄<30))
下面的SQL语句中可以正确执行的是( )。
A)INSERT INTO student(学号,性别,年龄)VALUES(”0542”,”男”,l7)
B)INSERT INTO student(姓名,性别,年龄VALUES(”李蕾”,”女”,20)
C)INSERT INTO student(姓名,性别,年龄)VALUES(”男”,25)
D)INSERT INTO student(学号,姓名)VALUES(”0897”,”安宁”,16)
第7题:
已知数据表Student存储在SQL Server服务器的School数据库中,用户名为sa,密码为xyz123,创建student数据表的命令为: CREATE TABLE Student ( SName varchar(20) Primary Key Not NULL, SPwd Varchar(15) Not NULL ) 试根据下面的代码使用命令对象完成在student数据表中插入一条记录。 <% tname = Request.Form("txtName") ’接收到的用户名 tpwd = Request.Form("txtPwd") ’接收到的密码 %>
第8题:
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()
第9题:
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()
第10题:
第11题:
CREATE TABLE student_grades (student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), CONSTRAINT student_id_fk REFERENCES (student_id) FOREIGN KEY student (student_id));
CREATE TABLE student_grades(student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id));
CREATE TABLE student_grades(student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), CONSTRAINT FOREIGN KEY (student_id) REFERENCES student (student_id));
CREATE TABLE student_grades(student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id));
第12题:
ALTER TABLE students ADD PRIMARY KEY student_id;
ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);
ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
第13题:
根据SQL标准,下面哪句语句能够找出年龄最小的同学?其中age为学生表student中的年龄字段,sno为学生的学号。()
A select max(age) from student
B select sno from student where age = max(age)
C select sno from student having age = max(age)
D select sno from student a where a.age<= (select min(b.age) from student b)
第14题:
如果学生表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<25)) 下面的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)
第15题:
如果学生表STUDENT是使用下面的SQL语句创建的 CREATE TABLE STUDENT(SNOC(4)PR1MARY KEY NOTNULL; SNC(8),; SEXC(2),; AGEN(2)CHECK(AGE>15AND AGE<30) 下面的SQI语句中可以正确执行的是 ______。
A.INSERT INTO STUDENT(SNO,SEX,AGE)valueS("S9","男",17)
B.INSERT INTO STUDENT(SNO,SEX,AGE)valueS(“李安琦”,“男”,20)
C.INSERT INTO STUDENT(SEX,AGE)valueS(“男”,20)
D.INSERT INTO STUDENT(SNO,SN)valueS("S9",“安琦”,16)
第16题:
一个学生信息表student,要求它由学号sno,姓名sname,性别sex,年龄age,4个属性组成。现在对这个现有的表增加一个入学时间cometime字段为日期型,下列语句正确的是
A.ALTER TABLE student ADD cometime DATE NOT NULL;
B.ALTER TABLE student ADD cometime DATE;
C.ALTER TABLE student DROP cometime DATE NOT NULL:
D.ALTER TABLE student MODIFY cometime DATE;
第17题:
建立一个学生信息表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);
第18题:
You need to design a student registration database that contains several tables storing academic information. The STUDENTS table stores information about a student. The STUDENT_GRADES table stores information about the student's grades. Both of the tables have a column named STUDENT_ID. The STUDENT_ID column in the STUDENTS table is a primary key. You need to create a foreign key on the STUDENT_ID column of the STUDENT_GRADES table that points to the STUDENT_ID column of the STUDENTS table. Which statement creates the foreign key?()
第19题:
在SQL Sever中,创建数据库student,使用的语句是()。
第20题:
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()
第21题:
CREATE TABLE student
CREATE VIEW student
CREATE PROC student
CREATE DATABASE student
第22题:
ALTER TABLE students ADD PRIMARY KEY _ id;
ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);
ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;
ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
第23题:
ALTER TABLE students ADD PRIMARY KEY student_id;
ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);
ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;
ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);