
113 True/False questions
-
char [(n)] , the value of n must be between ___ → 4 bytes of storage
-
The syntax for numeric data type is expressed as ___ → store mathematical computations and is employed when you do not require a decimal point output.
-
The purpose of a table is to ___ → SQL Server will preserve space in the row in which that element resides based on the column's defined size (and not on the actual number of characters in the character string itself ), plus an extra two bytes of data for offset data.
-
Views ensure the security of data by restricting access to the following data: → • By using SSMS
• By writing a Transact-SQL statement -
A view is stored in a database as a ___ → simplify query execution.
-
if your columns contain 9 to 16 bits, the columns will be stored as ___ → bit data type.
-
The integer (int) numeric data type is used to ___ → 8 bytes of storage
-
Regular data types include those identified with ___ → NCHAR and NVARCHAR
-
A view is ___ → a virtual table consisting of different columns from one or more tables;
( or )
an object that obtains its data from one or more tables. -
When you use a VAR element ___ → provide a structure for storing data within a relational database.
-
Cast and Convert functions ??? → force a conversion
-
Varchar ??? → This character-string data type is commonly used in databases where you are supporting English attributes.
-
Money ??? → This numeric data type is used in places where you want money or currency involved in your database;
-
Some common examples of views include the following: → exec usp_displayallusers
-
Examples of PascalCase are such names as ___ → previously written SQL statement that has been "stored" or saved into a database.
-
Set the Default Value of the DateCreated column to (getdate()); this will insert the ___ → store mathematical computations and is employed when you do not require a decimal point output.
-
datetime and datetime2 ??? → Defines a date that is combined with a time of day. The time is based on a 24-hour day, with seconds always zero (:00), meaning there are no fractional
seconds. Range: 1900-01-01 through 2079-06-06 Accuracy: one minute. -
The float numeric data type is commonly used in the ___ → store mathematical computations and is employed when you do not require a decimal point output.
-
Cast is compliance with ___ → convert the count variable to a float
-
Examples of camelCase are names like ___ → myAddress and vendorTerms
-
A regular character uses ___ → one 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, accommodating English and some European languages.
-
When two expressions (mathematical functions or comparison functions) have different data types, rules for data-type precedence specify that the ___ → data type with lower precedence
is converted to the data type with higher precedence. -
A stored procedure is an already-written SQL statement that is ___ → stored in a database.
-
sql_variant ??? → Unicode Character data type with fixed length.
-
Microsoft SQL Server 2008's built-in data types are organized into the following general categories: → Regular and Unicode.
-
Precision (p) ??? → is the maximum total number of decimal digits that can be stored, both to the left and the right of the decimal point. This value must be a minimum of 1 and a maximum of 38. The default precision number is 18.
-
datetime2 is the data type to use if you will be storing values ___ → between January 1, 1900, and June 6, 2079, that are accurate to only 1 minute.
-
Datetime ??? → Defines a date that is combined with a time of day that is based on a 24-hour clock. Range: 0001-01-01 through 9999-12-31. Range: 00:00:00 through 23:59:59.9999999. Accuracy: 100 nanoseconds.
-
how many bytes datetime2 data type requires ___ → 4 bytes of storage
-
Complex queries can be stored in the form of a view and data from the view can then be mined ___ → using simple query statements.
-
smallint ??? → Integer data from -2^15 (-32,768) to 2^15-1 (32,767).
-
binary ??? → Binary data with fixed length.
-
The Boolean data type is also known as the ___ → predefined data types (Microsoft SQL Server)
-
syntax of the convert function ??? → CONVERT ( data_type [ ( length ) ], expression [,style ] )
-
INSERT INTO planets (name, diameter) VALUES ('earth', 10000);
if SQL Server didn't support implicit conversion, the following syntax would be needed: → INSERT INTO planets (name, diameter) VALUES ('earth', CAST (10000 as varchar(50))) -
Creating tables within SSMS is simple because SSMS ___ → is an easy-to-use graphical interface.
-
uniqueidentifier (UUID) ??? → is the maximum total number of decimal digits that can be stored, both to the left and the right of the decimal point. This value must be a minimum of 1 and a maximum of 38. The default precision number is 18.
-
MAX specifier ? → A value with a size identified up to a certain threshold (the default is 8,000) is stored inline in the row.
-
TRUE and FALSE string values can be converted ___ → to bit values. Specifically, TRUE is converted to 1 and FALSE is converted to 0.
-
SSMS definition : → A value with a size identified up to a certain threshold (the default is 8,000) is stored inline in the row.
-
money, monetary or currency values from ___ → -922,337,203,685,477.508 to 922,337, 203,685,477.5807
-
If you are creating complex query statements, your best bet is to ___ → create a stored procedure for them and run that stored procedure from within the Query Analyzer using an execute (exec) command.
-
An example of executing a stored procedure: → allows you to store all the logic inside the database, so by using a simple command, you can query and retrieve all information from all sources.
-
CONVERT(nvarchar(10), OrderDate, 101) ??? → subtypes of datetime data type
-
CREATE VIEW vwCustomer
AS
SELECT CustomerId, Company Name, Phone
FROM Customers → This creates a view called vwCustomer that will be stored as an object. Here, the data that is queried from the columns comes from the Customers table. -
how can you create tables using ANSI SQL syntax? → you will use the create table statement to accomplish this task.
-
tinyint ??? → Integer data from -2^63 (-9,223,372,036,854,775,808) to 2^63-1 8 bytes (9,223,372,036,854,775,807).
-
Boolean ??? → This data type converts true and false string values to bit values, with true converted to 1 and false converted to 0.
-
VARCHAR(25) ? → Specify that a string supports a maximum of only 25 characters
-
datetime2* ??? → Defines a date that is combined with a time of day that is based on a 24-hour clock. Range: 0001-01-01 through 9999-12-31. Range: 00:00:00 through 23:59:59.9999999. Accuracy: 100 nanoseconds.
-
A Unicode character uses ___ → Transact-SQL data types you would use to represent monetary or currency values. Both data types are accurate to 1/10,000th of the monetary units they represent.
-
smalldatetime ??? → Defines a date that is combined with a time of day. The time is based on a 24-hour day, with seconds always zero (:00), meaning there are no fractional
seconds. Range: 1900-01-01 through 2079-06-06 Accuracy: one minute. -
The date and time data types include ___ → date, datetime, datetime2, datetimeoffset, smalldatetime, and time.
-
A less direct method of attack injects malicious code into ___ → date, datetime, datetime2, datetimeoffset, smalldatetime, and time.
-
if your columns store 8 bits or fewer, the columns will be stored as ___ → between the dates of January 1, 1753, and December 31, 9999, that are accurate to 3.33 milliseconds,
-
For example, although a DateTime value is represented as a float, ___ → 8 bytes of storage
-
Unicode data types are identified with ___ → NCHAR and NVARCHAR
-
time* ??? → Defines a date. Range: 0001-01-01 through 9999-12-31. Accuracy: one day.
-
datetimeoffset* ??? → Defines a date that is combined with a time of day that has time-zone awareness and is based on a 24-hour clock. Range: 0001-01-01 through 9999-12-31 ... 00:00:00 through 23:59:59.9999999. Accuracy: 100 nanoseconds.
-
syntax of the cast function ??? → CONVERT ( data_type [ ( length ) ], expression [,style ] )
-
Using a stored procedure ___ → allows you to store all the logic inside the database, so by using a simple command, you can query and retrieve all information from all sources.
-
Money and smallmoney are ___ → Transact-SQL data types you would use to represent monetary or currency values. Both data types are accurate to 1/10,000th of the monetary units they represent.
-
Non-Unicode data type varchar[(n|max)] is a ___ → bit data type.
-
nchar ??? → Unicode Character data type with fixed length.
-
Exact numerics include ___ → underlying tables.
-
The syntax for decimal data type is expressed as ___ → numeric[(p[,s])]
-
A view is also a mechanism to ___ → simplify query execution.
-
bigint ??? → Integer data from -2^63 (-9,223,372,036,854,775,808) to 2^63-1 8 bytes (9,223,372,036,854,775,807).
-
Scale(s) ??? → Reflects the maximum number of decimal digits that can be stored to the right of the decimal point. This must be a value from 0 through p, but it can be specified only if precision is also specified. The default scale is 0.
-
varbinary ??? → Binary data with variable length.
-
"exec" → tells SQL Server to execute the code in the stored procedure.
-
char ??? → If you are supporting multiple languages, use this data type.
-
Once you have defined a view, you can reference it as you would any other ___ → create a stored procedure for them and run that stored procedure from within the Query Analyzer using an execute (exec) command.
-
how many bytes datetime data type uses ___ → 8 bytes of storage
-
cast(count AS float) ??? → convert the count variable to a float
-
You should also avoid using spaces because they add complications that make it necessary for you to use ___ → quotes
-
ntext ?? → This data type will be removed in future SQL releases; therefore, use nvarchar(max) instead.
-
Reasons to provide a view instead of enabling users to access the underlying tables in your database: → you will use the create table statement to accomplish this task.
-
smallmoney, monetary or currency values from ___ → Transact-SQL data types you would use to represent monetary or currency values. Both data types are accurate to 1/10,000th of the monetary units they represent.
-
text ??? → This data type will be removed in future SQL releases; therefore, use varchar(max) instead.
-
if you multiply an item's cost (represented as a float) with the number of items (represented as an integer), the answer will be ___ → you may not implicitly convert to a float because it is meant to be a date and/or time.
-
indexing plays a role in query time and an even greater role in ___ → database performance improvements.
-
Views are referred to as ___ → previously written SQL statement that has been "stored" or saved into a database.
-
Add Table dialog box ??? → This dialog box allows you to do:
• specify the table to be used as the primary source...
• To use another existing view, click the Views tab...
• generate records from a function (Functions tab).
• If you want to use more than one source, you can click each of the different tabs to find the table, view, or function you wish to add to your query.
• Once you have selected the desired source(s) (click the Add button)
• Once you have selected and added all your desired sources (Close button) -
nvarchar ??? → Reflects the maximum number of decimal digits that can be stored to the right of the decimal point. This must be a value from 0 through p, but it can be specified only if precision is also specified. The default scale is 0.
-
data set char is identified as ___ → char [(n)] and is a fixed-length, non-Unicode character (regular character) with a length of n bytes. The value of n must be between 1 and 8,000, making the storage size n bytes.
-
image ??? → Defines a date. Range: 0001-01-01 through 9999-12-31. Accuracy: one day.
-
Steps to create a stored procedure (SSMS) : → Programmability section >>> Right-click Stored Procedures and choose New Stored Procedure
-
Database views are designed to create a virtual table that is representative of ___ → decimal[(p[,s])]
-
Steps to create your view: → Right-click the Views folder, then select New View.
-
When a conversion (convert values from one data type to another) is done automatically it is called an ___ → numeric[(p[,s])]
-
Differences between regular and Unicode are the ___ → bytes of storage used for each.
-
NVarchar ??? → If you are supporting multiple languages, use this data type.
-
when you are expressing a Unicode character literal, it must have the letter ___ → table in a database.
-
Adding indexes to the schema can actually increase the overhead of your database due to the ___ → ongoing maintenance of these indexes.
-
varchar ??? → Character data type with variable length.
-
There are two methods for creating a view: → • By using SSMS
• By writing a Transact-SQL statement -
A regular character literal is always expressed with ___ → CHAR and VARCHAR
-
SQL injection is an ___ → SQL Server Management Studio
-
date* ??? → is a Transact-SQL integer data type that takes a value of 1, 0, or NULL
-
data type ??? → Defines a date. Range: 0001-01-01 through 9999-12-31. Accuracy: one day.
-
The injection process's function is to ___ → provide a structure for storing data within a relational database.
-
SELECT * FROM USERLIST → What this select statement does is return all the data that is found in the USERLIST table.
-
numeric & decimal ??? → If you are supporting multiple languages, use this data type.
-
LOB ? → Character data type with fixed length.
-
One way to save time when running the same query over and over again is to create a ___ → to bit values. Specifically, TRUE is converted to 1 and FALSE is converted to 0.
-
built-in data types is a wide range of ___ → NCHAR and NVARCHAR
-
you should use the datetime data type if you will be storing values ___ → between the dates of January 1, 1753, and December 31, 9999, that are accurate to 3.33 milliseconds,
-
bit ??? → Binary data with fixed length.
-
A stored procedure is a ___ → allows you to store all the logic inside the database, so by using a simple command, you can query and retrieve all information from all sources.
-
int ?? → Binary data with fixed length.
-
Microsoft SQL Server supports only two character string types: → -922,337,203,685,477.508 to 922,337, 203,685,477.5807
-
The primary form of SQL injection is a direct insertion of code into ___ → numeric[(p[,s])]