To create a database in MySQL, you use the CREATE DATABASE statement as follows: CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name [create_specification] … create_specification: [DEFAULT] [...]
DROP DATABASE drops all tables in the database and deletes the database. DROP SCHEMA is a synonym for DROP DATABASE. IF EXISTS is used to prevent an error from occurring if the database does not [...]
Alter Database command enables you to change the overall characteristics of a database. ALTER {DATABASE | SCHEMA} [db_name] alter_specification … alter_specification: [DEFAULT] CHARACTER [...]
To create table we use the CREATE TABLE statement. The typical form of SQL CREATE TABLE statement is as follows: CREATE TABLE [IF NOT EXISTS] table_name( column_list ) engine=table_type MySQL [...]
Besides creating table, MySQL allows you to alter existing table structures with a lot of options. Here is the ALTER TABLE statement: ALTER [IGNORE] TABLE table_name options[, options…] [...]
To delete table from the database, you can use DROP TABLE statement: DROP TABLE [IF EXISTS] table_name [, table_name…] MySQL allows you to drop multiple tables at once by listing them all, [...]
In some cases, you want to delete all table data in a fast way and reset all auto increment columns. MySQL provides TRUNCATE table statement to allow you to do so. The SQL TRUNCATE statement is [...]
Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The [...]
DROP INDEX index_name ON tbl_name DROP INDEX drops the index named index_name from the table tbl_name. After deleting the index on ‘gender’ column, the performance enhancement is lost.