3 Hours / 70 Marks: Seat No
3 Hours / 70 Marks: Seat No
3 Hours / 70 Marks: Seat No
com
11920
22319
3 Hours / 70 Marks Seat No.
Marks
(a) State any two advantages of DBMS over file processing system.
(a) Distinguish between Network and Hierarchical model. (Any four points)
[1 of 4] P.T.O.
www.truexams.com
22319 [2 of 4]
3. Attempt any THREE of the following : 12
(b) Describe create & alter command with syntax & example.
(a) Draw an ER diagram for library management system. (Use Books, Publisher
& Member entities).
(b) Write a command to create table student (rollno, Stud_name, branch, class,
DOB, City, Contact_no) and write down queries for following :
P.T.O.
www.truexams.com
22319 [4 of 4]
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 1 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Correct
diagram
2M
Page 2 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 3 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 4 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 5 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
product_name,rate)
Now the above two tables are in 2NF
Step 2: To convert the above tables in 3NF, we have to
decomposehem in three tables satisfying the transitive dependencies
property.
Table 4: Supplier Details
(Supplier_no,Supplier_name,Supplier_city)
Table 5: Product Details:
(Product_code, product_name,rate)
Table 6: Order Details (or Transaction Details)
((Order_no,Supplier_no,Product_code,Order_quantity,Order_amount
)
Hence the above three tables are satisfying Transitive dependencies.
Thus they are in 3NF.
(b) Define index. Explain it‟s types. 4M
Ans. An Index is a schema object. It is used by the oracle server to
improve the speed of retrieval of the rows from a table .Indexes are of Definitio
two types based on number of columns included in the index. n 1M
The types of index are:
1) Simple index: An index created on a single column of table is
called as simple index
Syntax: Each
SQL>Create Index index_name on tablename(attribute); type
Example:Create index emp_index on emp(empno); 1½M
2) Composite Index: An index created on more than one column is
called composite index.
Syntax:
SQL>Create Index index_name on
tablename(attribute1,attribute2);
Example: Create index emp_index on emp(empno,ename);
(c) Explain Exception handling with it‟s types. 4M
Ans. An exception is an error condition during a program execution.
PL/SQL supports programmers to catch such conditions Explana
using EXCEPTION block in the program and an appropriate action tion 2M
is taken against the error condition.
There are two types of exceptions −
1) System-defined exceptions/Predefined exceptions/Built-in
exceptions
Page 6 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
2) User-defined exception
1) Predefined exceptions- PL/SQL provides predefined Exception,
which are executed when any database rule is violated by a program.
Example: NO_DATA_FOUND, ZERO_DIVIDE.
Syntax for Predefined Exception Handling:
Types
The general syntax for exception handling is as follows. 2M
DECLARE
<declarations section>
BEGIN
<executable command(s)>
EXCEPTION
<exception handling goes here >
WHEN exception1 THEN
exception1-handling-statements
WHEN exception2 THEN
exception2-handling-statements
WHEN exception3 THEN
exception3-handling-statements
........
WHEN others THEN
exception3-handling-statements
END;
2) User defined Exceptions:
PL/SQL allow us to define our own exception according to the need
of our program. A user defined exception must be declared and then
raised explicitly.
Page 7 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
ACID Properties
A transaction is a very small unit of a program and it may contain
several lowlevel tasks. A transaction in a database system must Explana
maintain Atomicity, Consistency, Isolation, and Durability − tion
commonly known as ACID properties − in order to ensure accuracy, of each
completeness, and data integrity. property
1M
Atomicity: This property states that a transaction must be treated
as an atomic unit, that is, either all of its operations are executed
or none. There must be no state in a database where a transaction
is left partially completed. States should be defined either before
the execution of the transaction or after the
execution/abortion/failure of the transaction.
Consistency: The database must remain in a consistent state after
any transaction. No transaction should have any adverse effect on
the data residing in the database. If the database was in a
consistent state before the execution of a transaction, it must
remain consistent after the execution of the transaction as well.
Isolation: In a database system where more than one transaction
are being executed simultaneously and in parallel, the property of
isolation states that all the transactions will be carried out and
executed as if it is the only transaction in the system. No
transaction will affect the existence of any other transaction.
Durability: The database should be durable enough to hold all its
latest updates even if the system fails or restarts. If a transaction
updates a chunk of 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 springs back into
action.
4. Attempt any THREE of the following: 12
(a) Explain strong and weak entity set. 4M
Ans. Strong entity set:
An entity set that has sufficient attributes to form a primary key is
Page 8 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Syntax
The basic syntax of the CREATE TABLE statement is as follows –
CREATE TABLE table_name Each
comman
(
d 2M
column1 datatype (size),
column2 datatype(size),
column3 datatype(size),
....
);
Example:
CREATE TABLE Persons
(
PersonIDnumber(10),
LastNamevarchar2(20),
FirstNamevarchar2(20),
Address varchar2(20),
City varchar2(20)
Page 9 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
);
The ALTER TABLE statement is also used to add and drop various
constraints on an existing table.
Page 10 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Creating Triggers
The syntax for creating a trigger is −
CREATE [OR REPLACE ] TRIGGER trigger_name
{BEFORE | AFTER | INSTEAD OF } Create
{INSERT [OR] | UPDATE [OR] | DELETE} 2M
[OF col_name]
ON table_name
[REFERENCING OLD AS o NEW AS n]
[FOR EACH ROW]
WHEN (condition)
DECLARE
Declaration-statements
BEGIN
Executable-statements
EXCEPTION
Exception-handling-statements
END;
Page 11 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
ELSE
sequence_of_statements2
END IF;
END CASE;
Page 13 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
GOTO Statement
...
<<insert_row>>
INSERT INTO empVALUES ...
END;
(e) Describe database backups with it‟s types. 4M
Ans. Regular backups are required to protect database and
ensure its restoration in case of failure. Various backup types provide Descript
different protection to our database. Backing up and restoring data is ion 2M
one of the most important responsibilities of IT professionals
Three common types of database backups can be run on a desired
system: normal (full), incremental and differential.
i) Normal or Full Backups:
When a normal or full backup runs on a selected drive, all the files on
that drive are backed up. This, of course, includes system files,
application files, user data — everything. Those files are then copied
to the selected destination (backup tapes, a secondary drive or the Types
cloud), and all the archive bits are then cleared. 2M
Normal backups are the fastest source to restore lost data because all
the data on a drive is saved in one location.
ii) Incremental Backups:
A common way to deal with the long running times required for
full backups is to run them only on weekends. Many businesses then
run incremental backups throughout the week since they take far less
time. An incremental backup will grab only the files that have been
updated since the last normal backup. Once the incremental
backup has run, that file will not be backed up again unless it changes
or during the next full backup.
Page 15 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Correct
entities
2M
Correct
symbols
2M
Correct
relations
hips 2M
Page 16 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 17 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 18 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
(iii)Display all books whose price is between Rs.500 & Rs. 800
SQL> Select * from Book_Master where price between 500 and
800;
OR
SQL> Select * from Book_Master where price >=500 and
price<=800;
(iv) Display all books with details whose name start with ‘D’
SQL> Select bookname from Book_Master where bookname like
„D%‟;
(vi) Display all books whose number of copies are less than 10
SQL>Select * from Book_Master where no_of_copies<10;
(b) Write a PL/SQL program to print n even numbers using For 6M
Loop.
(Note: Any other logic can be allowed)
Page 19 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Ans. declare
num number; Correct
n number:=&n; logic 3M
begin
for num in 1..n loop
if(mod(num,2)=0) then
dbms_output.put_line(‘Even no are :’||num); Correct
end if; syntax
end loop; 3M
end;
(c) Describe database privileges. Write down the procedure for 6M
granting & revoking privileges in database objects to the users.
Ans. Database privileges:
When multiple users can access database objects, authorization can
be controlled to these objects with privileges. Every object has an
owner. Privileges control if a user can modify an object owned by Databas
another user. Privileges are granted or revoked either by the instance e
administrator, a user with the ADMIN privilege or, for privileges to a Privilege
certain object, by the owner of the object. s 2M
1) System Privileges:
System privileges are privileges given to users to allow them to
perform certain functions that deal with managing the database and
the server
e.gCreate user, Create table, Drop table etc.
2) Object Privileges:
Object privileges are privileges given to users as rights and
restrictions to change contents of database object – where database
objects are things like tables, stored procedures, indexes, etc.
Ex. Select,insert,delete,update,execute,references etc
Procdure for granting privileges
Grant: This command is used to give permission to user to do Procedu
operations on the other user’s object. re for
Syntax: Grant<object privileges>on<object granting
name>to<username>[with grant option] ; privilege
Example: Grant select, update on emp to user1; s
2M
Procedure for revoking privileges
Revoke: This command is used to withdraw the privileges that has
Page 20 / 21
www.truexams.com
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 21 / 21