MySQL - Create, Alter and Delete Tables (Create Table, Alter Table, Drop Table )

Опубликовано: 04 Октябрь 2024
на канале: Eli the Computer Guy
6,049
186

Find code and diagrams at: https://www.EliTheComputerGuy.com

Tables are the building blocks of Databases. They store the records for the Database are are easy to create, alter and delete.

Use database; – Enter Database
Select database(); – Shows what Database you are currently in
Show tables; – Shows Tables in Database
Create a Table Example:

Create table users(
user_id INT Auto_INCREMENT PRIMARY KEY,
Name TEXT,
Age INT,
Bio TEXT
);
Desc tableName; – Shows Column information for Table
Alter Table Example:

alter table users
add gender text;

alter table users
drop gender;