Complete the code to show the current running processes in MySQL.
SHOW [1];The SHOW PROCESSLIST; command displays the currently running threads in MySQL, which helps monitor active queries and connections.
Complete the code to enable the slow query log in MySQL.
SET GLOBAL [1] = 'ON';
Setting slow_query_log to ON enables logging of queries that take longer than the defined threshold, useful for profiling slow queries.
Fix the error in the command to show the slow query log file location.
SHOW VARIABLES LIKE '[1]';
The correct variable name is slow_query_log_file, which shows the path to the slow query log file.
Fill both blanks to create a query that shows the top 5 longest running queries from the slow query log summary table.
SELECT sql_text, [1] FROM mysql.slow_log ORDER BY [2] DESC LIMIT 5;
The start_time shows when the query began, and ordering by query_time descending lists the longest running queries first.
Fill all three blanks to create a query that counts queries grouped by user and orders by count descending.
SELECT [1], COUNT(*) AS [2] FROM mysql.general_log WHERE command_type = 'Query' GROUP BY [3] ORDER BY [2] DESC;
The query groups by user_host to count queries per user. The count is aliased as query_count and ordered descending to show the most active users.