单项选择题Which of the following SQL statements will return the year and average salary for all employees hired within a given year that have a salary greater than $30,000?()

A.SELECT * FROM t1 UNION SELECT * FROM t2
B.SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2
C.SELECT * FROM t1 INTERSECT SELECT * FROM t2
D.SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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?()

A.UPDATE stock SET (status = NULL; quantity, price = 0) WHERE item LIKE S%
B.UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE item LIKE S%
C.UPDATE stock SET status = NULL, SET quantity = 0, SET price = 0 WHERE item LIKE 'S%'
D.UPDATE stock SET (status = NULL), (quantity = 0), (price = 0) WHERE item LIKE S%

3.单项选择题Which of the following will begin a new unit of work?()

A.The CONNECT statement
B.The first FETCH of a cursor
C.The BEGIN TRANSACTION statement
D.The first executable SQL statement

4.单项选择题

Given that tables T1 and T2 contain the following rows:
Table T1: C1 C2 1 4 1 3 1 2
Table T2: C1 C2 1 1 1 2 1 3
Which of the following queries will return only those rows that exist in both T1 and T2?()

A.SELECT * FROM t1 UNION SELECT * FROM t2
B.SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2
C.SELECT * FROM t1 INTERSECT SELECT * FROM t2
D.SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)

8.单项选择题Which of the following statements allows USER1 to take away read access on the table ORG.TAB1 from USER2?()

A.REVOKE SELECT FROM user2 ON TABLE org.tab1
B.REVOKE SELECT ON TABLE org.tab1 FROM user2
C.REVOKE READ ACCESS FROM user2 ON TABLE org.tab1
D.REVOKE READ ACCESS ON TABLE org.tab1 FROM user2

最新试题

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?()

题型:单项选择题

On which of the following database objects may the SELECT privilege be controlled?()

题型:单项选择题

Which of the following database objects is considered executable using SQL?()

题型:单项选择题

Given the following stored procedure:CREATE PROCEDURE increase_salary ( IN p_workdept CHAR(6), OUT p_sum DECIMAL(9,2) ) SET p_sum = (SELECT SUM(salary) FROM employee WHERE workdept=p_workdept);How can this stored procedure be called from the Command Line Processor?()

题型:单项选择题

Which of the following actions may cause a trigger to be fired?()

题型:单项选择题

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?()

题型:单项选择题

Which of the following will begin a new unit of work?()

题型:单项选择题

Which of the following database objects can be used to raise an error if a table is updated?()

题型:单项选择题

Which kind of non-sourced UDF can be created so that it only returns a single value?()

题型:单项选择题

Which of the following SQL statements will return the year and average salary for all employees hired within a given year that have a salary greater than $30,000?()

题型:单项选择题