Master MySQL Queries with Navicat: Create, Design, and Query Databases
This article walks you through using Navicat for MySQL to create databases and tables, design table structures, and perform native SQL SELECT queries—including filtering, multiple conditions, and column selection—illustrated with step‑by‑step screenshots and code examples.
Introduction
Hello, I am the IT sharing host nicknamed PiPi. Today I will talk about query operations in MySQL.
Preface
Previously we learned basic commands such as creating databases and tables. In practice, we often use visual tools like Navicat for MySQL to simplify these operations.
Navicat can conveniently help us create databases, create tables, and modify tables.
Navicat for MySQL Simple Example
Create Database
After connecting to a MySQL service with Navicat: Right‑click → New Database Select the new database information:
Character set: utf8mb4 – UTF‑8 Unicode (supports Emoji)
Collation:
utf8mb4_general_ciCreate Table
Right‑click Table → New TableDefine the table structure (see screenshot).
Save the table ( Ctrl+S).
Design Table
In real projects we often need to modify table structures, i.e., design tables. Right‑click Table → Design Table Modify the table and save.
Query
While visual tools are convenient for creating and modifying databases, they cannot perform queries; native SQL is required and offers the most flexibility.
Requirement Analysis
Assume we need a student management system with a student table (name, age, gender, etc.) and a class table . Each student belongs to a class.
Table Structure Diagram
Table Structure Code
school_test.sqlSELECT Queries
Query All
-- Syntax
SELECT * FROM <table_name>;
-- Example: query the student table
SELECT * FROM student;WHERE Condition Query
-- Syntax
SELECT * FROM <table_name> WHERE <condition>;
-- Example: query id = 1
SELECT * FROM student WHERE id = 1;WHERE Multiple Conditions (AND)
-- Syntax
SELECT * FROM student WHERE <condition1> AND <condition2> ...;
-- Example: query male student named "琪琪"
SELECT * FROM student WHERE name = "琪琪" AND gender = "男";Select Specific Columns
SELECT * FROM <table_name>selects all columns. To select particular columns, list them after SELECT, e.g., SELECT id, name, age FROM student. Columns can also be given aliases:
SELECT id, name AS "姓名", age FROM student;Summary
This tutorial demonstrated how to use Navicat for MySQL to create databases, create tables, and design tables. It then introduced a simple student‑class schema and showed how to perform native SQL SELECT queries, including retrieving all rows, filtering with WHERE, combining conditions with AND, and selecting specific columns or using column aliases.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
