ExamVeda
Login
Home
11
Which storage engine in MySQL provides foreign key support?
Discuss
Answer & Solution
Answer: Option B
Solution:
The InnoDB storage engine in MySQL provides foreign key support.
Foreign keys are constraints that enforce referential integrity between tables. InnoDB is the only storage engine in MySQL that supports foreign key constraints, allowing for the enforcement of relational integrity in the database.
Option A, TRANSACTION, is incorrect because TRANSACTION is not a storage engine in MySQL.
Option C, MyISAM, is incorrect because MyISAM does not support foreign key constraints.
Option D, MEMORY, is incorrect because the MEMORY storage engine does not support foreign key constraints.
12
The grant table scope columns that is case insensitive is . . . . . . . .
Discuss
Answer & Solution
Answer: Option B
Solution:
The grant table scope column that is case insensitive in MySQL is User.
In MySQL, the usernames stored in the grant tables are case insensitive, meaning that MySQL does not distinguish between usernames based on case.
Option A, Host, is incorrect because the Host column in the grant tables is case sensitive, as it specifies the host from which a user can connect to the MySQL server.
Option C, Password, is incorrect because the Password column in the grant tables is case sensitive, as it stores the encrypted passwords for users.
Option D, Db, is incorrect because the Db column in the grant tables is case sensitive, as it specifies the databases to which a user has access privileges.
13
Which of these has higher priority?
writes, reads
Discuss
Answer & Solution
Answer: Option A
Solution:
In MySQL, writes typically have higher priority than reads.
When the database system faces contention between write operations (such as INSERT, UPDATE, DELETE) and read operations (such as SELECT), the write operations are generally given higher priority to ensure data consistency and integrity.
Option B, reads, is incorrect because writes usually take precedence over reads in MySQL.
Option C, same priority, is incorrect because writes typically have higher priority than reads.
Option D, machine dependent, is incorrect because the priority between writes and reads is not determined by the machine's characteristics; rather, it is a design principle in database systems like MySQL to prioritize writes for data consistency.
14
The statement used to create a trigger is . . . . . . . .
Discuss
Answer & Solution
Answer: Option A
Solution:
The statement used to create a trigger in MySQL is CREATE TRIGGER.
This statement is followed by the trigger name, the trigger timing (BEFORE, AFTER), the event (INSERT, UPDATE, DELETE), and the trigger action (the SQL code to execute when the trigger is activated).
Option B, CREATE TRIGGERS, is incorrect because the correct syntax in MySQL is CREATE TRIGGER (singular form), not CREATE TRIGGERS (plural form).
Option C, PRODUCE TRIGGER, is incorrect because there is no such statement as PRODUCE TRIGGER in MySQL.
Option D, PRODUCE TRIGGERS, is incorrect because there is no such statement as PRODUCE TRIGGERS in MySQL.
15
Which statement suspends the replication related activity of the slave server?
Discuss
Answer & Solution
Answer: Option C
Solution:
The STOP SLAVE statement suspends the replication-related activity of the slave server in MySQL.
When you execute this statement on the slave server, it stops the SQL thread and IO thread, effectively pausing replication.
Option A, RESUME SLAVE, is incorrect because RESUME SLAVE is used to resume replication activity after it has been suspended using STOP SLAVE.
Option B, START SLAVE, is incorrect because START SLAVE is used to start the replication process on the slave server after it has been stopped or initialized.
Option D, GET SLAVE, is incorrect because there is no such statement as GET SLAVE in MySQL; instead, SHOW SLAVE STATUS is used to view the status of the slave server and its replication activity.
16
Find odd one out?
Discuss
Answer & Solution
Answer: Option A
Solution:
Among the given options, GROUP BY is the odd one out.
Explanation:
DESC and ASC are used to specify the ordering of the query results (descending and ascending order, respectively) with ORDER BY.
ORDER BY is used to sort the query results based on specified criteria.
GROUP BY, on the other hand, is used to group rows that have the same values into summary rows, often used with aggregate functions such as SUM, COUNT, AVG, etc.
Option A, GROUP BY, does not relate to sorting or ordering rows like the other options, making it the odd one out.
17
Which among the following is the correct representation of "float(1,1)"?
Discuss
Answer & Solution
Answer: Option C
Solution:
In MySQL, the syntax "float(1,1)" represents a floating-point number with a total of 2 digits.
The first parameter (1) specifies the total number of digits in the number.
The second parameter (1) specifies the number of digits after the decimal point.
Therefore, "float(1,1)" allows for a total of 2 digits, with one digit before the decimal point and one digit after it.
Option A, Total of 1 digit, is incorrect because "float(1,1)" allows for a total of 2 digits, not just 1.
Option B, Total of 2 digit, is incorrect because it lacks specificity regarding the position of the decimal point.
Option D, None of the mentioned, is incorrect because Option C accurately represents the definition of "float(1,1)" in MySQL.
18
REPAIR TABLE works with how many of the following?
MyISAM, ARCHIVE, CSV
Discuss
Answer & Solution
Answer: Option B
Solution:
The REPAIR TABLE command in MySQL is primarily used for repairing corrupted tables.
It is relevant for tables using the MyISAM storage engine.
MyISAM tables can become corrupted due to various reasons such as system crashes or unexpected shutdowns.
However, the REPAIR TABLE command does not apply to tables using the ARCHIVE or CSV storage engines.
Therefore, it only works with one of the provided storage engines, which is MyISAM.
Option A, 0, is incorrect because REPAIR TABLE works with at least one of the provided storage engines (MyISAM).
Option C, 2, is incorrect because REPAIR TABLE only works with one of the provided storage engines, not two.
Option D, 3, is incorrect because REPAIR TABLE does not work with all three of the provided storage engines; it only works with MyISAM.
19
The variable which represents the default time zone of the MySQL server is . . . . . . . .
Discuss
Answer & Solution
Answer: Option B
Solution:
In MySQL, the variable that represents the default time zone of the MySQL server is system_time_zone.
This variable holds the time zone setting configured for the MySQL server system.
Option A, time_zone, is incorrect because there is no such variable in MySQL representing the default time zone.
Option C, date_and_time, is incorrect because it does not represent the default time zone setting of the MySQL server.
Option D, system_time, is incorrect because it does not specifically represent the default time zone setting of the MySQL server; it might be related to the system time, but not the time zone configuration.
20
The collations this statement lists are . . . . . . . .
SHOW COLLATION LIKE 'utf8%'
Discuss
Answer & Solution
Answer: Option A
Solution:
The statement SHOW COLLATION LIKE 'utf8%' is used to display collations that start with the characters 'utf8'.
The '%' character is a wildcard in MySQL, meaning it matches any sequence of characters.
Therefore, the statement will list collations whose names begin with 'utf8'.
Option B, names ending with utf8, is incorrect because the statement looks for collations starting with 'utf8', not ending with it.
Option C, names containing utf8% anywhere, is incorrect because the statement specifically looks for collations that start with 'utf8'.
Option D, names ending in utf8%, is incorrect because the statement searches for collations starting with 'utf8', not ending with it.