Jawaban Tugas 2
Jawaban Tugas 2
Define the following terms: entity, attribute, attribute value, relationship instance, composite attribute, multivalued attribute, derived attribute, complex attribute, key attribute, and value set (domain). entityThe basic object that the ER model represents is an entity, which is a thing in the real world with an independent existence. An entity may be an object with a physical or conceptual existence. attribute The particular properties that describes the entity. attribute value The attribute value describe each entity become a major part of the data stored in the database. relationship instance Each relationship instance ri in R composite attributeComposite attributes can be divided into smaller subparts, which represent more basic attributes with independent meanings. multivalued attribute It means that an entity may have different numbers of values for particular attribute. derived attribute One attribute can be derived from another attribute. For example, a particular person entity, the value of Age can be determined from the current(todays) date and the value of the that persons Brith_date. complex attribute It means that a complex ( composite ) attribute is composed of more than one simple ( atomic ) attribute. key attribute An entity type usually has an attribute whose values are distinct for each individual entity in the entity set. Such an attribute is called a key attribute, and its values can identify each entity uniquely. value set (domain)Each simple attribute of an entity type is associated with a value set (or domain of values ), which specifies the set of values that may be assigned to that attribute for each individual entity. 3.7. What is a participation role? When is it necessary to use role names in the description of relationship types? Each entity type that participates in a relationship type plays a particular role in the relationship. It necessary to use role names in the description of relationship types, in some cases the same entity type participates more than once in relationship type in different roles. In such cases the role name become essential for distinguishing the meaning of each participation. Such relationship types are called recursive relationships. 3.11. What is meant by a recursive relationship type? Give some examples of recursive relationship types. Recursive relationship is the entity type participates more than once in a relationship type in different role.
For example. A department manger is the supervisor of the employee work for the department or a supervisee of a general manger of a company. 3.16. Consider the following set of requirements for a UNIVERSITY database that is used to keep track of students transcripts. This is similar but not identical to the database shown in Figure 1.2: a. The university keeps track of each students name, student number, social security number, current address and phone, permanent address and phone, permanent address and phone, birth data, sex, class ( freshman, sophomore, graduate), major department, minor department (if any), and degree program (B.A.,B.S.,, Ph.D.).Some user applications need to refer to the city, state, and ZIP Code of the students permanent address and to the students last name. Both social security number and student number have unique values for each student. b. c. d. Each department is described by a name, department code, office num-ber, office phone, and college. Both name and code have unique values for each department. Each course has a course name, description, course number, number of semester hours, level, and offering department. The value of the course number is unique for each course. Each section has an instructor, semester year, course, and section num-ber. The section number distinguishes sections of the same course that are taught during the same semester/year; its values are 1,2,3,up to the number of sections taught during each semester. e. A grade report has a student, section, letter grade, and numeric grade (0,1,2,3, or ,4). Design an ER schema for this application, and draw an ER diagram for the schema. Specify key attributes of each entity type, and structural constraints on each relationship type. Note any unspecified requirements, and make appropriate assumptions to make the specification complete.
3.17. Composite and multivalued attributes can be nested to any number of lev-els. Suppose we want to design an attribute for a STUDENT entity type to keep track of previous college education. Such an attribute will have one entry for each college previously attended, and each such entry will have one posed of college name, start and end dates, degree entries (degrees awarded at that college, if any), and transcript entries (courses completed at that col - lege, if any). Each degree entry contains the degree name and the month and year the degree was awarded, and each transcript entry contains a course name, semester, year, and grade. Design an attribute to hold this informa-tion. Use the conventions of Figure 3.5.
{ PreviousEducation ( CollegeName, StartDate, EndDate, { Degree (DegreeName, Month, Year) }, { Transcript (CourseName, Semester, Year, Grade) } ) }
3.27. Cardinality ratios often dictate the detailed design of a database. The cardi-nality ratio depends on the real-world meaning of the entity types involved and is defined by the specific application. For the binary relationships below, suggest cardinality ratios based on the common-sense meaning of the entity types. Clearly state any assumptions you make. Entity 1 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. STUDENT STUDENT CLASSROOM COUNTRY COURSE ITEM (that can be found in an order) STUDENT CLASS INSTRUCTOR EBAY_AUCTION_ CLASS INSTRUCTOR OFFICE EBAY_BID Cardinality Ratio Entity 2 SOCLAL_SECURITY_CARD TEACHER WALL CURRENT_PRESIDENT TEXTBOOK ORDER
ITEM
Entity 1 1. Student
Cardinality Ratio 1-many A student may have more than one social security card (legally with the same unique social security number), and every social security number belongs to a unique student.
Entity 2 SocialSecurityCard
2.
Student
Many-many Generally students are taught by many teachers and a teacher teaches many students.
Teacher
3.
ClassRoom
Many-many Dont forget that the wall is usually shared by adjacent rooms.
Wall
4.
Country
1-1 Assuming a normal country under normal circumstances having one president at a time.
CurrentPresident
5.
Course
Many-many A course may have many textbooks and a text book may be prescribed for different courses.
TextBook
6.
Order
7.
Student
Many-many One student may take several classes. Every class usually has several students.
Class
8.
Class
Many-to-1 Assuming that every class has a unique instructor. In case instructors were allowed to team teach, this will be many-many.
Instructor
9.
Instructor
1-1 Assuming every instructor has only one office and it is not shared. In case of offices shared by 2 instructors, the relationship will be 2-1. Conversely, if an instructor has a joint appointment (in two departments) and offices in both departments, then the relationship will be 12. In a very general case, it may be many-many.
Office
10.
1-many 1 item has many bids and a bid is unique to an item (assuming a regular auction format).
E-bay bid