全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1847 1
2015-06-20
悬赏 5 个论坛币 未解决

1) Why would you want to sometimes de-normalize data?


A. Prevent data from becoming inconsistent

B. Improve query response

C. Eliminate redundant data

D. All of the above


2) Given two tables, each with one column X of type number which is the primary key. Table A has 100 rows, Table B has 50 rows. When doing an Inner Join between A and B on X, which option would be correct?

  • The maximum possible number of rows is 100, the minimum possible number of rows 50

  • The maximum possible number of rows is 5000, the minimum possible number of rows 0

  • The maximum possible number of rows is 50, the minimum possible number of rows 0

  • The maximum possible number of rows is 100, the minimum possible number of rows 100

  • It is not possible to estimate a maximum and minimum. More information is needed.


3) Given two tables, each with one column X of type number which is the primary key. Table A has 100 rows, Table B has 50 rows. When doing a Left Outer join from A to B on X, which option would be correct?

  • The maximum possible number of rows is 100, the minimum possible number of rows 50

  • The maximum possible number of rows is 5000, the minimum possible number of rows 0

  • The maximum possible number of rows is 50, the minimum possible number of rows 0

  • The maximum possible number of rows is 100, the minimum possible number of rows 100

  • It is not possible to estimate a maximum and minimum. More information is needed.


4)Two tables A and B are given:

A          B

X Y        Y Z

1 1        2 1

2 2        2 2  

3 1        3 3  

4 2        4 5

How many rows will be in the result set of the following query?

SELECT B.Z

FROM A LEFT OUTER JOIN B

ON A.X = B.Y

  • 6 Rows

  • 5 Rows

  • 4 Rows

  • 2 Rows

  • 1 Row


5)Two tables A and B are given:

A         B

X         Y

1         1

2         2

3         5  

          7

How many rows will be in the result set of the following query?

SELECT A.X, B.Y

FROM A, B

WHERE A.X < 3 AND B.Y > = 2

  • 5 Rows

  • 6 Rows

  • 7 Rows

  • 10 Rows

  • 12 Rows


6) The following EMPLOYEE table is given:


ID   NAME        DEPT    SALARY        

1    JOHN        HR      100

2    SAM         IT      200

3    TOM         QA      150

4    NICOLE

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-6-20 06:55:10
这种题目,建议楼主安装SQL环境实验,方知表之间集合关系。祝楼主学习SQL愉快。我来回答第4题,环境为SQL SERVER。

DECLARE @A TABLE(X INT,Y INT);
DECLARE @B TABLE(        Y INT ,Z INT);
INSERT INTO @A(X,Y) VALUES(1,1),(2,2),(3,1),(4,2);
INSERT INTO @B(Y,Z) VALUES(2,1),(2,2),(3,3),(4,5);
SELECT A.*,B.* FROM @A A LEFT OUTER JOIN @B B ON A.X = B.Y;
SELECT B.Z FROM @A A LEFT OUTER JOIN @B B ON A.X = B.Y;

QQ截图20150620065406.png
附件列表
QQ截图20150620065406.png

原图尺寸 28.99 KB

QQ截图20150620065406.png

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群