MySQL UPDATE Statement

The MySQL UPDATE Statement The UPDATE statement is used to modify the existing records in a table. UPDATE Syntax Note: Be careful when updating records in a table! Notice the WHERE clause in the UPDATE statement. The WHERE clause specifies which record(s) that should be updated. If you omit the WHERE clause, all records in […]

MySQL NULL Values

What is a NULL Value? A field with a NULL value is a field with no value. If a field in a table is optional, it is possible to insert a new record or update a record without adding a value to this field. Then, the field will be saved with a NULL value. Note: […]

MySQL INSERT INTO Statement

The MySQL INSERT INTO Statement The INSERT INTO statement is used to insert new records in a table. INSERT INTO Syntax It is possible to write the INSERT INTO statement in two ways: 1. Specify both the column names and the values to be inserted: 2. If you are adding values for all the columns […]

MySQL ORDER BY Keyword

The MySQL ORDER BY Keyword The ORDER BY keyword is used to sort the result-set in ascending or descending order. The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword. ORDER BY Syntax Demo Database Below is a selection from the “Customers” […]

MySQL AND, OR and NOT Operators

The MySQL AND, OR and NOT Operators The WHERE clause can be combined with AND, OR, and NOT operators. The AND and OR operators are used to filter records based on more than one condition: The AND operator displays a record if all the conditions separated by AND are TRUE. The OR operator displays a […]

MySQL WHERE Clause

The MySQL WHERE Clause The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified condition. WHERE Syntax Note: The WHERE clause is not only used in SELECT statements, it is also used in UPDATE, DELETE, etc.! Demo Database Below is a selection from the “Customers” […]

MySQL SELECT Statement

The SELECT statement is used to select data from a database. The data returned is stored in a result table, called the result-set. SELECT Syntax Here, column1, column2, … are the field names of the table you want to select data from. If you want to select all the fields available in the table, use […]