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

0

B

1

C

2

D

3


参考解析

解析: 暂无解析

相关考题:

You need to perform these tasks:1. Create and assign a MANAGER role to Blake and Clark2. Grant CREATE TABLE and CREATE VIEW privileges to Blake and ClarkWhich set of SQL statements achieves the desired results? ()A. CREATE ROLE manager; GRANT create table, create view TO manager; GRANT manager TO BLACK, CLARK;B. CREATE ROLE manager; GRANT create table, create voew TO manager; GRANT manager ROLE TO BLACK, CLARK;C. GRANT manager ROLE TO BLACK, CLARK; GRANT create table, create voew TO BLACK CLARK; ***MISSING***

Examine the following command;ALTER SYSTEM SET enable_ddl_logging = TRUE;Which statement is true?() A. Only the data definition language (DDL) commands that resulted in errors are logged in the alert log file.B. All DDL commands are logged in the alert log file.C. All DDL commands are logged in a different log file that contains DDL statements and their execution dates.D. Only DDL commands that resulted in the creation of new segments are logged.E. All DDL commands are logged in XML format in the alert directory under the Automatic Diagnostic Repository (ADR) home.

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)

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

Given the following two tables:TAB1 C1 C21 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY5 Europe 6 North America 7 South AmericaWhich of the following SQL statements will insert all rows found in table TAB2 into table TAB1?()A.INSERT INTO tab1 SELECT cx, cy FROM tab2B.INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)C.INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)D.INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)

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)

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)

Which of the following statements is true regarding the VERSIONS BETWEEN clause?()  A、 The VERSIONS BETWEEN clause may be used in DML statements.B、 The VERSIONS BETWEEN clause may be used in DDL statements.C、 The VERSIONS BETWEEN clause may not be used to query past DDL changes to tables.D、 The VERSIONS BETWEEN clause may not be used to query past DML statements to tables.

You are responsible for maintaining a SQL Server 2005 database. Business analysts in the company routinely use a view named v CustomerSales to join the Customers and Sales tables in the database. They use the view to aggregate total sales by customer by month. You need to increase the performance of the view. What should you do?()A、Update the view to use an outer join between the Customers and Sales tables.B、Create a clustered index on the v CustomerSales view.C、Create two separate views that do not contain any joinsone view named Customers for the Customers table and another one named v Sales for the Sales table.D、Create a stored procedure for the business analysts that uses the v CustomerSales view.

设有关系模式商品(商品号,商品名称,单价,数量,类别),建立统计每类商品总数量的视图的正确语句是()A、CREATE VIEW v1AS SELECT类别,SUM(数量)FROM商品GROUP BY类别B、CREATE VIEW v1AS SELECT类别,COUNT(数量)FROM商品GROUP BY类别C、CREATE VIEW v1(类别,总数量)AS SELECT类别,SUM(数量)FROM商品GROUP BY类别D、CREATE VIEW v1(类别,总数量)AS SELECT类别,COUNT(数量)FROM商品GROU PBY类别

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)

tony would like to make it easier for users of the video application to enter new doc using the “video form”, he’d like users to be able to create new “video” doc form within the view. Which one of the following should tony so to build this interface?()A、create a view action that has the following formula:@command([create];”video”)B、create a form action that has the following formula:@command([compose];”video”)C、create a view action that has the following formula:@command([compose];”video”)D、create a database action that has the following formula:@command([compose];”video”)

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

You need to perform these tasks: 1. Create and assign a MANAGER role to Blake and Clark 2. Grant CREATE TABLE and CREATE VIEW privileges to Blake and Clark Which set of SQL statements achieves the desired results?()A、CREATE ROLE manager; GRANT create table, create view TO manager; GRANT manager TO BLACK, CLARK;B、CREATE ROLE manager; GRANT create table, create voew TO manager; GRANT manager ROLE TO BLACK, CLARK;C、GRANT manager ROLE TO BLACK, CLARK; GRANT create table, create voew TO BLACK CLARK; ***MISSING***

You are creating a view to join the Customers and Orders tables in a SQL Server 2005 database. You need to ensure that the view cannot be affected by modifications to underlying table schemas. You want to accomplish this goal by using the least possible amount of overhead. What should you do?()A、Create CHECK constraints on the tables. B、Create a DDL trigger to roll back any changes to the tables if the changes affect the columns in the view. C、Create the view, specifying the WITH SCHEMABINDING option. D、Create the view, specifying the WITH CHECK option.

A Windows Azure application stores data in a SQL Azure database.  The application will start an operation that includes three insert statements.  You need to recommend an approach for rolling back the entire operation if the connection to SQL Azure is lost.  What should you recommend?()A、 Ensure that all statements execute in the same database transaction.B、 Create a stored procedure in the database that wraps the insert statements in a TRY CATCH block.C、 Create a stored procedure in the database that wraps the insertstatements in a TRANSACTION block.D、 Open a new connection to the database. Use a separate transaction scope to roll back the original operation.

单选题You need to perform these tasks: 1. Create and assign a MANAGER role to Blake and Clark 2. Grant CREATE TABLE and CREATE VIEW privileges to Blake and Clark Which set of SQL statements achieves the desired results? ()ACREATE ROLE manager; GRANT create table, create view TO manager; GRANT manager TO BLACK, CLARK;BCREATE ROLE manager; GRANT create table, create voew TO manager; GRANT manager ROLE TO BLACK, CLARK;CGRANT manager ROLE TO BLACK, CLARK; GRANT create table, create voew TO BLACK CLARK; ***MISSING***

单选题In your multitenant container database (CDB) containing pluggable database (PDBs), the HR user executes the following commands to create and grant privileges on a procedure: CREATE OR REPLACE PROCEDURE create_test_v (v_emp_id NUMBER, v_ename VARCHAR2,v_SALARY NUMBER, v_dept_id NUMBER) BEGIN INSERT INTO hr.test VALUES (V_emp_id, V_ename, V_salary, V_dept_id); END; / GRANT EXECUTE ON CREATE_TEST TO john, jim, smith, king; How can you prevent users having the EXECUTE privilege on the CREATE_TEST procedure from inserting values into tables on which they do not have any privileges?()ACreate the CREATE_TEST procedure with definer’s rights.BGrant the EXECUTE privilege to users with GRANT OPTION on the CREATE_TEST procedure.CCreate the CREATE_TEST procedure with invoker’s rights.DCreate the CREATE_TEST procedure as part of a package and grant users the EXECUTE privilege the package.

单选题You need to perform these tasks: 1. Create and assign a MANAGER role to Blake and Clark 2. Grant CREATE TABLE and CREATE VIEW privileges to Blake and Clark Which set of SQL statements achieves the desired results?()ACREATE ROLE manager; GRANT create table, create view TO manager; GRANT manager TO BLACK, CLARK;BCREATE ROLE manager; GRANT create table, create voew TO manager; GRANT manager ROLE TO BLACK, CLARK;CGRANT manager ROLE TO BLACK, CLARK; GRANT create table, create voew TO BLACK CLARK; ***MISSING***

单选题tony would like to make it easier for users of the video application to enter new doc using the “video form”, he’d like users to be able to create new “video” doc form within the view. Which one of the following should tony so to build this interface?()Acreate a view action that has the following formula:@command([create];”video”)Bcreate a form action that has the following formula:@command([compose];”video”)Ccreate a view action that has the following formula:@command([compose];”video”)Dcreate a database action that has the following formula:@command([compose];”video”)

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

单选题Examine the following command; ALTER SYSTEM SET enable_ddl_logging = TRUE; Which statement is true?()AOnly the data definition language (DDL) commands that resulted in errors are logged in the alert log file.BAll DDL commands are logged in the alert log file.CAll DDL commands are logged in a different log file that contains DDL statements and their execution dates.DOnly DDL commands that resulted in the creation of new segments are logged.EAll DDL commands are logged in XML format in the alert directory under the Automatic Diagnostic Repository (ADR) home.

单选题A view is created with the following statement:CREATE VIEW v1 AS SELECT col1, col2, col3 FROM t1 WHERE col4 1000 ; When will DB2 access the data from table T1 for view V1?()AWhen view V1 is createdBEach time the REFRESH VIEW v1 statement is executedCEach time an SQL statement is executed against view V1DOnly the first time an SQL statement is executed against view V1

单选题Examine the following command:ALTER SYSTEM SET enable_ddl_logging=FALSE;Which statement is true?()ANone of the data definition language (DDL) statements are logged in the trace file.BOnly DDL commands that resulted in errors are logged in the alert log file.CA new log.xml file that contains the DDL statements is created, and the DDL command details are removed from the alert log file.DOnly DDL commands that resulted in the creation of new database files are logged.

单选题Which of the following statements is true regarding the VERSIONS BETWEEN clause?()A The VERSIONS BETWEEN clause may be used in DML statements.B The VERSIONS BETWEEN clause may be used in DDL statements.C The VERSIONS BETWEEN clause may not be used to query past DDL changes to tables.D The VERSIONS BETWEEN clause may not be used to query past DML statements to tables.