单选题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;()A4B3C1D0

单选题
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


参考解析

解析: 暂无解析

相关考题:

建立一个“职员”表,表中有5个字段:职员号、姓名、性别、年龄、部门。要求职员号属性的值唯一,并且不能为空值。建立该表的SQL语句可以是______。A.CREATE TABLE 职员(职员号 CHAR(6),姓名CHAR(8),; 性别CHAR(2),年龄INT(4),部门CHAR(12))B.CREATE TABLE职员(职员号CHAR(6)NULL,姓名CHAR(8),; 性别CHAR(2),年龄INT(4),部门CHAR(12))C.CREATE TABLE 职员(职员号CHAR(6)NOT NULL UNIQUE,; 姓名CHAR(8),性别CHAR(2),年龄INT(4),部门CHAR(12))D.CREATE TABLE职员(职员号CHAR(6)UNIQUE,姓名CHAR(8),: 性别CHAR(2),年龄INT(4),部门CHAR(12))

建立一个用品信息表goods_inf,要求它由用品号gno,用品名gname,用品数量gnum,用品入库时间gtime,4个属性组成,其用品号属性惟一,用品名、用品号字段不能为空。下列语句正确的是A.CREATE TABLE goods inf (gno char(5) NOT NULL gaame char(8) NOTNULL gnum int gtime DATE):B.CREATE TABLE goods inf (gno char(5) NOT NULL UNIQUE gaame char(8) gnum int gtime DATE):C.CREATE TABLE (gno char(5) NOT NULL UNIQUE gname char(8) NOT NULL gnum int gtime DATE);D.CREATE TABLE goods inf (gno char(5) NOT NULL UNIQUE gname char(8) NOT NULL gnum int gtime DAT

建立一个学生信息表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);

A table was created using the following DDL:CREATE TABLE employee (id SMALLINT NOT NULL, name VARCHAR(9), dept SMALLINT CHECK (dept BETWEEN 10 AND 100),job CHAR(10) CHECK (job IN (‘Sales‘,‘Mgr‘,‘Clerk‘)), hiredate DATE, salary DECIMAL(7,2), comm DECIMAL(7,2), PRIMARY KEY (id), CONSTRAINT yearsal CHECK (YEAR(hiredate) 2004 OR salary 80500) );Which of the following INSERT statements will fail?()A.INSERT INTO employee VALUES (2, ‘Smith‘, 80, ‘Mgr‘, ‘09/03/2006‘, 80000, NULL)B.INSERT INTO employee VALUES (4, ‘Smith‘, 86, ‘Mgr‘, ‘07/14/2003‘, 90000, NULL)C.INSERT INTO employee VALUES (1, ‘Smith‘, 55, ‘Sales‘, ‘07/14/2003‘, NULL, NULL)D.INSERT INTO employee VALUES (3, ‘Smith‘, 33, ‘Analyst‘, ‘11/26/2006‘, 90000, NULL)

An application needs a table for each connection that tracks the ID and Name of all items previously ordered and committed within the connection. The table also needs to be cleaned up and automatically removed each time a connection is ended. Assuming the ITEMS table was created with the following SQL statement:CREATE TABLE items item_no INT, item_name CHAR(5), item_qty INT)Which of the following SQL statements will provide the table definition that meets the specified requirements?()A.DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLEB.DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWSC.CREATE TABLE systmp.tracker AS (SELECT item_num, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWSD.CREATE TABLE tracker AS (SELECT item_num, item_name FROM items) ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE

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‘)) );

Given the following DDL and INSERT statements:CREATE VIEW v1 AS SELECT col1 FROM t1 WHERE col1 10; CREATE VIEW v2 AS SELECT col1 FROM v1 WITH CASCADED CHECK OPTION; CREATE VIEW v3 AS SELECT col1 FROM v2 WHERE col1 100; INSERT INTO v1 VALUES(5); INSERT INTO v2 VALUES(5); INSERT INTO v3 VALUES(20); INSERT INTO v3 VALUES(100);How many of these INSERT statements will be successful?()A.0B.1C.2D.3

Given the following statements:CREATE TABLE tab1 (col1 INT); CREATE TABLE tab2 (col1 INT); CREATE TRIGGER trig1 AFTER UPDATE ON tab1 REFERENCING NEW AS new1 FOR EACH ROW MODE DB2SQL INSERT INTO tab2 VALUES(new1.col1); INSERT INTO tab1 VALUES(2),(3);What is the result of the following query? SELECT count(*) FROM tab2;()A.3B.2C.1D.0

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.4B.3C.1D.0

Given the following requirements:Create a table named TESTTAB, which has an identity column named ACTIVITYNO. Define the identity column to generate the values for the column by default. Start the values at 10 and increment by 10. Make the identity column unique. Which of the following CREATE statements will successfully create this table?()A.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))B.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTNO))C.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 1), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))D.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

Given the following DDL for the PARTS table:CREATE TABLE parts (part_no INT(9) NOT NULL, part_name VARCHAR(24), part_remain INT(9));All part numbers entered will be different and all rows should be displayed in order of increasing part numbers whenever the table is queried. Which of the following create index statements will meet this criteria and require the least amount of storage for the index object?()A.CREATE UNIQUE INDEX idx_partno ON parts(part_no)B.CREATE UNIQUE INDEX idx_partno ON parts(part_name ASC)C.CREATE UNIQUE INDEX idx_partno ON parts(part_name, part_no ASC)D.CREATE UNIQUE INDEX idx_partno ON parts(part_no, part_name ASC)

建立一个学生信息表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);

If a unique constraint is defined on column COL1 of table TAB1, what are the characteristics of COL1?()A、COL1 will accept NULL values and can be referenced in another table's foreign key specification.B、COL1 will not accept NULL values and cannot be referenced in another tables foreign key specification.C、COL1 will not accept NULL values and can be referenced in another tables foreign key specification.D、COL1 will accept NULL values and cannot be referenced in another tables foreign key specification.

Given the following DDL for the PARTS table:CREATE TABLE parts (part_no INT(9) NOT NULL, part_name VARCHAR(24), part_remain INT(9));All part numbers entered will be different and all rows should be displayed in order of increasing part numbers whenever the table is queried. Which of the following create index statements will meet this criteria and require the least amount of storage for the index object?()A、CREATE UNIQUE INDEX idx_partno ON parts(part_no)B、CREATE UNIQUE INDEX idx_partno ON parts(part_name ASC)C、CREATE UNIQUE INDEX idx_partno ON parts(part_name, part_no ASC)D、CREATE UNIQUE INDEX idx_partno ON parts(part_no, part_name ASC)

Given the following statements: CREATE TABLE tab1 (col1 INT); CREATE TABLE tab2 (col1 INT); CREATE TRIGGER trig1 AFTER UPDATE ON tab1 REFERENCING NEW AS new1 FOR EACH ROW MODE DB2SQL INSERT INTO tab2 VALUES(new1.col1); INSERT INTO tab1 VALUES(2),(3); What is the result of the following query? SELECT count(*) FROM tab2;()A、3B、2C、1D、0

An application needs a table for each connection that tracks the ID and Name of all items previously ordered and committed within the connection. The table also needs to be cleaned up and automatically removed each time a connection is ended. Assuming the ITEMS table was created with the following SQL statement: CREATE TABLE items item_no INT, item_name CHAR(5), item_qty INT) Which of the following SQL statements will provide the table definition that meets the specified requirements?()A、DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLEB、DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWSC、CREATE TABLE systmp.tracker AS (SELECT item_num, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWSD、CREATE TABLE tracker AS (SELECT item_num, item_name FROM items) ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE

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')) );

Given the following requirements:Create a table named TESTTAB, which has an identity column named ACTIVITYNO. Define the identity column to generate the values for the column by default. Start the values at 10 and increment by 10. Make the identity column unique. Which of the following CREATE statements will successfully create this table?()A、CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))B、CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTNO))C、CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 1), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))D、CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

单选题Given the following table definition: STOCK: item VARCHAR(30) status CHAR(1) quantity INT price DEC(7,2) If items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE to zero, which of the following statements would be used to update the STOCK table to indicate that all the items whose description begins with the letter "S" are out of stock?()AUPDATE stock SET (status = NULL; quantity, price = 0) WHERE item LIKE S%BUPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE item LIKE S%CUPDATE stock SET status = NULL, SET quantity = 0, SET price = 0 WHERE item LIKE 'S%'DUPDATE stock SET (status = NULL), (quantity = 0), (price = 0) WHERE item LIKE S%

单选题If a unique constraint is defined on column COL1 of table TAB1, what are the characteristics of COL1?()ACOL1 will accept NULL values and can be referenced in another table's foreign key specification.BCOL1 will not accept NULL values and cannot be referenced in another tables foreign key specification.CCOL1 will not accept NULL values and can be referenced in another tables foreign key specification.DCOL1 will accept NULL values and cannot be referenced in another tables foreign key specification.

单选题Given the following DDL and INSERT statements: CREATE VIEW v1 AS SELECT col1 FROM t1 WHERE col1 10; CREATE VIEW v2 AS SELECT col1 FROM v1 WITH CASCADED CHECK OPTION; CREATE VIEW v3 AS SELECT col1 FROM v2 WHERE col1 100; INSERT INTO v1 VALUES(5); INSERT INTO v2 VALUES(5); INSERT INTO v3 VALUES(20); INSERT INTO v3 VALUES(100); How many of these INSERT statements will be successful?()A0B1C2D3

单选题Given the following requirements:Create a table named TESTTAB, which has an identity column named ACTIVITYNO. Define the identity column to generate the values for the column by default. Start the values at 10 and increment by 10. Make the identity column unique. Which of the following CREATE statements will successfully create this table?()ACREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))BCREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTNO))CCREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 1), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))DCREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

单选题Examine the following query output: You issue the following command to import tables into the hr schema: $ impdp hr/hr directory = dumpdir dumpfile = hr_new.dmp schemas=hr TRANSFORM=DISABLE_ARCHIVE_LOGGING: Y Which statement is true?()AAll database operations performed by the impdp command are logged.BOnly CREATE INDEX and CREATE TABLE statements generated by the import are logged.COnly CREATE TABLE and ALTER TABLE statements generated by the import are logged.DNone of the operations against the master table used by Oracle Data Pump to coordinate its activities are logged.

单选题Assuming PUBLIC has been granted all privileges on table T1, which of the following statements would continue to permit any user to add rows to table T1, but not remove them?()AREVOKE DROP ON t1 FROM PUBLICBREVOKE UPDATE ON t1 FROM PUBLICCREVOKE DELETE ON t1 FROM PUBLICDREVOKE CONTROL ON t1 FROM PUBLIC

单选题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')) );

单选题Given the following DDL for the PARTS table:CREATE TABLE parts (part_no INT(9) NOT NULL, part_name VARCHAR(24), part_remain INT(9));All part numbers entered will be different and all rows should be displayed in order of increasing part numbers whenever the table is queried. Which of the following create index statements will meet this criteria and require the least amount of storage for the index object?()ACREATE UNIQUE INDEX idx_partno ON parts(part_no)BCREATE UNIQUE INDEX idx_partno ON parts(part_name ASC)CCREATE UNIQUE INDEX idx_partno ON parts(part_name, part_no ASC)DCREATE UNIQUE INDEX idx_partno ON parts(part_no, part_name ASC)

单选题A table was created using the following DDL: CREATE TABLE employee (id SMALLINT NOT NULL, name VARCHAR(9), dept SMALLINT CHECK (dept BETWEEN 10 AND 100), job CHAR(10) CHECK (job IN ('Sales','Mgr','Clerk')), hiredate DATE, salary DECIMAL(7,2), comm DECIMAL(7,2), PRIMARY KEY (id), CONSTRAINT yearsal CHECK (YEAR(hiredate) 2004 OR salary 80500) ); Which of the following INSERT statements will fail?()AINSERT INTO employee VALUES (2, 'Smith', 80, 'Mgr', '09/03/2006', 80000, NULL)BINSERT INTO employee VALUES (4, 'Smith', 86, 'Mgr', '07/14/2003', 90000, NULL)CINSERT INTO employee VALUES (1, 'Smith', 55, 'Sales', '07/14/2003', NULL, NULL)DINSERT INTO employee VALUES (3, 'Smith', 33, 'Analyst', '11/26/2006', 90000, NULL)

单选题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;()A4B3C1D0