InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 151. |
What is the maximum length for alias names in terms of characters?(a) 64(b) 128(c) 256(d) 32 |
|
Answer» The correct answer is (c) 256 To explain I would say: The identifiers in MySQL have a maximum length of 64 characters. However, the alias names for identifiers can have the number of characters up to 256. Aliases can also be quoted or unquoted. |
|
| 152. |
Find the odd one out in terms of scheduling policies.(a) MyISAM(b) InnoDB(c) MEMORY(d) MERGE |
|
Answer» The correct option is (b) InnoDB To explain: The InnoDB storage engine implements locking at a different level. It has differing performance characteristics in terms of contention management. It uses row-level locks. |
|
| 153. |
Which of the following statements does not modify the table?(a) INSERT(b) UPDATE(c) DELETE(d) SELECT |
|
Answer» Correct option is (d) SELECT Easy explanation: In MySQL, the ‘SELECT’ statement is used to display the tables or their components according to some specified conditions and clauses. It does not modify the table unlike the others. |
|
| 154. |
To reactivate indexes the command used is _________________(a) DISABLE KEYS(b) DISABLE INDEXES(c) ENABLE KEYS(d) ENABLE INDEXES |
|
Answer» Correct answer is (c) ENABLE KEYS Easiest explanation: In MySQL, the clauses ‘DISABLE KEYS’ and ‘ENABLE KEYS’ are used to deactivate and reactivate indexes for the table. The server does the work in deactivations and reactivations. |
|
| 155. |
Which statement issues a lock on tables?(a) ISSUE LOCK(b) LOCK ISSUE(c) LOCK TABLES(d) ISSUE LOCKS |
|
Answer» Right choice is (c) LOCK TABLES To explain I would say: Locks can be acquired and released explicitly by issuing LOCK TABLES and UNLOCK TABLES statements. Normally the server’s lock manager automatically acquires locks as necessary and releases them when they no longer are needed. |
|
| 156. |
How is communication established with MySQL?(a) SQL(b) Network calls(c) A programming language like C++(d) APIs |
|
Answer» Correct answer is (a) SQL Explanation: SQL is the standard language for RDBMS systems like MySQL. SQL queries facilitate quick information retrieval from tables and other elementary operations required to maintain an RDBMS system. |
|
| 157. |
What represents a ‘tuple’ in a relational database?(a) Table(b) Row(c) Column(d) Object |
|
Answer» Correct answer is (b) Row The explanation: Each row in a table represents a record. A tuple is a collection of attribute values that makes a record unique. A tuple is a unique entity whereas attribute values can be duplicate in the table. |
|
| 158. |
A view can be deleted using the command __________(a) REMOVE(b) DELETE(c) CLEAR(d) DROP |
|
Answer» Correct choice is (d) DROP To explain I would say: In MySQL, ‘Views’ act as virtual tables. Many operations can be performed on views like the operations on tables. A view can be created, displayed and dropped. They can also be used to perform calculations. |
|
| 159. |
What cannot be done on a view?(a) display(b) filter(c) index(d) drop |
|
Answer» Right answer is (c) index For explanation I would say: In MySQL, ‘Views’ act as virtual tables. It is not possible to create indexes on a view. However, they can be used for the views that are processed using the merge algorithm. |
|
| 160. |
Which of the following functions are not performed by “ALTER” clause?(a) Change the name of the table(b) Change the name of the column(c) Drop a column(d) All of the mentioned |
|
Answer» Correct option is (d) All of the mentioned Explanation: None. |
|
| 161. |
What can be used to check for views that have been invalidated by DROP or ALTER operations?(a) CREATE TABLE(b) VERIFY TABLE(c) DETAILS TABLE(d) CHECK TABLE |
|
Answer» The correct answer is (d) CHECK TABLE For explanation: A ‘View’ is created in MySQL by writing the clause ‘CREATE VIEW’ followed by the view name. Once a view is dropped or altered after being created, it can be checked by the ‘CHECK TABLE’ clause. |
|
| 162. |
Which statement is used for updating existing information in the table?(a) UPDATE(b) WHERE(c) MODIFY(d) ALTER |
|
Answer» The correct option is (a) UPDATE Best explanation: None. |
|
| 163. |
Which keyword is used to specify the foreign key after the table is created?(a) SETUP(b) SET(c) ALTER TABLE(d) SPECIFY |
|
Answer» The correct answer is (c) ALTER TABLE Easiest explanation: When the table has already been created but the foreign key has not been set of foreign key constraints are not specified, the ‘ALTER TABLE – ADD FOREIGN KEY’ clause is used. |
|
| 164. |
In UNIX, the name of the option file is __________(a) .my.cnf(b) .my.ini(c) .my.opt(d) .my.opc |
|
Answer» The correct option is (a) .my.cnf The best I can explain: Under Unix, an option file is set up by creating a file named ‘~/.my.cnf’ in the home directory. ‘C:my.ini’ is the option file that is setup in Windows. An option file stores the connection parameters. |
|
| 165. |
Which option prints output in table-format when MySQL is run interactively?(a) -t(b) -tf(c) -p(d) -pf |
|
Answer» Right answer is (a) -t The explanation: MySQL produces output in tab-delimited format when it is run in batch mode. Suppose a table-format output is desired, the -t option is used along with the mysql command. -tf is not a valid option. |
|
| 166. |
The clause that enables mapping a short command to a long command is __________(a) map(b) direct(c) label(d) alias |
|
Answer» The correct option is (d) alias Easy explanation: If the shell program permits an alias, a short command can be mapped to a long command. This reduces the time taken by typing long commands frequently. An alias is defined by the keyword ‘alias’ followed by the short and long commands. |
|
| 167. |
In which directory are the DBI scripts located?(a) cgi-inc(b) cgi-bin(c) cgi-usr(d) cgi-perl |
|
Answer» The correct choice is (b) cgi-bin For explanation: DBI scripts are located in a cgi-bin directory located outside of document tree. The PHP scripts are different from DBI scripts since PHP scripts are located within the web server document tree. |
|
| 168. |
The output from PHP is __________(a) statically generated(b) dynamically generated(c) not generated(d) no output |
|
Answer» Correct option is (b) dynamically generated To explain I would say: The interpreter switches between code mode back and text mode when it sees another special tag which signals the end of the code. This enables the mix of static text with dynamically generated results. |
|
| 169. |
For a heavily used program, which of these languages should be preferred?(a) C(b) Perl(c) PHP(d) Python |
|
Answer» Right choice is (a) C Easy explanation: C is compiled while Perl and PHP are interpreted. So C programs generally will run faster than Perl or PHP scripts. Therefore C should be the best choice for a heavily used program. |
|
| 170. |
The protocol CGI is _____________(a) computer graphics interface(b) common graphics interface(c) computer gateway interface(d) common gateway interface |
|
Answer» Right option is (d) common gateway interface Explanation: The web server ‘Apache’ uses the interpreters as some CGI programs. This means that it communicates with these programs using the popular ‘Common Gateway Interface (CGI)’ protocol. |
|
| 171. |
Which is the correct decreasing order for highly developed text manipulation capabilities?(a) Perl, PHP, C(b) Perl, C, PHP(c) PHP, Perl, C(d) C, PHP, Perl |
|
Answer» Right choice is (a) Perl, PHP, C Easiest explanation: Perl has the most highly developed capabilities in terms of text manipulation, and PHP follows it in the order. C is very rudimentary by comparison. It has the least simplicity. |
|
| 172. |
What is the maximum number of characters allowed for a database name to have?(a) 16(b) 32(c) 64(d) 128 |
|
Answer» Correct option is (c) 64 The explanation: MySQL allows the database names and the table names to be a maximum of 64 characters long. The length of these names is also bound by the length allowed by the operating system on the machine. |
|
| 173. |
The datadir variable value can be seen using ______________(a) SHOW VARIABLES(b) DISP VARIABLES(c) CONNECT VARIABLES(d) SHOW VARIABLE |
|
Answer» Right choice is (a) SHOW VARIABLES Explanation: The data directory location is checked by the ‘datadir’ variable. It can be obtained using a ‘SHOW VARIABLES’ statement or a ‘mysqladmin’ variables command, like: SHOW VARIABLES LIKE ‘datadir’. |
|
| 174. |
Which data directory subdirectory provides the information used to inspect the internal execution of the server at runtime.(a) mysql(b) performance_schema(c) sys(d) nbdinfo |
|
Answer» Right option is (b) performance_schema To elaborate: The ‘performance_schema’ directory corresponds to the Performance Schema. It provides information used to inspect the internal execution of the server at runtime. The ‘sys’ directory maps to ‘nbdinfo’. |
|
| 175. |
Which data directory subdirectory corresponds to the nbdinfo database?(a) mysql(b) performance_schema(c) sys(d) nbdinfo |
|
Answer» Correct answer is (b) performance_schema Explanation: The sys directory corresponds to the sys schema. It provides a set of objects to interpreting Performance Schema information. The ‘performance_schema’ directory corresponds to the Performance Schema. |
|
| 176. |
Which statement upgrades the database directory name encoding?(a) ALTER DATABASE(b) ALTER SERVER(c) ALTER EVENT(d) ALTER FUNCTION |
|
Answer» Correct option is (a) ALTER DATABASE Easiest explanation: The statement ‘ALTER DATABASE’ changes database attributes or upgrades the database directory name encoding. It requires the ‘ALTER’ privilege for the database to be given. |
|
| 177. |
In the database directory of the database each view and trigger object is associated with how many files?(a) 0(b) 1(c) 2(d) 3 |
|
Answer» Right option is (b) 1 Easy explanation: Each view and trigger object is associated with one file in the database directory of the database containing that object. A view consists of a .frm file that contains the view definition. |
|
| 178. |
What is joining a table to itself called?(a) COMPLETE(b) SELF(c) OBSOLETE(d) CROSS |
|
Answer» Right choice is (b) SELF To explain I would say: Joining a table to itself in a database is called ‘self-join’. When a self-join is being performed, the table is being used multiple times within the query and a table name qualifier is unnecessary. |
|
| 179. |
CROSS JOIN and JOIN are similar to __________(a) INNER JOIN(b) NATURAL JOIN(c) OUTER JOIN(d) CARTESIAN JOIN |
|
Answer» Right answer is (a) INNER JOIN The best I can explain: The joins ‘CROSS JOIN’ and ‘JOIN’ types are exactly similar to the ‘INNER JOIN’. The statements containing ‘INNER JOIN’ can replace it with ‘CROSS JOIN’ or ‘JOIN’ to get exactly the same result. |
|
| 180. |
What are CROSS JOIN and JOIN are similar to?(a) INNER JOIN(b) NATURAL JOIN(c) OUTER JOIN(d) CARTESIAN JOIN |
|
Answer» Correct answer is (a) INNER JOIN Easiest explanation: The joins ‘CROSS JOIN’ and ‘JOIN’ types are exactly similar to the ‘INNER JOIN’. The statements containing ‘INNER JOIN’ can replace it with ‘CROSS JOIN’ or ‘JOIN’ to get exactly the same result. |
|
| 181. |
What does ‘C’ stand for in the ACID property of transactions?(a) Compound(b) Concrete(c) Collision(d) Consistency |
|
Answer» The correct choice is (d) Consistency The explanation: The elementary characteristics of a transaction are known as the ‘ACID’ properties. ‘ACID’ is the acronym for the four basic characteristics that a transaction must have for smooth processing. |
|
| 182. |
Among the following, for which language is image processing least simple?(a) PHP(b) Perl(c) Python(d) C |
|
Answer» Correct option is (d) C The explanation: It is not as easy to perform text processing and memory management in C than it is in languages like Perl and PHP. These capabilities tend to be heavily used in the web applications. |
|
| 183. |
What is the durability property of transactions?(a) statements form a logic unit(b) database remains consistent(c) one transaction does not affect the other(d) transaction effects are recorded permanently |
|
Answer» Right answer is (d) transaction effects are recorded permanently To explain I would say: The ‘durability’ property of a transaction is one of the four elementary characteristics that are expected for a database transaction to maintain throughout. The others are Isolation, Atomicity and Consistency. |
|
| 184. |
Which of the following is case sensitive in MySQL?(a) Event names(b) Logfile group names(c) Column names(d) Indexes |
|
Answer» The correct option is (b) Logfile group names To explain I would say: Column names and indexes are not case sensitive on any platform and neither are column aliases. Unlike the standard SQL, the names of the log file groups are always case sensitive. |
|
| 185. |
Which of these modes is a composite server mode?(a) COMPOSITE(b) COMPOSITE_MODE(c) COMPOSITE_SERVER(d) ANSI |
|
Answer» Correct option is (d) ANSI Easiest explanation: The ‘ANSI’ mode value is a composite mode. It turns on several other mode values like ANSI_QUOTES, PIPES_AS_CONCAT. This makes the server behave much like standard SQL than the default mode. |
|
| 186. |
Which mode is a shorthand for ‘both strict modes plus a bunch of other restrictions’?(a) STRICT_ALL_TABLES(b) STRICT_TRANS_TABLES(c) TRADITIONAL(d) ERROR_WHEN_DIVIDE_BY_ZERO |
|
Answer» Correct choice is (c) TRADITIONAL To explain: In MySQL, the ‘TRADITIONAL’ mode is used to enable the strict mode. It also enables all of the additional restrictions by the command ‘SET sql_mod = ‘TRADITIONAL” The other SQL modes have other functions. |
|
| 187. |
The mode used to turn on strict mode and all of the additional restrictions is _____________(a) STRICT_ALL_TABLES(b) ERROR_FOR_DIVISION_BY_ZERO(c) TRADITIONAL(d) ERROR_WHEN_DIVIDE_BY_ZERO |
|
Answer» The correct choice is (c) TRADITIONAL Best explanation: The ‘TRADITIONAL’ mode is used to enable the strict mode and all of the additional restrictions. It is done by the command SET sql_mod = ‘TRADITIONAL’; The other SQL modes have other functions. |
|
| 188. |
The escape sequence for carriage return is ___________(a) ‘c’(b) ‘’(c) ‘’(d) ‘z’ |
|
Answer» Right choice is (b) ‘’ To explain I would say: MySQL provides the facility to use a wide range of escape sequences. They are special characters. They begin with the backslash character. For example, ‘’ specifies carriage return. |
|
| 189. |
The mode used to turn off the special meaning of backslash and treat it as an ordinary character is _____________(a) NO_ESCAPES_SLASH(b) NO_ESCAPES_BACKSLASH(c) NO_BACKSLASH_ESCAPES(d) NO_BACKSLASH_ESCAPE |
|
Answer» Correct answer is (c) NO_BACKSLASH_ESCAPES Explanation: To turn off the special meaning of backslash in MySQL, and treat it as an ordinary character, the SQL mode named NO_BACKSLASH_ESCAPES is enabled. The escape sequence is treated as characters. |
|
| 190. |
Which mode is used to turn off the special meaning of backslash and treat it as an ordinary character?(a) NO_ESCAPES_SLASH(b) NO_ESCAPES_BACKSLASH(c) NO_BACKSLASH_ESCAPES(d) NO_BACKSLASH_ESCAPE |
|
Answer» Right answer is (c) NO_BACKSLASH_ESCAPES Best explanation: To turn off the special meaning of backslash in MySQL, and treat it as an ordinary character, the SQL mode named NO_BACKSLASH_ESCAPES is enabled. The escape sequence is treated as characters. |
|
| 191. |
Is duplicate entry of primary key is allowed in SQL?(a) Yes(b) No(c) Depends(d) None of the mentioned |
|
Answer» The correct answer is (b) No Easy explanation: Primary key are used to uniquely define attributed stored in the table. |
|
| 192. |
The REAL type is synonym for ___________(a) FLOAT(b) INT(c) DOUBLE(d) BIT |
|
Answer» The correct answer is (c) DOUBLE The best explanation: The REAL datatype, by default, is for the DOUBLE type. Floating point types can be defined as UNSIGNED. This eliminates the negative end of the type ranges. MySQL has a variety of default types. |
|
| 193. |
The maximum number of elements allowed in SET() is ___________(a) 16(b) 32(c) 64(d) 128 |
|
Answer» Right answer is (c) 64 Explanation: The SET type specification is very useful for storing a collection a ordered and distinct elements. The storage size required for this datatype is variable and dependent on the cardinality. |
|
| 194. |
The maximum size in bytes of a row in MySQL is __________(a) 65534(b) 65535(c) 65536(d) 65537 |
|
Answer» Right choice is (b) 65535 Best explanation: The allowable range of M for VARCHAR(M) syntactically is 1 to 65535, but the effective number of the maximum characters is less than 65535 since MySQL has a maximum row size of 65,535 bytes. |
|
| 195. |
Which among the following have the maximum bytes?(a) Varchar(b) Char(c) Text type(d) Both Varchar and Char |
|
Answer» Correct answer is (c) Text type Best explanation: None. |
|
| 196. |
What will happen if the data being loaded into a text column exceeds the maximum size of that type?(a) Extra memory will be allocated(b) Process terminate(c) Data will be truncated(d) Depend on the system |
|
Answer» Correct choice is (c) Data will be truncated To elaborate: Mysql cannot allocate dynamic memory therefore if data exceeds the memory then extra data will be truncated. |
|
| 197. |
Which data type is more suitable for storing “small notes” in Mysql?(a) Char(b) Varchar(c) Mediumtext(d) Longtext |
|
Answer» Correct answer is (c) Mediumtext Explanation: None. |
|
| 198. |
“Numeric Data” is used to store ____________(a) Whole numbers(b) Natural numbers(c) Rational numbers(d) Both Whole and Natural numbers |
|
Answer» The correct choice is (d) Both Whole and Natural numbers The best explanation: None. |
|
| 199. |
Which data type is more suitable for storing “documents” in Mysql?(a) Varchar(b) Longtext(c) Mediumtext(d) Either Varchar or Longtext |
|
Answer» Correct choice is (b) Longtext To explain: Longtext has largest range. |
|
| 200. |
Numbers prefixed with ‘0x’ are in base __________(a) 8(b) 16(c) 32(d) 64 |
|
Answer» The correct choice is (b) 16 The best I can explain: In MySQL, there are many numeric datatypes. They include integers and floating points. For example, 34, 12.3, -1.3E11. The numbers that are prefixed with ‘0x’ are in hexadecimal. |
|