wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL_29/11

Total questions: 47

Worksheet time: 26mins

Name
Class
Date
1.

QuocHN1: A CTE, also called as ... in long form

a)

Common Type Expression

b)

Calculator Table Expression

c)

Common Table Expression

d)

Common Type Experience

2.

HieuNT143. How many join types in join condition:

a)

4

b)

2

c)

3

d)

5

3.

HieuNT143. Which join refers to join records from the write table that have no matching key in the left table are include in the result set:

a)

Left outer join

b)

Right outer join

c)

Full outer join

d)

None of the above

4.

HieuNT143. SQL Server supports two types of CTEs:

a)

indexed and nonindexed

b)

recursive and nonrecursive

c)

with view and without views

d)

None of above

5.

HieuNT143. You can use a CTE within a CREATE VIEW statement.

a)

True

b)

False

6.

HieuNT143. Tables which are on the remote servers cannot be referenced in the CTE.

a)

True

b)

False

7.

QuocHN1: Sub-queries can be nested in?

a)

UPDATE,DELETE,INSERT, HAVING statements

b)

UPDATE,GROUP BY, DELETE, INSERT, SELECT

c)

UPDATE, DELETE,INSERT, SELECT statement

d)

None Of Them

8.

PhatHT9: Is the following statement true or false? The recursive CTE definition must contain at least two CTE query definitions, an anchor member and a recursive member.

a)

True

b)

False

9.

QuocHN1: Book(BookID,Name,KindOfBook)

PRIMARY KEY is [BookID,KindOfBook]

Which code snippet will list out students that the major not equals “Novel”?

a)

SELECT * FROM Book HAVING KindOfBook <> 'Novel'

b)

SELECT * FROM GROUP BY KindOfBook HAVING KindOfBook <> 'Novel'

c)

SELECT * FROM Book b WHERE b.KindOfBook != 'Novel'

d)

None Of Them

10.

QuocHN1: Which operator performs pattern matching?

a)

LIKE operator

b)

BETWEEN operator

c)

EXISTS operator

d)

None of these

11.

QuocHN1: In SQL, which command(s) is(are) used to change a table's storage characteristics?

a)

CHANGE TABLE

b)

MODIFY TABLE

c)

ALTER TABLE

d)

All of the above

12.

PhatHT9: Which set operators combine anchor members?

a)

UNION

b)

UNION ALL

c)

EXCEPT

d)

All of the above

13.

PhatHT9: Select a correct answer:

a)

The number of columns in the anchor and recursive members must be the same.

b)

The number of columns in the anchor and recursive members can be diffrent.

14.

PhatHT9: Can the data type of a column in the recursive member be diffrent from the data type of the corresponding column in the anchor member?

a)

Yes

b)

No

15.

PhatHT9: A CTE must be followed by a single (a)   statement.

16.

HiepNQ4: How many tables may be included with a join?

a)

1

b)

2

c)

3

d)

All of the mentioned

17.

HiepNQ4: How many join types in join condition

a)

2

b)

3

c)

4

d)

5

18.

HiepNQ4: Which join refers to join records from the right table that have no matching key in the left table are include in the result set

a)

left join

b)

right join

c)

Full join

d)

half join

19.

HiepNQ4:Which of the following is correct statement about primary key of a table?

a)

Primary keys can contain NULL values and table can have multiple primary key.

b)

Primary key cannot be NULL and table can have multiple Primary keys

c)

Primary keys cannot contain NULL values and a table can have only one primary key.

d)

Primary key can be NULL and table can have only one primary key.

20.

HIepNQ4: Which SQL function is used to count the number of rows in a SQL query?

a)

COUNT(*)

b)

COUNT()

c)

MAX()

d)

NUMBER()

21.

HiepNQ4: To give a temporary name to a table, or a column in a table for more readability, what is used?

a)

SQL LIKES

b)

SQL aliases

c)

SQL Temp

d)

SQL Wildcards

22.

HiepNQ4: In which case would you use a FULL OUTER JOIN?

a)

When you want all matched and unmatched data from only one table

b)

When you want all matched data from both tables.

c)

When you want all unmatched data from one table.

d)

When you want all unmatched data from both tables

23.

SonND18: How many tables can be included with a join ?

a)

1

b)

2

c)

3

d)

All of the mentioned options

24.

SonND18: Which of the following statements is true concerning subqueries ?

a)

Involves the use of an inner and outer query

b)

Cannot return the same result as a query that is not a subquery

c)

Does not start with the word SELECT

d)

All of the mentioned options

25.

SonND18: Which of the following is a correlated subquery ?

a)

Uses the result of an inner query to determine the processing of an outer query

b)

Uses the result of an outer query to determine the processing of an inner query

c)

Uses the result of an inner query to determine the processing of an inner query

d)

Uses the result of an outer query to determine the processing of an outer query

26.

[HoaVC]where is the CTE syntax?

a)

[ WITH <common_table_expression> [ ,...n ] ] <common_table_expression>::= expression_name [ ( column_name [ ,...n ] ) ] AS ( CTE_query_definition )

b)

[ WITH <expression_name [ ( column_name [ ,...n ] ) ] AS ( CTE_query_definition )

c)

<common_table_expression>::= expression_name [ ( column_name [ ,...n ] ) ] AS ( CTE_query_definition )

d)

[ WITH <common_table_expression> [ ,...n ] ] <common_table_expression>::= expression_name [ ( column_name [ ,...n ] ) ]

27.

[HoaVC]Subqueries can be nested multiple times

a)

TRUE

b)

FALSE

28.

[HoaVC]Which of following statements is true concerning subqueries?

a)

Involves the use of an inner and outer quẻy

b)

Cannot return the same result as a query

c)

Does not start with the word SELECT

d)

All of the mentioned options

29.

[HoaVC]Which of the following is a crrelated subquery?

a)

Uses the result of an inner query to determine the processing of outer query

b)

Uses the result of an outer query to determine the processing of an inner query

c)

Uses the result of an inner query to determine the processing of an inner query

d)

Uses the result of an inner query to determine the processing of an outer query

30.

[HoaVC] Sub-queries can be nested in?

a)

UPDATE statements only

b)

INSERT statements only

c)

DELETE

statements only

d)

UPDATE ,INSERT,DELETE and SELECT

statements

31.

SonND18: Sub-queries can be nested in?

a)

UPDATE statements only.

b)

INSERT statements only.

c)

DELETE statements only.

d)

UPDATE, DELETE, INSERT and SELECT statements.

32.

SonND18: We have the following rank functions:

a)

ROW_NUMBER()

b)

RANK()

c)

DENSE_RANK()

d)

NTILE()

33.

SonND18: Which of following is not outer join?

a)

Left join

b)

Right join

c)

Full join

d)

Cartesian join

34.

DongTT3. A data manipulation command the combines the records from one or more tables is called 

a)

SELECT

b)

SHARE

c)

JOIN

d)

ADD

35.

DongTT3.The UNION operator selects only distinct values by default. To allow duplicate values, use:

a)

UNION ALL

b)

UNION

c)

FULL UNION

d)

All are correct

36.

DongTT3. How to creates an index on a table. Duplicate values are allowed:

a)

CREATE INDEX index_name ON table_name (column1, column2, ...);

b)

CREATE UNIQUE INDEX index_name

ON table_name (column1, column2, ...);

c)

None of these

37.

DongTT3. Subqueries can be nested multiple times:

a)

True

b)

False

c)

Can't tell

38.

DongTT3.By Default ORDER BY will sort by

a)

Ascending

b)

Descending

c)

Random

39.

SonND18: How many types of Join ?

a)

1

b)

3

c)

4

d)

5

40.

[HaiNV36] In the UPDATE statement, if we do not use the WHERE clause, then:

a)

Will not execute the update statement

b)

Only some records are updated

c)

No recored are update

d)

All of the recored will be updated

41.

[HaiNV36] Sql statement execution order?

a)

SELECT, FROM, WHERE, ORDER BY

b)

FROM, WHERE, GROUP BY, SELECT

c)

FROM, WHERE,SELECT,HAVING

d)

FROM, WHERE, HAVING, SELECT

42.

[HaiNV36] Which word is different from the rest?

a)

GROUP BY

b)

ROLLUP

c)

CUBE

d)

GROUPING SETS

43.

[HaiNV36] You have to use GROUP BY if SELECT COUNT(ID),NAME FROM EMPLOYEE ?

a)

YES

b)

NO

c)

MAYBE

d)

I DON'T KNOW

44.

HieuNDT1: How many type of join

a)

1

b)

2

c)

5

d)

4

45.

HieuNDT1: How many type of outer join

a)

1

b)

2

c)

3

d)

4

46.

HieuNDT1: Which is type of outer join

a)

left join

b)

cross join

c)

inner join

d)

all is wrong

47.

[HaiNV36] The differance between the DELETE and TRUNCATE is:

a)

the DELETE clause deletes all row,

the TRUNCATE can have a WHERE condition and might not delete all row

b)

the TRUNCATE is identical to the DELETE

c)

the TRUNCATE delete all rows, the DELETE can have Where condition and might delete all row

d)

The TRUNCATE deletes table structure, the DELETE remove data