Chapter 4
In Structured Query Language (SQL), how many bytes of information does SMALLINT store? 4 1 2 3
2
If you used the statement Float(5, 3) for the value 22.0009, what would SQL return? 23 22.10 22.001 22
22.001
In Structured Query Language (SQL), how many potential values can be held by TINYINT? 2^32 2^16 2^8 2^64
2^8
What is the proper format for DATE? MM-DD-YYYY YY-MM-DD YYYY-MM-DD MM-DD-YY
YYYY-MM-DD
Assuming it is not the last column in a database, what is the correct formatting for a DATE data type for the column 'enrollment_date'? enrollment_date DATE DATE enrollment_date DATE enrollment_date; enrollment_date DATE;
enrollment_date DATE;
How many possible choices can be used in a BOOLEAN data type? Infinite 3 1 10
3
In most database management systems, a BLOB can hold up to _____. 256 bytes 4 gigabytes 8 bytes 32 megabytes
4 gigabytes
In Structured Query Language, how many bytes does each BIGINT entry permit? 8 3 2 4
8
Which of these CANNOT be stored in VARCHAR or CHAR records? Letters Spaces All of these can be stored in either type of data. Numbers
All of these can be stored in either type of data.
In using Structured Query Language, why might a user want to limit the size of integers? Any of these answers is correct Reduced memory requirements Increased speed Accuracy
Any of these answers is correct
Real, float, and double are considered _____ numbers True Real Decimal Approximate
Approximate
Using the float keyword, which statement will return all digits for the value 3.5872? Float(7,0) Float(0,5) Float(5, 4) Float(3,7)
Float(5, 4)
What is the correct format for TIME? HH:MM:SS.[nnnnnnn] HH:MM:S nnnnnnn:SS:MM:HH MM:HH:SS
HH:MM:SS.[nnnnnnn]
What is NOT an advantage of using BOOLEAN as a data type? It is versatile. It is faster. It is unambiguous. It involves fewer errors.
It is versatile.
In Structured Query Language (SQL), about how many values can INT hold? More than 2 million A quintillion 256 More than 4 billion
More than 4 billion
Which of these data types allows for decimals? INTEGER SMALLINT NUMERIC BIGINT
NUMERIC
Which of these would likely NOT be stored using CHAR in SQL? Phone numbers Social security numbers Names ID codes
Names
BLOBS are _____ data types Neutral Object Primitive Inherited
Object
Which of these would NOT likely be stored using VARCHAR in SQL? e-mail addresses Phone numbers (including area codes) Names Addresses
Phone numbers (including area codes)
What does the 'p' stand for in a DECIMAL or NUMERIC value? Precision Portable Politics Partial
Precision
A database stores a value for vacation accrual. A sample value is 1.2533458. Which SQL statement will show a value of 1.253? SELECT CAST(vacation_accrual as Int(3)); SELECT CAST(vacation_accrual as Real(0)); SELECT CAST(vacation_accrual (4,3)); SELECT CAST(vacation_accrual as Float(4,3));
SELECT CAST(vacation_accrual as Float(4,3));
Which of these would be a useful BOOLEAN question? College graduate? Graduation major? Hometown? Graduation year?
College graduate?
In MySQL, the _____ can hold 4 gigabytes. TINYBLOB LONGBLOB BLOB MEDIUMBLOB
LONGBLOB
Which data type stores 4 bytes, or 7 digits after the decimal? Double Float Real Long
Real
What does the 's' stand for in a DECIMAL or NUMERIC value? Sequence Sort Scale Size
Scale
Which of the following is FALSE about TIMESTAMP? TIMESTAMP must be manually entered like TIME and DATE. TIMESTAMP is a command. TIMESTAMP is used to create a record of any sort of change that happens to a record. To create a TIMESTAMP, simply include the word TIMESTAMP as you are creating a table.
TIMESTAMP must be manually entered like TIME and DATE.
How should DECIMAL and NUMERIC be used in the same database? They should be used alternatingly. They should not be used together. They should be on different parent-child levels. They can be used interchangeably.
They should not be used together.
What type of data can BOOLEAN hold? A 7 letter word True or false It doesn't hold data A number
True or false
Which types of data would be a good candidate for a Binary Large Object (BLOB)? Video, Audio, Images Integers, characters, decimal values Dates, times Phone numbers, fax numbers
Video, Audio, Images
Which of these is a properly formatted CHAR example? CHAR(13) college_code drivers_id (10)CHAR CHAR college_code(13) book_id CHAR(5)
book_id CHAR(5)
Which of these is a properly formatted example of VARCHAR? first_name VARCHAR(10) school_code (VARCHAR)6 school_name CHAR(15) first_name CHAR(10)
first_name VARCHAR(10)
Which of these is properly formatted? BOOLEAN, friend BOOLEAN friend, friend BOOLEAN; friend, BOOLEAN
friend BOOLEAN;
Which shows how the column 'game_time' should be formatted using TIME, assuming it is not the last column in a database? TIME game_time, game_time TIME; TIME game_time game_time TIME
game_time TIME;
What values need to be entered after selecting a data type (either NUMERIC or DECIMAL)? n and p p and s q and s p and q
p and s
To declare a BLOB in SQL Server, the following statement is used. BLOB = new BLOB(); var myBlob = new binary BLOB; varbinary(MAX); declare BLOB;
varbinary(MAX);