-
Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements insert a row into the table? ()
A . INSERT INTO employees VALUES ( NULL, 'John', 'Smith');
B . INSERT INTO employees( first_name, last_name) VALUES( 'John', 'Smith');
C . INSERT INTO employees VALUES ( '1000', 'John', NULL);
D . INSERT INTO employees (first_name, last_name, employee_id) VALUES ( 1000, 'John', 'Smith');
E . INSERT INTO employees (employee_id) VALUES (1000);
F . INSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'John', ' ')
-
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?()
A . ALTER TABLE students ADD PRIMARY KEY student_id;
B . ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);
C . ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
D . ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id)
-
Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE Which UPDATE statement is valid?()
A . UPDATE employees SET first_name = 'John' SET last_name ='Smith' WHERE employee_id = 180;
B . UPDATE employees SET first_name = 'John', SET last_name ='Smith' WHERE employee_id = 180;
C . UPDATE employees SET first_name = 'John' AND last_name ='Smith' WHERE employee_id = 180;
D . UPDATE employees SET first_name = 'John', last_name ='Smith' WHERE employee_id = 180
-
Examine the following statement that is used to modify the primary key constraint on the SALES table: SQL> ALTER TABLE SALES MODIFY CONSTRAINT pk DISABLE VALIDATE; Which three statements aretrue regarding the above command()
A . The constraint remains valid.
B . The index on the constraint is dropped.
C . It allows the loading of data into the table using SQL *Loader.
D . New data conforms to the constraint, but existing data is not checked.
E . It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements.
-
Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements inserts a row into the table? ()
A . INSERT INTO employees VALUES (NULL, 'JOHN','Smith');
B . INSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');
C . INSERT INTO employees VALUES ('1000','JOHN','NULL');
D . INSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');
E . INSERT INTO employees (employee_id) VALUES (1000);
F . INSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'john',")
-
Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2 (25) LAST_NAME VARCHAR2 (25) HIRE_DATE DATE Which UPDATE statement is valid? ()
A . UPDATE employees SET first_name = 'John' SET last_name = 'Smith' WHERE employee_id = 180;
B . UPDATE employees SET first_name = 'John', SET last_name = 'Smoth' WHERE employee_id = 180;
C . UPDATE employee SET first_name = 'John' AND last_name = 'Smith' WHERE employee_id = 180;
D . UPDATE employee SET first_name = 'John', last_name = 'Smith' WHERE employee_id = 180
-
由以下语句创建的表有种子字段,请正确组合插入语句,可不分先后。CREATE TABLE Customer(id int IDENTITY PRIMARY KEY,Customer varchar(40))()
A . INSERT INTO Customer
B . SET IDENTITY_INSERT Customer ON
C . VALUES(3,’garden shovel’)
D . (id,Customer)
-
Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements insert a row into the table? ()
A . INSERT INTO employees VALUES (NULL, 'John', 'smith');
B . INSERT INTO employees (first_name, last_name) VALUES ('John', 'smith');
C . INSERT INTO employees VALUES ('1000, 'John', 'smith');
D . INSERT INTO employees (first_name, last_name, employee_id) VALUES (1000, 'John', 'smith');
E . INSERT INTO employees (employee_id) VALUES (1000);
F . INSERT INTO employees ( employee_id, first_name, last_name, ) VALUES (1000, 'John','')
-
Which of the following will be a consequence of defining the column IDCOL2 in TABLE2 as a foreign key referencing the primary key (IDCOL1) of TABLE1?()
A . DB2 will no longer allow updating the value of IDCOL1 in TABLE1.
B . When inserting a row in TABLE2, the only values that DB2 will allow for IDCOL2 are the existing values of IDCOL1.
C . When inserting a row in TABLE2, DB2 will only allow foreign values for IDCOL2, that is values which do not exist in IDCOL1.
D . When a SELECT statement joins TABLE1 with TABLE2, DB2 will automatically add the condition TABLE1.IDCOL1=TABLE2.IDCOL2 if not specified in the statement.
-
Which two statements are true about the primary key constraint in a table? ()
A . It is not possible to disable the primary key constraint.
B . It is possible to have more than one primary key constraint in a single table.
C . The primary key constraint can be referred by only one foreign key constraint.
D . The primary key constraint can be imposed by combining more than one column.
E . The non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.
-
设有Teachers表,该表的定义如下: CREATE TABLE Teachers( Tno CHAR(8) PRIMARY KEY, Tname VARCHAR(10) NOT NULL, Age TINYINT CHECK(Age BETWEEN 25 AND 65) ) 下列插入语句中,不能正确执行的是()。
A . INSERT INTO Teachers VALUES(’T100’,’张宏’,NULL)
B . INSERT INTO Teachers(Tno,Tname,Age) VALUES(’T100’,’张宏’,30)
C . INSERT INTO Teachers(Tno,Tname) VALUES(’T100’,’张宏’)
D . INSERT INTO Teachers VALUES(’T100’,’张宏’)
-
CREATE TABLE customer (cid BIGINT NOT NULL PRIMARY KEY, info XML) How many names will be returned for this XQuery?()https://assets.asklib.com/images/image2/2018080214495585870.jpg
A . 0
B . 1
C . 2
D . 3
-
Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE Which INSERT statement is valid? ()
A . INSERT INTO employees (employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01/01/01);
B . INSERT INTO employees(employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01 january 01');
C . INSERT INTO employees(employee_id, first_name, last_name, Hire_date) VALUES (1000, 'John', 'smith', To_ date ('01/01/01));
D . INSERT INTO employees(employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01-Jan-01')
-
Examine the command: ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS; What does the command accomplish?()
A . Creates an additional copy of the database online redo log files.
B . Stores the primary key column values of each row involved in a DML operation in the online redo log files.
C . Stores the primary key column values of each row involved in a DML operation in the supplemental log files.
D . Stores the old and new primary key column values of each row involved in a DML operation only when the primary key is modified in the online redo log files.
-
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?()
A . ALTER TABLE students ADD PRIMARY KEY _ id;
B . ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);
C . ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;
D . ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
E . ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id)
-
关于主键(primary key)描述正确的是:
-
创建“教师表”,其中Tno是主码 , Dno是外码。 CREATE TABLE 教师表 (Tno char(5) CONSTRAINT PK_Tno PRIMARY KEY, Tname char(20) NULL, Dno FOREIGN KEY char(2) REFERENCES 院系表(Dno) )
-
The following statements:CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TA
The following statements:CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TABLE t2 (col1 INT NOT NULL, col2 CHAR(1) NOT NULL, PRIMARY KEY (col1, col2), FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE CASCADE ON UPDATE RESTRICT); CREATE TABLE t3 (col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (col1, col2),FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE NO ACTION ON UPDATE RESTRICT);INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1, ‘a‘), (1, ‘b‘), (2,‘c‘); INSERT INTO t3 VALUES (1, 100), (2, 200), (2,300);How many rows will be deleted by the following DELETE statement? DELETE FROM t1 WHERE col1= 1;()
A.4
B.3
C.1
D.0
-
For relation where primary key contains multiple attributes, no non-key attribute should be functionally dependent on a part of primary key. This relation R is at least in(66).
A.3NF
B.2NF
C.INF
D.BCNF
-
在SQL Server数据库中,UNIQUE约束与PRIMARY KEY约束之间最主要的区别是()(选一项)
A.UNIQUE约束要求数据库中至少存在一行数据,因此必须在创建数据库表之后才能创建,而PRIMARY KEY约束无此限制
B.UNIQUE约束允许有空值,而PRIMARY KEY约束不允许有空值
C.创建UNIQUE约束后,该数据行允许被更改,而PRIMARY KEY约束的数据行不允许更改
D.UNIQUE约束列不能创建外键,而PRIMARY KEY约束可以创建外键引用
-
企业职工和部门的关系模式如下所示,其中部门负责人也是一个职工。职工(职工号,姓名,年龄,月薪,部门号,电话,地址)部门(部门号,部门名,电话,负责人代码,任职时间)请将下面的SQL语句空缺部分补充完整。CREATE TABLE部门(部门号CHAR(4) PRIMARY KEY,部门名CHAR(20),电话CHAR(13),负责人代码CHAR(5),任职时间DATE,FOREIGN KEY())
A.(电话)REFERENCES(职工电话)
B.(部门号)REFERENCES部门(部门号)
C.(部门号)REFERENCES职工(部门号)
D.(负责人代码)REFERENCES 职工(职工号)
-
CREATETABLE命令中的PRIMARY KEY子句用于定于关系的()。
A.A.实体完整性
B.B.用户定义完整性
C.C.参照完整性
D.D.一致性
-
11、若用如下的SQL语句创建了一个表S: CREATE TABLE S (SNO CHAR(6) PRIMARY KEY, NAME CHAR(12) NOT NULL, SEX CHAR(2), AGE INT); 现向S表中插入如下行时,能够成功插入的是()。
A.('191001', '李明芳', '女', '23')
B.('191002', '张宇', NULL, NULL)
C.(NULL, '陈明', '男', 23)
D.('191003', NULL , '女', '23')