erd questions

16
Questions on E-R Diagrams Q1. Consider a university database for scheduling of classrooms for final exams. These are exams taking place for various courses. Each course has a unique name, department and course-number. For each course, there may be many sections. Sections have a section-number and enrollment. There are multiple rooms available in various buildings. Each rooms is identified room-number, seating-capacity and building number and is reserved one or more courses exam. For each exam, date and time are stored. For the above mentioned database draw E-R diagram and suggest various tables with appropriate file structures.

Upload: pankaj-rawat

Post on 26-May-2015

736 views

Category:

Documents


46 download

TRANSCRIPT

Page 1: Erd questions

Questions on E-R Diagrams

Q1. Consider a university database for scheduling of classrooms for final exams. These are exams taking place for various courses. Each course has a unique name, department and course-number. For each course, there may be many sections. Sections have a section-number and enrollment. There are multiple rooms available in various buildings. Each rooms is identified room-number, seating-capacity and building number and is reserved one or more courses exam. For each exam, date and time are stored. For the above mentioned database draw E-R diagram and suggest various tables with appropriate file structures.

Page 2: Erd questions

Q2. In a certain educational institution, a student can register for several courses, for instance, a course in Calculus, Algebra or Spanish, History. A student has to register for at least one course. Every course offered has a code and a title and assigned to a classroom, a day of the week and a time at which it is conducted. A course is taught by only one instructor. However, an instructor can teach several courses.

A student can be a day scholar or a resident scholar. A resident scholar is assigned to a hostel and a hostel room. Day scholars are assigned to

store their belongings while one campus.

During the course, the student required to appear in several examinations. A course must have at least one examination; a course can have several examinations. The examinations may be of many types- tests, quizzes, seminars and projects. The date, time and place of these examinations are assigned at the beginning of the course. The examinations are evaluated by the instructors. Several instructors may correct the same set of answer scripts belonging to a course.

An instructor may have to correct the answer scripts for more than one examination. An instructor may not correct any answer scripts. A record of the student’s marks has to be maintained.

Map the E/R diagram of the educational institution to corresponding tables.

Page 3: Erd questions

Q3. Draw an entity-relationship diagram to illustrate the case given belowIn a Factory, a Vendor can supply various items. Each vendor has got a vendor code, vendor name, vendor address and each item also has got an item code, item name, its price per unit. When a vendor supplies an item the transaction is recorded and the information about the transaction stored is date of Supply, Quantity supplied, Order number, Item code and Vendor code. Map the E/R diagram to corresponding tables. Also identify the key fields.

Page 4: Erd questions

Q4. Draw an E-R diagram for college database, also find out entries, their attributes and relationship among them, whose points are given below:i. One student can opt one course but one course can opt by many students.ii. One course can be taught by many faculties and one faculty can taught many courses.iii. In a department there can be any number of faculty members but each faculty member belongs to one department only.iv. Many students can enrolled in one department but a student can not enrolled in more than one department.v. A student can have more than one local guardian but one guardian is assured to be relate to one student only

Page 5: Erd questions

Q5. Draw an E-R diagram for the Company database whose points are given below:

i. The company is organized into departments. Each department has a unique name, a unique number & a particular employee who manages the department. We keep track of the start date when that employee began managing the department. A department may have several locations.

ii. A department controls a number of projects, each of which has a unique name, a unique number and a single location.iii. We store each employee’s name, social security

number, address, salary, sex & birth date. An employee is assigned to one department but may work on several projects, which are not necessary controlled by the same department. We keep track of the number of hours per week an employee works on each project. We also track of the direct supervisor of each employee.

iv. We want to keep track of the dependents of each employee for insurance purposes. We keep each dependents first name, sex, birth date and relationship to the employee.

Q6. Draw an E-R diagram for the Company database which maintains information about following

- Employee

Page 6: Erd questions

- Departments- Project undertaken by departments- No. of hours employee work on project (an employee can work on more than one project)- Dependents of employee- Identify attributes of each entity, Primary key and relations among entities

Page 7: Erd questions

Q7. Consider a person with a unique License No, address & name. Person can own 1 or more cars but a car is registered to 1 person only.Car has unique Registration No, of a given manufacturer name, model No & year of Registration.A car met with an accident where the person involved will get a damage amount & also accident will have a Unique FIR No, location of accident & date on which accident takes place.

Q8. Create an ERD Diagram for the following:

Page 8: Erd questions

a) Each company operates 4 Departments, and each Department belongs to company.b) Each company in part a employees 1 or more employees & each employ works for 1 deptc) Each of the employees in part bmay or may not have 1 or more dependent & each dependent belongs to 1 employee.d) Each employee in part c may or may not have an employment history.

Q9. You are required to create a conceptual data model (ER diagram) of the following data:

Page 9: Erd questions

A Company has 30 Instructors & can handle upto 100 Trainees per training session. The Company offers five advance technology courses each of which is taught by a teaching team of 2 or more instructors. Each instructor is assigned to a max of 2 teaching terms or may be assigned to do research work. Each trainee undertakes 1 advance technology course per training session.

Page 10: Erd questions

Q10. A University registrar office maintains data about the following entities:a) Course including number, title, credits, syllabus & pre-

requisite.b) Course including course-no, year, semester, section no,

instructors, timings, class-roomc) Students including Student ID, name & programd) Instructors including ID_No, name, dept & title.Further the enrollment of students in courses includes grades awarded to students in each course they are enrolled. Make an ERD for registrar office.

Page 11: Erd questions

Q11. Draw a ER Diagram of library System to manage books with a unique ID, title, author, price & availability. A Book can have many publishers with a unique Publisher-ID, Name & Address. A Book can have many supplier with a unique Supp-ID, Name & Address.

Page 12: Erd questions

Q12. Draw an ER Diagram for a Airline Reservation system.

An Airplane with a unique Reg No, Capacity & Model No flies on a flight with Departure date & time, Arrival date & time, Location from & to which it flies.

A Flight offers bookings to book flights.

1 passenger can have 1 or more than bookings with a given name, surname, & unique Email Address.

Page 13: Erd questions

Q1. Consider a university database for scheduling of classrooms for final exams. These are exams taking place for various courses. Each course has a unique name, department and course-number. For each course, there may be many sections. Sections have a section-number and enrollment. There are multiple rooms available in various buildings. Each rooms is identified room-number, seating-capacity and building number and is reserved one or more courses exam. For each exam, date and time are stored. For the above mentioned database draw E-R diagram and suggest various tables with appropriate file structures.

Q2. In a certain educational institution, a student can register for several courses, for instance, a course in Calculus, Algebra or Spanish, History. A student has to register for at least one course. Every course offered has a code and a title and assigned to a classroom, a day of the week and a time at which it is conducted. A course is taught by only one instructor. However, an instructor can teach several courses.

A student can be a day scholar or a resident scholar. A resident scholar is assigned to a hostel and a hostel room. Day scholars are assigned to store their belongings while one campus.

During the course, the student required to appear in several examinations. A course must have at least one examination; a course can have several examinations. The examinations may be of many types- tests, quizzes, seminars and projects. The date, time and place of these examinations are assigned at the beginning of the course. The examinations are evaluated by the instructors. Several instructors may correct the same set of answer scripts belonging to a course.

An instructor may have to correct the answer scripts for more than one examination. An instructor may not correct any answer scripts. A record of the student’s marks has to be maintained.

Map the E/R diagram of the educational institution to corresponding tables.

Q3. Draw an entity-relationship diagram to illustrate the case given belowIn a Factory, a Vendor can supply various items. Each vendor has got a vendor code, vendor name, vendor address and each item also has got an item code, item name, its price per unit. When a vendor supplies an item the transaction is recorded and the information about the transaction stored is date of Supply, Quantity supplied, Order number, Item code and Vendor code. Map the E/R diagram to corresponding tables. Also identify the key fields.

Q4. Draw an E-R diagram for college database, also find out entries, their attributes and relationship among them, whose points are given below:i. One student can opt one course but one course can opt by many students.ii. One course can be taught by many faculties and one faculty can taught many courses.iii. In a department there can be any number of faculty members but each faculty member belongs to one department only.iv. Many students can enrolled in one department but a student can not enrolled in more than one department.v. A student can have more than one local guardian but one guardian is assured to be relate to one student only

Page 14: Erd questions

Q5. Draw an E-R diagram for the Company database whose points are given below:v. The company is organized into departments. Each department has a unique name, a unique number & a particular employee who manages the department. We keep

track of the start date when that employee began managing the department. A department may have several locations.vi. A department controls a number of projects, each of which has a unique name, a unique number and a single location.vii. We store each employee’s name, social security number, address, salary, sex & birth date. An employee is assigned to one department but may work on several

projects, which are not necessary controlled by the same department. We keep track of the number of hours per week an employee works on each project. We also track of the direct supervisor of each employee.

viii.We want to keep track of the dependents of each employee for insurance purposes. We keep each dependents first name, sex, birth date and relationship to the employee.

Q6. Draw an E-R diagram for the Company database which maintains information about following- Employee- Departments- Project undertaken by departments- No. of hours employee work on project (an employee can work on more than one project)- Dependents of employee- Identify attributes of each entity, Primary key and relations among entities

Q7. Consider a person with a unique License No, address & name. Person can own 1 or more cars but a car is registered to 1 person only.- Car has unique Registration No, of a given manufacturer name, model No & year of Registration.- A car met with an accident where the person involved will get a damage amount & also accident will have a Unique FIR No, location of accident & date on which

accident takes place.Q8. Create an ERD Diagram for the following:

a) Each company operates 4 Departments, and each Department belongs to company.b) Each company in part a employees 1 or more employees & each employ works for 1 deptc) Each of the employees in part bmay or may not have 1 or more dependent & each dependent belongs to 1 employee.d) Each employee in part c may or may not have an employment history.