21bcs2008 Prashant Kumar Singh Assignment 1
21bcs2008 Prashant Kumar Singh Assignment 1
Data Independence is defined as a property of DBMS that helps you to change the Database schema
at one level of a database system without requiring to change the schema at the next higher level. Data
independence helps to keep data separated from all programs that make use of it.
Physical data independence helps to separate conceptual levels from the internal/physical levels. It
provide a logical description of the database without the need to specify physical structures.
Compared to Logical Independence, it is easy to achieve physical data independence.
Logical Data Independence is defined as the ability to make changes in the structure of the middle
level of the Database Management System (DBMS) without affecting the highest-level schema or
application programs. Hence, modification in the logical level should not result in any changes in
the view levels or application programs.
Question no2:- Write at least Five advantages of DBMS over traditional file based systems.
Data redundancy and inconsistency: Redundancy is the concept of repetition of data i.e. each
data may have more than a single copy. The file system cannot control the redundancy of data
as each user defines and maintains the needed files for a specific application to run. There may
be a possibility that two users are maintaining the data of the same file for different
applications. Hence changes made by one user do not reflect in files used by second users,
which leads to inconsistency of data. Whereas DBMS controls redundancy by maintaining a
single repository of data that is defined once and is accessed by many users. As there is no or
less redundancy, data remains consistent.
Data sharing: The file system does not allow sharing of data or sharing is too complex.
Whereas in DBMS, data can be shared easily due to a centralized system.
SUBJECT NAME-Fundamentals of Computer Programming SUBJECT CODE-21CSH101
Data concurrency: Concurrent access to data means more than one user is accessing the same
data at the same time. Anomalies occur when changes made by one user get lost because of
changes made by another user. The file system does not provide any procedure to stop
anomalies. Whereas DBMS provides a locking system to stop anomalies to occur.
Data searching: For every search operation performed on the file system, a different
application program has to be written. While DBMS provides inbuilt searching operations. The
user only has to write a small query to retrieve data from the database.
Data integrity: There may be cases when some constraints need to be applied to the data before
inserting it into the database. The file system does not provide any procedure to check these
constraints automatically. Whereas DBMS maintains data integrity by enforcing user-defined
constraints on data by itself.
System crashing: In some cases, systems might have crashed due to various reasons. It is a
bane in the case of file systems because once the system crashes, there will be no recovery of
the data that’s been lost. A DBMS will have the recovery manager which retrieves the data
making it another advantage over file systems.
Data security: A file system provides a password mechanism to protect the database but how
long can the password be protected? No one can guarantee that. This doesn’t happen in the case
of DBMS. DBMS has specialized features that help provide shielding to its data.
Backup: It creates a backup subsystem to restore the data if required.
Interfaces: It provides different multiple user interfaces like graphical user interface and
application program interface.
Easy Maintenance: It is easily maintainable due to its centralized nature.
Question no3:- Show the use of UNION and INTERSECT operator using relations.
UNION is used to combine the results of two or more select statements. However it will eliminate
duplicate rows from its resultset. In case of union, number of columns and datatype must be same in
both the tables, on which UNION operation is being applied.
Intersect operation is used to combine two select statements, but it only retuns the records which are
common from both select statements. In case of Intersect the number of columns and datatype must
be same.