dbms noes
dbms noes
dbms noes
UNIT 1 notes: -
Ans. 1. Data:
Definition: Data refers to raw, unprocessed facts and figures that do not have any specific
meaning or context on their own.
Example: Numbers like 123, 45.67, or a string like John Doe are examples of data.
2. Information:
Definition: Information is processed or organized data that has meaning and can be used for
decision-making. It is data put into context.
Example: If you have a table showing 123 as the ID, John Doe as the name, and 45.67 as the
balance, this becomes meaningful information.
3. Records:
Definition: A record is a collection of related data items (fields) that are treated as a unit. In a
database, a record typically corresponds to a row in a table.
Example: In a table of customer data, a record might include fields such as Customer ID,
Name, Address, and Phone Number, all related to a single customer.
4. Files:
Definition: A file is a collection of records. In the context of a DBMS, a file usually represents
a table in which each record is a row, and each field within a record is a column.
Example: A file might be a database table storing all customer records, where each row in
the file corresponds to a customer.
1. File-Based Approach:
Definition: In a traditional file-based system, data is stored in flat files, and each application
program manages its own files. These systems were used before the advent of DBMS.
Structure: The data is stored in separate files, often specific to particular applications. Each
file might represent different entities, such as a customer file, an inventory file, or an
employee file.
Access: To access or manipulate the data, custom application programs are written. These
programs perform operations like reading, writing, updating, and deleting data within the
files.
Duplication of Data: The same data might be duplicated in multiple files because each
application has its own set of files.
Fixed Structure: Files often have a fixed format, meaning that changing the structure of the
data (e.g., adding a new field) can be challenging.
Explanation: Since data is often duplicated across multiple files, there is a high
chance of redundancy. This can lead to inconsistencies if one instance of the data is
updated while others are not.
Example: If a customer’s address is stored in multiple files (e.g., in a billing file and a
shipping file), and it is updated in only one of them, the system ends up with
inconsistent data.
Example: To generate a report that involves data from multiple files, a programmer
must write a custom program to extract and combine the data.
Example: If a record in one file references data in another, there's no guarantee that
the referenced data exists, leading to potential integrity issues.
Example: If two users try to update the same file at the same time, it can lead to
conflicts or data corruption.
5. Poor Security:
Example: If someone has access to the file, they might be able to see or modify all
the data within it, even if they shouldn’t have access to certain parts.
Ans.
1. Database Administrator
Database administrator is a user who is responsible for administering the resources of the database
and is also responsible for authorizing the access to the database.
2. Database designers
This type of user is responsible for identifying the data to be stored in the database for choosing
appropriate structure to represent and store theses data.
3. End users
This type of users are the people whose job is to access to the database for querying, updating and
generating reports. End users are of four types.
b. Naive or parametric end users - uses some standard types of queries and updates
4. System Analyst and Application Programmer System analysts determine the requirements of the
end users, and develop specifications for canned transactions that meet these requirements.
Application programmers implement these specifications as programs and test, debug, document
and maintain these canned transactions.
Advantages and disadvantages of DBMS
1. Controlling of Redundancy: Data redundancy refers to the duplication of data (i.e storing same
data multiple times). In a database system, by having a centralized database and centralized control
of data by the DBA the unnecessary duplication of data is avoided. It also eliminates the extra time
for processing the large volume of data. It results in saving the storage space.
2. Improved Data Sharing : DBMS allows a user to share the data in any number of application
programs.
3. Data Integrity : Integrity means that the data in the database is accurate. Centralized control of the
data helps in permitting the administrator to define integrity constraints to the data in the database.
For example: in customer database we can can enforce an integrity that it must accept the customer
only from Noida and Meerut city.
4. Security : Having complete authority over the operational data, enables the DBA in ensuring that
the only mean of access to the database is through proper channels. The DBA can define
authorization checks to be carried out whenever access to sensitive data is attempted.
5. Data Consistency : By eliminating data redundancy, we greatly reduce the opportunities for
inconsistency. For example: is a customer address is stored only once, we cannot have disagreement
on the stored values. Also updating data values is greatly simplified when each value is stored in one
place only. Finally, we avoid the wasted storage that results from redundant data storage.
6. Efficient Data Access : In a database system, the data is managed by the DBMS and all access to
the data is through the DBMS providing a key to effective data processing
7. Enforcements of Standards : With the centralized of data, DBA can establish and enforce the data
standards which may include the naming conventions, data quality standards etc.
8. Data Independence : Ina database system, the database management system provides the
interface between the application programs and the data. When changes are made to the data
representation, the meta data obtained by the DBMS is changed but the DBMS is continues to
provide the data to application program in the previously used way. The DBMs handles the task of
transformation of data wherever necessary.
9. Reduced Application Development and Maintenance Time : DBMS supports many important
functions that are common to many applications, accessing data stored in the DBMS, which
facilitates the quick development of application.
Disadvantages of DBMS
1) It is bit complex. Since it supports multiple functionality to give the user the best, the underlying
software has become complex. The designers and developers should have thorough knowledge
about the software to get the most out of it.
2) Because of its complexity and functionality, it uses large amount of memory. It also needs large
memory to run efficiently.
3) DBMS system works on the centralized system, i.e.; all the users from all over the world access this
database. Hence any failure of the DBMS, will impact all the users.
4) DBMS is generalized software, i.e.; it is written work on the entire systems rather specific one.
Hence some of the application will run slow.
DBMS languages
A database system provides a Data Definition Language (DDL) to specify the database schema and a
Data Manipulation Language (DML) to express database queries and updates. In practice, the data
definition and data manipulation languages are not two separate languages; instead, they simply
form parts of a single database language, such as the widely used SQL language. Additionally, SQL
includes Data Control Language (DCL) for managing access permissions, Data Query Language (DQL)
for querying data, and Transaction Control Language (TCL) for handling transaction management,
making it a comprehensive tool for all database operations.
A Data Definition Language (DDL) is a language used to define the database structure or schema. DDL
allows users to create and modify the structure of database objects, such as tables, indexes, and
views. The main operations performed by DDL are:
Creation of database objects: Establishes tables, indexes, views, and other structures within
the database.
Modification of database objects: Alters the structure of existing database objects, such as
adding or modifying columns in a table.
Deletion of database objects: Removes tables, indexes, or other structures from the
database. DDL commands do not manipulate the data itself but rather define the structure
and organization of the data within the database. Once executed, DDL statements take effect
immediately, and the changes they make are often irreversible without additional DDL
commands. DDL is an essential component of database management, laying the foundation
upon which data manipulation and querying occur.
Data-Manipulation Language
A data-manipulation language (DML) is a language that enables users to access or manipulate data
as organized by the appropriate data model. The types of access are:
There are basically two types: • Procedural DMLs require a user to specify what data are needed and
how to get those data.
• Declarative DMLs (also referred to as nonprocedural DMLs) require a user to specify what data are
needed without specifying how to get those data. Declarative DMLs are usually easier to learn and
use than are procedural DMLs. However, since a user does not have to specify how to get the data,
the database system has to figure out an efficient means of accessing 13 data. A query is a statement
requesting the retrieval of information. The portion of a DML that involves information retrieval is
called a query language
A Data Query Language (DQL) is a subset of SQL used specifically for querying and retrieving data
from the database. The primary command in DQL is the SELECT statement, which allows users to
specify what data they wish to retrieve from one or more tables. The main purposes of DQL are:
Retrieving specific data: Extracts specific information from the database based on conditions
set by the user.
Sorting and filtering: Orders and filters the retrieved data to match specific criteria.
Aggregating data: Summarizes data, such as calculating sums, averages, or counts. DQL is
declarative, meaning users specify what data they need without detailing how to retrieve it.
The database system interprets the query and determines the most efficient way to execute
it. DQL is a powerful tool for accessing data and is central to the interaction between users
and the database.
A Data Control Language (DCL) is used to control access to data within the database. It allows
database administrators to grant and revoke privileges to users or roles, determining who can access
or modify specific data. The primary functions of DCL are:
Granting permissions: Assigns specific privileges to users or roles, such as the ability to
SELECT, INSERT, UPDATE, or DELETE data.
A Transaction Control Language (TCL) is used to manage transactions within a database, ensuring
that operations are executed in a reliable and consistent manner. TCL commands control the
behavior of transactions, which are sequences of operations that must be executed as a single unit.
The primary functions of TCL are:
Committing transactions: Saves all changes made during the transaction, making them
permanent.
Rolling back transactions: Reverts all changes made during the transaction, undoing the
operations if an error occurs.
Setting savepoints: Marks a point within a transaction to which you can roll back without
affecting the entire transaction.
Releasing savepoints: Removes a savepoint, preventing rollback to that point. TCL ensures
that transactions either complete fully or not at all, preserving data consistency and integrity.
This is essential in multi-user environments where simultaneous operations could lead to
conflicts or data corruption without proper transaction control.