0
0
MySQLquery~10 mins

Replication basics in MySQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to show the command that starts the slave replication process.

MySQL
START [1];
Drag options to blanks, or click blank then click option'
ASLAVE
BREPLICA
CMASTER
DSERVER
Attempts:
3 left
💡 Hint
Common Mistakes
Using START MASTER instead of START SLAVE.
Using START REPLICA which is not valid in MySQL 5.x.
Forgetting the semicolon at the end.
2fill in blank
medium

Complete the code to check the status of the slave replication.

MySQL
SHOW [1] STATUS\G
Drag options to blanks, or click blank then click option'
ASLAVE
BSERVER
CMASTER
DREPLICA
Attempts:
3 left
💡 Hint
Common Mistakes
Using SHOW MASTER STATUS instead, which shows master info.
Using SHOW REPLICA STATUS which is not valid in MySQL 5.x.
Forgetting the \G to format output vertically.
3fill in blank
hard

Fix the error in the command to configure the slave to connect to the master.

MySQL
CHANGE MASTER TO MASTER_HOST='192.168.1.100', MASTER_USER='replica', MASTER_PASSWORD=[1];
Drag options to blanks, or click blank then click option'
Apassword123
B'password123'
C'replica'
Dreplica
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the password string.
Using the username instead of the password.
Using double quotes which may cause errors in some MySQL versions.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each database name to its size in MB from a list of tuples.

MySQL
{ [1]: [2] for [1], [2] in db_sizes }
Drag options to blanks, or click blank then click option'
Adb
Bsize_mb
Cdatabase
Dsize
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for key and value.
Using variable names not matching the tuple unpacking.
Confusing key and value positions.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase database names to their sizes only if size is greater than 100.

MySQL
{ [1]: [2] for [3], [2] in db_sizes if [2] > 100 }
Drag options to blanks, or click blank then click option'
Adatabase.upper()
Bsize
Cdb
Ddatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Not converting database names to uppercase.
Using wrong variable names in the comprehension.
Missing the condition to filter sizes.