You are on page 1of 9

Homework Title / No.

: ______1______________________________________Course Code : __cse301_______

Course Instructor : mr.Shakun garg____________________ Course Tutor (if applicable) : ____________

Date of Allotment : _____27/8/2010________________ Date of submission : 07/09/2010___________________

Student’s Roll No.___A13___________________ Section No. : ___E2802______________________

Declaration:
I declare that this assignment is my individual work. I have not copied from any other student’s work or from any other source except where due
acknowledgment is made explicitly in the text, nor has any part been written for me by another person.

Student’s Signature : _PANKAJ KUMAR___________

Evaluator’s comments: _____________________________________________________________________

Marks obtained : ___________ out of ______________________

Content of Homework should start from this page only:


Question1- conceptually and diagrammatically describes the logical steps while
executing users request to access the database system.
Ans :- When a user a query for acceing data from data base system then following steps are follow....

A user request for data is recevied by data manager which determine the physical record requird.The data manager send the request for
specific physical record to the file manager .the file manager decide which physical block of secondary storage device contains the erquird
record and send the appropieate block to disk manager .The disk manager retrieve the block and send it to the file manager ,which send the
requird record to the data manager.To improve reliability in mission-critical systems, disks can be organized into structures generically
called redundant arrays of independent disks (RAID). In a RAID system, data are organized with some amount of redundancy (such as
replication) across several disks. Even if one of the disks in the RAID system were to be damaged and lose data, the lost data can be
reconstructed from the other disks in the RAID system.One way to retrieve a desired record in a relational database is to perform a scan on
the corresponding relation; a scan fetches all the records from the relation, one at a time.

The database management is like a bridge between the application programme and the oprating system of the computer which is
responsible for placing data on the magnatic storage device.

user’s query

request specific record request specific file i/o block

Block response to user request record requested block blockfrmsecondrydevic

Logical Diagram To Access the Database

To retrieve the data from database the following operation perform-

1-A user issues an access request, using some application programming or data manipulation language.

2-The application program determine what data are need and communicates the need to data base management.

3-The DBMS intercepts the request and interprets it.

4-The database management system instruct the os to locate and retrieve the data from the specific location on the magnetic disk.

5-A copy of data is given to the application programme for processing.

6-The DBMS inspects in turn the external schema the external mapping the conceptual schema the concepitual mapping and storage
structure definition.

7.When a user gives the query then goes to external view level, external view level gives abstraction exists to simplify there instection with
the system.after that view level pass to the conceptual level and conceptual level make a conceptual schema and pass to the enternal view
which interect directy to the data base and access the data from it.
Question 2: Construct a E-R diagram for a hospital management system with a set of
doctors and a set of patients.With each patient,a series of various tests and
examinations are conducted. On the basis of preliminary report patients are
admitted to a particular specialty ward.
Doc_na Patient_i Patient
ANS :- me Patient_id d name
Doc_id
address

Doctor patient
treats

Doc_ad Doc_specia
dress lity
Doc_id

Test
positive

Test
Patient_id conduc
ted Test_id

Test

Test
Test_id
name

Test
speciality
Question:-3 Compare and contrast the different models?

Ans : - ADVANTAGE AND DISADVANTAGE OF RELATIONAL DATA BASE MODEL

The Advantages to using a relational database system:

1.SIMPLICTY:A data Relational data base is very simple and easy to design and implement at the logical level.the different table in the
database can be using appropriate attributes and data value very easily.All the relation are designed in a tabular manner,which helps the
user to concentrate on the logical view of the database rather than complex internal details of how data is stored.

2.FLEXIBLE:The relational database provides flexibility that allows changes to database structure to be easily accommodated.

3.DATA INDEPENDENCE: Because resides in table ,the structure of database can be changed without having to change any application
that were based on that structure .

4.It is structure independence.

5.QUERY CAPABILITY:It makes possible for a high level query language like SQL to avoid comlex database navigation.in this model
the queries are based on logical relationships and processing thouse queries does not require predefind access path among the data.

1.The most significant limitation of relational model is its limited ability to deal with binary large objects such as images ,e-mail.

2.mapping object to a relational database can be a difficult skill to learn.

3. This is costiy affair.

we use tables to create the relation. Inside the tables are primary and alternative keys.
The primary keys create the relation between the tables with the alternative keys.

The disadvantage: You can lose information if the keys overlap in the requests made by the creator. Sometimes this is true and sometimes it
is not.

SQL is a type of database, is called structure query language. Which commonly is known to form the structure of the backbone for most
relations database query systems? The popularity of this language is because the American Standard Institute standardized it. Another
reason is that it was originally developed and marketed by IBM and has thus benefited from a high level of exposure.

ADVANTAGE AND DISADVANTAGE OF E-R MODEL


Entity-Relationship diagrams are useful for modelling data and the relationships between the data. They can be used
when the constraints between data are relatively simple. They do not allow specification of interactions between the data
or model how the data changes Object –based data model

ADVANTAGES

Provide very efficient "High-speed" retrieval

1.Simplicity

The network model is conceptually simple and easy to design.

2.Ability to handle more relationship types

The network model can handle the one-to-many and many-to-many relationships.

3.Ease of data access

In the network database terminology, a relationship is a set. Each set comprises of two types of records.- an owner
record and a member record, In a network model an application can access an owner record and all the member records
within a set.

4.Data Integrity

In a network model, no member can exist without an owner. A user must therefore first define the owner record and then the member
record. This ensures the integrity.

5.Data Independence

The network model draws a clear line of demarcation between programs and the complex physical storage details. The application
programs work independently of the data. Any changes made in the data characteristics do not affect the application program.
DISADVANTAGES

1.System complexity

In a network model, data are accessed one record at a time. This males it essential for the database designers, administrators, and
programmers to be familiar with the internal data structures to gain access to the data. Therefore, a user friendly database management
system cannot be created using the network model

2.Lack of Structural independence.

Making structural modifications to the database is very difficult in the network database model as the data access method is navigational.
Any changes made to the database structure require the application programs to be modified before they can access data. Though the
network model achieves data independence, it still fails to achieve structural independence.

ADVANTAGE AND DISADVANTAGE OF SEMI STRUCTURED DATA MODE

Issues with Semi-Structured Data :


Semi-structured data need to be characterized, turned over, stored, manipulated or analyzed with adeptness. Even so there are challenges in
semi-structured data use. Some of these challenges include:

1.Data Diversity: The issues of data diversity in federated systems is a complex issue, it also involves areas such as unit and sementic
incompatibilities, grouping incompatibilities, and non-consistent overlapping of sets.

2.Extensibility: It is vital to realize that extensibility as used to data is in indication to data presentation and not data processing. Data
processing should be able to happen without the aid of database updates.

3.Storage: Transfer formats like XML are universally in text or in Unicode; they are also prime candidates for transference, yet not so
much for storage. The presentations are instead stored by deep seated and accessible systems that support such standards.

In short ,many academic open source, or other direct attention to these particular issues have been at an on-the-surface level of resolving
representation or definitions, or even units.

The formation of sufficient processing engines for well-organized and scalable storage recovery has been wholly deficient in the complete
driving force for a semi-structured data model. It is obvious that this needs further study and attention from developers.

Conclusion:
We have researched many area of the semi-structured data model; include the differences between structured data, unstructured data, and
semi-structured data. We have also explored the various used for the model.

After looking at the advantages and the disadvantages, we are now educated enough about the semi-structured model to make a decision
regarding its usefulness.

Though this model is worthy of more research and deeper contemplation. The advantage of flexibility and diversity that this particular
model offers is more then praiseworthy.

After researching, one can see many conventional and non-conventional uses for this model in our systems. A model example for semi-
structured data model is depicted below.
The semi-structured information used above is actually the detail pertaining to this very article. Each line or arrow in the model had a
specific purpose. This purpose is clearly listed as Article, Author, Title, and Year.

ADVANTAGE AND DISADVANTAGE OF NETWORK DATA MODEL

ADVANTAGES

1.Provide very efficient "High-speed" retrieval

2.Simplicity

The network model is conceptually simple and easy to design.

3.Ability to handle more relationship types

The network model can handle the one-to-many and many-to-many relationships.
4. Eliminate data Redundancy.

5.Lesser storage requirement.

6.Better performance.

7.Can handle many type of relationship.

8.Easey of data access


In the network database terminology, a relationship is a set. Each set comprises of two types of records.- an owner record and a member
record, In a network model an application can access an owner record and all the member records within a set.

9.Data Integrity

In a network model, no member can exist without an owner. A user must therefore first define the owner record and then the member
record. This ensures the integrity.

10.Data Independence

The network model draws a clear line of demarcation between programs and the complex physical storage details. The application
programs work independently of the data. Any changes made in the data characteristics do not affect the application program.

DISADVANTAGES

1.System complexity
In a network model, data are accessed one record at a time. This males it essential for the database designers, administrators, and
programmers to be familiar with the internal data structures to gain access to the data. Therefore, a user friendly database management
system cannot be created using the network model

2.Lack of Structural independence.

Making structural modifications to the database is very difficult in the network database model as the data access method is navigational.
Any changes made to the database structure require the application programs to be modified before they can access data. Though the
network model achieves data independence, it still fails to achieve structural independence.

ADVANTAGE AND DISADVANTAGE OF HIERARCHICAL MODEL

Advantages of Hierarchical model:

1.Adding and deleting records is easy

2. Fast data retrieval through higher level records

3.Multiple associations with like records in different files

4.Hierarchical model is simple to construct and operate on

5. Corresponds to a number of natural hierarchically organized domains- eg; assemblies in manufacturing, personnel organization in
companies

6. Language is simple; uses constructs like GET, GET UNIQUE, GET NEXT, GET NEXT WITHIN PARENT etc.

7.Integrity of data.

8.Efficiency

9.Handle transaction efficiently

Disadvantages of Hierarchical model:

1. Pointer path restrict access

2. Each association requires repetitive data in other records

3. Pointers require large amount of computer storage

4. Navigational and procedural nature of processing

5. Database is visualized as a linear arrangement of records

6. Little scope for "query optimization"

7. Complexity

8.Inflexibility

9.Lack of querying facilities

10. Problem with data manipulation opration

QUESTION NO4:- If WE want to change the schema of at one level of database


system without having change the schema of next higher level , is it possible , if yes
representing using abstraction levels.

ANS:-. - The three-schema architecture is a convenient tool for the user to visualize the schema levels in a database system. Most of the
DBMS’s do not separate the three levels completely, but support three-schema architecture. The three schemas are, only the description of
data the only data that exists in the physical level. What is a schema? Basically schema is the structure of our table. The description of
database is called database schema, which is specified during database design and it is not expected to change frequently. A displayed
schema is called a schema diagram and each object in the schema is called schema construct.

In this DBMS architecture, schemas can define in three levels:


1:-INTERNAL

2:-CONCEPTUAL

3:-EXTERNAL

THE FOLLOWING WILL HAPPEN WHEN WE CHANGE ONE LEVEL OF DATA BASE WITHOUT CHANNGING THE SCHEMA
OF NEXT HIGHER LEVEL.

The three-schema architecture explains the concept of data independence, which is defined as the capacity to the change the schemas at one
level of the database system without having to change the schema at next higher level. The three-schema architecture makes it easier to
achieve true data independence. There are two types of data independence; Logical data independence is the capacity to change the
conceptual schema without having to change the external schemas or application programs. Only the view definition and the mappings need
to be changed in the DBMS that supports logical data independence. Physical data independence is the capacity to change the internal
schema without having to change the external schemas.

Data independence is accomplished because, when the schema is changed at one level the schema at the next higher-level remains
unchanged only the mapping between the two levels is changed. View is also called as “Virtual table” because view does not contain
physically stored records and will not occupy any space. A multi-user database whose users have variety of applications must provide
facilities for defining multiple views. This three-schema helps us to provide data security of data’s among different users accessing the
database, ensures data integrity and avoid duplication of data’s in the database. It helps us to establish and maintain relationship among the
data’s in the database

Question 5: Can we treat a relationship as a high level entity? Justify your answer
with example?
ANS 5. No we can’t treat a relation as a high level entity .Because a high level entity has a primary key and a relation cant have a primary
key. Let’s understand it by an example. Consider a entity set payment which is a relation has three attributes :salary no , sallary__date
,sallary amount. Although each sallary entity is distinct but sallary for different employe may share the sallary number .Thus, this entity set
does not have a primary key and it is weak entity set.

Question 6: A university has many academic unit named schools. Each school is
administered by a Head of School. The school has administrative and teaching staff.
A school offers many courses. A course consists of many subjects A subject is taught
to students who have registered for a subject in a class room by a teacher. Draw the
necessary E-R diagram for the university specifying aggregation, generalization or
specialization hierarchy.

ANS:- Se
Roo Tna dep
Snam Ti c Tid
St_id ANS6. e m no me tt
no
En me Te
rol ac
student Course Teacher
l he
offered
no rs
.

semest
er
Year

syallab cc
us Course_no

course

Title
marks
QUES-7. How deletion, insertion is possible using relational Algebra?

Ans : - .

Delete operation:-

The deletion operation is expressed like a query. Instead of displaying tuples to user we remove the tuples from the selected database .we
can delete only whose tuples; we can’t delete values on only particular attribute.

In relational algebra deletion operation is expressed as

rr-E

where r is a relation and E is a relational algebra query.

Ex.

Delete all accounts of Mr. Bean

Depositer depositer— sigma(customer_ name)=”Mr Bean”(depositer)

Ex2:

Delete all loan with amount in the range 0 to 50.

Loanloan-sigma(amount)>=0and <=50(loan).

Insert operation:-

To insert data into relation we either specify a topule to be inserted or write a query to whose result is a set of topules to be inserted .all
attribute values for inserted topules must be member of attribute’s domain .Similarly , topules inserted must be of correct arity.

The relational algebra expresses an insertion by

RrUE

Where r is a relation and E is a relational algebra.

Suppose we wish to insert Smith has $1000 in account A-987 at the Perryridge branch

Then

Account account U { (A-987,”Perryridge”,1200)}

You might also like