This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Relocating Data Directory Contents”.
1. Symlink is an applicable relocation method for ______________
a) entire data directory
b) individual database tables
c) server PID file
d) log files
View Answer
Explanation: Symlink is an applicable relocation method for the individual database tables. However, the startup option is better suited relocation method for server PID file and the log files.
2. For which of these is the startup option best suited?
a) entire data directory
b) individual database tables
c) server PID file
d) individual database directories
View Answer
Explanation: The startup option is better suited relocation method for server PID file and the log files, while symlink is an applicable relocation method for the individual database tables.
3. Before relocation of database, the server should be stopped if running.
a) True
b) False
View Answer
Explanation: The server always looks for the database directories in the data directory. The only way to relocate a database is by the symlink method. The server should be stopped if running.
4. When relocating an individual table, the table to be relocated should be ______________
a) MyISAM
b) InnoDB
c) TRANSACTION
d) ENGINE
View Answer
Explanation: The relocation of an individual table is supported only under certain limited circumstances. When relocating an individual table, the table to be relocated should be a MyISAM table.
5. What is the special database that always exists after setting up MySQL on a computer?
a) sampdb
b) mysql
c) information_schema
d) readme_db
View Answer
Explanation: After installation of MySQL, ‘information_schema’ is the special database that always exists. ‘mysql’ can be seen depending on access rights. It holds the grant tables. ‘sampdb’ and ‘readme_db’ do not exist by default.
6. What is InnoDB in the following MySQL code?
CREATE TABLE student ( name CHAR(30), student_id INT, PRIMARY KEY (student_id) ) ENGINE = InnoDB;
a) database name
b) table name
c) reference engine
d) storage engine
View Answer
Explanation: ‘InnoDB’ is the name of the ‘storage engine’ for the above table. The ‘ENGINE’ clause is used to specify the name of the storage engine that MySQL should use to handle the table being created. MySQL has several storage engines with its own properties.
7. What is the table name in the following SQL code?
INSERT INTO student VALUES('Kyle','M',NULL);
a) student
b) VALUES
c) Kyle
d) M
View Answer
Explanation: The ‘INSERT INTO’ clause here inserts a row in the table named ‘student’. The table has three fields. The first field or attribute value in the row/tuple is ‘Kyle’. The second attribute value is ‘M’ and the last attribute is set to NULL.
8. In which file are the statements entered in ‘mysql’ saved?
a) .mysql_queries
b) .queries
c) .mysql_history
d) .history
View Answer
Explanation: Statements entered in ‘mysql’ are stored in the file named ‘.mysql_history’. This file is located in the home directory itself. The SQL statements can be directly pasted into this file.
9. Mysql cannot be used to execute script files.
a) True
b) False
View Answer
Explanation: Mysql is capable of reading input from a file in batch mode. This is also known as the non-interactive mode. A lot of typing and time can be saved when commands are stored in a file and executed from a file.
10. Which command is used to make a script file ‘run_me.sh’ executable?
a) chmod +e run_me.sh
b) chmod +a run_me.sh
c) chmod +y run_me.sh
d) chmod +x run_me.sh
View Answer
Explanation: The command name ‘chmod’ stands for ‘change mode’. It is used to define the way a file can be accessed. To make the script file ‘run_me.sh’ executable, the chmod command is used.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check MySQL Books
- Apply for Programming Internship
- Check Information Technology Books
- Practice Programming MCQs