Home / Questions / Illustrate the difference between relation schema and relation instance.
Explanatory Question

Illustrate the difference between relation schema and relation instance.

👁 2,143 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

relation schema (also termed as relation intension) depicts the attributes of the table. It consists of a relation name R and a set of attributes (or fields) A1, A2,……, An. It is represented by R (A1, A2,……, An) and is used to describe a relation R. To understand the concept of relation schema, consider the book, publisher and author information stored in an Online Book database with the schema of the relations given as:


BOOK (ISBN, Book title, Category, Price, Copyright date, Year,

Page count, P ID)

AUTHOR (A_ID, Aname, City, State, Zip, Phone, URL)

PUBLISHER (P_ID, Pname, Address, State, Phone, Email_id)

In these statements, ISBN, Book_title, Category, Price, Copyright_date, Year, Page_count and P_ID are the attributes of relation BOOK. A_ID, Aname, City, State, Zip, Phone and URL are the attributes of relation AUTHOR. P_ID, Pname, Address, State, Phone and Email_id are the attributes of relation PUBLISHER.

relation instance (also termed as relation extension) is a two-dimensional table with a time-varying set of tuples. A relation instance (or relation) r of the relation schema R (A1A2,……, An) is a set of n-tuples t. It is also denoted by r(R). A relation instance is an ordered set of attributes values v that belongs to the domain D and it can be denoted as r = {t1, t2,……, tm} where, t = {v1,……, vn). It can be considered as a table, which is a collection of tuples having same number of attributes.

Above figure shows an instance B1 of BOOK relation which contains three tuples and eight attributes. If the tuple t denotes the first tuple of the relation, the notation t[ISBN] refers to the value of t on the ISBN attribute. Hence, t[ISBN] = "001-354-921-1", t[Book_title] = "Ransack" and so on.