wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

RMP-2025-SOC23-Day 3-2

Total questions: 30

Worksheet time: 30mins

Name
Class
Date
1.
following is C like pseudo-code of a function that takes a Queue as an argument, and uses a stack S to do processing.  void fun(Queue *Q) {     Stack S;  // Say it creates an empty stack S     while (!isEmpty(Q))     { push(&S, deQueue(Q));     }     while (!isEmpty(&S))     { enQueue(Q, pop(&S));     } } What does the above function do in general?
a)
Removes the last from Q
b)
Keeps the Q same as it was before the call
c)
Makes Q empty
d)
Reverses the Q
2.
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
a)
Full: (REAR+1) mod n == FRONT, empty: REAR == FRONT
b)
Full: (REAR+1) mod n == FRONT, empty: (FRONT+1) mod n == REAR
c)
Full: REAR == FRONT, empty: (REAR+1) mod n == FRONT
d)
Full: (FRONT+1) mod n == REAR, empty: REAR == FRONT
3.
Consider the following pseudo code. Assume that IntQueue is an integer queue. What does the function fun do?  void fun(int n) {     IntQueue q = new IntQueue();     q.enqueue(0);     q.enqueue(1);     for (int i = 0; i < n; i++)     {         int a = q.dequeue();         int b = q.dequeue();         q.enqueue(b);         q.enqueue(a + b);         print(a);     } }
a)
Prints numbers from 0 to n-1
b)
Prints numbers from n-1 to 0
c)
Prints first n Fibonacci numbers
d)
Prints first n Fibonacci numbers in reverse order.
4.
Let the following circular queue can accommodate maximum six elements with the following data.What will happen after ADD O operation takes place? front = 2 rear = 4 queue = _______; L, M, N, ___, ___
a)
front = 2 rear = 5 queue = ______; L, M, N, O, ___
b)
front = 3 rear = 5 queue = L, M, N, O, ___
c)
front = 3 rear = 4 queue = ______; L, M, N, O, ___
d)
front = 2 rear = 4 queue = L, M, N, O, ___
5.
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
a)
Full: (REAR+1) mod n == FRONT, empty: REAR == FRONT
b)
Full: (REAR+1) mod n == FRONT, empty: (FRONT+1) mod n == REAR
c)
Full: REAR == FRONT, empty: (REAR+1) mod n == FRONT
d)
Full: (FRONT+1) mod n == REAR, empty: REAR == FRONT
6.
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter. MultiDequeue(Q){ m = k while (Q is not empty and m > 0) { Dequeue(Q) m = m - 1 } } What is the worst case time complexity of a sequence of n MultiDequeue() operations on an initially empty queue?
a)
Theta(n)
b)
Theta(n + k)
c)
Theta(nk)
d)
Theta(n^2)
7.
An implementation of a queue Q, using two stacks S1 and S2, is given below: void insert(Q, x) { push (S1, x); } void delete(Q){ if(stack-empty(S2)) then if(stack-empty(S1)) then { print(“Q is empty”); return; } else while (!(stack-empty(S1))){ x=pop(S1); push(S2,x); } x=pop(S2); } Let n insert and m (<=n) delete operations be performed in an arbitrary order on an empty queue Q. Let x and y be the number of push and pop operations performed respectively in the process. Which one of the following is true for all m and n?
a)
n+m <= x < 2n and 2m <= y <= n+m
b)
n+m <= x < 2n and 2m<= y <= 2n
c)
n+m <= x < 2n and 2m<= y <= 2n
d)
2m <= x <2n and 2m <= y <= 2n
8.

Examine the structure of the student table: Student Table:sid,sname,contact_no,doj(date of join),fees College management has decided to give a 15% discount on fees to the students who joined On "WEDNESDAY", Which one is a valid query?

a)
update student set fees=fees-fees*0.15 where doj='WEDNESDAY'
b)
update student set fees=fees-fees*0.15 where to_char(doj,'DY')="WEDNESDAY"
c)
update student set fees=fees-fees*0.15 where to_char(doj,'DAY')='WEDNESDAY'
d)
update student set fees=fees-fees*0.15 where to_char(doj,'DAY')="WEDNESDAY"
9.
Examine the structure of the STUDENT table: STUDENT_ID NUMBER Primary Key S_NAME VARCHAR2(25) S_BRANCH VARCHAR2(25) Which one is a correct statement?
a)
INSERT INTO STUDENT VALUES ('1000','CCC',NULL);
b)
INSERT INTO STUDENT(student_id,s_name) VALUES (1000,'CCC','CSE');
c)
INSERT INTO STUDENT VALUES (NULL,'CCC','CSE');
d)
INSERT INTO STUDENT VALUES (1000,'CCC','CSE');
10.
Examine the structure of the two tables: Student Table:sid,sname,contact_no Marks Table:sid,course_id,marks,grade Which one is a wrong statement?
a)
sid column in student table is a Primary Key column
b)
sid and course_id are the composite Primary Key in Marks Table
c)
sid column in Marks Table is a foreign key column on Student Table
d)
sid column in Student Table is a foreign key column on Marks Table
11.
Identify the wrong statement to remove column(s) from existing table?
a)
ALTER TABLE table_name DROP (column_name1,column_name2);
b)
ALTER TABLE table_name DROP column_name;
c)
ALTER TABLE table_name DROP column column_name;
d)
ALTER TABLE table_name DROP (column_name);
12.
Identify the wrong statement?
a)
CREATE TABLE STUNENT#1 (fees number(7,2));
b)
CREATE TABLE STUNENT-1 (empid number);
c)
CREATE TABLE 1STUNENT (empid number);
d)
Both b and c
13.
Which one is a correct statement?
a)
ALTER TABLE table_name STATUS = ENABLE CONSTRAINT constraint_name;
b)
ALTER TABLE table_name ENABLE constraint_name;
c)
ALTER TABLE table_name ENABLE CONSTRAINT constraint_name;
d)
ALTER TABLE table_name STATUS ENABLE CONSTRAINT constraint_name;
14.
The EMP tables has 3 columns: ENAME VARCHAR2(35) SAL NUMBER(8,2) COMMISSION NUMBER(5,2) Display the accurate daily salary along with commission also. For records that have a NULL commission,the sal column is consider as monthly salary. Which one is a correct statement?
a)
SELECT ename, (salary *12*commission)/365 FROM EMPS;
b)
SELECT ename, (salary * 12*IFNULL(commission, 0) /365 FROM EMP;
c)
SELECT ename, (salary * NULL(commission, 0))/30 FROM EMP;
d)
SELECT ename, (salary * 12 * NVL(commission, 0))/365 FROM EMP;
15.
Which clause can be specified at the last in SELECT statement?
a)
ORDER BY
b)
WHERE
c)
GROUP BY
d)
HAVING
16.
Examine the structure of the student table: Student Table: sid, sname, contact_no Which one of these is an incorrect statement?
a)
select sid student_rollnumber from student;
b)
select sname as student_name from student;
c)
select contact_no "student phone number" from student;
d)
select sname as student name from student;
17.
Which one of the following is a valid statement?
a)
The concatenation operator is represented by pipe symbol(||)
b)
The concatenation operator is links columns to other columns
c)
The concatenation operator is links columns to arithmetic expressions or constants
d)
All of the above
18.
Examine the structure of the student table: Student Table:sid,sname,contact_no,doj(date of join) Identify the query for deleting all details of students who joined eight years ago?
a)
delete from student where months_between(sysdate,doj)>96
b)
delete from student where years_between(sysdate,doj)>8
c)
delete from student where months_between(doj,sysdate)>96
d)
delete from student where years_between(doj,sysdate)>8
19.
Which one is a valid statement?
a)
to_char() function is used to convert number to characters
b)
to_char() function is used to convert date to characters
c)
to_char() function is used to convert characters to number
d)
Both A and B
20.
Examine the structure of the STUDENT table: STUDENT_ID NUMBER Primary Key S_NAME VARCHAR2(25) S_BRANCH VARCHAR2(25) Identify the query for displying all details of students who's name start with 'K' and 3rd letter shoud be 'v'?
a)
select S_NAME from STUDENT where S_NAME like 'K_v%'
b)
select * from STUDENT where S_NAME like 'K%v_'
c)
select student_id,s_name,s_branch from STUDENT where S_NAME like 'K_v%'
d)
select * from STUDENT where S_NAME like 'k_v%'
21.
Which one is a valid statement?
a)
to_date() function is used to convert number to a valid date
b)
to_date() function is used to convert date to characters
c)
to_date() function is used to convert characters to a valid date
d)
All of the above
22.
Which one is a valid statement?
a)
Group functions returns a single row based on groups of rows
b)
Group functions can be appear in SELECT lists and HAVING clauses
c)
Group functions can be appear in SELECT lists and not in HAVING clauses
d)
except c
23.
Examine the structure of the student table: Student Table:sid,sname,contact_no,doj(date of join),fee_due,branch College management has decided to know the total amount of fees due whose maximum fee due for each branch; For example,CSE branch total fee due is 50 lakhs, IT branch total fee due is 20 lakhs, ECE branch total fee due is 55 lakhs then print 55 lakhs. Which one is a valid query?
a)
select max(sum(fee_due)) from student group by branch
b)
select max(sum(fee_due)),branch from student group by branch
c)
select max(fee_due) from student
d)
select sum(fee_due) from student
24.
Which one is a correct statement?
a)
GRANT command is used to share data to other users
b)
GRANT command can be used only on table object
c)
GRANT command can be used not only table,but also on views,indexes,sequences
d)
Both A and C
25.
Which one is a correct statement?
a)
A ROLE is a group of privilages that can be assigned to a USER
b)
A ROLE is a group of privilages that can be assigned to other ROLE
c)
We can assign multiple roles to a USER or ROLE
d)
All of the above
26.
Choose incorrect statement.
a)
Normalization is used to remove insertion Anomalies
b)
Normalization is used to remove update and deletion Anomalies
c)
Normalization is used to remove total dublication of data
d)
Normalization is used to avoid data redundancy
27.
Normalization process can not be achieved by.
a)
Introducing new rows into a table.
b)
Introducing new columns into a table.
c)
Decomposing the tables from one table
d)
Combining the tables into one table
28.
Consider the attributes A and B in a Relation R, choose the correct functional dependency between A and B.
a)
A → B
b)
R → AB
c)
B<— A
d)
AB<— R
29.
Consider the following tables and choose the transitive dependency table
a)
Student table:sid,sname,branch,phone_number
b)
Marks Grade:lomarks,himarks,grade
c)
Student table:sid,cid,sname,marks,grade
d)
Student table:sid,sname,branch,mail_id
30.
Consider the following tables and choose multi valued attribute table
a)
Student table:sid,sname,branch,phone_number
b)
Marks Grade:lomarks,himarks,grade
c)
Student table:sid,cid,sname,marks,grade
d)
Student table:sid,sname,branch,phone_numbers