0% found this document useful (0 votes)
9 views

Data Types

The document outlines various data types used in databases and programming, including Text, Number, Date/Time, Currency, Boolean, and OLE, each with definitions, usage, and examples. It also explains the concepts of Primary Key and Foreign Key for database relationships. Additionally, it compares Flat File Databases and Relational Databases, highlighting their advantages and disadvantages.

Uploaded by

Taarani Gopal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Data Types

The document outlines various data types used in databases and programming, including Text, Number, Date/Time, Currency, Boolean, and OLE, each with definitions, usage, and examples. It also explains the concepts of Primary Key and Foreign Key for database relationships. Additionally, it compares Flat File Databases and Relational Databases, highlighting their advantages and disadvantages.

Uploaded by

Taarani Gopal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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

●​ Definition: Stores numerical data for calculations.


●​ Usage: For quantities, IDs, and numeric values that need calculations.
●​ Example: 42, 1500, 3.14.

3. Date/Time

●​ Definition: Stores date and time values.


●​ Usage: For recording events, scheduling, or tracking durations.
●​ Example: "2025-01-22," "12:30 PM," "2025-12-31 23:59.".

4. Currency

●​ Definition: Stores monetary values with precision.


●​ Usage: For financial data, like prices, incomes, and expenses.
●​ Example: $100.00, €75.50, ₹1500.

5. Boolean/Logical

●​ Definition: Stores values representing true or false conditions.


●​ Usage: For binary conditions like "Yes/No," "On/Off," "True/False.".
●​ Example: True, False.

6. OLE (Object Linking and Embedding)

●​ Definition: Stores objects like files, images, or videos, linked to or embedded in a


database.
●​ Usage: To include multimedia or external file references.
●​ Example: Embedding an Excel chart or linking a PDF file.
Primary Key

●​ Definition: A unique identifier for each record in a table.


●​ Purpose: Ensures each row can be uniquely identified.
●​ Example: Student ID in a "Students" table.

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.

Flat File Database

Advantages

1.​ Simple: Easy to create and use.


2.​ Portable: Can be stored and shared as a single file.
3.​ Low Cost: No need for special software.
4.​ Good for Small Data: Works well for small projects.

Disadvantages

1.​ Repetition: Data is often repeated (redundancy).


2.​ Errors: More chance of mistakes in data (inconsistency).
3.​ Limited: Hard to manage large or complex data.
4.​ No Relationships: Can't link data like relational databases.

Relational Database

Advantages

1.​ Organised: Stores data in tables with clear relationships.


2.​ Accurate: Reduces errors by avoiding data duplication.
3.​ Powerful: Can handle large amounts of data.
4.​ Flexible: Easy to run queries and get specific information.

Disadvantages

1.​ Complex: Needs more knowledge to set up and use.


2.​ Expensive: May require special software and hardware.
3.​ Time-Consuming: Takes time to design and organise.
4.​ Resource-Heavy: Uses more system resources.

You might also like