JNTU
JNTU MCA 2022 DATABASE MANAGEMENT SYSTEMS Previous Question Paper (March/April - 2022 - R17)
Answer any five questions
All questions carry equal marks
Main
Define ER diagram. What are additional features of ER diagrams? Explain in detail with suitable examples.
Answer
An Entity-Relationship (ER) diagram is a graphical representation of entities and their relationships in a database, serving as a high-level conceptual data model. It depicts the logical structure of a database by identifying the objects (entities) of interest, their attributes, and the associations (relationships) between them.
Beyond basic entities, attributes, and relationships, advanced ER modeling includes several features that enhance the representation of complex data requirements:
- Generalization and Specialization: This is a top-down approach where a high-level entity is divided into lower-level entities based on distinct characteristics. For example, an entity 'Account' can be specialized into 'SavingsAccount' and 'CurrentAccount'. Conversely, generalization merges lower-level entities into a higher-level one.
- Aggregation: This feature allows a relationship between two entities to be treated as a single entity, enabling relationships to be formed between that relationship and another entity. For instance, if an 'Employee' works on a 'Project' and uses 'Equipment', the 'Works_On' relationship can be aggregated to associate it with the 'Equipment' entity.
- Attribute Inheritance: In specialization/generalization hierarchies, lower-level entities inherit all attributes and relationships from the higher-level superclass entity, reducing redundancy.
- Constraints: These include cardinality constraints (one-to-one, one-to-many, many-to-many) and participation constraints (total vs. partial participation), which define the rules governing how entities interact.
- Weak Entities: An entity that does not have a primary key of its own and depends on the existence of an identifying 'owner' entity. It is represented by a double-bordered rectangle.
These features allow designers to capture real-world constraints more accurately, facilitating a smoother transition from conceptual design to physical database implementation.
A university registrar’s office maintains data about the following entities: (a) courses, including number, title, credits, syllabus, and prerequisites; (b) course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom; (c) students, including student-id, name, and program; and (d) instructors, including identification number, name, department, and title. Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled for must be appropriately modeled.
Construct an E-R diagram for the registrar’s office. Document all assumptions that you make about the mapping constraints.
Answer
The E-R diagram for the registrar's office consists of four primary entity sets and their relationships. The entities are defined as follows: Course (CourseNumber, Title, Credits, Syllabus, Prerequisites), Offering (CourseNumber, Year, Semester, SectionNumber, Timings, Classroom), Student (StudentID, Name, Program), and Instructor (InstructorID, Name, Department, Title).
The relationships are modeled as follows:
- Course-Offering: A one-to-many relationship where one course can have multiple offerings, but an offering belongs to exactly one course.
- Offering-Instructor: A many-to-many relationship as an offering may have multiple instructors, and an instructor may teach multiple offerings.
- Enrollment: A many-to-many relationship between Student and Offering. The relationship set includes the attribute Grade to record the performance of the student in that specific course offering.
Assumptions and Mapping Constraints:
- A Course is identified by its CourseNumber. Prerequisites is a multi-valued attribute of Course, representing a self-referencing relationship where a course can have multiple prerequisites.
- Offering is a weak entity set dependent on Course, identified by the combination of CourseNumber, Year, Semester, and SectionNumber.
- An Instructor can be associated with zero or more offerings, and an offering must have at least one instructor.
- A Student can enroll in multiple offerings, and an offering can have many students. The Grade attribute is stored on the Enrollment relationship, which is a ternary-like association between Student, Offering, and the Grade result.
- We assume that Timings and Classroom are simple attributes of the Offering entity.
Consider the following relations:
Student (snum: integer, sname: string, major: string, level: string, age: integer)
Class (name: string, meets_at: time, room: string, fid: integer)
Enrolled (snum: integer, cname: string)
Faculty (fid: integer, fname: string, deptid: integer)
The meaning of these relations is straightforward; for example, Enrolled has one record per student-class pair such that the student is enrolled in the class.
Write the following queries in SQL. No duplicates should be printed in any of the answers.
- Find the names of all Juniors (level = JR) who are enrolled in a class taught by I. Teach.
- Find the age of the oldest student who is either a History major or enrolled in a course taught by I. Teach.
- Find the names of all classes that either meet in room R128 or have five or more students enrolled.
- Find the names of all students who are enrolled in two classes that meet at the same time.
- Find the names of faculty members who teach in every room in which some class is taught.
- Find the names of faculty members for whom the combined enrollment of the courses that they teach is less than five.
- Print the level and the average age of students for that level, for each level.
- Print the level and the average age of students for that level, for all levels except JR.
Answer
Sign in to view the complete answer paper.
Explain about complex integrity constraints in SQL and designing active databases.
Answer
Sign in to view the complete answer paper.
Describe selection, projection, set operations, renaming and joins in relational algebra with examples.
Answer
Sign in to view the complete answer paper.
Consider the relation R on attributes (ABCDE) with functional dependencies: AB -> CDE, AC -> BDF, B -> C, C -> B, C -> D, B -> E.
i) Determine a Key for relation R.
ii) Find 3NF decomposition for R using normalization process.
Answer
Sign in to view the complete answer paper.
What are the pitfalls in relational database design?
Answer
Sign in to view the complete answer paper.
Describe the two-phase locking protocol with the help of an example.
Answer
Sign in to view the complete answer paper.
What are the basic properties of a transaction? Explain these properties with the help of an example?
Answer
Sign in to view the complete answer paper.
Explain the following:
Buffer manager
Answer
Sign in to view the complete answer paper.
Composite search key
Answer
Sign in to view the complete answer paper.
ISAM
Answer
Sign in to view the complete answer paper.