0% found this document useful (0 votes)
22 views10 pages

DBMS Unit 1

The document discusses the roles and responsibilities of a database administrator (DBA). A DBA maintains, secures and operates databases, ensuring data is correctly stored and retrieved. Key tasks of a DBA include schema definition, storage structure definition, modifying schema and organization, granting data access authorization, and specifying integrity constraints.

Uploaded by

Aman Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views10 pages

DBMS Unit 1

The document discusses the roles and responsibilities of a database administrator (DBA). A DBA maintains, secures and operates databases, ensuring data is correctly stored and retrieved. Key tasks of a DBA include schema definition, storage structure definition, modifying schema and organization, granting data access authorization, and specifying integrity constraints.

Uploaded by

Aman Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

ATHARV GUPTA

Database Administrator(DBA)-responsible for maintaining,


securing and operating databases. Ensures data is correctly
stored and retrieved.
Work-
• Schema Definition
• Storage Structure and Access Method Definition
• Schema and Physical Organization Modification
• Granting of Authorization for Data Access
• Integrity Constraint Specification

File System vs DBMS

What are the different types of Data Models in DBMS?


Explain them.

1. Relational Data Model:


 Description: The relational data model represents data in tabular form,
where each table consists of rows (tuples) and columns (attributes). The
relationships between tables are established using keys.
 Key Concepts:
 Tables: Represent entities or relationships.
 Rows: Instances of entities or relationships.
 Columns: Attributes or properties of entities or relationships.
 Keys: Unique identifiers to establish relationships between
tables.
 Example: In a relational database, you might have tables for
"Customers" and "Orders," with relationships defined using customer
IDs and order IDs.
2. Entity-Relationship Model (ER Model):
 Description: The ER model represents data using entities, attributes,
and relationships. Entities are objects or concepts in the real world,
attributes describe properties, and relationships define connections
between entities.
 Key Concepts:
 Entities: Represent real-world objects or concepts.
 Attributes: Properties or characteristics of entities.
 Relationships: Connections between entities.
 Example: In a university database, you could have entities like
"Student" and "Course," with relationships defining how students are
enrolled in courses.
3. Object-Oriented Data Model:
 Description: The object-oriented data model represents data as
objects, similar to how it is done in object-oriented programming.
Objects have attributes and methods, and relationships between
objects are defined.
 Key Concepts:
 Objects: Instances of classes representing entities.
 Attributes: Properties of objects.
 Methods: Functions or operations associated with objects.
 Example: In an object-oriented database, you might have objects like
"Person" with attributes such as "Name" and "Age," along with
methods like "GetSalary."
4. Hierarchical Data Model:
 Description: In the hierarchical data model, data is organized in a tree-
like structure with a single root. Each node (record) has a parent-child
relationship, except for the root, which has no parent.
 Key Concepts:
 Nodes: Represent records or entities.
 Parent-Child Relationships: Define the hierarchical structure.
 Example: In a file system, the hierarchical structure can be represented
with directories (nodes) and files as children of directories.
5. Network Data Model:
 Description: The network data model is an extension of the
hierarchical model, allowing records to have multiple parents. This
model provides more flexibility in representing complex relationships.
 Key Concepts:
 Nodes: Represent records or entities.
 Parent-Child Relationships: Define the network structure.
 Sets: Groups of records.
 Example: In a network database, you might have records representing
"Employees" and "Projects," with multiple relationships indicating which
employees are assigned to different projects

Describe the three-schema architecture. Why do we


need mappings between
schema levels? How do different schema definition
languages support this

1. External Schema (User View):


 Represents user-specific views of the data.
 Customizable for different users or applications.
 Hides unnecessary details for simplicity.
 Multiple external schemas can coexist.
 Provides a high-level, user-tailored perspective.
2. Conceptual Schema (Logical View):
 Describes the entire database logically.
 Defines relationships and integrity constraints.
 Acts as an intermediary between user and physical views.
 Changes impact the overall database structure.
 Offers a platform-independent, abstract representation.
3. Internal Schema (Physical View):
 Defines physical storage and access details.
 Specifies storage structures and indexing.
 Transparent to higher-level schemas.
 Allows for performance optimizations.
 Changes are invisible to users and logical view.

Why Mappings Between Schema Levels are Needed:

 Abstraction and Independence: Allow changes at one level without affecting


others.
 Flexibility: Customize user views without altering database structure.
 Adaptation: Accommodate technology changes in storage and optimization.
 Maintenance: Simplify maintenance and evolution of the database system.

Schema Definition Languages:

 SQL: Widely used for defining both logical and user-specific schemas.
 XML: Expresses hierarchical relationships for conceptual schemas.
 DDL (Data Definition Language): Defines structures and constraints for both
conceptual and internal schemas.
 UML: Provides a graphical notation for conceptual schema modeling.
 JSON Schema: Defines JSON document structures, suitable for external
schemas.

Describe the classification of database language. Which


type of language is SQL ?

1. Data Definition Language (DDL):


 DDL is used to define the structure and schema of a database.
 It includes commands like CREATE, ALTER, RENAME and DROP, which
are used to create, modify, or delete database objects such as tables,
indexes, and views.
 DDL statements are typically executed by database administrators or
users with sufficient privileges.
2. Data Manipulation Language (DML):
 DML is used for managing data within the database.
 It includes commands like SELECT, INSERT, UPDATE, and DELETE, which
are used to retrieve, insert, modify, or delete data in the database.
 DML statements are commonly executed by application programs or
end-users to interact with the data.
3. Data Control Language (DCL):
 DCL is concerned with controlling access to data within the database.
 It includes commands like GRANT and REVOKE, which are used to
assign or revoke permissions and privileges on database objects.
 DCL statements are typically executed by database administrators to
manage security and access control.

SQL (Structured Query Language): SQL is a standardized programming language


specifically designed for managing and manipulating relational databases. SQL is not
limited to any one category but encompasses elements of all three types:

 DDL in SQL:
 SQL includes DDL statements for creating, altering, and dropping
database objects. For example:
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Salary DECIMAL(10, 2)
);
DML in SQL:
 SQL provides DML statements for querying, inserting, updating, and deleting
data. For example:
SELECT FirstName, LastName FROM Employees WHERE Salary > 50000;
DCL in SQL:
 SQL includes DCL statements for managing permissions and access control.
For example:
GRANT SELECT ON Employees TO user1;

(ek DQL bhi hota hai but usme bass SELECT hota hai – nothing imp)

Draw the overall structure of DBMS and explain its


components in brief.

The functional components of a database system can be broadly


divided into two components:
1. Storage Manager (SM): A storage manager is a program module
that provides the interface between the low level data stored in the
database and the application programs and queries submitted to the
system. The SM components include :
a. Authorization and integrity manager: It tests for the satisfaction
of integrity constraints and checks the authority of users to access
data.
b. Transaction manager: It ensures that the database remains in a
consistent state despite of system failures and that concurrent
transaction executions proceed without conflicting.
c. File manager: It manages the allocation of space on disk storage
and the data structures are used to represent information stored on
disk.
d. Buffer manager: It is responsible for fetching data from disk
storage into main memory and deciding what data to cache in main
memory. The buffer manager is a critical part of the database system,
since it enables the database to handle data sizes that are much larger
than the size of main memory.
2. Query Processor (QP): The Query Processor (Query Optimizer) is
responsible for taking every statement sent to SQL Server and figure
out how to get the requested data or perform the requested operation.
The QP components are :
a. DDL interpreter: It interprets DDL statements and records the
definition in data dictionary.
b. DML compiler: It translates DML statements in a query language
into an evaluation plan consisting of low-level instructions that the
query evaluation engine understands.
c. Query optimization: It picks the lowest cost evaluation plan from
among the alternatives.
d. Query evaluation engine: It executes low-level instructions
generated by the DML compiler
Describe Mapping Constraints and its types

In an Entity-Relationship Model, when dealing with two sets of entities known as


Binary sets, there are four types of Mapping Constraints that can exist. These
Mapping Constraints can be represented as follows:

1. One to One (1:1):


 Definition: Each entity in the first table is related to exactly one entity
in the second table, and vice versa.
 Example: An employee has only one corresponding record in a
personal details table.
2. One to Many (1:M):
 Definition: Each entity in the first table can be related to multiple
entities in the second table, but each entity in the second table is
related to only one entity in the first table.
 Example: A professor can teach multiple courses, but each course is
taught by only one professor.
3. Many to One (M:1):
 Definition: Multiple entities in the first table can be related to a single
entity in the second table.
 Example: Multiple orders can be associated with a single custom er.
4. Many to Many (M:M):
 Definition: Multiple entities in the first table can be
related to multiple entities in the second table, and
vice versa.
 Example: Multiple students can enroll in multiple
courses, and each course can have multiple enrolled
students.

Define key. Explain various types of keys in dbms

A key is a field or set of fields that uniquely identifies a record within a


table. Keys play a crucial role in establishing relationships between
tables, ensuring data integrity, and facilitating efficient data retrieval.

Super key:
• Set of attributes using which we can identify each tuple uniquely is
called Super
key.
• Let X be a set of attributes in a Relation R , if X+(Closure of X)
determines all
attributes of R then X is said to be Super key of R .
• There should be at least one Super key in every relation

Candidate key:
• Minimal set of attributes using which we can identify each tuple uniquely
is
called Candidate key. A super key is called candidate key if it’s No proper
subset
is a super key. Also called as MINIMAL SUPER KEY.
• There should be at least one candidate key.

[Prime attribute - Attributes that are member of at least one


candidate Keys are called Prime attributes.]

Primary key:
• One of the candidate keys is selected by database administrator as a
Primary
means to identify tuple is called primary Key. Primary Key attribute are
not
allowed to have Null values. Exactly one Primary Key per table in RDMS.
• Candidate key which are not chosen as primary key is alternate key

Foreign Keys:
• A foreign key is a column or group of columns in a relational database
table that
refers the primary key of the same table or some other table to represent
relationship.
• The concept of referential integrity is derived from foreign key theory

Explain generalization, specialization and aggregation.


Generalization
• Involves merging two lower-level entities to create a higher-level entity.
• A bottom-up approach that builds complexity from simpler components.
• Highlights similarities among lower-level entity sets while hiding
differences.
• Leads to a simplified, structured data representation, aiding in database
design
and querying processes.
Specialization
• A process where a higher-level entity is broken down into more specific,
lower-level entities.
• This top-down approach delineates complexity into simpler components.
• Acts as the converse of the generalization process, focusing on
differentiating
properties rather than similarities.

Aggregation
• A concept wherein relationships are abstracted to form higher-level
entities, enabling a more organized representation of complex
relationships

You might also like