Illustrate the difference between relation schema and relation instance.

Database Management System >   DBMS Relational Databases >   Relational Database Design  

Long Question

2039


Answer:

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.


This Particular section is dedicated to Question & Answer only. If you want learn more about Database Management System. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.