CMS专题

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

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

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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)


参考答案:D

第2题:

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.3

B.2

C.1

D.0


参考答案: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***


参考答案:A

第4题:

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.

正确答案:C

第5题:

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

第6题:

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


参考答案:C

第7题:

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 tab2

B.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)


参考答案:A

第8题:

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.


参考答案:B

第9题:

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)

正确答案:D

第10题:

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.

正确答案:B

更多相关问题