Easy. Test your connection with SELECT 1. Target: The result grid contains 1, not a connection error.
SELECT 1;
Medium. Check which server you connected to. Target: Record your version locally; it must be MySQL 8.0+. Do not publish credentials.
SELECT VERSION() AS mysql_version;
Hard. Check whether a database is selected. Target: DATABASE() returns NULL before selecting a schema, or the selected schema name. NULL here is not a connection failure.
SELECT DATABASE() AS selected_database;
Professional. Save a safe connection-check script for your next session. Target: A saved .sql file contains only checks, no password or private connection string; both statements run after reconnecting.
SELECT 1 AS connection_ok;
SELECT VERSION() AS mysql_version;
Easy. Run SELECT 1 + 1 to prove the editor runs queries. Target: 1 row: two = 2
SELECT 1 + 1 AS two;
Easy. Show today's date from the server. Target: 1 row with today's date
SELECT CURDATE() AS today;
Easy. Show the current date and time. Target: 1 row with date and time
SELECT NOW() AS right_now;
Easy. Show which MySQL user you are logged in as. Target: 1 row like you@localhost
SELECT CURRENT_USER() AS me;
Medium. List all databases on the server. Target: Includes mysql, information_schema, sys
SHOW DATABASES;
Medium. Show which port the server listens on. Target: Usually 3306
SELECT @@port AS port;
Medium. Show the server version and edition in one row. Target: 8.0.16+ and Community Server
SELECT VERSION() AS version, @@version_comment AS edition;
Medium. Show the server's time zone settings. Target: Often SYSTEM, SYSTEM
SELECT @@global.time_zone AS global_tz, @@session.time_zone AS session_tz;
Medium. Check whether ONLY_FULL_GROUP_BY is on (you need it in lesson 5). Target: Text contains ONLY_FULL_GROUP_BY
SELECT @@sql_mode;
Hard. Run SELEC 1; on purpose and copy the error number. Target: Error 1064 (syntax error)
SELEC 1;
Hard. Run SELECT * FROM customers; before choosing a database. Target: Error 1046: No database selected
SELECT * FROM customers;
Hard. Run two statements in one go and see both result tabs. Target: Two result tabs: 1 and 2
SELECT 1 AS first; SELECT 2 AS second;
Hard. Show the character set of your connection. Target: utf8mb4 on MySQL 8
SELECT @@character_set_client AS charset;
Professional. Write a setup checklist script: version, user, port, sql_mode, selected database — five columns, one row. Target: 1 row, 5 columns; selected_db is NULL
SELECT VERSION() AS version, CURRENT_USER() AS user_name, @@port AS port, @@sql_mode AS sql_mode, DATABASE() AS selected_db;
Professional. Write a 3-line troubleshooting note: what 'connection refused', 'access denied' and error 1046 each mean and the fix. Target: Note saved in your .sql file, no passwords inside
/* refused: server stopped or wrong host/port */ /* access denied: wrong user/password */ /* 1046: run USE portfolio_retail_lab; */