MySQL Tables

In databases, tables are the containers of information. There can be one or many tables in a database. They are also called entities. Columns with data in a table are called attributes...

Creating MySQL Table

To create a table in MySQL, a CREATE TABLE statement is used. This statement is very complex because it requires defining all columns, data types and other parameters that make a c...

Modifying (altering) tables from a database

Changing or modifying a structure of an existing table is done by using ALTER TABLE statement. The "structure" that may be changed with ALTER TABLE includes following opt...

Deleting (removing) tables from database

To remove a table from database, the DROP statement must be used, and it usually comes with flags that are used to guide the removal syntax. Syntax DROP [TE...

Truncating tables and deleting data from them

In order to delete all data from a table and not the table itself we may use the TRUNCATE TABLE statement. Syntax TRUNCATE TABLE employees; I...

Adding rows to a table (INSERT INTO statement)

The INSERT INTO statement is used very frequently in MySQL and is used to insert a new row in a table. Syntax INSERT INTO table_name VALUES (value1, value2,...

Updating data within a table (UPDATE statement)

The UPDATE statement is used to update existing records in a table. The UPDATE statement is always used in combination with

Records deleting in MySQL (DELETE statement)

The DELETE statement deletes record, or records, from MySQL table. In order to delete a specific row or rows the

Replacing rows within a table (REPLACE statement)

The REPLACE statement is a MySQL addition to the SQL, and it is used or could be used to insert and update data in database tables. The REPLACE query work similarly to

What is Auto-increment in MySQL and how to set it?

A very often and commonly used feature in databases in general (and MySQL is not an exemption) is to set a field of a row that will automatically increment the value upon inserting it in a database...