MySQL Database Multiple Choice Questions on “Spatial Data Types”.
1. Which classes does spatial data types in MySQL correspond to?
a) OpenGSS
b) OpenGIS
c) ClosedGSS
d) ClosedGIS
Answer: b
Clarification: MySQL has spatial data types that correspond to OpenGIS classes. Some of them that hold single geometry values are ‘GEOMETRY’, ‘POINT’, ‘LINESTRING’ and ‘POLYGON’. Some can hold a collection of values.
2. Which type can store a collection of objects of any type?
a) GEOMETRYCOLLECTION
b) MULTIPOINT
c) MULTILINESTRING
d) MULTIPOLYGON
Answer: a
Clarification: ‘GEOMETRYCOLLECTION’ can store a collection of objects of any type. The other collection types like ‘MULTIPOINT’, ‘MULTILINESTRING’, ‘MULTIPOLYGON’ and ‘GEOMETRYCOLLECTION’ restrict collection members to those having a particular geometry type.
3. SPATIAL indexes cannot be created on NOT NULL spatial columns.
a) True
b) False
Answer: b
Clarification: The ‘SPATIAL’ indexes can be created on ‘NOT NULL’ spatial columns. Therefore, if it is planned to index the column, it would need to be declared as NOT NULL. This type can be used in many ways.
4. MySQL does not automatically convert a date or time value to a number if the value is used in a numeric context.
a) True
b) False
Answer: b
Clarification: MySQL automatically converts a date or time value into a number if the value is used in a numeric context and vice versa. A ‘zero’ value can also be represented in MySQL.
5. What is the generic handle whose meaning depends on context?
a) $dbh
b) $sth
c) $fh
d) $h
Answer: d
Clarification: The variable named ‘$fh’ is a handle to an open file. ‘$h’ is a generic handle and the meaning depends on context. ‘$dbh’ is a handle to a database object. ‘$sth’ is a handle to a query object.
6. What is the non handle array representing a row of values?
a) $rc
b) $rv
c) $rows
d) $ary
Answer: d
Clarification: The Perl Non-handle variable ‘$ary’ is an array or list representing a row of values returned by a query. ‘$rc’ returns code from operations that return true or false. ‘$rv’ returns value from operations that return an integer. ‘$rows’ returns value from operations that return a row count.
7. The mode of search is the search string parsed into words and the search looks for rows is ______________
a) Boolean mode
b) Natural language
c) Query expansion
d) Cross mode
Answer: b
Clarification: In MySQL, a full text search capability is provided, which enables to look for words or phrases without using pattern-matching operations. There are three kinds of full text searches.
8. In which mode is the indicator of the presence/absence of a word in search used?
a) Natural language
b) Boolean mode
c) Query expansion
d) Cross mode
Answer: b
Clarification: A full text search capability is provided in MySQL. It facilitates to look for words or phrases without using pattern-matching operations. Boolean search is one of the three modes.
