Types of Data

Updated · 6 min read
easyPython 3.13aidatastructured-dataunstructured-datajsonbeginnersinterview

Why is a spreadsheet easy for a computer, while a photo is hard? Advitha's college keeps two kinds of records. One is a neat table of students, with a column for each detail. The other is a folder of scanned certificates, photos and recorded interviews. Both hold useful information, but a computer can search the table in a moment, while the folder needs AI just to understand what is inside.

The difference is how the data is organized. This lesson explains the three types: structured, unstructured and semi-structured.

The Three Types at a Glance

Structured, unstructured and semi-structured data

Structured Data

Structured data is organized in rows and columns, like a spreadsheet or a database table. Every row is one record, and every column holds the same kind of value.

NameAgeCityCourse
Navika21HyderabadAI
Srihitha24PuneJava
Advitha19ChennaiGit

Because every value has a known place, structured data is easy to sort, count, filter and search. "How many students take Java?" is a one-line question for a computer. Bank transactions, sales records, exam marks and inventory lists are structured data, and many prediction models, such as house-price models, learn from tables like this.

Unstructured Data

Unstructured data has no predefined rows or columns: photos, videos, audio, documents, emails and conversations. Most of the world's data is unstructured.

A computer can store a photo easily, but it can't answer "is there a dog in this photo?" by looking up a column, because there is no column. Deep learning made unstructured data useful: image models read photos, speech models turn audio into text, and language models read documents and emails.

Semi-Structured Data

Semi-structured data sits in between. It has named fields, but not a fixed table: different records can have different fields, and fields can contain lists or other fields inside them. JSON, XML and log files are common examples.

A supermarket price label is a good real-world example: it always names its fields (item, weight, price, total), even though it isn't a row in a table. Here is the same label as JSON, read with Python:

Python
import json
 
# The price label as semi-structured data (JSON text)
label_text = '{"item": "Mandarins", "weight_kg": 0.862, "price_per_kg": 159.99, "total": 137.91}'
 
label = json.loads(label_text)
print(label["item"])
print(round(label["weight_kg"] * label["price_per_kg"], 2))
Output
Mandarins
137.91

The program finds each value by its field name, and the calculated total matches the printed label. JSON is everywhere in AI work: model APIs send and receive it, as a later chapter on model APIs shows.

Comparison

StructuredSemi-structuredUnstructured
ShapeFixed rows and columnsNamed fields, flexibleNo fixed shape
ExamplesSpreadsheets, databasesJSON, XML, logsPhotos, audio, video, documents
Easy to search?YesMostlyNot without AI
Typical AI usePredictions from tablesData exchange with APIsVision, speech, language

Common Mistakes

Thinking unstructured means messy or useless. It only means there is no fixed table. A clear photo or a well-written document is unstructured, and very valuable.

Thinking a PDF is structured because it contains a table. To a computer, a PDF is mostly a page layout; the table has to be extracted first.

Thinking JSON is a table. Two JSON records can have different fields, which a table doesn't allow.

Interview Corner

What is the difference between structured and unstructured data?

Structured data is organized in fixed rows and columns, such as a database table, so it is easy to search and count. Unstructured data has no fixed shape, such as photos, audio and documents, and needs AI to interpret.

Give an example of semi-structured data.

JSON, as used by web APIs: each value has a field name, such as "item" or "price", but different records can have different fields. XML and log files are other examples.

Practice

Exercise: sort your phone. Pick ten things on your phone, such as contacts, photos, a calendar event, a voice note and a downloaded bill. Label each one structured, semi-structured or unstructured, with one sentence explaining why. Which type did you have the most of?

Check your understanding:

  1. Why is structured data easy to search?
  2. Name three kinds of unstructured data.
  3. What makes JSON semi-structured rather than structured?

Quick check: types of data

4 questions
1A table of exam marks with a column for each subject is...
2Which of these is unstructured data?
3What makes JSON semi-structured?
4Which development made unstructured data most useful for AI?

Key Takeaways

Quick reference

TermMeaning
Structured dataData in fixed rows and columns
Unstructured dataData with no predefined shape
Semi-structured dataData with named fields but no fixed table
JSONA text format of named fields, common in web APIs
RecordOne row or one item of data

Was this tutorial helpful?

Lesson 9 of 186