C2090-733 Free Dumps Study Materials
Question 7: Given the following table and view definitions: CREATE TABLE city ( cityid INT
GENERATED
ALWAYS AS IDENTITY , city_name CHAR(10), state_code CHAR(2) CHECK(state_code IN
('CA','IL','NY','OH','TX')));CREATE VIEW city_view AS ( SELECT city_name||','||state_code
AS fullname
FROM city WHERE state_code NOT IN ('OH','IL')); and the following trigger
definition:CREATE
TRIGGER city_viewInput INSTEAD OF INSERT ON city_view REFERENCING NEW AS
nFOR EACH
ROW MODE DB2SQLBEGIN ATOMIC DECLARE delim INT;SET delim = LOCATE(',',
n.fullname);
INSERT INTO city(city_name,state_code) VALUES(SUBSTR(n.fullname, 1, delim - 1),
SUBSTR(n.fullname, delim + 1, 2));END; If the following SQL statments are
executed:INSERT INTO city
VALUES(DEFAULT,'San Jose','CA') ; INSERT INTO city_view VALUES('Chicago,IL');
INSERT INTO city
VALUES(DEFAULT,'Detroit','MI'); INSERT INTO city VALUES(DEFAULT,'Austin','TX');
INSERT INTO
city_view VALUES('Denver,CO'); How many rows will be returned by the following query:
SELECT *
FROM city
A. 1
B. 2
C. 3
D. 4
Correct Answer: C