网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
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)
参考答案
参考解析
解析:
暂无解析
更多 “单选题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 t2B SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2C SELECT * FROM t1 INTERSECT SELECT * FROM t2D SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)” 相关考题
考题
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 t2B.SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2C.SELECT * FROM t1 INTERSECT SELECT * FROM t2D.SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)
考题
Given that tables T1 and T2 contain the following rows:Table T1: C1 C2 1 4 1 3 1 2Table T2: C1 C2 1 1 1 2 1 3Which of the following queries will return only those rows that exist in both T1 and T2?()
A.SELECT * FROM t1 UNION SELECT * FROM t2B.SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2C.SELECT * FROM t1 INTERSECT SELECT * FROM t2D.SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)
考题
Assuming PUBLIC has been granted all privileges on table T1, which of the following statements would continue to permit any user to add rows to table T1, but not remove them?()
A.REVOKE DROP ON t1 FROM PUBLICB.REVOKE UPDATE ON t1 FROM PUBLICC.REVOKE DELETE ON t1 FROM PUBLICD.REVOKE CONTROL ON t1 FROM PUBLIC
考题
The following statements:CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TABLE t2 (col1 INT NOT NULL, col2 CHAR(1) NOT NULL, PRIMARY KEY (col1, col2), FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE CASCADE ON UPDATE RESTRICT); CREATE TABLE t3 (col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (col1, col2),FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE NO ACTION ON UPDATE RESTRICT);INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1, ‘a‘), (1, ‘b‘), (2,‘c‘); INSERT INTO t3 VALUES (1, 100), (2, 200), (2,300);How many rows will be deleted by the following DELETE statement? DELETE FROM t1 WHERE col1= 1;()A.4B.3C.1D.0
考题
Given that tables T1 and T2 contain the following rows: Table T1:C1 C25 4 5 2 5 5Table T2: C1 C2 5 1 5 2 5 3Which of the following queries will return only those rows that exist in T1 and not in T2?()
A.SELECT * FROM T1 MINUS SELECT * FROM T2B.SELECT * FROM T1 EXCEPT SELECT * FROM T2C.SELECT * FROM T2 UNION EXCEPT SELECT * FROM T1D.SELECT * FROM T1 NOT EXISTS SELECT * FROM T2
考题
设某数据库中有表Tl(c1,c2,c3),并只对U1执行了如下授权语句:GRANT SELECT ON T1 TO U1下列语句中,U1无权执行的是( )。
A.GRANT SELECT ON T1 TO U2B.SELECT*FROM T1C.SELECT c1 FROM T1D.SELECT c1.c2 FROM T1
考题
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 t2B、SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2C、SELECT * FROM t1 INTERSECT SELECT * FROM t2D、SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)
考题
A view is created with the following statement:CREATE VIEW v1 AS SELECT col1, col2, col3, col4 FROM t1 WHERE col4 1000 WITH CHECK OPTIONWhat is the effect of the CHECK OPTION clause?()A、Any row inserted or updated through view V1 must meet the condition that col4 1000.B、From now on, any row inserted or updated in table T1 must meet the condition that col4 1000, but existing rows in the table are not checked.C、At view creation, DB2 will check the data in table T1, and if in any row doesn't meet the condition col4 1000, the view creation will be rejected.D、Any row inserted or updated through view V1 must meet the condition that col4 1000 and no row in table T1 can be updated such that col4 = 1000, but new rows in the table can be inserted with col4 = 1000.
考题
存在两个结构相同的数据库表T1(col1,col2,col3)、T2(col1,col2,col3),写出一SQL语句将所有T1数据导入到T2表()A、select col1,col2,col3 from T1 into T2(col1,col2,col3)B、insert T1 (col1,col,col3) into T2(col1,col2,col3)C、insert into T2 (col1,col2,col3) as select col1,col2,col3 from T1D、insert into T2(col1,col2,col3) select col1,col2,col3 from T1;
考题
Given that tables T1 and T2 contain the following rows: Table T1: C1 C2 5 4 5 2 5 5 Table T2: C1 C2 5 1 5 2 5 3 Which of the following queries will return only those rows that exist in T1 and not in T2?()A、SELECT * FROM T1 MINUS SELECT * FROM T2B、SELECT * FROM T1 EXCEPT SELECT * FROM T2C、SELECT * FROM T2 UNION EXCEPT SELECT * FROM T1D、SELECT * FROM T1 NOT EXISTS SELECT * FROM T2
考题
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 t2B、SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2C、SELECT * FROM t1 INTERSECT SELECT * FROM t2D、SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)
考题
Given the following two tables: TAB1 C1 C2 A 11 B 12 C 13 TAB2 CX CY A 21 C 22 D 23 The following results are desired: C1 C2 CX CY A 11 A 21 C 13 C 22 -- --D 23 Which of the following queries will yield the desired results?()A、SELECT * FROM tab1 INNER JOIN tab2 ON c1=cxB、SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cxC、SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cxD、SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx
考题
The following statements: CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TABLE t2 (col1 INT NOT NULL, col2 CHAR(1) NOT NULL, PRIMARY KEY (col1, col2), FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE CASCADE ON UPDATE RESTRICT); CREATE TABLE t3 (col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (col1, col2),FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE NO ACTION ON UPDATE RESTRICT);INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1, 'a'), (1, 'b'), (2,'c'); INSERT INTO t3 VALUES (1, 100), (2, 200), (2,300); How many rows will be deleted by the following DELETE statement? DELETE FROM t1 WHERE col1= 1;()A、4B、3C、1D、0
考题
Assuming PUBLIC has been granted all privileges on table T1, which of the following statements would continue to permit any user to add rows to table T1, but not remove them?()A、REVOKE DROP ON t1 FROM PUBLICB、REVOKE UPDATE ON t1 FROM PUBLICC、REVOKE DELETE ON t1 FROM PUBLICD、REVOKE CONTROL ON t1 FROM PUBLIC
考题
Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which 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)
考题
Consider this syntax: MERGE INTO t1 USING t2 ON (join predicate)….. What does the MERGE syntax do?()A、It performs a merge join of the row from T2 only if it doesn’t exist in the T1 table. B、It creates a natural join of tables T1 and T2 for all columns that have the same name. C、It creates a Cartesian product of table T1 and table T2 for all columns that have the same name. D、For each row from T2, it updates the row if it exists within table T1, otherwise it inserts the row into T1.
考题
单选题Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which 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)
考题
单选题存在两个结构相同的数据库表T1(col1,col2,col3)、T2(col1,col2,col3),写出一SQL语句将所有T1数据导入到T2表()A
select col1,col2,col3 from T1 into T2(col1,col2,col3)B
insert T1 (col1,col,col3) into T2(col1,col2,col3)C
insert into T2 (col1,col2,col3) as select col1,col2,col3 from T1D
insert into T2(col1,col2,col3) select col1,col2,col3 from T1;
考题
单选题Consider this syntax: MERGE INTO t1 USING t2 ON (join predicate)….. What does the MERGE syntax do?()A
It performs a merge join of the row from T2 only if it doesn’t exist in the T1 table. B
It creates a natural join of tables T1 and T2 for all columns that have the same name. C
It creates a Cartesian product of table T1 and table T2 for all columns that have the same name. D
For each row from T2, it updates the row if it exists within table T1, otherwise it inserts the row into T1.
考题
单选题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 t2B
SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2C
SELECT * FROM t1 INTERSECT SELECT * FROM t2D
SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)
考题
单选题Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which 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)
考题
单选题The following statements: CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TABLE t2 (col1 INT NOT NULL, col2 CHAR(1) NOT NULL, PRIMARY KEY (col1, col2), FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE CASCADE ON UPDATE RESTRICT); CREATE TABLE t3 (col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (col1, col2),FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE NO ACTION ON UPDATE RESTRICT);INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1, 'a'), (1, 'b'), (2,'c'); INSERT INTO t3 VALUES (1, 100), (2, 200), (2,300); How many rows will be deleted by the following DELETE statement? DELETE FROM t1 WHERE col1= 1;()A
4B
3C
1D
0
考题
单选题Given that tables T1 and T2 contain the following rows: Table T1: C1 C2 5 4 5 2 5 5 Table T2: C1 C2 5 1 5 2 5 3 Which of the following queries will return only those rows that exist in T1 and not in T2?()A
SELECT * FROM T1 MINUS SELECT * FROM T2B
SELECT * FROM T1 EXCEPT SELECT * FROM T2C
SELECT * FROM T2 UNION EXCEPT SELECT * FROM T1D
SELECT * FROM T1 NOT EXISTS SELECT * FROM T2
考题
单选题Assuming PUBLIC has been granted all privileges on table T1, which of the following statements would continue to permit any user to add rows to table T1, but not remove them?()A
REVOKE DROP ON t1 FROM PUBLICB
REVOKE UPDATE ON t1 FROM PUBLICC
REVOKE DELETE ON t1 FROM PUBLICD
REVOKE CONTROL ON t1 FROM PUBLIC
考题
单选题Given that tables T1 and T2 contain the following rows: Table T1: C1 C2 5 4 5 2 5 5 Table T2: C1 C2 5 1 5 2 5 3 Which of the following queries will return only those rows that exist in T1 and not in T2?()A
SELECT * FROM T1 MINUS SELECT * FROM T2B
SELECT * FROM T1 EXCEPT SELECT * FROM T2C
SELECT * FROM T2 UNION EXCEPT SELECT * FROM T1D
SELECT * FROM T1 NOT EXISTS SELECT * FROM T2
考题
单选题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 t2B
SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2C
SELECT * FROM t1 INTERSECT SELECT * FROM t2D
SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)
考题
(难度:中等)已知表T1中有2行数据,T2中有3行数据,执行SQL语句“select a.* from T1 a,T2 b”后,返回的行数为6
热门标签
最新试卷