0% found this document useful (0 votes)
9 views8 pages

Batch 2 Set4

The document is an answer key for a Database Management Systems test conducted at SRM Institute of Science and Technology for the academic year 2023-24. It includes a course articulation matrix, questions with answers, and detailed explanations of components related to storage management and query processing. Additionally, it outlines a relational data model for an online movie ticket system and provides SQL statements for various database operations.

Uploaded by

januaryb859
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)
9 views8 pages

Batch 2 Set4

The document is an answer key for a Database Management Systems test conducted at SRM Institute of Science and Technology for the academic year 2023-24. It includes a course articulation matrix, questions with answers, and detailed explanations of components related to storage management and query processing. Additionally, it outlines a relational data model for an online movie ticket system and provides SQL statements for various database operations.

Uploaded by

januaryb859
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/ 8

SRM Institute of Science and Technology

College of Engineering and Technology


School of Computing
SRM Nagar, Kattankulathur – 603203, Chengalpattu District, Tamilnadu
Academic Year: 2023-24 (EVEN) SET – 4(BATCH 2)
ANSWER KEY

Test: CLA-T1 Date: 09-02-2024


Course Code & Title: 18CSC303J Database Management Systems Duration: 50
Minutes
Year & Sem: III Year / VI Sem Max. Marks: 25

Course Articulation Matrix:


S. Course PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO
No. Outcome
1 CO1 3 2 2 - - - - - - - - - 2 2 -
2 CO2 3 2 2 - - - - - - - - - 2 2 -
3 CO3 3 3 3 - - - - - - - - - 2 2 -
4 CO4 3 3 3 2 - - - - - - - - 2 2 -
5 CO5 3 2 2 - - - - - - - - - 2 2 -

Part - A
(10 x 1 = 10 Marks)
Instructions: Answer all
Q. Question Marks BL CO PO PI
No Code
1 Which of the following is NOT a component of a typical 1 L1 1 1 1.6.1
DBMS architecture?
a) Query Processor
b) Database Administrator
c) Data Warehouse
d) Data Storage Manager

Answer: C
2 Which of the following is an advantage of using a DBMS over 1 L2 1 1 1.7.1
traditional file systems?
a) Increased data redundancy
b) Improved data integrity
c) Limited query capabilities
d) Simplified data storage

Answer: B
3 What is the purpose of a Database Administrator (DBA) in a 1 L1 1 1 1.7.1
DBMS?
a) To design and implement the database schema
b) To optimize SQL queries for performance
c) To manage user access and permissions
d) To interact with users and perform data analysis

Answer: a & c
4 Which of the following is NOT a property of ACID in database 1 L1 1 1 1.6.1
transactions?
a) Accuracy
b) Atomicity
c) Consistency
d) Durability

Answer:a
5 Which data model represents data in a tree-like structure with a 1 L1 1 1 1.7.1
single root and multiple children?
a) Relational Data Model
b) Hierarchical Data Model
c) Network Data Model
d) Entity-Relationship Model
Answer: b
6 Which of the following is an example of a relational database 1 L1 1 1 1.6.1
management system?
a) MongoDB
b) Oracle Database
c) Redis
d) Cassandra
Answer: b
7 Existence of business logic in 1 L1 1 1 1.6.1
a) Two-tier architecture
b) Three-tier architecture
c) Both a and b
d) Client-server machine

Answer: b
8 In DDL, which statement is used to define constraints on a 1 L1 1 1 1.7.1
table?
a) Create constraint
b) Add constraint
c) Set constraint
d) Enforce constraint

Answer: b

9 Which of the following is NOT a type of relationship constraint 1 L2 1 1 1.7.1


in the ER model?
a) Cardinality
b) Participation
c) Key
d) Degree

Answer: d
10 One department account (C) is debited and another department 1 L1 1 1 1.6.1
account (D) is credited, either both the credit and debit should
occur, or that neither should occur is an example of _________.
a) Durability
b) Consistency
c) Atomicity
d) Integrity

Answer: c

PART B(1 X 7.5 = 7.5)

11.a List the components of Storage Manager and Query processor 7.5 L2 1 1 1.7.1
and explain them

In a Database Management System (DBMS), the Storage


Manager and Query Processor are two essential components
responsible for managing data storage and handling queries,
respectively.

Storage Manager Components:

1. Data Files:

- Description: Physical storage on disk where the actual data


is stored.

- Function: Organizes and stores data in a structured format,


usually in tables.

2. Buffer Manager:

- Description: Manages a buffer pool in memory for


frequently accessed data.

- Function: Minimizes disk I/O operations by keeping


frequently used data in memory, improving overall system
performance.

3. File Organization Module:

- Description: Determines how data is organized and stored


within data files.

- Function: Defines the structure of data storage, such as


indexing, sorting, and clustering, to optimize retrieval and
storage efficiency.

4. Disk Space Manager:

- Description: Manages the allocation and deallocation of


space on disk for data storage.

- Function: Ensures efficient utilization of disk space and


handles tasks like space allocation, deallocation, and file
expansion.

5. Storage Interface:

- Description: Provides an interface for interaction between


the DBMS and the operating system's file system.

- Function: Manages communication and data transfer


between the DBMS and the physical storage layer.

Query Processor Components:

1. Query Parser:

- Description: Analyzes and validates the syntax of SQL


queries.

- Function: Breaks down queries into components and checks


their syntax, ensuring they conform to the language rules.

2. Query Optimizer:

- Description:Determines the most efficient way to execute a


query.

- Function: Analyzes various execution plans and selects the


one with the least cost, optimizing query performance.

3. Query Executor:

- Description: Executes the optimized query plan generated


by the query optimizer.

- Function:Coordinates the retrieval and manipulation of data


based on the optimized plan, interacting with the Storage
Manager to access and modify data.

4. Transaction Manager:

- Description: Ensures the consistency and integrity of


transactions.

- Function: Manages the execution of transactions, including


the beginning, committing, or rolling back of transactions to
maintain the database's integrity.

5. Concurrency Control Manager:

- Description: Handles simultaneous access to the database by


multiple transactions.

- Function: Enforces isolation among transactions to prevent


interference and conflicts, ensuring consistency and
correctness.

6. Database Scheduler:

- Description: Coordinates the execution of various tasks and


transactions.

- Function: Manages the scheduling of concurrent tasks and


transactions to optimize resource utilization and maintain
system efficiency.

Both the Storage Manager and Query Processor work together


to ensure the efficient storage, retrieval, and manipulation of
data within a database system. Their coordination is crucial for
maintaining the integrity, security, and performance of the
database.

OR

11.b Describe in detail about Relational Data model and design the 7.5 L3 1 1 1.7.1
relational data model for online movie ticket system.

Relational Data Model:

The relational data model is a database model based on the


mathematical concept of a relation, which is essentially a table
with rows and columns. In this model, data is organized into
tables, and relationships between tables are established using
keys. The primary components of the relational data model
include:

1. Table (Relation):

- Represents an entity, and each row in the table represents an


instance of that entity.

- Columns in the table represent attributes or properties of the


entity.

- Each table has a unique name.


2. Attribute (Field):

- Represents a property or characteristic of an entity.

- Corresponds to a column in a table.

3. Tuple (Row):

- Represents a single instance or record in a table.

- Contains values for each attribute defined in the table.

4. Key:

- Uniquely identifies a tuple within a table.

- Primary key: A unique identifier for each tuple in a table.

- Foreign key: A field in one table that refers to the primary


key of another table, establishing a relationship.

5. Relationship:

- Defines connections between tables using keys.

- Common types include one-to-one, one-to-many, and many-


to-many relationships.

Relational Data Model for an Online Movie Ticket System:

Let's design a simplified relational data model for an Online


Movie Ticket System. We'll consider entities such as Movies,
Cinemas, Users, and Bookings.

1. Movies Table:

- Attributes: MovieID (Primary Key), Title, Genre,


ReleaseDate, Duration.

2. Cinemas Table:

- Attributes: CinemaID (Primary Key), Name, Location,


Capacity.

3. Users Table:

- Attributes: UserID (Primary Key), FirstName, LastName,


Email, Password.

4. Bookings Table:

- Attributes: BookingID (Primary Key), UserID (Foreign


Key), MovieID (Foreign Key), CinemaID (Foreign Key), Date,
Time, TotalAmount.

- Explanation:

- The `Movies` and `Cinemas` tables store information about


movies and cinema locations.

- The `Users` table contains details about the users of the


system.

- The `Bookings` table is the central table, linking users,


movies, and cinemas through foreign keys. It stores booking
information, including the date, time, and total amount.

Example SQL Schema:

CREATE TABLE Movies (

MovieID INT PRIMARY KEY,

Title VARCHAR(255),

Genre VARCHAR(50),

ReleaseDate DATE,

Duration INT

);

CREATE TABLE Cinemas (

CinemaID INT PRIMARY KEY,

Name VARCHAR(100),

Location VARCHAR(255),

Capacity INT

);

CREATE TABLE Users (

UserID INT PRIMARY KEY,

FirstName VARCHAR(50),

LastName VARCHAR(50),

Email VARCHAR(255),

Password VARCHAR(50)

);

CREATE TABLE Bookings (

BookingID INT PRIMARY KEY,

UserID INT,

MovieID INT,
CinemaID INT,

Date DATE,

Time TIME,

TotalAmount DECIMAL(10, 2),

FOREIGN KEY (UserID) REFERENCES Users(UserID),

FOREIGN KEY (MovieID) REFERENCES


Movies(MovieID),

FOREIGN KEY (CinemaID) REFERENCES


Cinemas(CinemaID)

);

```

This schema represents a basic structure for an Online Movie


Ticket System, providing the foundation for managing movies,
cinemas, users, and bookings. Additional considerations, such
as seats, payment details, and real-world constraints, would be
essential for a fully functional system.

PART C(1 X 7.5 = 7.5)

12 Emp Emp Emp Emp Address Emp 7.5 L3 1 2 2.6.3


Id Name Age Salary

101 Ganesh 25 Chennai 45000

102 Rajesh 21 Trichy 75000

103 Pradeep 28 Madurai 65000

104 Murugan 30 Madurai 15000

105 Velu 32 Salem 25000

Write the SQL statements for the following scenario

a.Write the query to create the following table and to insert the
records.(2.5 Marks)

INSERT INTO Employee (EmpID, EmpName,


EmpAge, EmpAddress, EmpSalary)

VALUES

(101, 'Ganesh', 25, 'Chennai', 45000),

(102, 'Rajesh', 21, 'Trichy', 75000),

(103, 'Pradeep', 28, 'Madurai', 65000),

(104, 'Murugan', 30, 'Madurai', 15000),


(105, 'Velu', 32, 'Salem', 25000);

b.Make Emp Id as primary key using alter command(2 Marks)

ALTER TABLE Employee

ADD PRIMARY KEY (EmpID);

c. Change the salary as 39000 for the employees whose age is


above 30 (2 Marks)

UPDATE Employee

SET EmpSalary = 39000

WHERE EmpAge > 30;

d.Execute truncate command using delete command.(1 Mark)

Truncate table emp;

*Program Indicators are available separately for Computer Science and Engineering in AICTE
examination reforms policy.

Course Outcome (CO) and Bloom’s level (BL) Coverage in Questions

Approved by the Audit Professor/Course Coordinator

You might also like