MySQL Databases and Tables
This chapter introduces the operations related to databases and tables in MySQL, including creating and deleting databases, creating and deleting tables, modifying table columns, primary keys, data constraints, and data types.
-
MySQL Create Databases
In this article, we covers creating a new database using theCREATE DATABASE
statement. -
MySQL Drop Databases
In this article, we described how to drop a database using theDROP DATABASE
statement. -
MySQL Use Database
In this article, we explained how to select a database in MySQL and how to view the current database. -
MySQL Create Tables
In this article, we covered creating a new table using theCREATE TABLE
statement. -
MySQL Drop Tables
In this article, we described how to drop an existing table using theDROP TABLE
statement. -
MySQL Alters Tables
In this article, we will describe how to use theALTER TABLE
statement. -
MySQL Truncate Tables
In this article, we described how to use theTRUNCATE TABLE
statement to truncate a table. -
MySQL Primary Keys
In this article, we will learn what primary keys are, the rules of primary keys, and how to use primary keys in MySQL. -
MySQL Foreign Keys
In this article, we introduced what foreign keys are, the rules for foreign keys, and how to use them in MySQL. -
MySQL Lock Tables
In this article, you will learn how to acquire and release table locks using MySQLLOCK TABLES
andUNLOCK TABLES
statements. -
MySQL Drop Columns
In this article, you will learn how to drop one or more columns from a table using MySQLALTER TABLE ... DROP COLUMN
statements. -
MySQL Add Columns
In this article, you will learn how to add one or more columns to a table using MySQLALTER TABLE ... ADD
statements. -
MySQL Auto Increment Columns
In this article, we will introduce MySQL auto-increment columns and how to use auto-increment columns to generate unique identifiers. -
MySQL Check Constraints
In this article, you will learn how to use MySQL CHECK constraints to ensure that the data inserted into a table is correct. -
MySQL Rename Tables
In this article, you will learn how to rename a table using MySQLRENAME TABLE
andALTER TABLE
statements. -
MySQL Generated Columns
In this article, we’ll introduce the usage of generated columns in MySQL. -
MySQL Unique Keys
In this article, we describe how to use unique keys/unique indexes in MySQL to ensure that the values โโof one or several columns are unique. -
MySQL NOT NULL
In this article, we will discuss how to useNOT NULL
constrain. -
MySQL Charset and Collation
A character set is a set of rules for representing characters, and a collation defines the order of characters in a character set. Character sets are used to store data. A character set can contain multiple collations.