Database Management – Week 4

Average Rating
0 out of 5 stars. 0 votes.

Question 1

Which of the following best describes the IntelliSense feature in Query Editor?

  • It is a database building wizard.
  • It is a visual query builder.
  • Selected: It is a text AutoComplete feature.This answer is correct.
  • It is used to create tables.

Correct! Query Editor has IntelliSense, a text AutoComplete feature that helps with navigating the object hierarchy and SQL language.

1/1

Question 2

Which type of merge statement combines only rows that exist in two result sets?

  • UNION
  • Selected: INTERSECTThis answer is correct.
  • EXCEPT
  • JOIN

Correct! The INTERSECT operator combines only rows that exist in both result sets.

1/1

Question 3

Which types of functions are used to summarize data in a grouped column or r all records in a table?

  • summary procedures
  • grouping statements
  • Selected: aggregate functionsThis answer is correct.
  • totaling processes

Correct! Aggregation functions are used to summarize data in a grouped column or all records in a table.

0/1

Question 4

If Col1 contains the string “Hello” and Col2 is Null, what is the result of SELECT Col1 + Col2?

  • “Hello”
  • Null
  • Selected: ErrorThis answer is incorrect.
  • “HelloNull”

Actually, look again. An arithmetic or string concatenation operation evaluates to Null if one of the input columns is null. Review Module 4 again, and specifically, page 155 in Chapter 5 of the textbook.

1/1

Question 5

Which syntax would you use to compare a value in a column against a list of values?

  • WHERE [Column Name] LIKE ([Value1], [Value2], [Value3])
  • Selected: WHERE [Column Name] IN ([Value1], [Value2], [Value3])This answer is correct.
  • WHERE [Column Name] = ([Value1], [Value2], [Value3])
  • WHERE [Column Name] EXISTS ([Value1], [Value2], [Value3])

Correct! If you want to compare a value in a column against a list of values, the syntax used is WHERE [Column Name] IN ([Value1], [Value2], [Value3])    .

1/1

Question 6

Which command selects all columns in a table?

  • SELECT #
  • Selected: SELECT *This answer is correct.
  • SELECT ;
  • SELECT @

Correct! The command “SELECT *” selects all columns in a table.

1/1

Question 7

Which type of join returns all columns from both tables, but only returns rows where the join column values are equal?

  • Selected: innerThis answer is correct.
  • right outer
  • left outer
  • full outer

Correct! An INNER JOIN returns all columns from both tables, but it only returns rows that satisfy the join condition.

1/1

Question 8

Which syntax should you use to sort the result set in reverse alphabetical order?

  • ORDER ON [Column Name] Z-A
  • SORT ON [Column Name] REVERSE
  • SORT REVERSE BY [Column Name]
  • Selected: ORDER BY [Column Name] DESCThis answer is correct.

Correct! The syntax used to sort the result set in reverse alphabetical order is ORDER BY [Column Name] DESC.

1/1

Question 9

Which statement is used to modify the column values of an existing row in a table?

  • ALTER
  • MODIFY
  • CHANGE
  • Selected: UPDATEThis answer is correct.

Correct! An UPDATE statement is used to modify the column values of an existing row in a table.

1/1

Question 10

What are the keywords CHECK, UNIQUE, and NOT NULL referred to as?

  • limits
  • Selected: constraintsThis answer is correct.
  • keys
  • references

Correct! The keywords CHECK, UNIQUE, and NOT NULL are referred to as constraints.

 

1/1

Question 1

Which clause do you use with a join operation to specify the columns from each table that should be used as the matching key?

  • FROM
  • BY
  • Selected: ONThis answer is correct.
  • WITH

Correct! Inner and outer joins use join conditions—using the ON clause—that specify which columns from each table should be used as the matching key.

1/1

Question 2

Which of the following is true about the SQL language?

  • It is case sensitive.
  • Selected: The semicolon is a statement terminator.This answer is correct.
  • Keywords must be written in uppercase.
  • Statement terminators are required at the end of a statement.

Correct! The statement terminator is a semicolon placed to mark the end of a SQL statement.

1/1

Question 3

Which command selects all columns in a table?

  • SELECT #
  • Selected: SELECT *This answer is correct.
  • SELECT ;
  • SELECT @

Correct! The command “SELECT *” selects all columns in a table.

1/1

Question 4

Which command returns the product of two columns in a single column named ProdC1C2?

  • Selected: SELECT Col1 * Col2 AS ProdC1C2This answer is correct.
  • SELECT FROM Col1 * Col2 TOTAL ProdC1C2
  • SELECT AS ProdC1C2 Col1 x Col2
  • SELECT (Col1, Col2) PRODUCT ProdC1C2

Correct! The command “SELECT Col1 * Col2 AS ProdC1C2” returns the product of two columns in a single column named ProdC1C2.

1/1

Question 5

In which type of query is a SQL query embedded within another SQL query?

  • nested query
  • Selected: subqueryThis answer is correct.
  • embedded query
  • inner query

Correct! Data can also be combined using a subquery, which is a SQL query embedded within another SQL query.

1/1

Question 6

Which type of join returns all columns from both tables, but only returns rows where the join column values are equal?

  • Selected: innerThis answer is correct.
  • right outer
  • left outer
  • full outer

Correct! An INNER JOIN returns all columns from both tables, but it only returns rows that satisfy the join condition.

1/1

Question 7

Which types of functions are used to summarize data in a grouped column or r all records in a table?

  • summary procedures
  • grouping statements
  • Selected: aggregate functionsThis answer is correct.
  • totaling processes

Correct! Aggregation functions are used to summarize data in a grouped column or all records in a table.

1/1

Question 8

Which syntax would you use to compare a value in a column against a list of values?

  • WHERE [Column Name] LIKE ([Value1], [Value2], [Value3])
  • Selected: WHERE [Column Name] IN ([Value1], [Value2], [Value3])This answer is correct.
  • WHERE [Column Name] = ([Value1], [Value2], [Value3])
  • WHERE [Column Name] EXISTS ([Value1], [Value2], [Value3])

Correct! If you want to compare a value in a column against a list of values, the syntax used is WHERE [Column Name] IN ([Value1], [Value2], [Value3])    .

1/1

Question 9

What are the keywords CHECK, UNIQUE, and NOT NULL referred to as?

  • limits
  • Selected: constraintsThis answer is correct.
  • keys
  • references

Correct! The keywords CHECK, UNIQUE, and NOT NULL are referred to as constraints.

 

1/1

Question 10

Which command should you use to remove duplicates from a result set?

  • SELECT AS
  • SELECT ONLY
  • SELECT UNIQUE
  • Selected: SELECT DISTINCTThis answer is correct.

Correct! Using the keyword DISTINCT removes duplicates from the result set so that only unique records are returned.

 

Leave a Reply

Your email address will not be published. Required fields are marked *