Anda di halaman 1dari 11

1. Explain all E.F. Codd’s Rules?

Dr E.F.Codd, also known as the ‘Father of Database Management Systems’ had


propounded 12 rules. These are:

Rule 0: Foundation rule


The system must qualify as relational, as a database, and as a management
system. For a system to qualify as a relational database management system, that
system must use its relational facilities to manage the database.
Rule 1: Rule of Information
Relational Databases should store the data in the form of relations. Tables are
relations in Relational Database Management Systems. It is important to store the
value as an entity in the table cells.
Rule 2: Rule of Guaranteed Access
The use of pointers to access data logically is strictly forbidden. Every data entity
which is atomic in nature should be accessed logically by using a right combination
of the name of table, primary key represented by a specific row value and column
name represented by attribute value.
Rule 3: Rule of Systematic Null Value Support
Null values are completely supported in relational databases. They should be
uniformly considered as ‘missing information’. Null values are independent of any
data type. They should not be mistaken for blanks or zeroes or empty strings. Null
values can also be interpreted as ‘inapplicable data’ or ‘unknown information.’
Rule 4: Rule of Active and online relational Catalog
In the Database Management Systems ‘metadata’ is the data about the database or
the data about the data. The active online catalog that stores the metadata is called
‘Data dictionary. The data dictionary is accessible only by authorised users who
have the required privileges and the query languages used for accessing the
database should be used for accessing the data of data dictionary.
Rule 5: Rule of Comprehensive Data Sub-language
A single robust language should be able to define integrity constraints, views, data
manipulations, transactions and authorizations. If the database allows access to the
unauthorised ones, it is violating this rule.
Rule 6: Rule of Updating Views
Views should reflect the updates of their respective base tables and vice versa. A
view is a logical table which shows restricted data. Views generally make the data
readable but not modifiable. Views help in data abstraction.

1
Rule 7: Rule of Set level insertion, update and deletion
A single operation should be sufficient to retrieve, insert, update and delete the
data.
Rule 8: Rule of Physical Data Independence
Batch and end user operations are logically separated from physical storage and
respective access methods.
Rule 9: Rule of Logical Data Independence
Batch and end users can change the database schema without having to recreate it
or recreate the applications built upon it.
Rule 10: Rule of Integrity Independence
Integrity constraints should be available and stored as metadata in data dictionary
and not in the application programs.
Rule 11: Rule of Distribution Independence
The Data Manipulation Language of the relational system should not be concerned
about the physical data storage and no alterations should be required if the physical
data is centralized or distributed.
Rule 12: Rule of Non Subversion
Any row should obey the security and integrity constraints imposed. No special
privileges are applicable.

2. Explain the role and responsibility of DBA?


DBA (Defination):- A Database Administrator is a person or a group of person who
are responsible for managing all the activities related to database system. This job
requires a high level of expertise by a person or group of person. Hence DBA is the
controller of everything related to database system
The various roles and responsibility of DBA are:
1. Schema Definition:- The DBA definition the logical Schema of the database. A
Schema refers to the overall logical structure of the database. According to this
schema, database will be developed to store required data for an organization.
2. Managing Data Integrity:-Data integrity should be managed accurately
because it protects the data from unauthorized use. DBA manages relationship
between the data to maintain data consistency.
3.Deciding the hardware device:-Depending upon the cost, performance and
efficiency of the hardware, it is DBA who have the duty of deciding which hardware

2
devise will suit the company requirement. It is hardware that is an interface between
end users and database so it needed to be of best quality.

4.Storage Structure and Access Method Definition :- The DBA decides how the
data is to be represented in the stored database.

5.Approving Data Access :-The DBA determines which user needs access to
which part of the database. According to this, various types of authorizations are
granted to different users.

6.Monitoring Performance:- The DBA monitors performance of the system. The


DBA ensures that better performance is maintained by making changes in physical
or logical schema if required.

7.Backup and Recovery:- Database should not be lost or damaged. The DBA
ensures this periodically backing up the database on magnetic tapes or remote
servers. In case of failure, such as virus attack database is recovered from this
backup.

8.Physical Organization Modification:- The DBA modifies the physical


organization of the database to reflex the changing needs of the organization or to
improve performance.

3. Write a short note on Hashing?


Hashing is an effective technique to calculate the direct location of a data record on
the disk without using index structure. Hashing uses hash functions with search keys
as parameters to generate the address of a data record. Hashing is used to index
and retrieve items in a database because it is faster to find the item using the shorter
hashed key than to find it using the original value.

Hash Organization

1. Bucket: - A hash file stores data in bucket format. Bucket is considered a unit of
storage. A bucket typically stores one complete disk block, which in turn can store
one or more records.

2.Hash Function :-A hash function, h, is a mapping function that maps all the set of
search keys K to the address where actual records are placed. It is a function from
search keys to bucket addresses. The hash function can use any of the column
value to generate the address. Hash function uses primary key to generate the hash
index – address of the data block. Hash function can be simple mathematical
function to any complex mathematical function. We can even consider primary key
itself as address of the data block. That means each row will be stored at the data

3
block whose address will be same as primary key. This implies how simple a hash
function can be in database.

4. Explain all physical storage devices ?


Several types of data storage exist in most computer systems. They vary in speed of
access, cost per unit of data, and reliability.

Cache:- This is the most costly and fastest form of storage. Usually very small, and
managed by the operating system.

Main Memory:- The storage area for data available to be operated on. General-
purpose machine instructions operate on main memory. Contents of main memory
are usually lost in a power failure or system crash occurs. Main memory may contain
many megabytes of data and it is generallly too small to store entire database.

Flash memory: EEPROM (electrically erasable programmable read-only memory).


Data in flash memory survive from power failure. Reading data from flash memory
takes about 10 nano-seconds (roughly as fast as from main memory), and writing
data into flash memory is more complicated: write-once takes about 4-10
microseconds. To overwrite what has been written, one has to first erase the entire
bank of the memory. It may support only a limited number of erase cycles .It has
found its popularity as a replacement for disks for storing small volumes of data (5-
10 megabytes) .

Optical storage:- The most popular form of optical storage is CD-ROM. Data is
stored optically on a disk and are read by laser. The optical disk used in CD-ROM
storage cannot be written and can be loaded into or removed from a drive. Another
version of optical storage is write once or read many(WORM) disk which allows data
to be written once but does not allow them to be erased and rewritten, this medium is
used for archival of data.

Tape Storage: It is used primarily for backup and archival data. It is cheaper, but
provide much slower access because the tape must be accessed sequentially from
the beginning. For this reason the tape storage is referred to as sequentially access
storage. Used as protection from disk failures. Tapes have a high capacity and can
be removed from the tape drive facilitating cheap archival storage.

Magnetic-disk storage:- It is the primary medium for long-term storage. Typically


the entire database is stored on disk. Data must be moved from disk to main
memory in order for the data to be operated on. After operations are performed, data
must be copied back to disk if any changes were made. Disk storage is called direct
access storage as it is possible to read data on the disk in any order.Disk storage
usually survives power failures and system crashes.
A magnetic disk is a storage device that uses a magnetization process to write,
rewrite and access data. It is covered with a magnetic coating and stores data in the
form of tracks, spots and sectors. Hard disks, zip disks and floppy disks are common
examples of magnetic disks.

4
(The storage hierarchy of physical storage devices where the higher levels are
expensive(cost per bit),fast(access time) but the capacity is smaller.)

5.What is Transaction Management explain brief ?


A transaction can be defined as a unit of program that accesses and updates various
data items. In other words any action that reads from and write to a database may
consists of simple select, update, insert is called a transaction. A successful
transaction changes the state of database from one consistent state to another.

A transaction in a database system must maintain Atomicity, Consistency, Isolation,


and Durability commonly known as ACID properties in order to ensure accuracy,
completeness, and data integrity.

Atomicity:-This property states that a transaction must be treated as an atomic


unit, that is, either all of its operations are executed or none. There must be no state
in a database where a transaction is left partially completed.

5
Consistency:-The database must remain in a consistent state after any transaction.
No transaction should have any adverse effect on the data residing in the database.
If the database was in a consistent state before the execution of a transaction, it
must remain consistent after the execution of the transaction as well.

Durability:-The database should be durable enough to hold all its latest updates
even if the system fails or restarts. If a transaction updates a chunk of data in a
database and commits, then the database will hold the modified data. If a
transaction commits but the system fails before the data could be written on to the
disk, then that data will be updated once the system springs back into action.

Isolation:-In a database system where more than one transaction are being
executed simultaneously and in parallel, the property of isolation states that all the
transactions will be carried out and executed as if it is the only transaction in the
system. No transaction will affect the existence of any other transaction.

Serializibility:- When multiple transactions are being executed by the operating


system in a multiprogramming environment, there are possibilities that instructions
of one transactions are interleaved with some other transaction. The database must
control concurrent executions of transactions to ensure that the database state
remains consistent
A transaction begins when data is read or written. A transaction ends with commit or
rollback statements.
COMMIT statement:- Use the COMMIT statement to end your current transaction
and make permanent all changes performed in the transaction.

ROLLBACK statement:- If you wished to rollback (undo) any changes made to the
database since the last commit, you can issue the command: ROLLBACK;

6. Explian Concurrency control in brief?


It is use to maintain serializability of a transaction in a multiuser database. To
maintain the concurrent access of transactions, two protocols are introduced.

Lock Based Protocol: - Lock is in other words called as access. In this type of
protocol any transaction will not be processed until the transaction gets the lock on
the record. That means any transaction will not retrieve or insert or update or delete
the data unless it gets the access to that particular data .These locks are broadly
classified as Binary locks and shared exclusive locks.

6
Binary lock:- In binary lock data can either be locked or unlocked. It will have only
these two states. It can be locked for retrieve or insert or update or delete the data or
unlocked for not using the data

Exclusive lock :- In this technique the data is said to be exclusively locked if for
insert, update ,delete. When it is exclusively locked no other transaction can read or
write the data.

Shared Lock:-When a data is read from the database, then its lock is shared i.e.;
the data can be read by other transaction too but it cannot be changed while
retrieving the data.

Lock Based Protocol are of two types:-

Two phase locking protocol:- In this type of protocol, as the transaction begins to
execute, it starts requesting for the locks that it needs. It goes on requesting for the
locks as and when it is needed. Hence it has a growing phase of locks. At one stage
it will have all the locks. Once the transaction is complete it goes on releasing the
locks. Hence it will have descending phase of locks. Thus this protocol has two
phases – growing phase of locks and shrinking phase of locks.

Time Stamp Based Protocol:-In this method as soon as a transaction is created it


assigns the order of the transaction. The order of the transaction is nothing but the
ascending order of the transaction creation. The priority for older transaction is given
to execute first. This protocol uses system time or logical counter to determine the
time stamp of the transaction.

Suppose there are two transactions T1 and T2. Suppose T1 has entered the system
at time 0005 and T2 has entered the system at 0008 clock time. Priority will be given
to T1 to execute first as it is entered the system first.In addition to the timestamp of a
transaction, this protocol also maintains the timestamp of last ‘read’ and ‘write’

7
operation on a data. Based on the timestamp of transaction and the data which it is
accessing a timestamp ordering protocol is defined.

7. ER diagram of University Registrar Office


The university registrar office maintains the data about the each class including
student enrolment number, department , grades record. And faculty details such as
department,email-id,phone number,gender.

Three Tier Architecture of Student Database

Three tier architecture shows the three levels:-


1. Physical Level:-Physical level describes the physical storage structure of data in
database. It is also known as Internal Level.
2. Conceptual Level:-Conceptual level describes the structure of the whole
database for a group of users. Conceptual schema is a representation of the entire
content of the database.
3. External Level:- External level is related to the data which is viewed by individual
end users. This level includes a no. of user views or external schemas.

8
9
8. ER Diagram for maintaining all patient visit to hospital including
their detail and billing

ID Name Disease

Visited Hospital
Patient
to

Bill By
Bill By

Department

Department

Treats

Type Room no

Treatment

Type Prescription

10
9. ER Diagram that show a relationship between employee and
organisation

Name
No of Emp

ID Add
Name Dep

Employee Worked at Organization

10. ER Diagram that show relationship between Student, course


and instructor

Name Code

ID Name Date
Age

Enroll
Student Course
By

Is Taught
BY

Name
ID Add

11
Instructor

Anda mungkin juga menyukai