0% found this document useful (0 votes)
0 views

impppp

The document is a sample paper for the CS409P course on Database Administration, featuring a series of multiple-choice questions related to PL/SQL, SQL commands, and database concepts. It includes practical questions on creating schemas, tables, views, and sequences, as well as questions about database triggers and exceptions. The paper is structured to assess knowledge on various aspects of database management and administration.

Uploaded by

sevdaism789
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

impppp

The document is a sample paper for the CS409P course on Database Administration, featuring a series of multiple-choice questions related to PL/SQL, SQL commands, and database concepts. It includes practical questions on creating schemas, tables, views, and sequences, as well as questions about database triggers and exceptions. The paper is structured to assess knowledge on various aspects of database management and administration.

Uploaded by

sevdaism789
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Sample Paper

FINALTERM EXAMINATION
Fall 2022
CS409P – Introduction to Database Administration (Practical)

Marks: 40

Question No: 1 (Marks: 01) - Please choose the correct option


________ are PL/SQL programs that are set up to execute in response to a particular
event on a table in the database.
a. Package
b. Functions
c. Triggers
d. Procedure

Question No: 2 (Marks: 01) - Please choose the correct option


A program that resides inside an oracle database that manipulates data in the database
before the data is used outside the database is known as __________.
a. Triggers
b. Function
c. Stored procedure
d. Package

Question No: 3 (Marks: 01) - Please choose the correct option


Which command is used to fetch records from database?

a. Fetch
b. Select
c. Use
d. Get

Question No: 4 (Marks: 01) - Please choose the correct option


A ________ is a group of PL/SQL statements that can be called by name.

a. View
b. Trigger
c. Procedure
d. Function

Question No: 5 (Marks: 01) - Please choose the correct option


How many CREATE TRIGGER statements are there?

a. 4
b. 5
c. 6
d. 7

Question No: 6 (Marks: 01) - Please choose the correct option


TRUNCATE TABLE statement is used to remove the table.

a. TRUE
b. FALSE
c. Can be true or false
d. Can not say

Question No: 7 (Marks: 01) - Please choose the correct option


Which is the smallest unit of storage in an Oracle database?

a. Segment
b. Data Block
c. Extent
d. Data File

Question No: 8 (Marks: 01) - Please choose the correct option


How many types of procedure are there?

a. 1
b. 2
c. 3
d. 4

Question No: 9 (Marks: 01) - Please choose the correct option


What is the syntax to Drop Procedure?

a. DELETE PROCEDURE procedure_name;


b. DROP PROCEDURE procedure_name;
c. RETRIEVE PROCEDURE procedure_name;
d. END PROCEDURE procedure_name;
Question No: 10 (Marks: 01) - Please choose the correct option
How many types of exceptions are there?

a. 2
b. 3
c. 4
d. 5

Question No: 11 (Marks: 01) - Please choose the correct option


Errors that are encountered during the execution of the program are referred to as ____ in
PL/SQL.

a. FUNCTION
b. CURSOR
c. EXCEPTION
d. PROCEDURE

Question No: 12 (Marks: 01) - Please choose the correct option


Which command is used in order to raise an exception explicitly?

a. RISE
b. ROSE
c. RAISE
d. RINSE

Question No: 13 (Marks: 01) - Please choose the correct option


Oracle creates ____ when SQL statements are processed.

a. Content Areas
b. Context Areas
c. Context Ids
d. Content Ids

Question No: 14 (Marks: 01) - Please choose the correct option


An SQL ____ refers to a program that retrieves and processes one row at a time, based
on the results of the SQL statement.

a. Cursor
b. Function
c. Procedure
d. View
Question No: 15 (Marks: 01) - Please choose the correct option
Which of the following would cause an infinite loop to occur in a simple loop

a. LOOP
b. END LOOP
c. IF – THEN
d. EXIT

Question No: 16 (Marks: 01) - Please choose the correct option


Which identifier is valid?

a. Customer_12
b. Loop
c. customer@orgA
d. 12customer

Question No: 17 (Marks: 01) - Please choose the correct option


Select the best answer below. What are the components of a package?

a. Box, wrapping and binding


b. Specification and content
c. Header and body
d. None of the given

Question No: 18 (Marks: 01) - Please choose the correct option


If you cannot specify a mode for a parameter, what is the default mode?

a. OUT
b. IN
c. COPY
d. DEFAULT

Question No: 19 (Marks: 01) - Please choose the correct option


____________ is online backup.

a. Hot
b. Physical
c. Cold
d. Logical

Question No: 20 (Marks: 01) - Please choose the correct option


Which of the given files are not copied in cold/offline backup.

a. Data Files
b. Control Files
c. Init.ora and config.ora files
d. Log files

Question No: 21 (Marks: 01) - Please choose the correct option


Which of the following date function can be used to get the timestamp from database?
a. SYSTEMTIMESTAMP
b. SYSTIMESTAMP
c. SYSTEMDATE
d. SYSDATE

Question No: 22 (Marks: 01) - Please choose the correct option


Which SQL statement from the following is used to create a new tablespace?
a. CREATE TABLESPACE
b. CREATE TEMPORARY TABLESPACE
c. CREATE UNDO TABLESPACE
d. Both A & B

Question No: 23 (Marks: 01) - Please choose the correct option


Views are ____ tables that don't exist physically in Oracle.

e. Real
f. Virtual
g. Both A and B
h. None of the above

Question No: 24 (Marks: 01) - Please choose the correct option


What is the syntax to create view?

a. CREATE VIEW view_name AS


b. CREATE NEW view_name AS
c. CREATE AS view_name VIEW
d. CREATE AS view_name NEW

Question No: 25 (Marks: 05)


Given are the entitles of School management system, you have to create ERD for this.
Mention the primary key and cardinality relationship among all entities.
1. Teacher
2. Class
3. Student
Answer

Entities:

 Teacher: Primary Key: Teacher_ID


 Class: Primary Key: Class_ID
 Student: Primary Key: Student_ID

Cardinality Relationships:

 A Teacher can teach multiple Classes (One-to-Many from Teacher to Class).


 A Class can have multiple Students (One-to-Many from Class to Student).
 A Student belongs to one Class (Many-to-One from Student to Class).

Question No: 26 (Marks: 05)


Write sample query for creating schema named “Product” for sample user “AE” using
following attributes?

1. Table name is “new_product”


2. View is “new_product_view”
3. Grants is “SELECT” object privilege on view to the sample user “HR”

Answer

CREATE SCHEMA AUTHORIZATION AE;


CREATE TABLE new_product (
product_id NUMBER PRIMARY KEY,
product_name VARCHAR2(100),
price NUMBER
);
CREATE VIEW new_product_view AS
SELECT * FROM new_product;
GRANT SELECT ON new_product_view TO HR;

Question No: 27 (Marks: 05)


Write the basic syntax for creating and dropping sequence.
Answer
Create Sequence Syntax:
CREATE SEQUENCE sequence_name
START WITH start_value
INCREMENT BY increment_value;

 Drop Sequence Syntax:

sql
Copy code
DROP SEQUENCE sequence_name;

Question No: 28 (Marks: 05)


Write the PL/SQL statement to create a new group of redo log files. The redo log files
name should be log1a.rdo. log2b.rdo, their size should be 100 MS, block size 512 and
group number should be 15.
Answer

CREATE LOGFILE GROUP 15 ('log1a.rdo', 'log2b.rdo') SIZE 100M


BLOCKSIZE 512;

Question No: 29 (Marks: 05)


Write SQL command to create the “Student” table having the following columns and
their constraints. You are required to choose the appropriate data type for each column by
your own.

Column Name Data Type Constraint


Std_ID - NOT NULL
Std_Name - NOT NULL
Std_Age - DEFAULT 0
Std_Course - NOT NULL

Answer

CREATE TABLE Student (


Std_ID NUMBER(5) PRIMARY KEY,
Std_Name VARCHAR2(50) NOT NULL,
Std_Age NUMBER(2) DEFAULT 0,
Std_Course VARCHAR2(50) NOT NULL
);
Or
CREATE TABLE Student (
Std_ID INT NOT NULL,
Std_Name VARCHAR2(100) NOT NULL,
Std_Age INT DEFAULT 0,
Std_Course VARCHAR2(100) NOT NULL,
PRIMARY KEY (Std_ID)
);

Question No: 30 (Marks: 05)


Write the SQL Plus statements for following.

1. Recreating control files.


2. Viewing Alert Log using data dictionary
3. To trace files for your current session.

Answer

1. Recreating control files.

sql
Copy code
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

2. Viewing Alert Log using data dictionary:

sql
Copy code
SELECT * FROM V$DIAG_ALERT_EXT;

3. To trace files for your current session:

sql
Copy code
ALTER SESSION SET SQL_TRACE = TRUE;

You might also like