Find attributes, cardinality, domain and degree of a relation
Question
In this question, we have to find the attributes, cardinality, domain, and degree of the given relation.
Consider the following relation that stores data about suppliers.
SUPPLIER:
a. What are the attributes of SUPPLIER?
b. What are the domains of S# :
STATUS :
CITY :
c. What is the cardinality of SUPPLIER?
d. What is the degree of SUPPLIER?
Summary
In this question, we have been given one relation that stores some data of the supplier. And there are some questions related to the data, and we have to answer those questions. Here, we have to tell the attributes of the data supplier.
Explanation
In this question, a table is given for reference and we have to find the answers using the table. Here, the “supplier” is an entity. Here we will find the attributes, cardinality, domain, and degree of relation.
In the first question, we have to tell the attributes of the data supplier. An attribute is the set of properties of an entity and it describes the instances in the column of a database. Here, the attributes of the supplier are {S#, SNAME, CITY, and STATUS}.
In the second question, we have to tell the domains of different attributes. The domain of an attribute is the collection of values that are assigned to the attribute.
And the domain of the attribute “S#” is: {S1, S2, S3, S4, S5}.
The domain of the attribute “STATUS” is: {10, 20, 30}.
The domain of the attribute “CITY” is: {NY, AMS, LA}.
In the third question, we have to tell the cardinality of a relation. The cardinality is the number of tuples present in it. The tuple indicates a row. In the supplier table, there are five rows. So the cardinality of it will be 5.
In the fourth question, we have to tell the degree of the table. The degree is the number of attributes in a relation. Here we can see that there are four attributes {S#, SNAME, CITY, STATUS}, so the degree of this table will be 4.
Also read, ER diagram notation