Professional Documents
Culture Documents
310 812 Export
310 812 Export
Version
QUESTION NO: 1
You want to create two databases, test and Test. Which of the following statements
is true?
A. You can create both databases because database names in MySQL are case
sensitive.
B. You can create both databases when your operating system supports case sensitive
directory names.
C. You can create both databases when you quote delimited the database names like
`test` and `Test`.
D. You can create both databases since t and T are different in the ASCII character
set.
Answer: B
QUESTION NO: 2
Which of the following are a valid identifier for the user table in the mysql
database?
A. mysql.user
B. `mysql.user`
C. `mysql`.`user`
D. mysql.`user`
Answer: A,C,D
QUESTION NO: 3
Is the following statement true or false? "Each database corresponds to a single
directory under data directory, regardless of what storage engine table uses in the
database"
A. true
B. false
Answer: A
QUESTION NO: 4
Which of the following statements are true? Databases don't have a default
character set or collation.
QUESTION NO: 5
Ignoring any warnings that may be issued, which of the following statements will
delete the `world` database and its entire contents on execution, but return no
error if it doesn't exist?
A. DROP DATABASE `world` IGNORE ERRORS
B. DROP IF EXISTS DATABASE `world`
C. DROP DATABASE IF EXISTS `world`
D. DELETE DATABASE `world` IGNORE ERRORS
E. DELETE IF EXISTS DATABASE `world`
F. DELETE DATABASE IF EXISTS `world`
Answer: C
QUESTION NO: 6
Which of the following statements will return a list of all of the databases with a
name that starts with 'pro'?
QUESTION NO: 7
Which of the following statements will provide a list of all of the databases with
a name that starts with 'world'?
QUESTION NO: 8
Which of the following are true in relation to character set and collation
relationships in MySQL?
QUESTION NO: 9
In non-strict mode, assuming that the table city does not already exist and you
execute the following sequence of commands: CREATE TABLE city (city_name CHAR(5))
INSERT INTO city (city_name) VALUES ('NEW YORK'), ('TOKYO'), (23+345), ('LONDON')
-- Ignoring any errors or warnings that may be issued, which values are now in the
table?
QUESTION NO: 10
Consider the following: CREATE TABLE friends ( name VARCHAR(30) ) INSERT INTO
friends VALUES (' Tom ') SELECT name FROM friends Which of the quoted values below
will be returned for the name field in the SELECT results?
A. ' Tom'
B. ' Tom '
C. 'Tom'
D. 'Tom '
Answer: B
QUESTION NO: 11
Which statement(s) from following list are true for BINARY and VARBINARY data
types?
A. When BINARY values are stored, they are right-padded with null values to the
specified length
B. When VARBINARY values are stored, they are right-padded with null values to the
specified length
C. When BINARY values are retrieved, trailing nulls are removed
D. When VARBINARY values are retrieved, trailing nulls are removed
Answer: A,C
QUESTION NO: 12
Is the following statement true or false? "Fields with the DECIMAL column type are
always stored more efficiently than those with type FLOAT."
A. true
B. false
Answer: B
QUESTION NO: 13
Is the following statement true or false? "A 24-bit column can be specified with
BIT(24) in a CREATE statement."
A. true
B. false
Answer: A
QUESTION NO: 14
Is the following statement true or false? "VARCHAR columns usually require less
storage space than CHAR columns."
A. true
B. false
Answer: A
QUESTION NO: 15
Is the following statement true or false? "Math involving DOUBLE and FLOAT columns
is always accurate because MySQL 5 supports precision mathematics."
A. true
B. false
Answer: B
QUESTION NO: 16
Is the following statement true or false? "Defining a column as TIMESTAMP DEFAULT
CURRENT_TIMESTAMP will ensure that when rows are inserted, the current time will
always be used."
A. true
B. false
Answer: B
QUESTION NO: 17
Is the following a valid CREATE statement? CREATE TABLE pictures ( id INT
AUTO_INCREMENT NOT NULL, description VARCHAR(255) CHARACTER SET latin1 COLLATE
latin1_swedish_ci, image VARBINARY(17000) CHARACTER SET latin1 COLLATE latin1_bin,
PRIMARY KEY (id) )
A. Yes
B. No, the same collation must be used for all columns.
C. No, the parameter 17000 is invalid for the VARBINARY type.
D. No, the VARBINARY type may not have character set or collation attributes
Answer: D
QUESTION NO: 18
A column defined as DECIMAL, with no parameters, is equivalent to which of the
below?
A. DECIMAL(5,5)
B. DECIMAL(10,0)
C. DECIMAL(0,10)
D. DECIMAL(3,7)
Answer: B
QUESTION NO: 19
Which of the following statements will add two columns of INT type to the `country`
table?
QUESTION NO: 20
The query below is attempting to CREATE a table based on the definition of the
`world` table, including any column attributes and indexes. What is missing? CREATE
TABLE t1 ______ world
A. FROM
B. USING
C. COPY
D. LIKE
Answer: D
QUESTION NO: 21
Which of the following will CREATE a table with exactly one multi-column index?
QUESTION NO: 22
You have issued the statement: CREATE TABLE numbers (number INT NOT NULL)
ENGINE=MYISAM What is the result of issuing the following statement: INSERT INTO
numbers VALUES (NULL)
QUESTION NO: 23
What is the benefit of creating an index on a table?
A. To quickly retrieve records from a table without scanning the entire table.
B. To constrain a column to a specific set of values.
C. To guarantee uniqueness for a column.
D. It can be used to establish a relationship to another table via a FOREIGN KEY.
Answer: A,C,D
QUESTION NO: 24
On a clean installation of the MySQL server (which contains only the databases test
and mysql), you select the test database as the default database. Which of the
following CREATE TABLE statements will succeed?
QUESTION NO: 25
The table exams was created using the following statement: CREATE TABLE exams
( exam_id INTEGER UNSIGNED NOT NULL PRIMARY KEY, examinee_id INTEGER UNSIGNED
UNIQUE, score INTEGER UNSIGNED ) You need to make certain that examinee_id is
always defined and unique throughout the table. What changes (if any) should be
made to the table?
QUESTION NO: 26
Which of the following statements accurately describes the difference between HASH
and BTREE indexes used for MEMORY tables?
A. HASH indexes support rightmost prefixing of keys which makes them faster than
BTREE in many cases.
B. HASH indexes can be used by the optimizer to speed up ORDER BY operations by
minimizing use of the sort_buffer; BTREE indexes can not
be used this way.
C. HASH indexes are only used for equality comparisons (= or <=>), whereas BTREE
indexes can be used for range searches (> or <) as well.
D. HASH indexes are much faster than BTREE but can only be used for a single
column.
Answer: C
QUESTION NO: 27
You wish to create the table CountryLanguage which will contain the languages
spoken in each country across the world. All combinations of Country and Language
should be unique. Which of the following CREATE statements are the correct way of
specifying the table?
A. CREATE TABLE CountryLanguage ( Country CHAR(30) NOT NULL PRIMARY KEY, Language
CHAR(30) NOT NULL PRIMARY KEY )
B. CREATE TABLE CountryLanguage ( Country CHAR(30) NOT NULL, Language CHAR(30) NOT
NULL, PRIMARY KEY (Country,
Language) )
C. CREATE TABLE CountryLanguage ( Country CHAR(30) NOT NULL, Language CHAR(30) NOT
NULL, PRIMARY KEY (*) )
D. CREATE TABLE CountryLanguage ( Country CHAR(30) NOT NULL UNIQUE, Language
CHAR(30) NOT NULL UNIQUE )
E. CREATE TABLE CountryLanguage ( Country CHAR(30) NOT NULL, Language CHAR(30) NOT
NULL, UNIQUE (Country, Language)
)
F. CREATE TABLE CountryLanguage ( Country CHAR(30) NOT NULL, Language CHAR(30) NOT
NULL, UNIQUE (*) )
Answer: B,E
QUESTION NO: 28
Having the table Status defined with the following structure and data: mysql>
DESCRIBE Status; mysql> SELECT id, name FROM Status; Which of the following
statements are true?
QUESTION NO: 29
Consider the following table: mysql> DESC friends; 1 row in set (0.03 sec) Which of
the following statements can be used to change the name of the column name into
firstname?
QUESTION NO: 30
Which of the following MySQL client programs require a connection to a MySQL server
in order to work on database contents?
A. mysqlcheck
B. mysqldump
C. mysqlimport
D. myisamchk
Answer: A,B,C
QUESTION NO: 31
"The mysql command is used to start the MySQL database and open the prompt to
accept queries."
A. true
B. false
Answer: B
QUESTION NO: 32
Is the following statement true or false? If the MySQL server is started with
--sql-mode=IGNORE_SPACE, all function names are treated as reserved words
A. true
B. false
Answer: A
QUESTION NO: 33
Which of the following queries will return a value of NULL?
QUESTION NO: 34
The table user has the following structure and contents. mysql> DESCRIBE user;
SELECT * FROM user; 'NULL' in the output is the NULL value, not the character
string 'NULL'. How many rows will the following query return? SELECT name,
telephone FROM user WHERE telephone=''
A. 0
B. 1
C. 2
D. 3
E. 4
Answer: B
QUESTION NO: 35
The friends table has the following data: mysql> select @@sql_mode; What will be
the result of the following statement: SELECT name FROM friends WHERE name LIKE
"P_t%"
QUESTION NO: 36
The table t has a column c with following contents: mysql> SELECT c FROM t; If c is
a CHAR column that has the case-insensitive latin1_swedish_ci collation what will
be the output of the following SQL statement? SELECT c, COUNT(*) from t GROUP BY c
A. B. Answer: B
QUESTION NO: 37
Which of the following statements are true?
QUESTION NO: 38
Which sql-mode option is required for 'abc' || 'def' to be returned as the
concatenated string 'abcdef'?
A. --sql-mode=USE_CONCAT
B. --sql-mode=PIPES_AS_CONCAT
C. --sql-mode=NO_OR_CONCAT
D. --sql-mode=ANSI_CONCAT
Answer: B
QUESTION NO: 39
str is a multi-byte character string which contains five two-byte characters. What
will be the result of the following SQL statement? SELECT LENGTH(str),
CHAR_LENGTH(str)
A. 5, 5
B. NULL, NULL
C. 10, 5
D. 5, 10
Answer: C
QUESTION NO: 40
What does the following statement do? CREATE /*!32302 TEMPORARY */ TABLE t (a INT);
QUESTION NO: 41
What will be the result of the following SQL statement: SELECT IFNULL(1/0,'yes')
A. NULL
B. 1/0
C. 1
D. yes'
E. 0
Answer: D
QUESTION NO: 42
Consider the following: mysql> DESC item; mysql> SELECT * FROM item; What will be
the output of the following SELECT statement? SELECT SUM(price1) AS total1,
SUM(price2) AS total2 FROM item HAVING total1 = total2
QUESTION NO: 43
What will be returned when the following statement is executed? SELECT INTERVAL(25,
12, 13, 32, 42)
A. NULL
B. 1
C. 2
D. 3
E. 13
F. 32
Answer: C
QUESTION NO: 44
Having connected to a server with the mysql client program, you have typed mysql>
UPDATE tbl SET str = 'sample and pressed Enter. Now the prompt looks like this: '>.
What does this mean?
QUESTION NO: 45
You would like to make a tab-delimited export for a result of a query using the
mysql client program invoked interactively. Which option do you need to pass to
mysql to achieve this?
A. --tab-delimited
B. --batch
C. --export
D. No option is necessary. Tab-delimited output is the default in interactive mode.
Answer: B
QUESTION NO: 46
When redirecting a file containing SQL statements into the mysql client program, an
error occurs as follows: ERROR 1007 (HY000) at line 1: Can't create database
'world'; database exists Which of the following parameters can be given to the
mysql client program to make it continue processing the file regardless of any
errors?
A. --force
B. --ignore-errors
C. --create-database-if-not-exists
D. --batch
Answer: A
QUESTION NO: 47
Having connected to a server with the mysql client program, you want to execute a
query. What statement terminator can you use to execute the query?
A. ;
B. \g
C. \c
D. \G
Answer: A,B,D
QUESTION NO: 48
In mysql, which of the following statements will provide a list of all accessible
help topics?
QUESTION NO: 49
When the following command is entered into the mysql client program, which of the
options below describes the parameter '/home/sakila/world.sql'? SOURCE
/home/sakila/world.sql
A. A file which is on a filesystem accessible by the computer where the MySQL
server is running and is readable by the server
B. A file which is on a filesystem accessible by the computer where the mysql
client program is running and is readable by the client
Answer: B
QUESTION NO: 50
Which of the following mysql startup options will you use to guard against long-
running SQL queries?
A. --safe-selects
B. --safe-updates
C. --safe-deletes
D. all of above
Answer: B
QUESTION NO: 51
When issuing a SELECT statement which of the following keywords is used to rename a
column?
A. ALIAS
B. AS
C. NAMED
D. RENAME
Answer: B
QUESTION NO: 52
Assuming a table Country exists with a column Name, which of the following are
valid uses of the LIMIT clause?
QUESTION NO: 53
What keyword is missing from the following query in order to ensure that all
results, including duplicates, are returned? SELECT time, action, user FROM
log20040101 UNION SELECT time, action, user FROM log20040102
A. NONDISTINCT
B. DUPLICATE
C. ALL
D. RELAXED
Answer: C
QUESTION NO: 54
The table Office is defined as follows: mysql> DESC Office; The following statement
is executed: mysql> SELECT DISTINCT city FROM Office; What would be the order of
the rows if the query is rewritten to: SELECT DISTINCT city FROM Office ORDER BY
city
A. Paris, Amsterdam, New York, Tokyo
B. Amsterdam, Paris, Tokyo, New York
C. Amsterdam, New York, Paris, Tokyo
D. New York, Paris, Tokyo, Amsterdam
Answer: A
QUESTION NO: 55
The friends table contains the following data: Assuming a suitable collation, how
can you retrieve the names in alphabetical order by last_name then first_name?
QUESTION NO: 56
Consider the item table with the following data: What will be the result of the
following SELECT? SELECT color, COUNT(*) FROM item GROUP BY color
A. B. C. Answer: C
QUESTION NO: 57
Assume that a table table1 contains the following data: mysql> SELECT * FROM
table1; 6 rows in set (0.00 sec) How many rows will be returned when the following
statement is executed? SELECT DISTINCT col1 FROM table1;
A. 6
B. 3
C. 4
Answer: C
QUESTION NO: 58
Consider the friends table is given by the following information: mysql> SELECT *
FROM friends; Which of the following SELECT statements are valid?
QUESTION NO: 59
Which of the following comparisons is equivalent to: ( age >= 4 ) and ( age <= 8 )
A. The city names from USA and JPN in one result set.
B. The city names from USA and JPN in two different result sets.
C. The city names from USA in the first column and the cities from JPN in the
second column.
D. An error message is issued.
Answer: D
QUESTION NO: 61
Consider the following table structure. mysql> DESCRIBE TEST; Why is it a bad idea
to use SELECT * instead of specifying the required columns by their name?
A. SELECT * may cause more data to be to be read from disk if your application only
needs some columns.
B. SELECT * causes more data to be sent over the network if your application only
needs some columns.
C. SELECT * prevents the use of indexes, so a full table scan is required for every
query.
D. SELECT * causes your application to depend on the columns present when you wrote
it, so your application could break if new columns are
added to the table structure
Answer: A,B,D
QUESTION NO: 62
Which of the following INSERT statements are syntactically correct?
A. INSERT INTO friends (id, name, lastname, age) VALUES (1, 'John', 'Doe', 22)
B. INSERT INTO friends VALUES (1, 'John', 'Doe', 22)
C. INSERT INTO friends ROWS (1, 'John', 'Doe', 22)
D. INSERT INTO friends SET id=1, name='John', lastname='Doe', age=22
Answer: A,B,D
QUESTION NO: 63
Having the table names defined as follows: mysql> DESC names; The table names
contains the following data: mysql> SELECT * FROM names; We then execute following
REPLACE statement: mysql> REPLACE INTO names VALUES (2, 'Jim'), (4, 'Tom'), (6,
'Matt'); What will be the output of SELECT * FROM names now?
A. B. Answer: B
QUESTION NO: 64
Complete the following sentence. An UPDATE statement issued without a WHERE clause
will...
QUESTION NO: 65
Consider the codes table is given by the following. DESC codes; mysql> SELECT *
FROM codes; +----+---------+ | id | code | +----+---------+ | 3 | Charlie |
+----+---------+ An INSERT statement as follows is issued. INSERT INTO codes VALUES
(1, 'Alpha'), (2, 'Beta'), (3, 'Charlie'), (4, 'Delta') Which of the following will
be the result of the following SELECT query given the codes table is of the type
specified? SELECT * FROM codes
A. MyIsam
B. InnoDBB.InnoDB
C. MyIsamC.MyIsamC.MyIsamC.MyIsamC.MyIsamC.MyIsamC.MyIsamC.MyIsam
D. InnoDBD.InnoDBD.InnoDBD.InnoDBD.InnoDBD.InnoDBD.InnoDB
E. MyIsamE.MyIsamE.MyIsamE.MyIsamE.MyIsamE.MyIsamE.MyIsamE.MyIsamE.MyIsam
F. InnoDBF.InnoDBF.InnoDBF.InnoDBF.InnoDBF.InnoDBF.InnoDBF.InnoDBF.InnoDB
Answer: B,C
QUESTION NO: 66
Which of the following privileges is required for using TRUNCATE?
A. DROP
B. TRUNCATE
C. DELETE
D. SUPER
Answer: C
QUESTION NO: 67
Which of the following are correct? A REPLACE statement may be used...
QUESTION NO: 68
Is the following statement true or false? "Connector/ODBC can only connect to a
MySQL server via TCP/IP; named pipes and sockets are not supported because they are
operating system specific."
A. true
B. false
Answer: B
QUESTION NO: 69
Where should a MySQL Connector be installed?