Deck 5: Transact:SQL Primer
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Match between columns
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/41
Play
Full screen (f)
Deck 5: Transact:SQL Primer
1
What type of functions are used to summarize data in a grouped column or for all records in a table?
A)Summary procedures
B)Aggregate functions
C)Grouping statements
D)Totaling processes
A)Summary procedures
B)Aggregate functions
C)Grouping statements
D)Totaling processes
B
2
If Col1 contains the string "Hello" and Col2 is Null, what is the result of SELECT Col1 + Col2?
A)"Hello"
B)Error
C)Null
D)"HelloNull"
A)"Hello"
B)Error
C)Null
D)"HelloNull"
C
3
Which command returns the product of two columns returned in a column named ProdC1C2?
A)SELECT Col1 * Col2 AS ProdC1C2
B)SELECT AS ProdC1C2 Col1 x Col2
C)SELECT FROM Col1 * Col2 TOTAL ProdC1C2
D)SELECT (Col1, Col2)PRODUCT ProdC1C2
A)SELECT Col1 * Col2 AS ProdC1C2
B)SELECT AS ProdC1C2 Col1 x Col2
C)SELECT FROM Col1 * Col2 TOTAL ProdC1C2
D)SELECT (Col1, Col2)PRODUCT ProdC1C2
A
4
Which command selects all columns in a table?
A)SELECT #
B)SELECT ;
C)SELECT *
D)SELECT @
A)SELECT #
B)SELECT ;
C)SELECT *
D)SELECT @
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
5
Which command changes the database context?
A)OPEN [Database Name]
B)USE [Database Name];
C)SELECT [Database Name];
D)SWITCH [Database Name]
A)OPEN [Database Name]
B)USE [Database Name];
C)SELECT [Database Name];
D)SWITCH [Database Name]
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
6
If you want to remove duplicates from a result set, which command should you use?
A)SELECT AS
B)SELECT UNIQUE
C)SELECT ONLY
D)SELECT DISTINCT
A)SELECT AS
B)SELECT UNIQUE
C)SELECT ONLY
D)SELECT DISTINCT
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
7
Which command will result in records that have a Col1 value greater than 100?
A)SELECT Col1 FROM Table1 IF Col1 GT 100
B)SELECT Col1 FROM Table1 WHERE Col1 > 100
C)SELECT Col1 > 100 FROM Table1
D)IF Col1 > 100 SELECT * FROM Table1
A)SELECT Col1 FROM Table1 IF Col1 GT 100
B)SELECT Col1 FROM Table1 WHERE Col1 > 100
C)SELECT Col1 > 100 FROM Table1
D)IF Col1 > 100 SELECT * FROM Table1
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
8
Which of the following represents correct syntax for a SELECT statement?
A)SELECT [Column Name] FROM [Table Name]
B)SELECT [Object Name] FOR [Column Name];
C)SELECT [Database Name] From [Column Name];
D)SELECT [Table Name] FROM [Row Name]
A)SELECT [Column Name] FROM [Table Name]
B)SELECT [Object Name] FOR [Column Name];
C)SELECT [Database Name] From [Column Name];
D)SELECT [Table Name] FROM [Row Name]
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
9
A string concatenation operation evaluates to null if all of the input columns have a value.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
10
What keyword can you include in a SELECT statement to create a column alias for the column returned in the result set?
A)FROM
B)FOR
C)ALIAS
D)AS
A)FROM
B)FOR
C)ALIAS
D)AS
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
11
Which clause do you use with a join operation to specify which columns from each table should be used as the matching key?
A)FROM
B)ON
C)BY
D)WITH
A)FROM
B)ON
C)BY
D)WITH
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
12
The database schema is defined by the DDL components in the SQL programming language.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
13
If you want to compare a value in a column against a list of values, which syntax would you use?
A)WHERE [Column Name] LIKE ([Value1], [Value2], [Value3])
B)WHERE [Column Name] = ([Value1], [Value2], [Value3])
C)WHERE [Column Name] IN ([Value1], [Value2], [Value3])
D)WHERE [Column Name] EXISTS ([Value1], [Value2], [Value3])
A)WHERE [Column Name] LIKE ([Value1], [Value2], [Value3])
B)WHERE [Column Name] = ([Value1], [Value2], [Value3])
C)WHERE [Column Name] IN ([Value1], [Value2], [Value3])
D)WHERE [Column Name] EXISTS ([Value1], [Value2], [Value3])
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
14
Which of the following is true about the SQL language?
A)it is case sensitive
B)keywords must be written in uppercase
C)the semicolon is a statement terminator
D)statement terminators are required at the end of a statement
A)it is case sensitive
B)keywords must be written in uppercase
C)the semicolon is a statement terminator
D)statement terminators are required at the end of a statement
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
15
Which syntax should you use to sort the result set in reverse alphabetic order.
A)ORDER ON [Column Name] Z-A
B)SORT REVERSE BY [Column Name]
C)SORT ON [Column Name] REVERSE
D)ORDER BY [Column Name] DESC
A)ORDER ON [Column Name] Z-A
B)SORT REVERSE BY [Column Name]
C)SORT ON [Column Name] REVERSE
D)ORDER BY [Column Name] DESC
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
16
A database operation that can be used to merge and retrieve data stored in more than one table view is called a SELECT.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
17
Transact-SQL is the variant of SQL developed by Microsoft and Sybase.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
18
SQL is an imperative programming language.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
19
Which of the following best describes the IntelliSense feature in Query Editor?
A)it is a database building wizard
B)it is a text AutoComplete feature
C)it is a visual query builder
D)it is used to create tables
A)it is a database building wizard
B)it is a text AutoComplete feature
C)it is a visual query builder
D)it is used to create tables
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
20
Which command returns all the columns for records in which the value of Col1 is greater than 10 but has a value less than Col2?
A)SELECT * FROM Table1 WHERE Col1 10
B)SELECT ALL FROM Table1 WHEN Col1 10
C)SELECT * FROM Table1 IF Col1 > 10 BUT Col1 < Col2
D)SELECT ALL FROM Table1 LIKE Col1 > 10 NOT Col1 < Col2
A)SELECT * FROM Table1 WHERE Col1 10
B)SELECT ALL FROM Table1 WHEN Col1 10
C)SELECT * FROM Table1 IF Col1 > 10 BUT Col1 < Col2
D)SELECT ALL FROM Table1 LIKE Col1 > 10 NOT Col1 < Col2
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
21
Define the logical operators AND, OR, and NOT.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
22
Data ___________ language allows you to configure the logical security in the database.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
23
What are the keywords CHECK, UNIQUE, and NOT NULL referred to as?
A)limits
B)keys
C)constraints
D)references
A)limits
B)keys
C)constraints
D)references
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
24
Use the ___________ statement along with ADD or DROP to modify or rename existing views and tables.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
25
How does the SQL language handle case and what are the recommendations on using case when constructing SQL statements?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
26
Use the _________ keyword to match a string based on a pattern.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
27
How do you combine data using joins?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
28
Describe the use of the SELECT statement.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
29
What are the key requirements to keep in mind when creating an INSERT statement?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
30
Which type of merge statement only combines rows that exist in two result sets?
A)UNION
B)EXCEPT
C)INTERSECT
D)JOIN
A)UNION
B)EXCEPT
C)INTERSECT
D)JOIN
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
31
How can you ease the managing of permissions across different objects?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
32
Which type of join returns all columns from both tables and only returns rows where the join column values are equal?
A)inner
B)left outer
C)right outer
D)full outer
A)inner
B)left outer
C)right outer
D)full outer
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
33
Describe why you would use the data control language component of the SQL programming language.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
34
What is the name for the type of query where a SQL query is embedded within another SQL query?
A)nested query
B)embedded query
C)subquery
D)inner query
A)nested query
B)embedded query
C)subquery
D)inner query
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
35
What is a qualified name?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
36
What is a null value and how does it affect arithmetic or string operations in SQL statements?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
37
Use the syntax SELECT ________ (expression)[Column Name] to limit the result set to the number of rows defined by the expression.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
38
Which statement is used to modify column values of an existing row in a table?
A)ALTER
B)CHANGE
C)MODIFY
D)UPDATE
A)ALTER
B)CHANGE
C)MODIFY
D)UPDATE
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
39
Use the syntax WHERE [Column Name] ______________ (SELECT * FROM [Table Name 2])when you want to compare a value of a column against the results of a subquery.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
40
What is a statement terminator and how are they used in the SQL language?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
41
Match between columns
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck