Latest Tutorials

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...

What is MySQL index?

Indexing in MySQL is used to speed up and facilitate data retrieval. If an index has been attached to a column, the MySQL data query "jumps" immediately to that particular row, skipping t...

The UNIQUE constraint in MySQL

The UNIQUE constraint uniquely identifies each record in a database table. The UNIQUE and