Monday 29 February 2016

                                                NIIT RDBMS LAB@HOME 1


1.Shopping Spree is a leading departmental store in Shanghai.The store has a number of regular customers who purchase bulk items.The store also conducts regular feedback sessions to analyze customer satisfaction levels.Chen, the customer analyst of shopping spree, has to make ER diagram to represent the preceding situation, and then to map the ER diagram to the corresponding table.Help Chen to do the same.

ANSWER:





2.An organization has two types of employees,salaried and wage earning.Both the types of employees has some common properties,such as employee code,employee name, and employee address.However,the salaried employees have other additional properties:basic,allowance,and House Rent Allowance(HRA). The wage earning employees have distinct properties that are daily wage and overtime.

ANSWER:




3.


ANSWER:
Primary Key: DoctorID
Candidate Key: DoctorID,ShiftID
Alternate Key: Qualification

DoctorID and ShiftID are individually unique in every row.Therefore,the columns, DoctorID and ShiftID,are Candidate keys for primary key.However,the ShiftID column may contain duplicate values as two doctors may be on the same Shift.Therefore,DoctorID should be chosen as the primary key and ShiftID as the Alternate key.



4.You have been hired by a regional hospital to create a database that will be used to store the information of the patients.Implementing the database will make the date easily accessible.Identify the entities, their attributes,and the type of relationship between the entities.

ANSWER:
Entities: Patient,Doctor
Attributes of Patient: Patient_Name,Date_admitted,Patient_ID
Attributes of Doctor:
Doc_ID,Specialization,Doc_Name
Relationship :
Many to Many



5.Tom is working in an organization as a database administrator.Based on the hierarchy, the organization has multiple departments and each department has multiple employees.Identify entities,their attributes, and type of relationship between the entities.

ANSWER:
Entities: Employee,Department
Attributes of Employee:
EmpID,EmpName,DepID
Attributes of Department:
DepID,DepName,DepHead



6. Lee Wong is the newly appointed database administrator at Standard bank.The management of this bank wants to computerize the process of banking.According to the bank's policy,one customer can have many accounts but one account cannot be shared by many customers.Identify entities,their attributes,and type of relationship between the entities.

ANSWER:

Entities: Customer,Account
Attributes of Customer:
Customer Name,SSN Number ,Customer Address
Attributes of Account:
Account Number,Balance
Relationship: One to Many



7.An author can write multiple books and a book can be written by more than one author.Identify the relationship between the entity.Represent it with an ER Diagram.

ANSWER:


Relationship: Many to Many



8.In a college,there are multiple departments.Each department has various faculty members.Only one of these faculty members holds the position of the Head of the Department.Identify the relationship and represent it with an ER Diagram.

ANSWER:



Relationship: One to One