2022 Winter Model Answer Paper (Msbte Study Resources)
2022 Winter Model Answer Paper (Msbte Study Resources)
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
WINTER – 2022 EXAMINATION
Subject Name: Database Management System Model Answer Subject Code: 22319
Important Instructions to examiners: XXXXX
1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to assess the
understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance (Not applicable for
subject English and Communication Skills.
4) While assessing figures, examiner may give credit for principal components indicated in the figure. The figures
drawn by candidate and model answer may vary. The examiner may give credit for any equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values may vary and
there may be some difference in the candidate’s answers and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based on
candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on equivalent concept.
8) As per the policy decision of Maharashtra State Government, teaching in English/Marathi and Bilingual (English +
Marathi) medium is introduced at first year of AICTE diploma Programme from academic year 2021-2022. Hence if
the students in first year (first and second semesters) write answers in Marathi or bilingual language (English
+Marathi), the Examiner shall consider the same and assess the answer based on matching of concepts with
model answer.
a) Define 2M
i) Data Abstraction
ii) Instance.
Ans i) Data Abstraction: Each correct
Hiding complexity of data structures from end user through different levels is known definition: 1M
as data abstraction.
Many end users are not computer trained so it is needed to hide complex data
structures from them.
It has 3 levels :
a. Physical level
b. logical level
c. view level
ii) Instance:
The data stored in database at a particular moment of time is called instance of
database.
Example:
Let’s say a table teacher in our database whose name is School, suppose the table has
50 records so the instance of the database has 50 records for now and tomorrow we
are going to add another fifty records so tomorrow the instance have total 100 records.
This is called an instance.
Page No: 1 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
b) State any two advantages of DBMS. 2M
Ans Normalization is a process of organizing the data in database to avoid data 1 M for correct
redundancy, insertion anomaly, update anomaly & deletion anomaly. definition, 1 M
for correct types
Types of normalization are:
• First normal form(1NF)
• Second normal form(2NF)
• Third normal form(3NF)
• Boyce & Codd normal form (BCNF)
Page No: 2 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Subtraction Operator (-) operators: 1M
Multiplication Operator (+)
Division Operator (-)
Modulus Operator (+)
AND operator
OR operator
BETWEEN operator
IN operator
NOT operator
ANY operator
LIKE operator
Page No: 3 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
2. Attempt any THREE of the following: 12 M
Ans Explanation=3M
Diagram=1M
1. External level
It is also called view level because several users can view their desired data from this
level which is internally fetched from database with the help of conceptual and
internal level mapping.
The user doesn’t need to know the database schema details such as data structure;
table definition etc. user is only concerned about data which is what returned back to
the view level after it has been fetched from database which is present at the internal
level. External level is the top level of the three level DBMS architecture.
2. Conceptual level
It is also called logical level. The whole design of the database such as relationship
among data, schema of data etc. are described in this level.
Database constraints and security are also implemented in this level of architecture.
Page No: 4 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
This level is maintained by DBA (database administrator).
3. Internal level
This level is also known as physical level. This level describes how the data is stored
in the storage devices.
This level is also responsible for allocating space to the data. This is the lowest level
of the architecture.
Page No: 5 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
ON table_name (column1, column2, ...);
Example:
The following SQL creates an index named id_firstname on the FirstName column in
the Student table: Correct
explanation of
CREATE INDEX id_firstname DROP INDEX
ON Student (FirstName); Syntax with
example: 2M
DROP INDEX
Syntax:
DROP INDEX index_name ON table_name;
Example:
DROP INDEX id_firstname ON Student;
dbms_output.put_line('reverse is '||rev);
end;
Page No: 6 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Rule 2: Guaranteed Access Rule: all user get access to database
Rule 3: Systematic treatment of null values: null value should be empty
Rule 4: Dynamic online Catalog: record all transactions in database
Rule 5: Data Sub language rule: use only one language
Rule 6: View updating rule: table and view updated simultaneously
Rule 7: High level insert, delete and update: multiple insert delete update
Rule 8: Physical data independence: hardware change
Rule 9: Logical data independence: structure change
Rule 10: Integrity independence: store correct data
Rule 11: Distribution independence: distributed database
Rule 12: No subversion rule: no version of language used.
b) State the use of group by and order by clauses. 4M
Order by Clause:
To view the data in sorted order, the order by clause is used.
By default, the data is sorted in ascending order.
Syntax:
5. SELECT expressions
6. FROM tables
7. [WHERE conditions]
8. ORDER BY expression [ ASC | DESC ];
Example:
declare
name emp_details.ename%type;
cursor a is select ename from emp_details where empno=3;//cursor declaration
begin
open a;//opening the cursor
loop
2M
fetch a into name;//fetching the rows from cursor
update emp_details set comm=3000 where empno=3;
exit when a%notfound;
dbms_output.put_line('record updated');
end loop;
close a;//closing the cursor
end;
2. Consistency:
Consistency means update or edits the same data stored at different locations.
3. Isolation:
Isolation means all the transactions gets executed independent of each other.
4. Durability:
Durability means data can be saved in database permanently until user change it.
Page No: 8 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
1. Schema Definition:
Database or schema can be designed or defined by DBA.
2. Creating storage structure:
DBA allocate or decide the space to store the database.
3. Create grant access methods:
Different access methods to access the database can be granted by DBA to the
users.
4. Schema modification:
The database or schema which is already defined can be modified by DBA as per
the requirements.
5. Granting authorization:
To access the different databases, DBA can grant the authorization to authorized
users only.
6. Performance tuning:
The problems/errors arise in database accessing; can be resolved by DBA to
increase the performance.
7. Regular maintenance:
DBA can monitor the transactions in database and maintain the database error free by
doing the regular maintenance.
OR
Page No: 9 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
CREATE TABLE CUSTOMERS
(
ID INT NOT NULL,
NAME VARCHAR (20) NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR (25) ,
SALARY DECIMAL (18, 2),
PRIMARY KEY (ID, NAME)
);
Example:
OR
Page No: 11 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
raise_application_error(-20000,'cannot delete the record'); delete trigger
end;
e) Explain Database Recovery techniques in detail. 4M
3. Checkpoints:
Checkpoint records all committed transactions into logs.
When system fails, it check log to determine recovery action.
a) Draw the overall architecture of DBMS. Explain storage manager and query 6M
processor components.
Page No: 12 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
3. Authorization and Integrity Manager 2M=query
processor
Allows only authorized users to access data and should be hidden from the public
users. The Authorization and Integrity Manager verifies the authority of the user
trying to access the data and it also checks the integrity constraints when the database
is modified.
4. Transaction Manager
A transaction in DBMS is nothing but a very small unit of the program. The
Transaction Manager manages all the transaction (program) execution.
b) Write the SQL queries for following EMP table. Emp (empno, deptno, 6M
ename, salary, designation, city.)
i) Display average salary of all employees.
ii) Display names of employees who stay in Mumbai or Pune.
iii) Set the salary of employee 'Ramesh' to 50000.
iv)Display names of employees whose salaries are less than 50000.
v) Remove the Record of employees whose deptno is 10.
vi) Remove the column deptno from EMP table.
Ans i. select avg(salary) from emp; 1 M each
ii. select ename from emp where city=’Mumbai’ or city=’Pune’;
iii. update emp set salary=50000 where ename=’Ramesh’;
iv. select ename from emp where salary<50000;
v. delete from emp where deptno=10;
c) Write and Explain the syntax for creating, Altering and dropping the 6M
sequence.
Ans 2M
Syntax for creating sequence:
CREATE SEQUENCE sequence_name
START WITH initial_value
INCREMENT BY increment_value
MINVALUE minimum value
MAXVALUE maximum value
CYCLE|NOCYCLE ;
.where as:
Page No: 14 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
sequence_name: Name of the sequence.
Example:
CREATE SEQUENCE sequence_1
start with 1
increment by 1
minvalue 0
maxvalue 100
cycle;
Alter sequence:
Syntax:
alter sequence <sequence_name> maxvalue <number>;
Alter sequence can change the maxvalue in the sequence created.
Dropping sequence:
Syntax:
drop sequence <sequence_name>;
To drop the sequence the DROP command is used.
a) Write SQL queries for following. Consider table stud (roll no, name, subl, 6M
sub2, sub3)
i) Display names of student who got minimum mark in subl.
ii) Display names of students who got above 40 marks in sub2.
iii) Display count of Students failed in sub2.
iv) Display average marks of subl of all students.
v) Display names of students whose name start with 'A' by arranging them
in ascending order of subl marks.
vi) Display student name whose name ends with h' and subject 2 marks are
Page No: 15 | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
between 60 to 75.
Ans i. select name from stud where sub1= (select min(sub1) from stud); 1 M each
ii. select name from stud where sub2>40;
iii. select count(*) from stud where sub2<40;
iv. select avg(sub1) from stud;
v. select name from stud where name like 'A%' order by sub1;
vi. select name from stud where name like '%h' and sub2 between 60 and 75;
Page No: 16 | 16