C1=c1+1
B. CREATE VIEW v1 (c1)
AS (SELECT COUNT(*) FROM t2)
C. ALTER TABLE t1
ADD FOREIGN KEY (C1)
REFERENCES t2
ON INSERT CASCADE
D. CREATE TRIGGER t1
AFTER INSERT ON t2
FOR EACH ROW MODE DB2SQL
UPDATE t1 SET c1=c1+1
?C 21. Given the following statements:
CREATE TABLE t1 (col1 INT NOT NULL);
ALTER TABLE t1 ADD CONSTRAINT t1_ck CHECK (coll in (1, 2, 3));
INSERT INTO t1 VALUES (3);
CREATE TABLE t2 LIKE t1;
DROP TABLE t1;
Which of the following is the result of these statements?
A. Both tables are dropped
B. T2 is an empty table with the check constraint.
C. T2 is an empty table without the check constraint.
D. T2 contains 1 row and is defined with the check constraint.
E. T2 contains 1 row a.nd is defined without the check constraint
A 22. Given the following table definitions:
DEPARTMENT
Deptno CHAR (3)
Deptname CHAR (30)
Mgrno INTEGER
Admrdept CHAR (3)
EMPLOYEE
Empno INTEGER
Firstname CHAR (30)
Midinit CHAR (30)
Lastname CHAR (30)
Workdept CHAR (3)
Given that the result set should only include employees with a department, which of the following statements will list each employee’s number, last name, and deptname?
A. SELECT e.empno, e.lastname, d.deptname
FROM employe e department d
WHERE e.workdept=d.deptno
B. SELECT e.empno, e.lastname, d.deptname
FROM employee e LEFT OUTER JOIN deptnament d
发表评论