0% found this document useful (0 votes)
4 views5 pages

Data Types Presentation

The document provides an overview of three data types: CHAR, VARCHAR, and INT. CHAR is a fixed-length character type that occupies a specified number of bytes, while VARCHAR is a variable-length type that uses space based on the actual string length. INT is an integer type used for whole numbers, occupying 4 bytes of storage.

Uploaded by

KRISHNAPRASATH K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Data Types Presentation

The document provides an overview of three data types: CHAR, VARCHAR, and INT. CHAR is a fixed-length character type that occupies a specified number of bytes, while VARCHAR is a variable-length type that uses space based on the actual string length. INT is an integer type used for whole numbers, occupying 4 bytes of storage.

Uploaded by

KRISHNAPRASATH K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Data Types Overview

CHAR, VARCHAR, and INT


CHAR Data Type
• - Fixed-length character data type.
• - Stores alphanumeric characters.
• - Occupies the specified number of bytes
regardless of the actual string length.
• - Example:
• CHAR(5): 'Hi' will be stored as 'Hi '.
VARCHAR Data Type
• - Variable-length character data type.
• - Stores alphanumeric characters.
• - Occupies space based on the actual string
length plus 1-2 bytes for length information.
• - Example:
• VARCHAR(5): 'Hi' will be stored as 'Hi'.
INT Data Type
• - Integer numeric data type.
• - Used to store whole numbers (positive,
negative, or zero).
• - Occupies 4 bytes of storage.
• - Example:
• INT: 42, -7, 0.
Comparison of Data Types
• - CHAR:
• - Fixed length, space-efficient for small fixed-
size strings.
• - VARCHAR:
• - Flexible, space-efficient for varying string
lengths.
• - INT:
• - Ideal for numeric data, efficient
calculations.

You might also like