2019 Summer Model Answer Paper (Msbte Study Resources)
2019 Summer Model Answer Paper (Msbte Study Resources)
2019 Summer Model Answer Paper (Msbte Study Resources)
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant
ding.
7) For programming language papers, credit may be given to any other program based on
equivalent concept.
c) 2M
difference).
Ans. Sr. GROUP BY HAVING
No.
1 The GROUP BY Clause HAVING Clause is utilized
is utilized in SQL with in SQL as a conditional
the SELECT statement to Clause with GROUP BY Any two
organize similar data into Clause. differen
groups. It combines the ces 1M
multiple records in single each
or more columns using
aggregate functions.
2 GROUP BY returns only This conditional clause
one result per group of data.returns rows where aggregate
function results match with
given conditions only.
d) State any two advantages of PL/SQL. 2M
Ans. Advantages of PL/SQL are:
SQL is the standard database language and PL/SQL is strongly
integrated with SQL. PL/SQL supports both static and dynamic
SQL. Static SQL supports DML operations and transaction
control from PL/SQL block. In Dynamic SQL, SQL allows Any two
embedding DDL statements in PL/SQL blocks. advanta
PL/SQL allows sending an entire block of statements to the ges 1M
database at one time. This reduces network traffic and provides each
high performance for the applications.
PL/SQL gives high productivity to programmers as it can query,
transform, and update data in a database.
PL/SQL saves time on design and debugging by strong features,
such as exception handling, encapsulation, data hiding, and
object-oriented data types.
Applications written in PL/SQL are fully portable.
PL/SQL provides high security level.
e) List any four statements of PL/SQL. 2M
Ans. PL/SQL has different categories of control statements. They are the
Any
following: four
statemen
1/2
Conditional selection statements: Includes IF statement and ts M
Case statement each
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Loop statements:
The loop statements are the basic LOOP, FOR LOOP,
and WHILE LOOP
f) 2M
Ans. Oracle creates a memory area, known as the context area, for
processing an SQL statement, which contains all the information
needed for processing the statement; for example, the number of Definitio
rows processed, etc. n 2M
A cursor is a pointer to this context area. PL/SQL controls the
context area through a cursor. A cursor holds the rows (one or more)
returned by a SQL statement. The set of rows the cursor holds is
referred to as the active set.
g) Enlist the types of database users. 2M
Ans. Different Types of Database Users in DBMS:
1. Application Programmers
2. End Users
Casual User Each
Naive type 1/2M
Sophisticated users
Standalone users
3. DBA (Database Administrator)
4. System Analyst
2. Attempt any THREE of the following: 12
a) Describe simple and composite attribute with suitable example. 4M
Ans. Simple attribute
cannot be divided further. Each
For example, a student's phone number is an atomic value of 10 attribute
digits. with
Composite attribute example
one simple attribute. 2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Characteristics of index:
1. It can reduce disk i/o by using a rapid path access to locate data Any two
quickly. characte
2. Indexes are logically and physically independent of the table they ristics
index. 1M each
3. These are maintained automatically by the oracle server.
2. lower(str)
Converts a string to all lowercase characters.
Example:
dual;
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
3. upper(str)
Converts a string to all uppercase chracters.
Example:
4. length(str)
Find outs the length of given string.
Example:
5.ltrim(str)
Removesleading spaces from a string
Example:
Select l from dual;
6. rtrim(str)
Removes trailing spaces from a string
Example:
Select r abcd
7. Lpad(char1,length,char2)
It returns char1, left-padded to given length with the sequence of
characters in char2.
Example:
Select l
8. Rpad(char1,length,char2)
It returns char1, right-padded to given length
with the sequence of characters in char2.
Example:
Select r
10. Replace(char,searchstring,[repstring])
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
11. Substr(char,m,n)
It returns substring of character string that stack at m character and is
of length n
Example:
Select subs
13. Chr(n)
Returns a character binary equivalent of n.
select chr(65) from dual;
14. Ascii(char)
Returns a decimal representation of a character.
b) 4M
synonyms.
Ans. Create synonyms for class tables.
The following code shows how to create a synonym for the class 2M for
table creating
Example: synonym
Create Synonym Class.syn for class;
2M to
Write steps to create synonyms show the
Syntax: syntax
CREATE [OR REPLACE] [PUBLIC] SYNONYM [schema .] of how
synonym_name to create
FOR [schema.] object_name; synonym
c) Write a PL/SQL program to display 10 reverse numbers. Use 4M
Ans.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Declare 2M for
I number; correct
Begin syntax
For I in reverse 1..10
loop
Dbms_output.put_line(I); 2M for
End loop; correct
End; logic
d) Describe GRANT and Revoke with its syntax and example. 4M
Ans. Grant:
This command is used to give permission to user to do operations on Descript
the other user s object. ion of
Syntax: grant
Grant <object privileges>on< object name> to <username>[with 1M
grant option] ;
Example: Example
Grant select,update on emp to user1; 1M
Revoke:
This command is used to withdraw the privileges that has been Descript
granted to a user. ion of
revoke
Syntax: 1M
Revoke <object privileges>on<object name>
from <username> ; Example
Example: 1M
Revoke select, update on emp from user1;
Isolation-
In systems where more than one transaction execute simultaneously
and in parallel, all transaction will be carried out and each transaction
should feel that it is the only transaction happening. If Ti,Tj are two
transactions, then Ti should feel that it is the only transaction
happening while it is executing, either Tj should have completed
execution or will execute once Ti completes.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Durability-
The database should be durable enough to hold all its
latest updates even if the system fails or restarts. If a transaction
updates data in a database and commits, then the database will hold
the modified data. If a transaction commits but the system fails before
the data could be written on to the disk, then that data will be updated
once the system starts.
e) Define database backup. Describe how database backup helps to 4M
avoid failures.
Ans. Database backup:
Database Backup is storage of data that means the copy of the
data. 1M for
It is a safeguard against unexpected data loss and application definitio
errors. n
It protects the database against data loss.
If the original data is lost, then using the backup it can
reconstructed
2. Logical backup
Logical Backup contains logical data which is extracted from a
database.
It includes backup of logical data like views, procedures,
functions, tables, etc.
It is a useful supplement to physical backups in many
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
In case, you lose a database or any of the table becomes corrupt, then
you can simply reload your data from the backup. In addition, if you
lose the whole server, then you may need to set up a new server and
re-install the SQL Server backup software, before using any of your
backups.
One of the most effective ways to prevent any kind of data loss and to
recover your original data in case of any failure is to store your entire
SQL server database off-site. A secure off-shore backup can save you
from many serious hassles in future.
5. Attempt any TWO of the following: 12
a) 6M
name, address, DOB and percent.
(iv) Remove/ delete the data or records from student info table.
Ans.
rollno number(5),
name char(20), Create
address varchar2(40), table 3M
DOB date,
percent number(5,2)
);
Add 1M
alter table student add (city char(20));
Change
the
rename student to student_info; name
1M
(iv) Remove/ delete the data or records from student info table:
truncate table student_info ; Remove/
(OR) delete
delete from student_info; data 1M
b) Describe Commit, Rollback and save point with example. 6M
(Note: Any other example shall be considered)
Ans. 1) Commit:
This command is used to end the transaction and also make its effect
permanent to database. Commit deletes or removes the save points if
any.
Syntax:
Each
commit; (OR) commit work;
descripti
2) Rollback on
A rollback command is used to undo the work done in current 1M
transaction.
Syntax:
Rollback;(or) Rollback work;
3) Save point:
Save points define breakpoints for the transaction to have partial
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Syntax:
savepoint<savepoint_name>;
NO NAME CODE
---------- ------------------------------------------ ------------
1 RAM E101
SQL>COMMIT;
c) Give syntax for creating a view, Consider following schema- 6M
ACCOUNT (Account_No, Name, Account_Type, PAN_Number,
Balance). Create a view on ACCOUNT having attributes
(Account_No, Name, PAN_Number) where balance is less than
10,000.
Ans. Syntax for creating view:-
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)