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.

  1. MySQL Create Databases

    In this article, we covers creating a new database using the CREATE DATABASE statement.
  2. MySQL Drop Databases

    In this article, we described how to drop a database using the DROP DATABASE statement.
  3. MySQL Use Database

    In this article, we explained how to select a database in MySQL and how to view the current database.
  4. MySQL Create Tables

    In this article, we covered creating a new table using the CREATE TABLE statement.
  5. MySQL Drop Tables

    In this article, we described how to drop an existing table using the DROP TABLE statement.
  6. MySQL Alters Tables

    In this article, we will describe how to use the ALTER TABLE statement.
  7. MySQL Truncate Tables

    In this article, we described how to use the TRUNCATE TABLE statement to truncate a table.
  8. 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.
  9. MySQL Foreign Keys

    In this article, we introduced what foreign keys are, the rules for foreign keys, and how to use them in MySQL.
  10. MySQL Lock Tables

    In this article, you will learn how to acquire and release table locks using MySQL LOCK TABLES and UNLOCK TABLES statements.
  11. MySQL Drop Columns

    In this article, you will learn how to drop one or more columns from a table using MySQL ALTER TABLE ... DROP COLUMN statements.
  12. MySQL Add Columns

    In this article, you will learn how to add one or more columns to a table using MySQL ALTER TABLE ... ADD statements.
  13. 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.
  14. 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.
  15. MySQL Rename Tables

    In this article, you will learn how to rename a table using MySQL RENAME TABLE and ALTER TABLE statements.
  16. MySQL Generated Columns

    In this article, we’ll introduce the usage of generated columns in MySQL.
  17. 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.
  18. MySQL NOT NULL

    In this article, we will discuss how to use NOT NULL constrain.
  19. 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.