0% found this document useful (0 votes)
2 views

DMS

The document contains a series of questions and answers related to database management systems (DBMS), covering topics such as data independence, cardinality, database administration roles, entity types, and SQL commands. It also discusses the differences between weak and strong entities, features of network models versus relational models, and basic relational operations with examples. Additionally, it explains DDL, DML, DCL, and TCL in the context of database management.

Uploaded by

mailme9051
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

DMS

The document contains a series of questions and answers related to database management systems (DBMS), covering topics such as data independence, cardinality, database administration roles, entity types, and SQL commands. It also discusses the differences between weak and strong entities, features of network models versus relational models, and basic relational operations with examples. Additionally, it explains DDL, DML, DCL, and TCL in the context of database management.

Uploaded by

mailme9051
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

DMS NOTES

The ability to modify the internal schema without causing any change to
external schema is:

(a) External data independency

(b) Logical data Independency

(c) Physical data Independency

(d) none of these

Cardinality ratio means:

(a) Number of attributes associated with an entity.

(b) Number of relations of an entity-relationship diagram

(c) A ratio between Number of relations and Number of entities of an ER


diagram.

(d) Number of relationship instances in which the entity can participate.

is the information about data:

(a) Data (b) Meta-data (c) Entity (d) Relations

1. DBA is a:

(a) Software

(b) Hardware

(c) Person

(d) Others
2. The DML provides following function access to the database:

(a) Retrieve data and/or records

(b) Add (or Insert) records

(c) Delete records from database files

(d) All of these

3. Aggregation is:

(a) Specialization

(b) generalization

(c) Abstraction

(d) All of these

4. Prime attributes are part of:

(a) Primary domain

(b) Multivalued domain

(c) Candidate key

(d) None of these.

5. The command used to delete the records from a table is:

(a) Truncate

(b) Drop

(c) Select

(d) All of these.


6. Which of the following makes the transaction permanent in the
database?

(a) View

(b) Rollback

(c) Commit (d) Flashback

7. Which of the following is not an Aggregate function?

(a) Min

(b) Max

(c) Select

(d) Avg

11. Cardinality ratio means:


(a) Number of attributes associated with an entity.
(b) Number of relations of an entity-relationship diagram
(c) A ratio between Number of relations and Number of entities of an ER
diagram.
(d) Number of relationship instances in which the entity can
participate
12. Three DDL commands:
(a) CREATE, ALTER, DELETE
(b) INSERT, UPDATE, DELETE
(c) CREATE, UPDATE, DROP

(d) CREATE, ALTER, DROP

13. An entity set that does not have sufficient attributes to form a
primary key is a:
(a) Strong entity set
(b) Weak entity set

(c) Simple entity set

(d) Primary entity set

14. In a relational data model, columns of a model are called:


(a) Relation
(b) Tuple

(c) Attribute

(d) Degree.

15. SELECT operation in SQL is a:


(a) Data query language
(b) Data definition language

(c) Data manipulation language

(d) Data control language.

16. The information about data in a database is called:

(a) Meta data

(b) Teradata

(c) Hyper data

(d) None of these.

(i) ___________ is a ‘thing’ in the real world with an independent existence

a) Entity
b) Attribute

c) Key
d) Relationship.
Explain the roles of a database administrator (DBA)

1. Database Design and Implementation: Designing and setting up the


database structure.
2. Performance Tuning: Monitoring and optimizing database
performance.
3. Security Management: Managing user access and implementing
security measures.
4. Backup and Recovery: Planning and executing data backup and
recovery procedures.
5. Data Integrity and Consistency: Enforcing rules to ensure data
accuracy and consistency.
6. Database Maintenance: Performing regular maintenance tasks to
ensure smooth operation.
7. Support and Troubleshooting: Providing user support and resolving
database-related issues.
8. Database Migration and Upgrades: Managing database migrations
and upgrades.

Write down the differences between Weak and Strong Entity.

Aspect Weak Entity Strong Entity

Can exist independently


Existence Cannot exist without being
without needing any other
Dependency associated with a strong entity
entity

Does not have a primary key of its


Key Attribute Has its own primary key
own

Identified by combining its partial


Identified solely by its own
Identification key and the primary key of the
primary key
strong entity
Always associated with a strong Can exist without being related
Relationship
entity through a foreign key to other entities

An Employee or Product
Example An OrderItem in an Order entity
entity

List four significant differences between a file management system and a


DBMS.

Aspect File Management System DBMS

Data
High data redundancy and Minimal data redundancy and high
Redundancy
inconsistency due to lack of consistency through normalization
and
normalization and constraints
Consistency

Limited access control and


Robust access control, user
Data Access security features; manual
authentication, and security
and Security management of file
mechanisms
permissions

Requires custom scripts or Supports powerful query


Data
programs for data languages like SQL for efficient
Manipulation
manipulation; less efficient data manipulation

Automated backup and recovery


Backup and Manual backup processes and
processes ensuring data integrity
Recovery cumbersome recovery
and quick recovery

Explain the difference among primary key, candidate key and super key

1. Primary Key:
a. A primary key is a unique identifier for a record in a table.
b. It ensures that no two records have the same value for the
primary key attribute.
c. A primary key cannot contain NULL values.
d. Example: In a table of students, the StudentID can be the
primary key as it uniquely identifies each student.
2. Candidate Key:
a. A candidate key is a set of attributes that can uniquely identify a
record in a table.
b. There can be multiple candidate keys in a table.
c. Every candidate key can serve as a potential primary key.
d. Example: In a table of students, both StudentID and Email can
be candidate keys as they uniquely identify each student.
3. Super Key:
a. A super key is a set of attributes that can uniquely identify a
record in a table.
b. A super key can include one or more attributes.
c. All candidate keys and primary keys are super keys, but not all
super keys are candidate keys (super keys can have extra
attributes).
d. Example: In a table of students, {StudentID, Email} and
{StudentID, Name} can be super keys as they uniquely identify
each student, but they are not minimal like candidate keys.

Explain alternate key with an example

Alternate Key:

• An alternate key is a candidate key that is not chosen as the primary key
of a table.
• It can uniquely identify records in the table but serves as an alternative
to the primary key.

Example:

In an Employee table:

• EmployeeID (Primary Key)


• Email (Alternate Key)
• PhoneNumber (Alternate Key)

Both Email and PhoneNumber can uniquely identify employees but are not
the primary key.

Explain specialization, generalization and aggregation.

1. Specialization:
a. Specialization is the process of defining a set of subclass entities
from a superclass entity based on some distinguishing
characteristics.
b. In specialization, an entity type is divided into subtypes that have
their unique attributes or relationships in addition to those
inherited from the parent entity.
c. Example: In a database, if we have a Person entity, we can
specialize it into Employee and Customer entities. Each of these
sub-entities will have attributes specific to them, such as Salary
for Employee and PurchaseHistory for Customer.
2. Generalization:
a. Generalization is the reverse process of specialization. It is the
process of combining multiple entity types into a higher-level
generic entity type based on common characteristics.
b. In generalization, common attributes or relationships of lower-
level entities are abstracted into a higher-level entity.
c. Example: If we have Car and Bike entities, we can generalize
them into a Vehicle entity, capturing the common attributes like
Make, Model, and EngineCapacity.
3. Aggregation:
a. Aggregation is a modeling concept used to express a relationship
between a whole and its parts, or to represent a "has-a"
relationship between entities.
b. In aggregation, a higher-level entity is formed by grouping related
lower-level entities, showing how they collectively represent a
more complex entity.
c. Example: In a university database, an Instructor entity and a
Course entity can be aggregated to form a TeachingAssignment
entity, which represents the assignment of instructors to courses.

Describe entities, attributes, relationship and discriminator, existence


dependencies

1. Entities:
a. An entity is a distinct object or "thing" in the real world that can be
identified and has an independent existence. In the context of
databases, entities are typically represented as tables, with each
row corresponding to an instance of the entity.
b. Example: In a database for a school, Student, Teacher, and
Course are entities.
2. Attributes:
a. Attributes are the properties or characteristics of an entity that
provide more details about it. Each attribute corresponds to a
column in a table, and each entity instance has values for these
attributes.
b. Example: For the Student entity, attributes could include
StudentID, Name, DateOfBirth, and Address.
3. Relationships:
a. Relationships define how entities are related to each other. They
describe the associations between different entities and can be
one-to-one, one-to-many, or many-to-many.
b. Example: In a school database, there could be a relationship
between the Student and Course entities, indicating which
students are enrolled in which courses.
4. Discriminator:
a. A discriminator is an attribute used to distinguish between
different subtypes of an entity in a database. It is often used in the
context of inheritance, where a single table is used to store
information about different but related entities.
b. Example: In a Person entity that includes both Employee and
Customer, a Type attribute could be used as a discriminator to
indicate whether a record represents an Employee or a
Customer.
5. Existence Dependencies:
a. Existence dependency refers to the relationship between entities
where the existence of one entity depends on the existence of
another entity. Typically, a weak entity is existence-dependent on
a strong entity.
b. Example: An OrderItem entity is existence-dependent on an
Order entity because an order item cannot exist without being
part of an order.

Explain the derived attribute and composite attribute with an example.

• Derived Attribute: An attribute whose value is calculated from other


attributes in the database. It is not stored directly.
o Example: Age can be derived from DateOfBirth.

• Composite Attribute: An attribute that can be divided into smaller,


meaningful components.
o Example: Address can be divided into Street, City, State, and
ZipCode.

Write down the differences between Weak and Strong Entity.

Sure! Here are the differences between Weak and Strong Entities in table
form:
Aspect Weak Entity Strong Entity

Can exist independently


Cannot exist without being
Existence Dependency without needing any
associated with a strong entity
other entity

Does not have a primary key of its


own; identified by a combination of
Key Attribute Has its own primary key
its partial key and a strong entity's
primary key

Relies on the primary key of a Identified solely by its


Identification
strong entity for identification own primary key

Always associated with a strong Can exist without being


Relationship
entity through a foreign key related to other entities

An Employee or
Example An OrderItem in an Order entity
Product entity

Write the features of network model. Compare network model and


relational model

Features of Network Model:

• Complex Relationships: Supports many-to-many relationships.


• Data Integrity: Maintains parent-child relationships.
• Efficiency: Direct access to linked records.
• Data Redundancy: Minimizes redundancy.
• Navigational Access: Uses pointers for data traversal.
• Flexibility: Models real-world scenarios better.
• Data Independence: Supports physical and logical data
independence.

Comparison of Network Model and Relational Model:

Aspect Network Model Relational Model

Graph structure with nodes Table-based structure with rows


Structure
and edges and columns

Supports complex many-to- Primarily supports one-to-many


Relationships
many relationships relationships

Navigational access using


Data Access Declarative access using SQL
pointers

Maintains parent-child Ensures integrity with primary and


Data Integrity
relationships foreign keys

More flexible for complex


Flexibility Simpler and more intuitive
scenarios

Query Language No standard query language Standardized query language (SQL)

Generally efficient for a wide range


Performance Efficient for certain queries
of queries

Tuple Relational Calculus, ER diagram, Basic relational operations –


SHORT NOTE WITH EXAMPLES

Tuple Relational Calculus (TRC):

Tuple Relational Calculus (TRC) is a non-procedural query language used to


specify queries on a relational database. It focuses on describing what to
retrieve rather than how to retrieve it. Queries in TRC are expressed using
tuples and predicate logic. The result of a TRC query is a set of tuples that
satisfy the given conditions.
Example:

• To find the names of employees working in the 'Research' department:


$$ { t \ | \ t \in EMP \ \land \ \exists d \ (d \in DEPT \ \land \ d.D_name =
'Research' \ \land \ t.D_no = d.D_no) } $$

ER Diagram (Entity-Relationship Diagram):

An ER Diagram (ERD) is a graphical representation of an entity-relationship


model, used to design and visualize the structure of a database. It shows
entities, attributes, and relationships between entities. Entities are
represented by rectangles, attributes by ovals, and relationships by
diamonds.

Example:

• An ER Diagram for a simple student-course database may include


entities like Student and Course, attributes like StudentID, Name,
CourseID, CourseName, and a relationship like Enrolled.

Basic Relational Operations:

Relational operations are the fundamental operations used to manipulate


and query relational databases. They include selection, projection, join,
union, difference, and Cartesian product.

Examples:

1. Selection (σ): Retrieves rows that satisfy a given condition.


a. $$ \sigma_{D_name = 'Research'} (DEPT) $$
b. Retrieves departments with the name 'Research'.
2. Projection (π): Retrieves specific columns from a table.
a. $$ \pi_{E_name, E_add} (EMP) $$
b. Retrieves employee names and addresses.
3. Join (⨝): Combines rows from two tables based on a related column.
a. $$ EMP \bowtie_{D_no} WORKS_NO $$
b. Combines employee details with their respective department
numbers.
4. Union (∪): Combines the results of two queries, removing duplicates.
a. $$ \pi_{E_name} (EMP1) \cup \pi_{E_name} (EMP2) $$
b. Retrieves names of employees from two different tables.
5. Difference (−): Retrieves rows from one table that are not in another.
a. $$ \pi_{E_name} (EMP1) - \pi_{E_name} (EMP2) $$
b. Retrieves names of employees in EMP1 but not in EMP2.
6. Cartesian Product (×): Combines every row of one table with every row
of another.
a. $$ EMP \times DEPT $$
b. Retrieves all possible combinations of employees and
departments.

Explain DDL, DML, DCL and TCL.

Sure! Here are short explanations for DDL, DML, DCL, and TCL:

Data Definition Language (DDL):

• Defines and manages database schema objects.


• Commands: CREATE, ALTER, DROP.
• Example: CREATE TABLE Students (StudentID INT, Name
VARCHAR(50), Age INT);

Data Manipulation Language (DML):

• Manipulates data in the database.


• Commands: INSERT, UPDATE, DELETE, SELECT.
• Example: INSERT INTO Students (StudentID, Name, Age)
VALUES (1, 'John Doe', 20);
Data Control Language (DCL):

• Manages permissions and access rights.


• Commands: GRANT, REVOKE.
• Example: GRANT SELECT ON Students TO User1;

Transaction Control Language (TCL):

• Manages transactions to maintain data integrity.


• Commands: COMMIT, ROLLBACK, SAVEPOINT.
• Example: COMMIT;

Explain how GROUP BY, HAVING and WHERE can be used in same SQL
query.

SELECT EmployeeID, SUM(SaleAmount) AS TotalSales

FROM Sales

WHERE SaleDate BETWEEN '2025-01-01' AND '2025-12-31'

GROUP BY EmployeeID

HAVING SUM(SaleAmount) > 10000;

Differentiate between Tuple Relational Calculus (TRC) and Domain


Relational Calculus (DRC)

Sure! Here is an expanded table with additional points comparing Tuple


Relational Calculus (TRC) and Domain Relational Calculus (DRC):

Tuple Relational Calculus


Aspect Domain Relational Calculus (DRC)
(TRC)

Query Basis Based on tuples Based on domains (attributes)


Specifies variables Specifies variables representing
Syntax
representing tuples attribute values

Variable
Variables bound to tuples Variables bound to attribute values
Binding

Suitable for querying entire Suitable for querying specific


Use Case
tuples attribute values

Result Type Returns a set of tuples Returns a set of domain values

Generally simpler and more Can be more complex due to


Complexity
intuitive multiple attribute variables

Uses existential and universal Uses existential and universal


Quantifiers
quantifiers quantifiers

Focuses on individual attribute


Evaluation Focuses on tuples as a whole
values

You might also like