Font size
WorksheetsSQL_29/11
Total questions: 47
Worksheet time: 26mins
QuocHN1: A CTE, also called as ... in long form
Common Type Expression
Calculator Table Expression
Common Table Expression
Common Type Experience
HieuNT143. How many join types in join condition:
4
2
3
5
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:
Left outer join
Right outer join
Full outer join
None of the above
HieuNT143. SQL Server supports two types of CTEs:
indexed and nonindexed
recursive and nonrecursive
with view and without views
None of above
HieuNT143. You can use a CTE within a CREATE VIEW statement.
True
False
HieuNT143. Tables which are on the remote servers cannot be referenced in the CTE.
True
False
QuocHN1: Sub-queries can be nested in?
UPDATE,DELETE,INSERT, HAVING statements
UPDATE,GROUP BY, DELETE, INSERT, SELECT
UPDATE, DELETE,INSERT, SELECT statement
None Of Them
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.
True
False
QuocHN1: Book(BookID,Name,KindOfBook)
PRIMARY KEY is [BookID,KindOfBook]
Which code snippet will list out students that the major not equals “Novel”?
SELECT * FROM Book HAVING KindOfBook <> 'Novel'
SELECT * FROM GROUP BY KindOfBook HAVING KindOfBook <> 'Novel'
SELECT * FROM Book b WHERE b.KindOfBook != 'Novel'
None Of Them
QuocHN1: Which operator performs pattern matching?
LIKE operator
BETWEEN operator
EXISTS operator
None of these
QuocHN1: In SQL, which command(s) is(are) used to change a table's storage characteristics?
CHANGE TABLE
MODIFY TABLE
ALTER TABLE
All of the above
PhatHT9: Which set operators combine anchor members?
UNION
UNION ALL
EXCEPT
All of the above
PhatHT9: Select a correct answer:
The number of columns in the anchor and recursive members must be the same.
The number of columns in the anchor and recursive members can be diffrent.
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?
Yes
No
PhatHT9: A CTE must be followed by a single (a) statement.
HiepNQ4: How many tables may be included with a join?
1
2
3
All of the mentioned
HiepNQ4: How many join types in join condition
2
3
4
5
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
left join
right join
Full join
half join
HiepNQ4:Which of the following is correct statement about primary key of a table?
Primary keys can contain NULL values and table can have multiple primary key.
Primary key cannot be NULL and table can have multiple Primary keys
Primary keys cannot contain NULL values and a table can have only one primary key.
Primary key can be NULL and table can have only one primary key.
HIepNQ4: Which SQL function is used to count the number of rows in a SQL query?
COUNT(*)
COUNT()
MAX()
NUMBER()
HiepNQ4: To give a temporary name to a table, or a column in a table for more readability, what is used?
SQL LIKES
SQL aliases
SQL Temp
SQL Wildcards
HiepNQ4: In which case would you use a FULL OUTER JOIN?
When you want all matched and unmatched data from only one table
When you want all matched data from both tables.
When you want all unmatched data from one table.
When you want all unmatched data from both tables
SonND18: How many tables can be included with a join ?
1
2
3
All of the mentioned options
SonND18: Which of the following statements is true concerning subqueries ?
Involves the use of an inner and outer query
Cannot return the same result as a query that is not a subquery
Does not start with the word SELECT
All of the mentioned options
SonND18: Which of the following is a correlated subquery ?
Uses the result of an inner query to determine the processing of an outer query
Uses the result of an outer query to determine the processing of an inner query
Uses the result of an inner query to determine the processing of an inner query
Uses the result of an outer query to determine the processing of an outer query
[HoaVC]where is the CTE syntax?
[ WITH <common_table_expression> [ ,...n ] ] <common_table_expression>::= expression_name [ ( column_name [ ,...n ] ) ] AS ( CTE_query_definition )
[ WITH <expression_name [ ( column_name [ ,...n ] ) ] AS ( CTE_query_definition )
<common_table_expression>::= expression_name [ ( column_name [ ,...n ] ) ] AS ( CTE_query_definition )
[ WITH <common_table_expression> [ ,...n ] ] <common_table_expression>::= expression_name [ ( column_name [ ,...n ] ) ]
[HoaVC]Subqueries can be nested multiple times
TRUE
FALSE
[HoaVC]Which of following statements is true concerning subqueries?
Involves the use of an inner and outer quẻy
Cannot return the same result as a query
Does not start with the word SELECT
All of the mentioned options
[HoaVC]Which of the following is a crrelated subquery?
Uses the result of an inner query to determine the processing of outer query
Uses the result of an outer query to determine the processing of an inner query
Uses the result of an inner query to determine the processing of an inner query
Uses the result of an inner query to determine the processing of an outer query
[HoaVC] Sub-queries can be nested in?
UPDATE statements only
INSERT statements only
DELETE
statements only
UPDATE ,INSERT,DELETE and SELECT
statements
SonND18: Sub-queries can be nested in?
UPDATE statements only.
INSERT statements only.
DELETE statements only.
UPDATE, DELETE, INSERT and SELECT statements.
SonND18: We have the following rank functions:
ROW_NUMBER()
RANK()
DENSE_RANK()
NTILE()
SonND18: Which of following is not outer join?
Left join
Right join
Full join
Cartesian join
DongTT3. A data manipulation command the combines the records from one or more tables is called
SELECT
SHARE
JOIN
ADD
DongTT3.The UNION operator selects only distinct values by default. To allow duplicate values, use:
UNION ALL
UNION
FULL UNION
All are correct
DongTT3. How to creates an index on a table. Duplicate values are allowed:
CREATE INDEX index_name ON table_name (column1, column2, ...);
CREATE UNIQUE INDEX index_name
ON table_name (column1, column2, ...);
None of these
DongTT3. Subqueries can be nested multiple times:
True
False
Can't tell
DongTT3.By Default ORDER BY will sort by
Ascending
Descending
Random
SonND18: How many types of Join ?
1
3
4
5
[HaiNV36] In the UPDATE statement, if we do not use the WHERE clause, then:
Will not execute the update statement
Only some records are updated
No recored are update
All of the recored will be updated
[HaiNV36] Sql statement execution order?
SELECT, FROM, WHERE, ORDER BY
FROM, WHERE, GROUP BY, SELECT
FROM, WHERE,SELECT,HAVING
FROM, WHERE, HAVING, SELECT
[HaiNV36] Which word is different from the rest?
GROUP BY
ROLLUP
CUBE
GROUPING SETS
[HaiNV36] You have to use GROUP BY if SELECT COUNT(ID),NAME FROM EMPLOYEE ?
YES
NO
MAYBE
I DON'T KNOW
HieuNDT1: How many type of join
1
2
5
4
HieuNDT1: How many type of outer join
1
2
3
4
HieuNDT1: Which is type of outer join
left join
cross join
inner join
all is wrong
[HaiNV36] The differance between the DELETE and TRUNCATE is:
the DELETE clause deletes all row,
the TRUNCATE can have a WHERE condition and might not delete all row
the TRUNCATE is identical to the DELETE
the TRUNCATE delete all rows, the DELETE can have Where condition and might delete all row
The TRUNCATE deletes table structure, the DELETE remove data
