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

Dbms Aat2 Plag

1. The query evaluation engine has three main functions: query parsing, query optimization, and indexing. It analyzes queries, chooses efficient execution plans, and uses indexes to speed up data retrieval. 2. Weak entity sets exist in databases to accurately represent real-world relationships where entities depend on other strong entities. This guarantees referential integrity while allowing complex hierarchies. 3. The questions ask to write SQL queries to find employees meeting certain criteria based on a schema with tables for employees, works contracts, and companies. The queries use joins to link the tables and filter clauses to select matching rows.

Uploaded by

Nehanth Admirer
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)
21 views5 pages

Dbms Aat2 Plag

1. The query evaluation engine has three main functions: query parsing, query optimization, and indexing. It analyzes queries, chooses efficient execution plans, and uses indexes to speed up data retrieval. 2. Weak entity sets exist in databases to accurately represent real-world relationships where entities depend on other strong entities. This guarantees referential integrity while allowing complex hierarchies. 3. The questions ask to write SQL queries to find employees meeting certain criteria based on a schema with tables for employees, works contracts, and companies. The queries use joins to link the tables and filter clauses to select matching rows.

Uploaded by

Nehanth Admirer
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

Database Management Systems

Assignment

1. Discuss the functionality of query evaluation engine.

The functions of query evaluation engine are:

1. Query Parsing: It analyzes user requests to determine their structure


and purpose before looking for any syntax mistakes or invalid parts.

2. Query optimization: The engine chooses the most effective execution


plan for the query while taking indexes and join order into account. It
determines the optimum execution plan by estimating the costs of
the various options.

3. Indexing: It may employ database indexes to speed up data retrieval,


choosing which ones to use based on the query and optimization.

2. We can convert any weak entity set to strong entity set by simply
adding Appropriate attributes. Analyze why, then, do we have weak
entity sets?

Weak entity sets exist because accurate real-world representation is


required. They represent entities that rely on a strong entity to maintain
data integrity, provide unique identification, and provide semantic
clarity. Weak entities are advantageous in complex hierarchies because
they depend on higher-level entities at lower levels. This architecture
guarantees that no records are orphaned since relationships are
enforced by the database management system.
3. Consider the Schema employee(e-name, street, city) works(e-name, c-
name, salary) company(c-name, city) manages(e-name, m-name) Write
the queries for the following in DRC 1. Find the names, street address,
and cities of all employees who work for First Bank Corporation and
earn more than $10,000 per annum. Assume each person works for at
most one company. 2. Find the names of all employees in this database
who live in the same city as the company for which they work.

1. To locate the names, cities, and street locations of "First Bank


Corporation" workers with salaries greater than $10,000:

SELECT e.e-name, e.street, e.city


FROM employee e
INNER JOIN works w ON e.e-name = w.e-name
WHERE w.c-name = "First Bank Corporation" AND w.salary > 10000;

2. To obtain the names of staff members that reside in the same


metropolis as their employer:

SELECT DISTINCT e.e-name


FROM employee e
INNER JOIN works w ON e.e-name = w.e-name
INNER JOIN company c ON w.c-name = c.c-name AND e.city = c.city;

4. Consider the Schema employee(e-name, street, city) works(e-name, c-


name, salary) company(c-name, city) manages(e-name, m-name) Write
the queries for the following in Relational Algebra Find the names,
street address, and cities of all employees who work for First Bank
Corporation and earn more than $10,000 per annum. Assume each
person works for at most one company. Find the names of all
employees in this database who live in the same city as the company
for which they work.

1. To locate the names, cities, and street locations of "First Bank


Corporation" workers with salaries greater than $10,000:

SELECT e-name, street, city


FROM employee NATURAL JOIN works
WHERE c-name = "First Bank Corporation" AND salary > 10000;
2. To obtain the names of staff members that reside in the same
metropolis as their employer:

SELECT DISTINCT e.e-name


FROM employee e
WHERE EXISTS (
SELECT *
FROM works w, company c
WHERE e.e-name = w.e-name AND w.c-name = c.c-name AND
e.city = c.city
);

5. Define multiset. Why tables are considered assets in SQL?

In contrast to standard sets, where each element is unique, a multiset is


a collection or set of elements in which elements might exist more than
once. Because it permits duplicate items, a multiset is frequently
referred to as a "bag" or "unordered collection" in relational databases
and SQL.

Due to their capacity for organized data storage and manipulation,


tables in SQL databases are regarded as assets. For effective SQL
querying and retrieval, they arrange the data into rows and columns.

6. Explain the string pattern matching operator of SQL with examples.

Using wildcard characters, the LIKE operator in SQL makes it easier to


match patterns in strings. While the _ sign corresponds to a single
character, the % symbol represents any sequence of characters, even
none.

1. SELECT * FROM employees WHERE name LIKE 'J%';


2. SELECT * FROM cities WHERE name LIKE 'N_Y';
3. SELECT * FROM products WHERE name LIKE '%super%';
7. Write about Log based recovery?

A database management technique called log-based recovery ensures


data consistency and recoverability in the event of system failures. Two
stages are used in the recovery process:

1. Redo Phase: To restore consistency to the database, committed


transaction changes are applied again from the log.
2. Undo Phase: Changes made by incomplete or uncommitted
transactions are undone in order to stop uncommitted updates.

8. Describe Timestamp based locking protocols?

Databases utilize timestamp-based locking techniques to control


transaction concurrency while preserving data integrity. Upon beginning,
each transaction is given a special timestamp, and each data item also
has an associated timestamp. Older transactions always take precedence
since transactions are scheduled for execution depending on their
timestamps.

9. In the index allocation scheme of blocks to a file, Calculate on what


maximum possible size of file that depends

In an index allocation method, variables like disk block size (B), index
block size (IB), number of pointers per index block (N), and file system
addressing limits (M) influence the largest file that may be allocated. You
can use the formula F = (IB * N) * M to determine the maximum file size
(F). The system chooses the fixed parameter known as the disk block size
(B). Typically, index block size (IB) is a multiple of B. The size of the index
block and pointer size affect the number of pointers per index block (N).
10.Explain about Buffer management in DBMS.

A key element of a Database Management System (DBMS) that


optimizes data access and improves speed is buffer management. In
order to cache frequently requested data pages from the slower disk
storage, the system keeps a section of main memory known as the
"buffer pool". It operates at the page level and chooses which pages to
keep in the buffer pool and which to replace using a page replacement
policy (like LRU or FIFO).

Nehanth G
21951A6790

You might also like