Basic types describe individual values. A record bundles named fields into one structured item. A list gathers a sequence of items. Combining them lets you describe a whole dataset and its nested parts.
The supplied first shopping bill contains seven item records. Their amounts add up to ₹567.
YOUR COURSE DATA · TRY IT HERE
Read a shopping bill as a record
Use the supplied 30 shopping bills. No download or coding is needed.
READY TO START
A pile of 30 cards
Start with the first card. Read its fields, do one small action, then move on.
▱ ▱ ▱
What we remember
Read
0
Nothing has been read yet. Choose Next card to begin.
Look through all 30 original records
Bill 1SV Stores · ₹567
BillNo
1
Store
SV Stores
Customer
Srivatsan
BillAmount
567
MajorCategories
Apparel | Food | Toiletries
FoodClass
Mixed
Bill 2Big Bazaar · ₹1525
BillNo
2
Store
Big Bazaar
Customer
Sudeep
BillAmount
1525
MajorCategories
Apparel | Food | Household
FoodClass
Mixed
Bill 3SV Stores · ₹1341
BillNo
3
Store
SV Stores
Customer
Akshaya
BillAmount
1341
MajorCategories
Food | Toiletries
FoodClass
Mixed
Bill 4SV Stores · ₹123
BillNo
4
Store
SV Stores
Customer
Advaith
BillAmount
123
MajorCategories
Food
FoodClass
All food
Bill 5Big Bazaar · ₹4174
BillNo
5
Store
Big Bazaar
Customer
Akshaya
BillAmount
4174
MajorCategories
Apparel | Food | Household
FoodClass
Mixed
Bill 6Sun General · ₹354
BillNo
6
Store
Sun General
Customer
Srivatsan
BillAmount
354
MajorCategories
Electronics | Food | Stationery | Utilities
FoodClass
Mixed
Bill 7SV Stores · ₹96
BillNo
7
Store
SV Stores
Customer
Akhil
BillAmount
96
MajorCategories
Food
FoodClass
All food
Bill 8Big Bazaar · ₹3132
BillNo
8
Store
Big Bazaar
Customer
Advaith
BillAmount
3132
MajorCategories
Apparel | Food | Toiletries
FoodClass
Mixed
Bill 9Big Bazaar · ₹595
BillNo
9
Store
Big Bazaar
Customer
Mohith
BillAmount
595
MajorCategories
Apparel | Food
FoodClass
Mixed
Bill 10Sun General · ₹378
BillNo
10
Store
Sun General
Customer
Rajesh
BillAmount
378
MajorCategories
Food | Stationery
FoodClass
Mixed
Bill 11SV Stores · ₹893
BillNo
11
Store
SV Stores
Customer
Abhinav
BillAmount
893
MajorCategories
Food | Household
FoodClass
Mixed
Bill 12Sun General · ₹186
BillNo
12
Store
Sun General
Customer
Aparna
BillAmount
186
MajorCategories
Food | Household | Stationery
FoodClass
Mixed
Bill 13Big Bazaar · ₹3060
BillNo
13
Store
Big Bazaar
Customer
Abhinav
BillAmount
3060
MajorCategories
Apparel
FoodClass
No food
Bill 14Sun General · ₹656
BillNo
14
Store
Sun General
Customer
Vignesh
BillAmount
656
MajorCategories
Electronics | Grooming | Stationery | Utilities
FoodClass
No food
Bill 15Sun General · ₹229
BillNo
15
Store
Sun General
Customer
Abhinav
BillAmount
229
MajorCategories
Toiletries
FoodClass
No food
Bill 16Sun General · ₹187
BillNo
16
Store
Sun General
Customer
Advaith
BillAmount
187
MajorCategories
Stationery
FoodClass
No food
Bill 17SV Stores · ₹279
BillNo
17
Store
SV Stores
Customer
George
BillAmount
279
MajorCategories
Food
FoodClass
All food
Bill 18SV Stores · ₹603
BillNo
18
Store
SV Stores
Customer
Ahmed
BillAmount
603
MajorCategories
Food
FoodClass
All food
Bill 19SV Stores · ₹592
BillNo
19
Store
SV Stores
Customer
Neeraja
BillAmount
592
MajorCategories
Cosmetics | Food
FoodClass
Mixed
Bill 20SV Stores · ₹622
BillNo
20
Store
SV Stores
Customer
Ahmed
BillAmount
622
MajorCategories
Food | Toiletries
FoodClass
Mixed
Bill 21SV Stores · ₹128
BillNo
21
Store
SV Stores
Customer
Akshaya
BillAmount
128
MajorCategories
Food
FoodClass
All food
Bill 22Sun General · ₹315
BillNo
22
Store
Sun General
Customer
Suresh
BillAmount
315
MajorCategories
Food | Household | Utilities
FoodClass
Mixed
Bill 23SV Stores · ₹888
BillNo
23
Store
SV Stores
Customer
Julia
BillAmount
888
MajorCategories
Food
FoodClass
All food
Bill 24SV Stores · ₹92
BillNo
24
Store
SV Stores
Customer
Neeraja
BillAmount
92
MajorCategories
Food
FoodClass
All food
Bill 25Sun General · ₹1364
BillNo
25
Store
Sun General
Customer
Ahmed
BillAmount
1364
MajorCategories
Accessories | Electronics | Stationery
FoodClass
No food
Bill 26SV Stores · ₹276
BillNo
26
Store
SV Stores
Customer
Srivatsan
BillAmount
276
MajorCategories
Food
FoodClass
All food
Bill 27Sun General · ₹340
BillNo
27
Store
Sun General
Customer
Srivatsan
BillAmount
340
MajorCategories
Household
FoodClass
No food
Bill 28SV Stores · ₹514
BillNo
28
Store
SV Stores
Customer
Vignesh
BillAmount
514
MajorCategories
Food | Toiletries
FoodClass
Mixed
Bill 29SV Stores · ₹106
BillNo
29
Store
SV Stores
Customer
Ahmed
BillAmount
106
MajorCategories
Food
FoodClass
All food
Bill 30Big Bazaar · ₹798
BillNo
30
Store
Big Bazaar
Customer
Radha
BillAmount
798
MajorCategories
Food
FoodClass
All food
Bill 4 contains only food. Bill 1 also contains toiletries and apparel, so it fails the all-food condition.
YOUR COURSE DATA · TRY IT HERE
Find bills containing only food
Use the supplied 30 shopping bills. No download or coding is needed.
READY TO START
A pile of 30 cards
Start with the first card. Read its fields, do one small action, then move on.
▱ ▱ ▱
What we remember
Read
0
Nothing has been read yet. Choose Next card to begin.
Look through all 30 original records
Bill 1SV Stores · ₹567
BillNo
1
Store
SV Stores
Customer
Srivatsan
BillAmount
567
MajorCategories
Apparel | Food | Toiletries
FoodClass
Mixed
Bill 2Big Bazaar · ₹1525
BillNo
2
Store
Big Bazaar
Customer
Sudeep
BillAmount
1525
MajorCategories
Apparel | Food | Household
FoodClass
Mixed
Bill 3SV Stores · ₹1341
BillNo
3
Store
SV Stores
Customer
Akshaya
BillAmount
1341
MajorCategories
Food | Toiletries
FoodClass
Mixed
Bill 4SV Stores · ₹123
BillNo
4
Store
SV Stores
Customer
Advaith
BillAmount
123
MajorCategories
Food
FoodClass
All food
Bill 5Big Bazaar · ₹4174
BillNo
5
Store
Big Bazaar
Customer
Akshaya
BillAmount
4174
MajorCategories
Apparel | Food | Household
FoodClass
Mixed
Bill 6Sun General · ₹354
BillNo
6
Store
Sun General
Customer
Srivatsan
BillAmount
354
MajorCategories
Electronics | Food | Stationery | Utilities
FoodClass
Mixed
Bill 7SV Stores · ₹96
BillNo
7
Store
SV Stores
Customer
Akhil
BillAmount
96
MajorCategories
Food
FoodClass
All food
Bill 8Big Bazaar · ₹3132
BillNo
8
Store
Big Bazaar
Customer
Advaith
BillAmount
3132
MajorCategories
Apparel | Food | Toiletries
FoodClass
Mixed
Bill 9Big Bazaar · ₹595
BillNo
9
Store
Big Bazaar
Customer
Mohith
BillAmount
595
MajorCategories
Apparel | Food
FoodClass
Mixed
Bill 10Sun General · ₹378
BillNo
10
Store
Sun General
Customer
Rajesh
BillAmount
378
MajorCategories
Food | Stationery
FoodClass
Mixed
Bill 11SV Stores · ₹893
BillNo
11
Store
SV Stores
Customer
Abhinav
BillAmount
893
MajorCategories
Food | Household
FoodClass
Mixed
Bill 12Sun General · ₹186
BillNo
12
Store
Sun General
Customer
Aparna
BillAmount
186
MajorCategories
Food | Household | Stationery
FoodClass
Mixed
Bill 13Big Bazaar · ₹3060
BillNo
13
Store
Big Bazaar
Customer
Abhinav
BillAmount
3060
MajorCategories
Apparel
FoodClass
No food
Bill 14Sun General · ₹656
BillNo
14
Store
Sun General
Customer
Vignesh
BillAmount
656
MajorCategories
Electronics | Grooming | Stationery | Utilities
FoodClass
No food
Bill 15Sun General · ₹229
BillNo
15
Store
Sun General
Customer
Abhinav
BillAmount
229
MajorCategories
Toiletries
FoodClass
No food
Bill 16Sun General · ₹187
BillNo
16
Store
Sun General
Customer
Advaith
BillAmount
187
MajorCategories
Stationery
FoodClass
No food
Bill 17SV Stores · ₹279
BillNo
17
Store
SV Stores
Customer
George
BillAmount
279
MajorCategories
Food
FoodClass
All food
Bill 18SV Stores · ₹603
BillNo
18
Store
SV Stores
Customer
Ahmed
BillAmount
603
MajorCategories
Food
FoodClass
All food
Bill 19SV Stores · ₹592
BillNo
19
Store
SV Stores
Customer
Neeraja
BillAmount
592
MajorCategories
Cosmetics | Food
FoodClass
Mixed
Bill 20SV Stores · ₹622
BillNo
20
Store
SV Stores
Customer
Ahmed
BillAmount
622
MajorCategories
Food | Toiletries
FoodClass
Mixed
Bill 21SV Stores · ₹128
BillNo
21
Store
SV Stores
Customer
Akshaya
BillAmount
128
MajorCategories
Food
FoodClass
All food
Bill 22Sun General · ₹315
BillNo
22
Store
Sun General
Customer
Suresh
BillAmount
315
MajorCategories
Food | Household | Utilities
FoodClass
Mixed
Bill 23SV Stores · ₹888
BillNo
23
Store
SV Stores
Customer
Julia
BillAmount
888
MajorCategories
Food
FoodClass
All food
Bill 24SV Stores · ₹92
BillNo
24
Store
SV Stores
Customer
Neeraja
BillAmount
92
MajorCategories
Food
FoodClass
All food
Bill 25Sun General · ₹1364
BillNo
25
Store
Sun General
Customer
Ahmed
BillAmount
1364
MajorCategories
Accessories | Electronics | Stationery
FoodClass
No food
Bill 26SV Stores · ₹276
BillNo
26
Store
SV Stores
Customer
Srivatsan
BillAmount
276
MajorCategories
Food
FoodClass
All food
Bill 27Sun General · ₹340
BillNo
27
Store
Sun General
Customer
Srivatsan
BillAmount
340
MajorCategories
Household
FoodClass
No food
Bill 28SV Stores · ₹514
BillNo
28
Store
SV Stores
Customer
Vignesh
BillAmount
514
MajorCategories
Food | Toiletries
FoodClass
Mixed
Bill 29SV Stores · ₹106
BillNo
29
Store
SV Stores
Customer
Ahmed
BillAmount
106
MajorCategories
Food
FoodClass
All food
Bill 30Big Bazaar · ₹798
BillNo
30
Store
Big Bazaar
Customer
Radha
BillAmount
798
MajorCategories
Food
FoodClass
All food
A ShoppingBill record contains an ItemList, which is a list of Item records.
Related language terms include struct and tuple, but their exact rules differ by language. Here, use “record” for a bundle of named fields. Different fields may have different types; the three subject-mark fields happen to share one type.
X.word selects the word field of record X. It is not the entire record. A paragraph list contains many such records, including separate entries for repeated word occurrences.
MarksCardList is a list of MarksCard records. ParagraphWordList is a list of WordInPara records. ShoppingBillList is a list of ShoppingBill records. Lists can have different lengths, can be empty, and can contain repeated values. The course mainly uses lists whose elements share one declared type.
Order matters when reconstructing a paragraph or interpreting word positions. A count or sum over unchanged records is order-independent, but that does not mean list order is irrelevant to every task.
To check whether a bill has only food, inspect the category field of every Item in its items list. To count shopping visits, iterate over the outer ShoppingBillList. The level you iterate over decides whether you count bills or item rows.
A record can have individually valid field types and still have a wrong total, duplicate ID or incorrect category. You also need cross-field constraints such as totalMarks = maths + physics + chemistry, and across-record checks such as ID uniqueness. This distinction matters when turning a diagram into an actual validation procedure.
Try it yourself
Is a marks-card dataset better described as one MarksCard record or a list of MarksCard records?
Show explained answer
A list of MarksCard records. One record represents one card; the list represents the collection.
Try it yourself
What is the type of a bill’s items field in this model?
Show explained answer
ItemList: a list whose elements are Item records. It is not a single item name or a plain amount.
Try it yourself
Does a list need to have the same number of elements in every bill?
Show explained answer
No. Different bills can contain different numbers of Item records while keeping the same ItemList type.
Try it yourself
Do legal integer marks and a legal TMarks total guarantee that the total is correct?
Show explained answer
No. The values can each be in range yet fail the sum constraint. Check relationships separately.
Source: Lecture 1.10 — Introduction to complex datatypes. Small teaching datasets and diagrams are prepared for these notes; lecture and tutorial totals are identified explicitly.