Wednesday, May 6, 2020
Fundamentals of Database Systems_Assignment
Questions: 1. What is an entity type? What is an entity set? Explain the differences among an entity, an entity type, and an entity set.2. Explain the difference between an attribute and a value set.3. What is a relationship type? Explain the differences among a relationship instance, a relationship type, and a relationship set.4. What are the origins of the object-oriented approach?5. What primary characteristics should an OID possess? Answers: 1. In case of a database, any real world entity will be represented as an entity type. An attribute describes a characteristic of an entity type. An entity set is a set of entities that have same set of attributes. So, the differences among entity, an entity type and entity sets is as follows, Entity is a real world object than can be represented by a set of characteristics or attributes. An entity type is a class of specific entities sharing same set of attributes. An entity set is the set of entity types. For example, in a Library database, Book is an entity type. The attributes will be ISBN number, name of the book, Author name etc. The entity set will be Book. Where different books will be individual entities and part of the entity set Book. 2. An attribute is a characteristic of an entity set or relationship set. Each entity or relationship instance will have certain values for each attribute. An attribute will have a value set that is the set of values for the attribute. For example, there is an entity set Student. The attributes can be name, age sex of the students. The value set for the attribute sex will be a set of two values male and female. 3. A relationship type is a set of ordered pairs of the values from participating entities. For example, there may be E1 and E2 as entity sets. R1 is a relationship type between E1 and E2 for attributes e11, e12 and e21, e22. The relationship R1 will be a set or ordered pairs of (e11, e12, e21, e22). Here e11, e12 are attributes from E1; e21, e22 are attributes from E2. At any particular point of time, there will be set of relationship instances of a relationship type. The set is called relationship set. For example, there can be two entity sets Student and Course with following attributes, Student StudentID Name DOB Sex And Course CourseID CourseName A relationship type Enrolls connects Student and Course. It represents the how students are enrolled for different courses. The relationship type Enrolls will be, Enrolls CourseID StudentID The attribute CourseID comes from entity type Course and the attribute StudentID comes from entity set StudentID. 4. The origin of object oriented databases are object oriented programming languages. For example SmallTalk. In C ++ and early object oriented languages, objects were created and used to be transient till execution of the code. In object oriented databases, the objects became persistent. To define the internal states of the objects, instances variables are used. These variables can help to define different behaviors and functions on those objects. 5. OID or Object Identification helps to identify objects uniquely in an object oriented database. The primary characterizations of OIDs are, 1. The data contained in the object will not depend on the OIDs of Objects. These information are not used to create the OID. For example, an object of class Student can have different sets of values for different students. And there may be different attributes for a student like name, DOB etc. but studentID that is the OID of student object will be decided uniquely and independent of name, DOB etc. of any student. 2. The object system will generate OIDs. No program or user can control it. Programs can use OID for referencing to an object but cannot modify or change it. 3. OID will be valid for the lifetime of an object. During the lifetime the OID for the object cannot be changed, however, changes of data content is permissible. References Elmasri, R. (2014). Fundamentals of Database Systems (6th ed.). Pearson.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.