SQL & My SQL Tutorial
- What is SQL?
- SQL Microsoft
- SQL Management Tools
- SQL Developer
- Docker Commands
- Composite Key in SQL
- SQL Constraints
- Transactions in SQL Server
- SQL Server Data Types
- SQL Update Join
- SQL Operators
- SQL Clauses
- SQL Commands
- SQL Alter Command
- Distinct Keyword in SQL
- SQL Statements
- SQL Index
- SQL Injections
- Wildcards in SQL
- Alter and Truncate Command in SQL
- SQL Null Functions – ISNULL, IFNULL, Combine, & NULLIF
- SQL Sequence
- How to Find Duplicate Records in SQL
- Primary and Foreign Key in SQL with Examples
- COUNT Function
- SUM Function in SQL
- Dynamic SQL
- Database Tuning
- Pseudocolumn in Oracle SQL
- Triggers in SQL
- Embedded SQL in DBMS
MySQL Data Types
A Data Type defines a specific type of data, such as integers, floating points, Booleans, and so on. It also describes the type’s available values, actions that can be performed on the type, and how the type’s values are stored. Each database table in MySQL has a number of columns, each with its own type of data.
The following features can be used to identify the data type in MySQL.
- The type of values it represents (static or dynamic).
- It depends on whether the values are fixed-length or variable-length in terms of storage capacity.
- Its values may or may not be indexed.
- MySQL’s method for comparing values of a specific data type.
MySQL has a large number of SQL standard data types in many different categories. It employs a variety of data types, which can be classified as numeric, date and time, string kinds, geographic types, and JSON data types.
Numeric Data Types
MySQL includes all of the necessary SQL numeric data types. These data types can be exact numeric data types (for example, integer, decimal, numeric, etc.) or approximate numeric data types (for example, integer, decimal, numeric, etc). (For example, float, real, and double precision). It also has a BIT datatype that can be used to hold bit values. Except for bit data types, numeric data types in MySQL are divided into two categories: signed and unsigned.
Date and Time Data Type:
Date, time, datetime, timestamp, and year are all examples of temporal values represented by this data type. There are values in each temporal type, including zero. When we insert an invalid value, MySQL is unable to represent it, therefore it defaults to a zero value.
String Data Types:
The string data type is used to store plain text and binary data, such as files, pictures, and other types of data. MySQL can search for and compare string values using pattern matching techniques like the LIKE operator and Regular Expressions.
JSON Data Types
Since MySQL 5.7.8, the native JSON data type has been supported. This data type enables us to efficiently store and retrieve the JSON document.
When compared to storing JSON-format strings in a string column, the JSON data type offers the following benefits:
- It checks JSON documents for errors automatically. It would generate an error if we stored invalid documents in JSON columns.
- It has a storage format that is ideal.