Skip to main content

Posts

Showing posts with the label Character String Data Types

SQL, data types

In SQL, data types define the type of data that can be stored in a column. Here are some common SQL data types: img Numeric Data Types INT : Integer values. Example: INT , INTEGER FLOAT : Floating-point numbers. Example: FLOAT , DOUBLE DECIMAL : Fixed-point numbers, useful for storing exact numeric values. Example: DECIMAL(10, 2) (10 digits in total, 2 after the decimal point) SMALLINT : Smaller integer values. Example: SMALLINT BIGINT : Larger integer values. Example: BIGINT Character String Data Types CHAR : Fixed-length character strings. Example: CHAR(10) (10 characters) VARCHAR : Variable-length character strings. Example: VARCHAR(255) TEXT : Large variable-length character strings. Example: TEXT Date and Time Data Types DATE : Date values. Example: DATE (format: YYYY-MM-DD ) TIME : Time values. Example: TIME (format: HH:MM:SS ) DATETIME : Date and time values. Example: DATETIME (format: YYYY-MM-DD HH:MM:SS ) TIMESTAMP : Date and time values, typically used for tracki...