MTA 98-364 Test 2

25 July 2022
4.7 (114 reviews)
20 test answers
question
1. Which attribute specifies the type of data that an object can hold and specifies how many bytes it will take up? a) specifier b) data type c) validator d) data specific
answer
b) data type Section Reference: Defining Data Types Explanation: A data type is an attribute that specifies the type of data that an object can hold. It also specifies how many bytes each data type takes up. For example, several data types define only whole numbers, which are good for counting or for identification. Other data types allow decimal numbers and come in handy when storing values dealing with money. Other data types are designed to store strings or multiple characters so that you can define labels, descriptions, and comments. Lastly, you have other miscellaneous data types that can store dates, times, and binary numbers consisting of 0s and 1s or can be used to store digital images.
question
2. What common data type you would be used to count objects? a) money b) integer c) float d) double float
answer
b) integer Section Reference: Using Built-in Data Types Explanation: The int numeric data type is used to store mathematical computations and is used when you do not require a decimal point output. An example of an integer would be: 2 or -2
question
3. What common data type is used to store decimal numbers such as 3.14 and 7.07? a) money b) integer c) float d) varchar
answer
c) float Section Reference: Using Built-in Data Types Explanation: A float numeric data type is commonly used in the scientific community and is considered an approximate-number data type. This means that not all values within the data type range will be represented exactly. When considering using this numeric data type, note that the float data type ranges are different. For storage of 4 bytes, you would use the range of 1-24, as in float(24), and for 8 bytes, you would use the range of 25-53, as in float(53).
question
4. Which data type should you use to store text based on English? a) text b) int c) float d) varchar
answer
d) varchar Section Reference: Using Built-in Data Types Explanation: A varchar character string data type is commonly used in databases in which you are supporting English attributes. If you are supporting multiple languages, use the nvarchar data type instead because this will help minimize the issues that come with character conversion.
question
5. How many bytes does the int data type take up? a) 1 byte b) 2 byte c) 4 byte d) 8 byte
answer
c) 4 byte Section Reference: Using Built-in Data Types Explanation: The int data type holds integer data from -2^31(-2,147,483,648) to 2^31-1(2,147,483,647). It takes 4 bytes of data.
question
6. How many bytes does the money data type take up? a) 1 byte b) 2 byte c) 4 byte d) 8 byte
answer
d) 8 byte Section Reference: Using Built-in Data Types Explanation: The money data type holds currency values from -922,337,203,685,477.508 to 922,337,203,685,477.5807. It takes 8 bytes of data.
question
7. What type of conversion occurs without specifying the actual callout function? a) implicit b) explicit c) casting d) autocasting
answer
a) implicit Section Reference: Understanding Implicit Conversions Explanation: SQL Server supports implicit conversions, which can occur without specifying the actual callout function (cast or convert). This means that if you are doing calculations with multiple data types, implicit conversion will occur automatically.
question
8. How many bytes does a single character take up if it is a varchar that supports English and most European languages? a) 1 byte b) 2 bytes c) 4 bytes d) 8 bytes
answer
a) 1 byte Section Reference: Using Regular Character Strings Explanation: A regular character uses 1 byte of storage for each character, which allows you to define one of 256 (8 bits are in a byte and 2^8=256) possible characters that accommodate English and some European languages.
question
9. What kind of character takes up two bytes of storage and can include almost any language including Chinese, Japanese, and Arabic? a) standard b) ANSI c) Unicode d) Duocode
answer
c) Unicode Explanation: A Unicode character uses 2 bytes of storage per character so that you can represent one of 65,536 (16 bits are in a 2 bytes and 2^16=65,536 characters). The additional character allows it to store characters from just about any language, including Chinese, Japanese, Arabic, and so on.
question
10. What data type should you use to support Japanese or Arabic text? a) nvarchar b) char c) Unicode d) varchar
answer
a) nvarchar Section Reference: Understanding Unicode Character Strings Explanation: The Unicode character strings nchar and nvarchar can be either fixed or variable like their regular character strings. They use the Unicode UCS-2 character set.
question
11. Which naming conversion would capitalize the first character of each word with no spaces? a) PascalCase b) camelCase c) CapCase d) FirstCase
answer
a) PascalCase Section Reference: Creating and Using Tables Explanation: It really doesn't make a difference how you use upper- and lowercase, as long as you are consistent. Two common naming conventions are PascalCase and camelCase. Examples of PascalCase include such names as OrderDetails or CustomerAddresses.
question
12. What is a virtual table consisting of different columns from one or more tables? a) index b) view c) vtable d) vlookup
answer
b) view Section Reference: Creating Views Explanation: A view is simply a virtual table consisting of different columns from one or more tables. Unlike a table, a view is stored in the database as a query object; therefore, a view is an object that obtains its data from one or more tables.
question
13. What are previously written SQL statements that have been stored within a database? a) data statements b) views c) DDL statements d) stored procedures
answer
d) stored procedures Section Reference: Creating Stored Procedures Explanation: A stored procedure is a previously written SQL statement that has been "stored" or saved into the database. Creating a stored procedure will save you time when running the same query over and over again; you can then execute the stored procedure from within the database's command environment.
question
14. What command is used to execute a stored procedure? a) go b) use c) start d) exec
answer
d) exec Section Reference: Creating Stored Procedures Explanation: An example of executing a stored procedure is as follows: exec usp_displayallusers The name of the stored procedure is usp_displayallusers, and exec tells SQL Server to execute the code in the usp_displayallusers stored procedure.
question
15. What is a type of attack in which malicious code is inserted into strings that are passed to the SQL server instance? a) SQL infection b) SQL takeover c) SQL injection d) SQL force
answer
c) SQL injection Section Reference: Understanding SQL Injections Explanation: A SQL injection is an attack in which malicious code is inserted into strings that are later passed to instances of SQL Server waiting for parsing and execution. Any procedure that constructs SQL statements should be reviewed continually for injection vulnerabilities, because SQL Server will execute all syntactically valid queries from any source.
question
16. What is the set of rules that determine how data is sorted and compared? a) sort rule b) filter c) constraint d) collation
answer
d) collation Section Reference: Using Built-in Data Types Explanation: Collation refers to a set of rules that determine how data is sorted and compared. By default, SQL Server has predefined collation precedence. If you want to override how data is sorted, you must use a collation clause.
question
17. What type of data type would you use to store true/false or yes/no answers? a) int b) char c) Boolean d) float
answer
c) Boolean Section Reference: Using Build-in Data Types Explanation: Boolean is also known as a bit data type. If you are storing 8 or less bit columns in a table, the columns are then stored as 1 byte; if you are storing 9 to 16 bits, the columns are stored as 2 bytes, and so forth. The Boolean data type converts true and false string values to bit values, with true converted to 1 and false converted to 0.
question
18. A char string can be up to _______ characters long.
answer
Answer: 8,000 Explanation: For the data set char, it is identified as char [(n)] and is a fixed-length, non-Unicode character (in other words, regular character) and has a length of n bytes. The value of n must be between 1 and 8,000 bytes. The other non-Unicode data type, varchar[(n|max)], is a variable-length data set, which can consist of 1 to 8,000 characters.
question
19. What does VARCHAR(25) represent?
answer
Answer: A character string up to 25 characters long Section Reference: Using Regular Character Strings Explanation: When you use a VAR element, SQL Server preserves space in the row it resides in based on the column's defined size and not on the actual number of characters found in the character string itself, plus an extra 2 bytes of data are provided for offset data. For example, if you want to specify that a strong supports only a maximum of 25 characters, you would use VARCHAR(25).
question
20. What two commands will perform implicit conversion?
answer
Answer: Cast and Convert. Section Reference: Understanding Implicit Conversions Cast and convert play an integral partnership with any data type function as they convert an expression of one data type to another. convert was the old style of converting, with cast being used in the same manner.
1 of 20

Unlock all answers in this set

Unlock answers (16)
question
1. Which attribute specifies the type of data that an object can hold and specifies how many bytes it will take up? a) specifier b) data type c) validator d) data specific
answer
b) data type Section Reference: Defining Data Types Explanation: A data type is an attribute that specifies the type of data that an object can hold. It also specifies how many bytes each data type takes up. For example, several data types define only whole numbers, which are good for counting or for identification. Other data types allow decimal numbers and come in handy when storing values dealing with money. Other data types are designed to store strings or multiple characters so that you can define labels, descriptions, and comments. Lastly, you have other miscellaneous data types that can store dates, times, and binary numbers consisting of 0s and 1s or can be used to store digital images.
question
2. What common data type you would be used to count objects? a) money b) integer c) float d) double float
answer
b) integer Section Reference: Using Built-in Data Types Explanation: The int numeric data type is used to store mathematical computations and is used when you do not require a decimal point output. An example of an integer would be: 2 or -2
question
3. What common data type is used to store decimal numbers such as 3.14 and 7.07? a) money b) integer c) float d) varchar
answer
c) float Section Reference: Using Built-in Data Types Explanation: A float numeric data type is commonly used in the scientific community and is considered an approximate-number data type. This means that not all values within the data type range will be represented exactly. When considering using this numeric data type, note that the float data type ranges are different. For storage of 4 bytes, you would use the range of 1-24, as in float(24), and for 8 bytes, you would use the range of 25-53, as in float(53).
question
4. Which data type should you use to store text based on English? a) text b) int c) float d) varchar
answer
d) varchar Section Reference: Using Built-in Data Types Explanation: A varchar character string data type is commonly used in databases in which you are supporting English attributes. If you are supporting multiple languages, use the nvarchar data type instead because this will help minimize the issues that come with character conversion.
question
5. How many bytes does the int data type take up? a) 1 byte b) 2 byte c) 4 byte d) 8 byte
answer
c) 4 byte Section Reference: Using Built-in Data Types Explanation: The int data type holds integer data from -2^31(-2,147,483,648) to 2^31-1(2,147,483,647). It takes 4 bytes of data.
question
6. How many bytes does the money data type take up? a) 1 byte b) 2 byte c) 4 byte d) 8 byte
answer
d) 8 byte Section Reference: Using Built-in Data Types Explanation: The money data type holds currency values from -922,337,203,685,477.508 to 922,337,203,685,477.5807. It takes 8 bytes of data.
question
7. What type of conversion occurs without specifying the actual callout function? a) implicit b) explicit c) casting d) autocasting
answer
a) implicit Section Reference: Understanding Implicit Conversions Explanation: SQL Server supports implicit conversions, which can occur without specifying the actual callout function (cast or convert). This means that if you are doing calculations with multiple data types, implicit conversion will occur automatically.
question
8. How many bytes does a single character take up if it is a varchar that supports English and most European languages? a) 1 byte b) 2 bytes c) 4 bytes d) 8 bytes
answer
a) 1 byte Section Reference: Using Regular Character Strings Explanation: A regular character uses 1 byte of storage for each character, which allows you to define one of 256 (8 bits are in a byte and 2^8=256) possible characters that accommodate English and some European languages.
question
9. What kind of character takes up two bytes of storage and can include almost any language including Chinese, Japanese, and Arabic? a) standard b) ANSI c) Unicode d) Duocode
answer
c) Unicode Explanation: A Unicode character uses 2 bytes of storage per character so that you can represent one of 65,536 (16 bits are in a 2 bytes and 2^16=65,536 characters). The additional character allows it to store characters from just about any language, including Chinese, Japanese, Arabic, and so on.
question
10. What data type should you use to support Japanese or Arabic text? a) nvarchar b) char c) Unicode d) varchar
answer
a) nvarchar Section Reference: Understanding Unicode Character Strings Explanation: The Unicode character strings nchar and nvarchar can be either fixed or variable like their regular character strings. They use the Unicode UCS-2 character set.
question
11. Which naming conversion would capitalize the first character of each word with no spaces? a) PascalCase b) camelCase c) CapCase d) FirstCase
answer
a) PascalCase Section Reference: Creating and Using Tables Explanation: It really doesn't make a difference how you use upper- and lowercase, as long as you are consistent. Two common naming conventions are PascalCase and camelCase. Examples of PascalCase include such names as OrderDetails or CustomerAddresses.
question
12. What is a virtual table consisting of different columns from one or more tables? a) index b) view c) vtable d) vlookup
answer
b) view Section Reference: Creating Views Explanation: A view is simply a virtual table consisting of different columns from one or more tables. Unlike a table, a view is stored in the database as a query object; therefore, a view is an object that obtains its data from one or more tables.
question
13. What are previously written SQL statements that have been stored within a database? a) data statements b) views c) DDL statements d) stored procedures
answer
d) stored procedures Section Reference: Creating Stored Procedures Explanation: A stored procedure is a previously written SQL statement that has been "stored" or saved into the database. Creating a stored procedure will save you time when running the same query over and over again; you can then execute the stored procedure from within the database's command environment.
question
14. What command is used to execute a stored procedure? a) go b) use c) start d) exec
answer
d) exec Section Reference: Creating Stored Procedures Explanation: An example of executing a stored procedure is as follows: exec usp_displayallusers The name of the stored procedure is usp_displayallusers, and exec tells SQL Server to execute the code in the usp_displayallusers stored procedure.
question
15. What is a type of attack in which malicious code is inserted into strings that are passed to the SQL server instance? a) SQL infection b) SQL takeover c) SQL injection d) SQL force
answer
c) SQL injection Section Reference: Understanding SQL Injections Explanation: A SQL injection is an attack in which malicious code is inserted into strings that are later passed to instances of SQL Server waiting for parsing and execution. Any procedure that constructs SQL statements should be reviewed continually for injection vulnerabilities, because SQL Server will execute all syntactically valid queries from any source.
question
16. What is the set of rules that determine how data is sorted and compared? a) sort rule b) filter c) constraint d) collation
answer
d) collation Section Reference: Using Built-in Data Types Explanation: Collation refers to a set of rules that determine how data is sorted and compared. By default, SQL Server has predefined collation precedence. If you want to override how data is sorted, you must use a collation clause.
question
17. What type of data type would you use to store true/false or yes/no answers? a) int b) char c) Boolean d) float
answer
c) Boolean Section Reference: Using Build-in Data Types Explanation: Boolean is also known as a bit data type. If you are storing 8 or less bit columns in a table, the columns are then stored as 1 byte; if you are storing 9 to 16 bits, the columns are stored as 2 bytes, and so forth. The Boolean data type converts true and false string values to bit values, with true converted to 1 and false converted to 0.
question
18. A char string can be up to _______ characters long.
answer
Answer: 8,000 Explanation: For the data set char, it is identified as char [(n)] and is a fixed-length, non-Unicode character (in other words, regular character) and has a length of n bytes. The value of n must be between 1 and 8,000 bytes. The other non-Unicode data type, varchar[(n|max)], is a variable-length data set, which can consist of 1 to 8,000 characters.
question
19. What does VARCHAR(25) represent?
answer
Answer: A character string up to 25 characters long Section Reference: Using Regular Character Strings Explanation: When you use a VAR element, SQL Server preserves space in the row it resides in based on the column's defined size and not on the actual number of characters found in the character string itself, plus an extra 2 bytes of data are provided for offset data. For example, if you want to specify that a strong supports only a maximum of 25 characters, you would use VARCHAR(25).
question
20. What two commands will perform implicit conversion?
answer
Answer: Cast and Convert. Section Reference: Understanding Implicit Conversions Cast and convert play an integral partnership with any data type function as they convert an expression of one data type to another. convert was the old style of converting, with cast being used in the same manner.