Page 131 - CodePilot V5.0 C8
P. 131
Data Type Description Example
Stores date and time values in YYYY-MM- created_at TIMESTAMP;
TIMESTAMP
DD HH:MM:SS format. Example: ‘2025-07-10 14:30:00’
is_active BOOLEAN;
BOOLEAN Stores TRUE or FALSE values.
Example: TRUE, FALSE
CHAR data type always takes the same space, while VARCHAR data type only uses space for
the characters you type.
SQL OPERATORS
SQL operators are used to perform operations on values in a SQL query. They enable access,
comparison and modification of data in various ways.
Some common types of operators in SQL are:
Arithmetic operators Comparison operators
Logical operators Special operators
ARITHMETIC OPERATORS
Arithmetic operators perform basic mathematical operations on numerical data. They include
the following types:
Operator Description
+ (Addition) Adds two values.
- (Subtraction) Subtracts one value from another.
* (Multiplication) Multiplies two values.
/ (Division) Divides one value by another.
% (Modulus) Returns the remainder when one value is divided by another.
COMPARISON OPERATORS
Comparison operators are used to compare two expressions or values. They help in filtering
data based on conditions. They include the following types:
Operator Description
= Checks if two values are equal.
!= or <> Checks if two values are not equal.
129
MySQL: My First Database

