Types of Data
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 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.
| Name | Age | City | Course |
|---|---|---|---|
| Navika | 21 | Hyderabad | AI |
| Srihitha | 24 | Pune | Java |
| Advitha | 19 | Chennai | Git |
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:
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))Mandarins
137.91The 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
| Structured | Semi-structured | Unstructured | |
|---|---|---|---|
| Shape | Fixed rows and columns | Named fields, flexible | No fixed shape |
| Examples | Spreadsheets, databases | JSON, XML, logs | Photos, audio, video, documents |
| Easy to search? | Yes | Mostly | Not without AI |
| Typical AI use | Predictions from tables | Data exchange with APIs | Vision, 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:
- Why is structured data easy to search?
- Name three kinds of unstructured data.
- What makes JSON semi-structured rather than structured?
Key Takeaways
Quick reference
| Term | Meaning |
|---|---|
| Structured data | Data in fixed rows and columns |
| Unstructured data | Data with no predefined shape |
| Semi-structured data | Data with named fields but no fixed table |
| JSON | A text format of named fields, common in web APIs |
| Record | One row or one item of data |
Was this tutorial helpful?