Hereβs a quick overview of common MySQL commands you will use to manage databases, tables, and data:
CREATE DATABASE db_name; β Create a new database.USE db_name; β Select a database to work on.SHOW DATABASES; β List all databases.DROP DATABASE db_name; β Delete a database.CREATE TABLE table_name (column1 datatype, column2 datatype, ...); β Create a new table.SHOW TABLES; β List all tables in the current database.DESCRIBE table_name; β Show the structure of a table.DROP TABLE table_name; β Delete a table.INSERT INTO table_name (col1, col2) VALUES (val1, val2); β Add new data.SELECT * FROM table_name; β Retrieve all data.UPDATE table_name SET col1 = val1 WHERE condition; β Modify existing data.DELETE FROM table_name WHERE condition; β Remove data.SELECT col1, col2 FROM table_name WHERE condition; β Select specific columns with filters.ORDER BY col1 ASC|DESC; β Sort results ascending or descending.LIMIT n; β Limit the number of rows returned.;. Always remember to use it!
Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!