JAYASHREE ORACLE CERTIFIED JAIN UNIVERSITY

Friday, September 24, 2010

Try these RDBMS CASE Studies

1. A publishing company produces scientific books on various subjects. The books are written by authors who specialize in one particular subject. The company employs editors who, not necessarily being specialists in a particular area, each take sole responsibility for editing one or more publications. A publication covers essentially one of the specialist subjects and is normally written by a single author. When writing a particular book, each author works with on editor, but may submit another work for publication to be supervised by other editors. To improve their competitiveness, the company tries to employ a variety of authors, more than one author being a specialist in a particular subject

2. A General Hospital consists of a number of specialized wards (such as Maternity, Paediatry, Oncology, etc). Each ward hosts a number of patients, who were admitted on the recommendation of their own GP and confirmed by a consultant employed by the Hospital. On admission, the personal details of every patient are recorded. A separate register is to be held to store the information of the tests undertaken and the results of a prescribed treatment. A number of tests may be conducted for each patient. Each patient is assigned to one leading consultant but may be examined by another doctor, if required. Doctors are specialists in some branch of medicine and may be leading consultants for a number of patients, not necessarily from the same ward.

3. A database is to be designed for a Car Rental Co. (CRC). The information required includes a description of cars, subcontractors (i.e. garages), company expenditures, company revenues and customers. Cars are to be described by such data as: make, model, year of production, engine size, fuel type, number of passengers, registration number, purchase price, purchase date, rent price and insurance details. It is the company policy not to keep any car for a period exceeding one year. All major repairs and maintenance are done by subcontractors (i.e. franchised garages), with whom CRC has long-term agreements. Therefore the data about garages to be kept in the database includes garage names, addressees, range of services and the like. Some garages require payments immediately after a repair has been made; with others CRC has made arrangements for credit facilities. Company expenditures are to be registered for all outgoings connected with purchases, repairs, maintenance, insurance etc. Similarly the cash inflow coming from all sources - car hire, car sales, insurance claims - must be kept of file.CRC maintains a reasonably stable client base. For this privileged category of customers special credit card facilities are provided. These customers may also book in advance a particular car. These reservations can be made for any period of time up to one month. Casual customers must pay a deposit for an estimated time of rental, unless they wish to pay by credit card. All major credit cards care accepted. Personal details (such as name, address, telephone number, driving licence, number) about each customer are kept in the database.

4. A database is to be designed for a college to monitor students' progress throughout their course of study. The students are reading for a degree (such as BA, BA(Hons) MSc, etc) within the framework of the modular system. The college provides a number of module, each being characterised by its code , title, credit value, module leader, teaching staff and the department they come from. A module is co-ordinated by a module leader who shares teaching duties with one or more lecturers. A lecturer may teach (and be a module leader for) more than one module. Students are free to choose any module they wish but the following rules must be observed: some modules require pre-requisites modules and some degree programmes have compulsory modules. The database is also to contain some information about students including their numbers, names, addresses, degrees they read for, and their past performance (i.e. modules taken and examination results).

5. A relational database is to be designed for a medium sized Company dealing with industrial applications of computers. The Company delivers various products to its customers ranging from a single application program through to complete installation of hardware with customized software. The Company employs various experts, consultants and supporting staff. All personnel are employed on long-term basis, i.e. there are no short-term or temporary staff. Although the Company is somehow structured for administrative purposes (that is, it is divided into departments headed by department managers) all projects are carried out in an inter-disciplinary way. For each project a project team is selected, grouping employees from different departments, and a Project Manager (also an employee of the Company) is appointed who is entirely and exclusively responsible for the control of the project, quite independently of the Company's hierarchy. The following is a brief statement of some facts and policies adopted by the Company.
• Each employee works in some department.
• An employee may possess a number of skills
• Every manager (including the MD) is an employee
• A department may participate in none/one/many projects.
• At least one department participates in a project.
• An employee may be engaged in none/one/many projects
• Project teams consist of at least one member.

For the above business stories you are expected to create the following.

1. Analyze the data required.
2. Normalize the attributes.
3. Create the logical data model (ER diagrams).

Try for E R Diagram

Activity 1
• In this exercise you are going to model and implement the database-part of a (simplified) CD-archive.
• Requirements
• These are the requirements for your CD-archive:
• 1. A CD is published in a given year by a record company. The CD has a title.
• 2. A CD contains songs with a certain length and one or more artists plays and sings on it.
• 3. An artist is either a band or a person. A band is composed of multiple persons.
• 4. We assume that a person can’t be a member of more than one band, but a person might be an artist on his/her own as well.
• 5. An artist has a nationality.
• 6. A song is composed by one or more persons. It is interesting to know when a song
was composed.
• 7. A song could be recorded on multiple records, generally with other artists than the
composer (cover-tunes).
• 8. The length of each of the songs on a CD must be possible to retrieve.
• 9. To be able to pose questions to the record companies it is important to store contact
information (email and phone no.) in the system
Activity2:
• 1) Construct an E-R diagram for a car-insurance company whose customers own one of more cars each. Each car has associated with it zero to any number of recorded accidents.
• (2) Construct an E-R diagram for a hospital with a set of patients and set of medical doctors. Associate with each patient a log of the various tests and examinations conducted.
• Activity3:
• Consider a university database for the scheduling of classrooms for final exams. This database could be modeled as the single entity set exam, with attributes course-name, section-number, room-number, and time. Alternatively, one or more additional entity sets could be defined, along with relationship sets to replace some of the attributes of the exam entity set, as
• Course with attributes name, department, and c-number
• Section with attributes s-number and enrollment, and dependent as a weak entity set on course
• Room with attributes r-number, capacity, and building
• (a) Show an E-R diagram illustrating the use of all three additional entity sets listed
• (b) Explain what application characteristics would influence a decision to include or not to include each of the additional entity sets.

Thursday, September 23, 2010

DBMS FAQ's

1.What is database?

A database is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and which is designed, built and populated with data for a specific purpose.

2. What is DBMS?

It is a collection of programs that enables user to create and maintain a database. In other words it is general-purpose software that provides the users with the processes of defining, constructing and manipulating the database for various applications.


3. What is a Database system?

The database and DBMS software together is called as Database system.


4. Advantages of DBMS?

Ø Redundancy is controlled.

Ø Unauthorized access is restricted.

Ø Providing multiple user interfaces.

Ø Enforcing integrity constraints.

Ø Providing backup and recovery.

5. Disadvantage in File Processing System?

Ø Data redundancy & inconsistency.

Ø Difficult in accessing data.

Ø Data isolation.

Ø Data integrity.

Ø Concurrent access is not possible.

Ø Security Problems.

6. Describe the three levels of data abstraction?
The are three levels of abstraction:

Ø Physical level: The lowest level of abstraction describes how data are stored.

Ø Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data.

Ø View level: The highest level of abstraction describes only part of entire database.

7. Define the "integrity rules"

There are two Integrity rules.

Ø Entity Integrity: States that “Primary key cannot have NULL value”

Ø Referential Integrity: States that “Foreign Key can be either a NULL value or should be Primary Key value of other relation.



8. What is extension and intension?

Extension -

It is the number of tuples present in a table at any instance. This is time dependent.

Intension -

It is a constant value that gives the name, structure of table and the constraints laid on it.



9. What is System R? What are its two major subsystems?

System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center. It is a prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be used in a real life environment to solve real life problems, with performance at least comparable to that of existing system.

Its two subsystems are

Ø Research Storage

Ø System Relational Data System.

10. How is the data structure of System R different from the relational structure?
Unlike Relational systems in System R

Ø Domains are not supported

Ø Enforcement of candidate key uniqueness is optional

Ø Enforcement of entity integrity is optional

Ø Referential integrity is not enforced



11. What is Data Independence?

Data independence means that “the application is independent of the storage structure and access strategy of data”. In other words, The ability to modify the schema definition in one level should not affect the schema definition in the next higher level.

Two types of Data Independence:

Ø Physical Data Independence: Modification in physical level should not affect the logical level.

Ø Logical Data Independence: Modification in logical level should affect the view level.

NOTE: Logical Data Independence is more difficult to achieve



12. What is a view? How it is related to data independence?

A view may be thought of as a virtual table, that is, a table that does not really exist in its own right but is instead derived from one or more underlying base table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary.

Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the effects of restructuring and growth in the database. Hence accounts for logical data independence.



13. What is Data Model?

A collection of conceptual tools for describing data, data relationships data semantics and constraints.



14. What is E-R model?

This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entities are described in a database by a set of attributes.



15. What is Object Oriented model?

This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes.



16. What is an Entity?

It is a 'thing' in the real world with an independent existence.



17. What is an Entity type?

It is a collection (set) of entities that have same attributes.



18. What is an Entity set?

It is a collection of all entities of particular entity type in the database.



19. What is an Extension of entity type?

The collections of entities of a particular entity type are grouped together into an entity set.



20. What is Weak Entity set?

An entity set may not have sufficient attributes to form a primary key, and its primary key compromises of its partial key and primary key of its parent entity, then it is said to be Weak Entity set.



21. What is an attribute?

It is a particular property, which describes the entity.



22. What is a Relation Schema and a Relation?

A relation Schema denoted by R(A1, A2, …, An) is made up of the relation name R and the list of attributes Ai that it contains. A relation is defined as a set of tuples. Let r be the relation which contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list of n-values t=(v1,v2, ..., vn).



23. What is degree of a Relation?

It is the number of attribute of its relation schema.



24. What is Relationship?

It is an association among two or more entities.



25. What is Relationship set?

The collection (or set) of similar relationships.
26. What is Relationship type?
Relationship type defines a set of associations or a relationship set among a given set of entity types.

27. What is degree of Relationship type?
It is the number of entity type participating.

26. What is VDL (View Definition Language)?
It specifies user views and their mappings to the conceptual schema.

27. What is SDL (Storage Definition Language)?
This language is to specify the internal schema. This language may specify the mapping between two schemas.

39. What is normalization?
It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties
Ø Minimizing redundancy
Ø Minimizing insertion, deletion and update anomalies.


41. When is a functional dependency/repetitive group F said to be minimal?
Ø Every dependency in F has a single attribute for its right hand side.
Ø We cannot replace any dependency X A in F with a dependency Y A where Y is a proper subset of X and still have a set of dependency that is equivalent to F.
Ø We cannot remove any dependency from F and still have set of dependency that is equivalent to F.

44. What is 1 NF (Normal Form)?
The domain of attribute must include only atomic (simple, indivisible) values.

46. What is 2NF?
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key.

47. What is 3NF?