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

Dbms Mid Term

The document outlines various concepts related to relational databases, including definitions, operations, and normalization. It covers topics such as relational algebra, keys, integrity rules, SQL commands, and database design principles. Additionally, it discusses practical applications and examples for understanding database management systems and their architecture.

Uploaded by

aini.23bce11190
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)
29 views5 pages

Dbms Mid Term

The document outlines various concepts related to relational databases, including definitions, operations, and normalization. It covers topics such as relational algebra, keys, integrity rules, SQL commands, and database design principles. Additionally, it discusses practical applications and examples for understanding database management systems and their architecture.

Uploaded by

aini.23bce11190
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/ 5

Module 2-

 Define a relational database model: Explain the structure of a relational database,


including the terms "domain," "relation," and "schema." What role do these play in
organizing data? applications

 Relational Algebra Operations: Given the relations Employee(ID, Name,


Department, Salary) and Department(DeptID, DeptName), write relational algebra
expressions to:

 (a) Retrieve all employee names working in the "Sales" department.


 (b) Find the IDs of employees who earn more than $50,000.

 Keys and Integrity Rules: What is the difference between primary keys and foreign keys
in relational databases? Why are integrity constraints important, and how do they maintain
data consistency?

 Selection and Projection: Using relational algebra, how would you express:

 (a) Selection of employees with a salary above $40,000.


 (b) Projection to display only the Name and Salary attributes of each employee in the
Employee relation.

 Normalization Practical Problem: Consider a table with the following attributes:


StudentID, StudentName, CourseID, CourseName, and InstructorName. Identify
functional dependencies, then normalize this table to 3NF. Multivalue depency used for 4nf
explain

 Tuple Relational Calculus: Using tuple relational calculus, write a query to find all
students enrolled in "Database Systems." Assume a relation Enrolled(StudentID,
CourseID) and Course(CourseID, CourseName).

 Codd’s Rules: Briefly describe Codd’s twelve rules for relational databases. Why are
these rules foundational to relational database systems? Defin and desibe uml

 Join Operations: Given two relations Order(OrderID, CustomerID, ProductID) and


Customer(CustomerID, CustomerName, Location), write a relational algebra expression
to retrieve the names of all customers who have ordered a specific product, say
"Product_123."

 Normalization Theory: Explain the differences between 1NF, 2NF, 3NF, and BCNF.
Provide examples of tables that are in 1NF but not in 2NF, and so on.

 Advanced Join and Division: Write a relational algebra query using the division operator
to find customers who have ordered all products in a given Product table. Assume
Order(CustomerID, ProductID) and Product(ProductID).
Module 3-

Here are 10 questions covering relational database design, SQL features, data manipulation,
and practical queries:

1. **Relational Database Design**


- What are atomic domains in relational database design, and why are they important for
maintaining data integrity? Provide an example of an atomic domain and a non-atomic
domain.

2. **Data Definition Language (DDL) and Data Manipulation Language (DML)**


- Explain the difference between DDL and DML commands in SQL. Give two examples of
each type and describe their functions. tcl

3. **Aggregate Functions and NULL Values**


- Describe the role of aggregate functions (like COUNT, SUM, AVG) in SQL. How do
these functions handle NULL values? Provide an example query that counts non-null entries
in a column.

4. **Basic SELECT Statements and Nested Subqueries**


- Write a SQL query to retrieve the names of employees who earn more than the average
salary in their department. Explain how nested subqueries are used in your query.

5. **Table Joins and Retrieving Data from Multiple Tables**


- Explain the difference between INNER JOIN, LEFT JOIN, and FULL JOIN in SQL.
Write an example query for each type, joining an `Employee` table with a `Department` table
based on department ID.

6. **Restricting and Sorting Data**


- Write a SQL query that retrieves all customer orders from a database, but only for orders
placed in 2024. Sort the results in descending order by the order date. Explain how ORDER
BY and WHERE clauses are used in the query.

7. **Single-Row Functions, Conversion Functions, and Conditional Expressions**


- What are single-row functions in SQL, and how are they different from aggregate
functions? Provide an example of a single-row function that converts a date to a different
format and includes a conditional expression to display 'Unknown' if the date is NULL.

8. **Views and Data Independence**


- Define a view in SQL and explain how it contributes to data independence and security.
Write a query to create a view called `HighSalaryEmployees` that displays only the names
and salaries of employees earning more than $70,000. How is data independence different
form logical independence

9. **Triggers in SQL**
- What is a trigger in SQL, and how can it be used to enforce business rules within a
database? Write a SQL statement to create a trigger that logs an entry in a `SalaryAudit` table
whenever an employee's salary is updated.

10. **Set Operators and Group Functions**


- Explain the difference between UNION and INTERSECT set operators in SQL. Write a
query using UNION to combine the results from two tables, `Sales_2023` and `Sales_2024`,
that each contain a list of product sales for their respective years.

Module 1
Here are 10 questions covering the purpose of database systems, data independence, relational
databases, database system architecture, data models, and ER modeling with practical applications:

1. **Purpose of Database Systems**

- What are the primary purposes of a database management system (DBMS)? Describe how a
DBMS improves data management compared to a traditional file-based system. Provide examples of
real-world applications where a DBMS would be essential. Adv and dis adv

2. **View of Data and Data Independence**

- Explain the concept of data independence in database systems. Distinguish between logical and
physical data independence and provide examples of changes that would test each type.

3. **Database System Architecture**


- Describe the three-level architecture of a database system: external, conceptual, and internal
levels. How do mappings between these levels support data independence?

4. **Database Languages**

- Identify and explain the functions of the main types of database languages (DDL, DML, and DCL)
in a DBMS. Provide an example of each type in SQL and describe a scenario where each would be
used.

5. **Data Models and Degrees of Abstraction**

- What are data models in database design, and why are they important? Describe the three
degrees of data abstraction (physical, logical, and external) and give an example of how each degree
impacts database design.

6. **Roles of Users and the Database Administrator (DBA)**

- Differentiate between the roles of end-users, application developers, and the database
administrator (DBA) in a database environment. What specific tasks and responsibilities does a DBA
have in ensuring the database operates effectively?

7. **ER Model Basics and ER Diagrams**

- Describe the basic components of an Entity-Relationship (ER) model, including entities, attributes,
and relationships. Draw an ER diagram for a simple library system, showing entities for `Book`,
`Member`, and `Loan`, and specify any key constraints.

8. **ER Diagram Constraints and Issues**

- Explain the concept of cardinality constraints in an ER diagram, and provide an example of a 1:1,
1:N, and M:N relationship. Identify common issues that might arise when mapping these
relationships to a relational schema and how they can be resolved.

9. **Weak Entity Sets and Identifying Relationships**

- Define a weak entity set and explain why it requires an identifying relationship with a strong entity
set. Create an ER diagram involving a weak entity set `Dependent` that depends on an entity set
`Employee`, showing the identifying relationship.

10. **Practical Problem: Mapping an ER Model to Relational Schema**


- Consider an ER model with entities `Student`, `Course`, and `Enrollment`, where `Student` and
`Course` have a many-to-many relationship represented by `Enrollment`. Map this ER model to a
relational schema, identifying primary keys and foreign keys for each table.

You might also like