Checking your session…
Module 01: Introduction to Data and Data Types

1.3 Formats of Data

Level: 1 | Version: v1.1 | Author: Meptrasoft

Overview

Data can be organized in different ways depending on how clearly its structure is defined.

The three common formats are:

  1. Structured Data
  2. Semi-Structured Data
  3. Unstructured Data

The easiest way to understand them is:

TEXT
Structured      → Fixed structure
Semi-Structured → Some structure
Unstructured    → No fixed structure
Three Formats of Data: Structured, Semi-Structured, and Unstructured Data overview
Figure 1: Data can be structured, semi-structured, or unstructured depending on how its structure is defined.

1. Structured Data

Structured data is data organized in a fixed format, usually in rows and columns.

It follows a defined structure, which makes it easy to store, search, sort, and analyze.

Structured data is commonly used in relational databases.

Example: Student Marks Table

ID Name English Maths Social Science Total
1 Marilyn 38 24 28 90
2 John 41 24 32 97
3 Joseph 33 39 45 117
4 Daniel 35 36 25 96
5 Anthony 31 30 43 104

In this table:

  • A row represents one complete record.
  • A column represents one attribute.
  • Every row follows the same structure.
  • Each value has a defined position and meaning.

For example:

TEXT
Row    → One student's record
Column → One attribute such as Name or Maths
ID Name Department Marks 1 Arun CSE 87 2 Priya IT 91 3 Karthik CSE 78 COLUMN = One Attribute Vertical slice ("Department") Defines one property across all records ROW = One Complete Record Horizontal slice (Priya, IT, 91) All attributes belonging to one student Structured Data: Rows represent complete records; Columns represent distinct attributes.
Figure 2: In structured data, rows represent records and columns represent attributes.

Real-World Examples

  • Student records
  • Employee records
  • Product information
  • Bank transactions
  • Customer orders

2. Semi-Structured Data

Semi-structured data has some organization, but it does not have the rigid rows-and-columns structure of a relational table.

It often uses keys, tags, or nested structures to describe the data.

Common examples include:

  • JSON
  • XML
  • YAML
  • Log data

Example: JSON

JSON
{
  "name": "John Smith",
  "age": 20,
  "department": "CSE",
  "courses": [
    "Python",
    "SQL"
  ]
}

Here:

  • "name" is a key.
  • "John Smith" is its value.
  • "courses" contains multiple values.
  • Data can be nested inside other data.

Unlike a relational table, different JSON objects can contain different fields.

For example:

JSON
{
  "name": "John",
  "age": 20
}

Another object might contain:

JSON
{
  "name": "Priya",
  "age": 21,
  "department": "IT"
}

The structure is still understandable, but it is more flexible than a fixed table.


3. Unstructured Data

Unstructured data does not follow a predefined tabular structure.

Examples include:

  • Photos
  • Audio recordings
  • Videos
  • PDF documents
  • Scanned documents
  • Voice recordings

For example:

TEXT
student_photo.jpg
lecture.mp4
voice_note.mp3
resume.pdf

These files contain useful information, but they do not naturally fit into fixed rows and columns like a student table.


Simple Comparison

Feature Structured Semi-Structured Unstructured
Structure Fixed Flexible No fixed structure
Common format Rows and columns Keys, tags, nested fields Files / free-form content
Examples SQL tables, CSV JSON, XML, YAML Images, audio, video, PDFs
Schema Usually predefined Flexible or partially defined No fixed tabular schema
Easy to query as tables Yes Depends on the system Usually requires specialized processing

Key Idea

TEXT
STRUCTURED
     ↓
FIXED TABLE STRUCTURE

SEMI-STRUCTURED
     ↓
FLEXIBLE STRUCTURE

UNSTRUCTURED
     ↓
NO FIXED TABULAR STRUCTURE

Why Does SQL Mostly Work With Structured Data?

SQL was designed primarily for working with structured data in relational databases.

For example, a database may contain:

TEXT
Students
Orders
Products
Employees

Each table has defined columns and rows.

SQL can then be used to retrieve and analyze that data.

For example:

SQL
SELECT Name, Marks
FROM Students
WHERE Marks > 80;

This works naturally because the student data has a defined table structure.

Modern relational databases can also support semi-structured values such as JSON, but the relational table remains a core SQL data model.


Where Are These Formats Used?

Structured Data

Common in:

  • Banking systems
  • College systems
  • Payroll systems
  • Order management
  • Transaction processing

Semi-Structured Data

Common in:

  • Web APIs
  • Application configuration
  • Event data
  • Application logs
  • Data exchange between systems

Unstructured Data

Common in:

  • Social media
  • Video platforms
  • Digital documents
  • CCTV systems
  • Customer support recordings

Common Beginner Mistakes

✗ Mistake ✓ Correct Understanding
Structured data means only SQL data Structured data can also exist in formats such as CSV and spreadsheets
Semi-structured data has no structure It has some structure through keys, tags, nesting, or metadata
JSON is the same as a relational table JSON has a flexible structure and can contain nested data
Unstructured data is useless Unstructured data can contain valuable business and personal information
SQL can work only with structured data SQL primarily works with relational/structured data, and modern databases can also support some semi-structured data

Placement Quick Points

TEXT
STRUCTURED
→ FIXED ROWS AND COLUMNS
→ EXAMPLE: RELATIONAL TABLE

SEMI-STRUCTURED
→ KEYS / TAGS / NESTED STRUCTURE
→ EXAMPLE: JSON, XML

UNSTRUCTURED
→ NO FIXED TABULAR STRUCTURE
→ EXAMPLE: IMAGE, AUDIO, VIDEO, PDF
  • Structured data follows a defined schema and is commonly stored in relational tables.
  • Semi-structured data has organization through keys, tags, or nested structures but is more flexible than a table.
  • Unstructured data does not follow a fixed tabular structure.
  • SQL is primarily used with structured relational data.
  • Modern database systems can also work with some semi-structured data, especially JSON.

Interview Questions

What is structured data?

Structured data is data organized in a predefined format, usually using rows and columns in a table.

What is semi-structured data?

Semi-structured data has some organization through keys, tags, metadata, or nested fields, but it does not follow a rigid table structure.

What is unstructured data?

Unstructured data does not follow a predefined tabular structure. Examples include images, videos, audio files, and documents.

What is the main difference between structured and semi-structured data?

Structured data follows a predefined schema, usually rows and columns. Semi-structured data is more flexible and may use keys, tags, and nested structures.

Is JSON structured or semi-structured?

JSON is generally considered semi-structured data because it uses keys and values and can contain nested structures without requiring a fixed table schema.

Give examples of unstructured data.

Examples include:

TEXT
Images
Videos
Audio recordings
PDF documents
Scanned documents
Why is structured data suitable for relational databases?

Relational databases organize data into tables with predefined columns and rows, which matches the structure of structured data.


Practice & Hands-On Exercises

Beginner Practice

  1. Define structured data in your own words.
  2. Define semi-structured data in your own words.
  3. Define unstructured data in your own words.
  4. Give three examples of each format.
  5. Explain the difference between a row and a column.

Classify the Data

Classify each as Structured, Semi-Structured, or Unstructured:

  1. Student table in MySQL
  2. JSON response from a web API
  3. MP3 audio file
  4. Employee CSV file
  5. XML document
  6. Video recording
  7. PDF document

Think and Answer

  1. Why is JSON more flexible than a relational table?
  2. Why is a student database table considered structured data?
  3. Why can an image not naturally be represented as rows and columns like a student table?

SQL Connection

Consider:

TEXT
Student Table
ID | Name | Department | Marks
  1. Why is this structured data?
  2. Which part represents the records?
  3. Which part represents the attributes?
  4. Write a SQL query to display students who scored more than 80.
SQL
SELECT ID, Name, Department, Marks
FROM Students
WHERE Marks > 80;

💡 Tip: Test your queries using the in-browser interactive runner above.


Key Takeaway

TEXT
STRUCTURED
→ FIXED TABLE
→ ROWS + COLUMNS

SEMI-STRUCTURED
→ FLEXIBLE STRUCTURE
→ KEYS / TAGS / NESTED DATA

UNSTRUCTURED
→ NO FIXED TABULAR STRUCTURE
→ FILES / MEDIA / DOCUMENTS

Structured data has a fixed format, semi-structured data has a flexible format, and unstructured data has no fixed tabular structure.

End of Formats of Data