0% found this document useful (0 votes)
10 views5 pages

DBMS Question Bank

The document outlines key concepts related to database management systems (DBMS), including the roles of users such as Database Administrators and End Users, as well as important terms like Decomposition, Normal Forms, and Foreign Keys. It also explains data abstraction levels, differences between generalization and specialization, and various types of attributes in database design. Additionally, it covers SQL commands and functions, including DDL and DML, along with examples of nested subqueries and aggregate functions.

Uploaded by

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

DBMS Question Bank

The document outlines key concepts related to database management systems (DBMS), including the roles of users such as Database Administrators and End Users, as well as important terms like Decomposition, Normal Forms, and Foreign Keys. It also explains data abstraction levels, differences between generalization and specialization, and various types of attributes in database design. Additionally, it covers SQL commands and functions, including DDL and DML, along with examples of nested subqueries and aggregate functions.

Uploaded by

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

Here are the answers to your questions:

a) Users of DBMS:

1. Database Administrator (DBA): Responsible for managing and maintaining the database
system, including its security, performance, and integrity.

2. Database Designer: Responsible for designing the database schema, including the structure
of tables, relationships, and constraints.

3. End Users: Individuals who interact with the database to retrieve or update data. End users
can be casual users (non-technical) or sophisticated users (technical, like analysts).

4. Application Programmers: Developers who write software applications that access the
database for performing specific tasks.

5. System Administrators: Oversee the overall database system's operations, ensuring


hardware and software are functioning properly.

b) Decomposition: Decomposition in database design refers to the process of breaking a complex


relation (or table) into simpler, smaller relations (or tables). This is done to eliminate redundancy,
avoid anomalies, and ensure the database is normalized.

c) Second Normal Form (2NF): A table is in Second Normal Form (2NF) if:

1. It is in First Normal Form (1NF) (i.e., it has no repeating groups and each attribute contains
atomic values).

2. Every non-prime attribute is fully functionally dependent on the primary key. In other
words, no non-prime attribute depends on part of a composite primary key.

d) Domain of an Attribute: The domain of an attribute refers to the set of allowable values that an
attribute can take. It defines the type of data (such as integer, string, date, etc.) that can be stored in
a specific column of a table.

e) Entity: An entity is any object, person, place, event, or concept in the real world that is
represented in a database. An entity can be physical (like a student or product) or conceptual (like an
order or a transaction).

f) Foreign Key: A foreign key is an attribute or a set of attributes in one table that refers to the
primary key in another table. It is used to establish and enforce a link between the data in the two
tables, ensuring referential integrity.

g) DDL (Data Definition Language): DDL is a subset of SQL that is used to define and manage the
structure of a database, including creating, altering, and dropping tables, indexes, and other
database objects. Common DDL commands include CREATE, ALTER, DROP, and TRUNCATE.

h) View: A view is a virtual table in a database, created by a query that selects data from one or more
tables. It does not store data physically but provides a way to access data in a structured format.
Views can simplify complex queries and enhance security by restricting access to certain columns or
rows.

i) Two Aggregate Functions in SQL:

1. COUNT(): Counts the number of rows in a specified column or the entire table.
2. SUM(): Adds up the values of a specified numeric column.

j) Right Outer Join: A Right Outer Join (or simply Right Join) returns all the rows from the right table
and the matching rows from the left table. If there is no match, NULL values are returned for columns
of the left table.

Here are the answers to your questions:

a) Difference between Strong Entity and Weak Entity:

Feature Strong Entity Weak Entity

A strong entity is an entity that can A weak entity cannot exist without being
Definition exist independently in the database associated with a strong entity and does
and has a primary key. not have a primary key.

Weak entities do not have a primary key of


Strong entities have their own primary
Primary Key their own; they rely on the primary key of
key.
the related strong entity.

Existence Strong entities are independent of Weak entities depend on a strong entity
Dependency other entities. for their existence.

Student (with attributes such as Course Enrollment (which depends on


Example
Student_ID, Name) both Student_ID and Course_ID)

b) Functional Dependency: A functional dependency (FD) is a relationship between two sets of


attributes in a relational database. It occurs when one attribute or a group of attributes uniquely
determines the value of another attribute. For example, if A → B, it means that for each value of A,
there is a corresponding value of B.

• Example: If we have a table where Student_ID determines Student_Name, the functional


dependency can be written as:

• Student_ID → Student_Name

This means for each Student_ID, there is exactly one Student_Name.

c) Query Languages: Query languages are used to make queries (requests) to retrieve or manipulate
data from a database. They allow users to interact with the database. The most common query
language is SQL (Structured Query Language), which allows users to perform operations such as data
retrieval (using SELECT), insertion (INSERT), update (UPDATE), and deletion (DELETE).

d) DML (Data Manipulation Language): DML is a subset of SQL used to retrieve, insert, update, or
delete data in a database. It deals with the manipulation of data, rather than the structure of the
database.

• Example of DML:

• INSERT INTO Students (Student_ID, Student_Name, Age)

• VALUES (1, 'John Doe', 20);

This SQL statement adds a new record (a student) into the Students table.
e) Nested Subquery: A nested subquery is a query that is embedded within another query. The
result of the inner query (subquery) is used by the outer query. Subqueries can be used in SELECT,
INSERT, UPDATE, or DELETE statements.

Example of a Nested Subquery:

SELECT Student_Name

FROM Students

WHERE Student_ID IN (SELECT Student_ID

FROM Enrollments

WHERE Course_ID = 'CS101');

In this example:

• The inner query (SELECT Student_ID FROM Enrollments WHERE Course_ID = 'CS101')
retrieves the Student_IDs of students enrolled in the course CS101.

• The outer query then retrieves the Student_Name for each Student_ID found by the inner
query.

Here are the answers to your questions:

a) What is Data Abstraction? What are the Different Levels of Data Abstraction?

Data Abstraction is the process of hiding the complexities of data storage and focusing on the
essential features. In database management systems (DBMS), data abstraction refers to the
separation of the logical view of data from its physical storage. It allows users to interact with the
data without needing to understand how it's stored or how operations are performed.

There are three levels of data abstraction:

1. Physical Level:

o This is the lowest level of data abstraction and describes how the data is physically
stored in the database (e.g., file formats, indexing, storage paths).

o Users and application developers do not interact with this level directly.

2. Logical Level:

o The logical level describes what data is stored in the database, the structure of the
data (e.g., tables, relationships), and constraints (e.g., primary keys, foreign keys).

o It provides a conceptual view of the data, which is independent of how it is physically


stored.

3. View Level:

o The view level is the highest level of abstraction and describes how the data is
viewed by different users.

o It provides specific user perspectives or subsets of the data (e.g., different views of
the same data for different roles or permissions).
o It does not expose the underlying structure of the data but only a relevant subset for
a specific user or application.

b) Differentiate between Generalization and Specialization

Generalization and Specialization are both processes used in Entity-Relationship (ER) modeling to
handle hierarchies and abstraction.

Feature Generalization Specialization

Specialization is the process of dividing a


Generalization is the process of combining
higher-level entity into lower-level
Definition multiple lower-level entities into a higher-
entities based on specific characteristics
level entity that has common attributes.
or roles.

A Person entity might be generalized into


A Vehicle entity might be specialized into
a Student and Teacher entity, as both
Example Car, Bike, and Truck entities, each having
share common attributes (e.g., name,
distinct attributes.
address).

Used to create a generalized entity from


Used to create specific entities from a
Purpose several specific entities to reduce
general entity to capture more details.
redundancy.

Bottom-up approach: starts with specific Top-down approach: starts with a general
Top-down or
entities and combines them into a entity and divides it into more specialized
Bottom-up
generalized entity. entities.

c) What is an Attribute? Explain Different Types of Attributes

An attribute is a property or characteristic of an entity or relationship in a database. Attributes


represent data that describe an entity's characteristics or properties.

Types of Attributes:

1. Simple Attribute:

o A simple attribute cannot be divided into smaller subparts.

o Example: Age or Student_ID.

2. Composite Attribute:

o A composite attribute is made up of multiple simple attributes that can be


subdivided.

o Example: Full Name (can be divided into First Name and Last Name).

3. Derived Attribute:

o A derived attribute is one whose value can be calculated or derived from other
attributes.

o Example: Age, which can be derived from Date of Birth.

4. Multi-valued Attribute:
o A multi-valued attribute can have multiple values for a single entity.

o Example: Phone Numbers (an entity might have multiple phone numbers).

5. Key Attribute:

o A key attribute is one that uniquely identifies an entity within an entity set.

o Example: Student_ID for a Student entity.

6. Nullable Attribute:

o A nullable attribute is an attribute that can have a NULL value, meaning it might not
have a value for some entities.

o Example: Middle Name in a Person entity (some individuals may not have a middle
name).

These different types of attributes are used in designing the database schema and ensuring that the
data is structured appropriately.

You might also like