In this article, we will see what is a relation, bag, tuple and field. Let see each one of these in detail.
Lets consider the following products dataset as an example:
Lets consider the following products dataset as an example:
Id, product_name ----------------------- 10, iphone 20, samsung 30, Nokia
- Field: A field is a piece of data. In the above data set product_name is a field.
- Tuple: A tuple is a set of fields. Here Id and product_name form a tuple. Tuples are represented by braces. Example: (10, iphone).
- Bag: A bag is collection of tuples. Bag is represented by flower braces. Example: {(10,iphone),(20, samsung),(30,Nokia)}.
- Relation: Relation represents the complete database. A relation is a bag. To be precise relation is an outer bag. We can call a relation as a bag of tuples.
No comments:
Post a Comment