Data Types
Data Types
Data types define the kind of data a field in a database or programming environment can store.
Here are the commonly used types:
1. Text/Alphanumeric
● Definition: Stores letters, numbers, and symbols, but treats them as text.
● Usage: For names, addresses, phone numbers (e.g., "123-456-7890"), or any
non-calculable data.
● Example: "John Doe," "KL1234," "Apt. #45B.".
2. Number
3. Date/Time
4. Currency
5. Boolean/Logical
Foreign Key
● Definition: A field in a table that links to the primary key of another table.
● Purpose: Establishes relationships between tables.
● Example: A "Course ID" field in an "Enrolments" table that links to the "Course ID" in a
"Courses" table.
Advantages
Disadvantages
Relational Database
Advantages
Disadvantages