0% found this document useful (0 votes)
23 views12 pages

DBMS Model Questions Overview

best qb

Uploaded by

Srinivas D
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)
23 views12 pages

DBMS Model Questions Overview

best qb

Uploaded by

Srinivas D
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

DBMS Model Questions 2022 Scheme

Module 1

1. Explain the characteristics of database approach.


2. Explain the advantages of using DBMS Approach.
3. Explain three schema Architecture.
4. Define data independence. Explain types of data independence.
5. Explain database languages and Interfaces.
6. Discuss the various component modules of a DBMS and their interaction with a neat
diagram.
7. Draw ER diagram of Company Database.
8. Draw ER diagram of Bank Database
[Link] an entity and an attribute. Explain the different types of attributes that occur in the
ER model, with an example.
11. Explain the Structural Constraints,
[Link] is the cardinality ratio? Explain the possible cardinality ratios for binary relationship
types with an example

Module 2
1 Explain primary key , referential integrity and foreign key concepts with the specific
example
2 Explain union, Intersection and Minus Operations of Relational algebra with
examples

3 Describe Selection and Projector Operator in Relational Algebra and mention the
difference between them with examples.
4 Develop the following queries in Using Relational Algebra.
i) Find the names of all the employees whose salary is greater than 30000.
σsalary>30000(Employee)
ii) Retrieve the name and emp id of all employees.
πname, empid(Employee)
iii) Find the fname and lname of employees in department 4 that earn > 50000
πfname, lname(σsalary>30000(Employee))

5 Explain different types of Joins in SQL


6 Explain relational model constraints.
7 Explain different steps of ER to Relational Mapping algorithm.

8 Convert the following ER Diagram to Relational Model


Module 3
1. Explain the data types that are allowed for SQL attributes.
INTEGER, FLOAT, DECIMAL(i,j), CHAR(n), VARCHAR(n),DATE, TIME,
TIMESTAMP
2. Outline the different constraints in SQL while creating table

3. Explain the schema change statements of SQL


CREATE TABLE/VIEW-AS:

DROP TABLE:

ALTER TABLE/VIEW-AS:

UPDATE-SET-WHERE:
4. Write the SQL queries for the following:
a) Write the syntax to Create, Alter and Drop table. (REFER ABOVE Qs)
b) Write SQL Query to Create Employee table with the following attributes: eid, ename
and salary.
CREATE TABLE Employee (
eid INT PRIMARY KEY,
ename VARCHAR(100),
salary DECIMAL(10, 2)
);
c) Alter table employee by adding one more attribute called address.
ALTER TABLE Employee
ADD COLUMN address VARCHAR(255);
d) Give syntax to drop table employee and drop column salary.
ALTER TABLE Employee
DROP COLUMN salary;

DROP TABLE Employee;


5. Write the SQL queries for the following:
a) Retrieve the birth date and address of employee whose employee id is 10.
SELECT birth_date, address
FROM Employees
WHERE emp_id = 10;
b) Retrieve the name and address of all employees who work for ‘Research’ department.
SELECT e.emp_name, [Link]
FROM Employees e, Department d
WHERE d.dept_name = 'Research' AND d.dept_name = [Link];
c) Retrieve all employees in department 5 whose salary is between 30000 and 40000
SELECT *
FROM Employees
WHERE dept_id = 5
AND salary BETWEEN 30000 AND 40000;
d) Retrieve distinct salaries of employees
SELECT DISTINCT salary
FROM Employees;
6. Explain the ALTER TABLE command. Explain how the new constraint can be added and
also an existing constraint can be removed using suitable examples.(REFER Q3)
7. Explain INSERT, DELETE, UPDATE statements in SQL taking suitable examples.
INSERT:
INSERT INTO Employees (emp_id, emp_name, emp_salary)
VALUES (1, 'Alice', 50000);
DELETE:
DELETE FROM Employees
WHERE emp_id = 1;
UPDATE:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
8. Explain the aggregate functions in SQL? Explain with examples.

9. Explain the command used for ordering the query results? Explain with the syntax and an
example

[Link] SQL queries for following:


Student( Enrno, name, courseId, emailId, cellno)
Course(courseId, course_nm, duration)
a) Add a column city in student table.
ALTER TABLE Student
ADD COLUMN city VARCHAR(100);
b) Find out list of students who have enrolled in “computer” course.
SELECT name
FROM Student
WHERE courseId IN
(SELECT courseId FROM Course WHERE course_nm = 'computer');
c) List name of all courses with their duration.
SELECT course_nm, duration
FROM Course;
d) List name of all students start with „a‟.
SELECT name
FROM Student
WHERE name LIKE 'a%';
e) List email Id and cell no of all mechanical engineering students
SELECT emailId, cellno
FROM Student
WHERE courseId IN (SELECT courseId FROM Course WHERE course_nm =
'mechanical');
11. Explain Group by and having clause in SQL with an example.
12. Explain Views in SQL. Give the syntax to create and drop views.

13. Consider the below table:


Orders(ord_no , purch_amt, ord_date , customer_id, salesman_id)
a) write a SQL query to calculate total purchase amount of all orders.
SELECT SUM(purch_amt) AS total_purchase_amount
FROM Orders;
b) write a SQL query to calculate the average purchase amount of all orders.
SELECT AVG(purch_amt) AS average_purchase_amount
FROM Orders;
c) write a SQL query that counts the number of unique salespeople.
SELECT COUNT(DISTINCT salesman_id) AS num_unique_salespeople
FROM Orders;
d) write a SQL query to find the maximum and minimum purchase amount.
SELECT MAX(purch_amt) AS max_purchase_amount,
MIN(purch_amt) AS min_purchase_amount
FROM Orders;
Module 4
1. Construct Functional Dependency. Give Inference rules for Functional Dependencies.
2. Explain 1NF with example.
3. Explain 2NF with example.
4. Explain 3NF and BCNF with example.
5. Consider the below Relation
R{City, Street, HouseNumber, HouseColor, CityPopulation}
Assume key as {City, Street, HouseNumber}
The Dependencies are:
{City, Street, HouseNumber}  {HouseColor}
{City}  {CityPopulation}
Check whether the given R is in 2NF? If not convert into 2NF
6. Consider the relation
Emp-Proj ={SSN, Pnumber,Hours, Ename,Pname,Plocation}
Assume {SSN,Pnumber } as Primary key
The dependencies are:
{SSN,Pnumber}->Hours
SSN->Ename
Pnumber->{Pname,Plocation}
Normalize the above relation to 3NF
7. Consider the following relation
R {Title, PubId, AuId, Price, AuAddress}
Assume primary key as {Title, PubId, AuId}
The Dependencies are
{Title, PubId, AuID}  {Price}
{AuID}  {AuAddress}
Check whether the given R is in 2NF? If not convert into 2NF

8. Consider the following relation R {Studio, StudioCity, CityTemp}


Assum e Primary Key as {Studio}
The Dependencies are:
{Studio}  {StudioCity}
{StudioCity}  {CityTemp}
Check whether the given R is in 3NF? If not convert into 3NF

9. Give the minimal cover Algorithm. Find the minimal cover using the minimal cover
algorithm for the following functional dependency.
F = {B->A, D->A,AB->D}

10. Give the minimal cover Algorithm. Find the minimal cover using the minimal cover
algorithm for the following functional dependency.
F = {B->A, D->A,AB->D}

Module 5

1. Explain the desirable properties of Transactions.


2. Explain Different states of Transactions with Diagram.
3. Explain Why concurrency is needed?
4. Develop the steps involved in read and write operations of transactions
5. Explain the operations of transactions.
6. Explain the reasons for failure of transactions
7. Explain Deadlock and Starvation.
8. Explain the characteristics of NoSQL Databases.
9. Explain Types of databases of NoSQL
10. Define the Graph database. List the advantages and Disadvantages of Graph databases
11. Compare NoSql and RDBMS
12. Explain the need of Schemaless database

Common questions

Powered by AI

Data independence refers to the capacity to modify the schema at one level of a database system without changing the schema at the next higher level. Logical data independence is the ability to change the conceptual schema without altering the existing external schemas or application programs. Physical data independence, conversely, is the ability to switch the internal schema without having to change the conceptual schema. Changes in physical storage do not affect logical structures, thus keeping applications stable despite modifications to data location, compression, etc. .

Mapping an ER diagram to a relational database model involves converting entities into tables, with entity attributes becoming table columns. Key attributes become primary keys. Relationships are translated into foreign keys, ensuring referential integrity. For one-to-one relationships, a foreign key can be assigned to either participating entity tables; for one-to-many, a foreign key is added to the 'many' side table; for many-to-many relationships, a new table is created to accommodate primary keys from both connected tables .

The three-schema architecture of a DBMS enhances data abstraction and independence by separating the database into three different levels: internal, conceptual, and external. The internal schema defines physical storage structures, the conceptual schema provides a community user view (hiding data complexity from users), and the external schemas represent user interfaces. This separation allows changes at one level to occur without altering other levels, thus supporting data independence. Logical data independence allows changes to the conceptual schema without affecting external schemas, while physical data independence refers to changes at the internal level not affecting the conceptual schema .

NoSQL databases address challenges such as large-scale data storage and high throughput demands, offering scalable storage and flexible schema designs which traditional RDBMS may struggle to manage. NoSQL is ideal for unstructured data and horizontal scaling. Types of NoSQL databases include document stores (e.g., MongoDB), key-value stores (e.g., Redis), column-family stores (e.g., Cassandra), and graph databases (e.g., Neo4j), each specializing in handling specific data formats and retrieval models optimized for speed and scaling .

Normalization from 1NF to 2NF requires eliminating partial dependency, ensuring every non-prime attribute is fully functionally dependent on the primary key. This means removing subsets of data dependent on part of a composite key. Consider a relation R with attributes {A, B, C, D}, where {A, B} is the composite primary key, and C is dependent only on A, not B. Decompose R into two relations: R1(A, C) and R2(A, B, D), removing the partial dependency C on A. R2 contains attributes fully functionally dependent on the primary key (A, B).

In relational algebra, the Union operation combines tuples from two relations (tables) that have the same arity and attribute domains. For example, if R and S are relations over the same domain, R ∪ S denotes a relation with all tuples in either or both R and S. Intersection yields tuples that are only in both relations. For example, R ∩ S results in tuples found in both R and S. Minus (also known as Difference) results in tuples present in the first relation but not in the second. For instance, R - S shows tuples in R but not in S, aiding in filtering discrepancies or exclusions .

The SQL ALTER TABLE command modifies an existing table structure. It can add or drop columns, as well as constraints. To add a constraint, use syntax like ALTER TABLE table_name ADD CONSTRAINT constraint_name constraint_type(column). To remove a constraint, use ALTER TABLE table_name DROP CONSTRAINT constraint_name. Adding constraints improves data integrity by enforcing rules at the database level, whereas removing constraints can increase flexibility but risks data inconsistency .

SQL supports several types of joins: INNER JOIN returns records with matching values in both tables; LEFT JOIN or LEFT OUTER JOIN returns all records from the left table, and matched records from the right table, returning NULL for unmatched rows; RIGHT JOIN or RIGHT OUTER JOIN is the opposite of LEFT JOIN; FULL JOIN or FULL OUTER JOIN returns records when there is a match in either left or right table records. CROSS JOIN returns the Cartesian product of two tables, meaning it joins each row from the first table with every row from the second one. These joins facilitate combined analysis of data from multiple tables .

The primary advantages of using a DBMS over traditional file systems include improved data sharing and data security, efficient data management through reduced data redundancy, data independence, and consistency, easier data access, and more robust data recovery options. DBMSs support concurrent access, ensuring multiple users can access data without conflicting, and offer complex query capabilities for rigorous data analytics .

The desirable properties of database transactions, known as ACID properties, include Atomicity, Consistency, Isolation, and Durability. Atomicity ensures transactions are all-or-nothing, Consistency maintains the database's lawful state before and after the transaction, Isolation prevents transactions from interfering with each other, and Durability guarantees completed transactions persist even amidst system failures. These properties ensure reliability, data integrity, and robust database operation critical for transaction processing .

You might also like