RSM Question Bank - DMS 22319 RSD
RSM Question Bank - DMS 22319 RSD
MANAGEMENT SYSTEM
(22319)
4 PL/SQL programing 24
d) PL/SQL programing
c) PL/SQL programing
c) PL/SQL programing
d) PL/SQL programing
b) PL/SQL programing
CO-319.4 Apply triggers on database also create procedure and function according to
condition.
Descriptive Question
1] Define the following terms:
MCQ Question:
1. What is a foreign key?
a) A foreign key is a primary key of a relation which is an attribute in another relation
b) A foreign key is a superkey of a relation which is an attribute in more than one other
relation
c) A foreign key is an attribute of a relation that is a primary key of another
relation
d) A foreign key is the primary key of a relation that does not occur anywhere else in
the schema
2. A relational database consists of a collection of
a) Tables c) Records
b) Fields d) Keys
3. A ________ in a table represents a relationship among a set of values.
a) Column c) Row
b) Key d) Entry
Prepared By: Prof. R. S. Derle (Department of Computer Technology) Page 8 of 31
4. Student(ID, name, dept name, tot_cred) In this query which attributes form the primary
key?
a) Name c) Tot_cred
b) Dept d) ID
5. The _______operation performs a set union of two “similarly structured” tables
a) Union c) Product
b) Join d) Intersect
6. To remove a relation from an SQL database, we use the ______ command.
a) Delete c) Remove
b) Purge d) Drop table
7. SELECT name ____ instructor name, course id FROM instructor, teaches WHERE
instructor.ID= teaches.ID; Which keyword must be used here to rename the field name?
a) From c) As
b) Rename d) Join
8. SELECT * FROM employee WHERE dept_name="Comp Sci";
In the SQL given above there is an error. Identify the error.
a) Dept_name c) “Comp Sci”
b) Employee d) From
9. By default, the order by clause lists items in ______ order.
a) Descending c) Same
b) Any d) Ascending
10. In SQL the spaces at the end of the string are removed by _______ function.
a) Upper c) Trim
b) String d) Lower
11. Using the _______ clause retains only one copy of identical tuples
a) distinct c) no repeat
b) is not null d) from
12. E-R model uses this symbol to represent weak entity set ?
a) Dotted rectangle. c) Doubly outlined rectangle
b) Diamond d) None of these
13. Key to represent relationship between tables is called
a) Primary key c) Foreign Key
b) Secondary Key d) None of these
14. DBMS helps achieve _____.
a) Data independence b) Neither (A) nor (B)
c) Centralized control of data d) both (A) and (B)
Descriptive Question
1] Describe following key:
MCQ Question:
1. The statement in SQL which allows changing the definition of a table is
a) Alter c) Create
b) Update d) select
2. _____ operator is used for appending two strings.
a) & c) ||
b) % d) _
3. _____ clause is an additional filter that is applied to the result.
a) Select c) Having
b) Group-by d) Order by
Prepared By: Prof. R. S. Derle (Department of Computer Technology) Page 12 of 31
4. Which of the following is the syntax for views where v is view name?
a) Create view v as “query name”; c) Create view v as “query expression”;
b) Create “query expression” as view; d) Create view “query expression”;
5. Which of the following creates a virtual relation for storing the query?
a) Function c) Procedure
b) View d) None of the mentioned
6. Updating the value of the view
a) Will affect the relation from which it is defined
b) Will not change the view definition
c) Will not affect the relation from which it is defined
d) Cannot determine
7. Which of the following makes the transaction permanent in the database?
a) View c) Rollback
b) Commit d) Flashback
8. In order to undo the work of transaction after last commit which one should be used?
a) View c) Rollback
b) Commit d) Flashback
9. TRANSACTION.....
Commit;
ROLLBACK;
What does Rollback do?
a) Undoes the transactions before commit c) Redoes the transactions before commit
b) Clears all transactions d) No action
10. In order to maintain the consistency during transactions, database provides
a) Commit c) Flashback
b) Atomicity d) Retain
11. To include integrity constraint in an existing relation use:
a) Create table c) Alter table
b) Modify table d) Drop table
12. Which of the following is not an integrity constraint?
a) Not null c) Unique
b) Positive d) Check „predicate‟
13. Foreign key is the one in which the ________ of one relation is referenced in another
relation.
a) Foreign key c) References
b) Primary key d) Check constraint
Descriptive Question
1] Explain any four string functions with examples.
2] Explain “Group by” clause with suitable example.
3] Explain “Order by” clause with suitable example.
4] List aggregate functions in SQL.
5] Explain different functions in SQL
6] Explain views with example.
7] What is sequence? Why it is used? Create sequence for student table.
8] Explain index and list their types.
9] What are synonyms? How to create and drop synonyms?
MCQ Question:
1. In SQL the spaces at the end of the string are removed by _______ function.
a) Upper c) Trim
b) String d) Lower
2. _______ specifies a search condition for a group or an aggregate.
a) GROUP BY Clause c) FROM Clause
b) HAVING Clause d) WHERE Clause
3. _______ keyword is used to find the number of values in a column.
a) TOTAL c) ADD
b) COUNT d) SUM
4. By default, the order by clause lists items in ______ order.
a) Descending c) Same
b) Any d) Ascending
5. In SQL the spaces at the end of the string are removed by _______ function.
Prepared By: Prof. R. S. Derle (Department of Computer Technology) Page 18 of 31
a) Upper c) Trim
b) String d) Lower
6. Using the _______ clause retains only one copy of identical tuples
a) distinct c) no repeat
b) is not null d) from
7. The _______operation performs a set union of two “similarly structured” tables
a) Union c) Product
b) Join d) Intersect
8. ______________ function returns current date and time.
a) SET DATEFIRST c) Cert_ID
b) SYSDATETIME d) GETDATE
9. Which of the following function checks whether the expression is a valid date or not?
a) ISDATE c) ISVALID
b) ISDAY d) ISYEAR
10. Which of the following is not a mathematical function?
a) ATN2 c) PI
b) POWER d) CEIL
11. Built in Functions in SQL Server is categorized into how many categories?
a) 4 c) 6
b) 5 d) 7
12. Which SQL function is used to count the number of rows in a SQL query?
a) COUNT() c) SUM()
b) NUMBER() d) COUNT(*)
13. Which SQL keyword is used to retrieve a maximum value?
a) MOST c) MAX
b) TOP d) UPPER
14. A_____ is a query that retrieves rows from more than one table or view:
a) Start c) Join
b) End d) All of the mentioned
15. A condition is referred to as __________
a) Join in SQL c) Join in SQL & Condition
b) Join condition d) None of the mentioned
16. How many join types in join condition:
a) 2 c) 4
b) 3 d) 5
17. Which are the join types in join condition:
Descriptive Question
1] Explain PL/SQL block structure.
2] State 4 advantages of PL/SQL.
3] Explain while loop in PL/SQL with examples.
4] Write a PL/SQL program to print numbers from 1 to 10 using for loop.
5] Explain GOTO statement with example.
6] Describe exception handling with example.
7] Define cursor. List the two type of cursor
8] Explain following with syntax:
a) Function b) Procedure
9] What is database triggers? How to create trigger?
10] Write PL/SQL program to calculate factorial of given numbers.
MCQ Questions:
1. In SQL the spaces at the end of the string are removed by _______ function.
a) Upper c) Trim
b) String d) Lower
2. Which of the following is not a part of PL/SQL
a) Triggers c) Functions
b) Packages d) None of the mentioned
3. A _________ is a statement that the system executes whenever a database is modified
a) Trigger c) Package
b) Function d) Protocol
4. Foreign key is the one in which the ________ of one relation is referenced in another
relation.
a) Foreign key b) Primary key
Prepared By: Prof. R. S. Derle (Department of Computer Technology) Page 23 of 31
c) References d) Check constraint
5. The database administrator who authorizes all the new users, modifies the database and
takes grants privilege is
a) Super user c) Operator of operating system
b) Administrator d) All of the mentioned
6. A __________ is a special kind of a store procedure that executes in response to certain
action on the table like insertion, deletion or updating of data.
a) Procedures c) Functions
b) Triggers d) None of the mentioned
7. Triggers are not supported in
a) Delete c) Views
b) Update d) All of the mentioned
8. The CREATE TRIGGER statement is used to create the trigger. THE _____ clause
specifies the table name on which the trigger is to be attached. The ______ specifies that
this is an AFTER INSERT trigger.
a) for insert, on c) For, insert
b) On, for insert d) None of the mentioned
9. A Delete command operates on ______ relation.
a) One c) Several
b) Two d) Null
10. Which of the following is not a part of PL/SQL
a) Triggers c) Functions
b) Packages d) None of the mentioned
11. A _________ is a statement that the system executes whenever a database is modified
a) Trigger c) Package
b) Function d) Protocol
12. Which keyword is used instead of the assignment operator to initialize variables?
a) NOT NULL c) %TYPE
b) DEFAULT d) %ROWTYPE
13. Which statements execute a sequence of statements multiple times?
a) EXIT c) Both A & B
b) LOOP d) None of the above
14. Which of the following returns all distinct rows selected by either query?
a) INTERSECT c) UNION
b) MINUS d) UNION ALL
MCQ Questions:
1. In order to maintain the consistency during transactions, database provides
a) Commit c) Flashback
b) Atomicity d) Retain
2. Which of the following makes the transaction permanent in the database?
a) View c) Rollback
b) Commit d) Flashback
3. In order to undo the work of transaction after last commit which one should be used?
a) View c) Rollback
b) Commit d) Flashback
4. TRANSACTION.....
Commit;
ROLLBACK;
What does Rollback do?
a) Undoes the transactions before commit
Prepared By: Prof. R. S. Derle (Department of Computer Technology) Page 28 of 31
b) Clears all transactions
c) Redoes the transactions before commit
d) No action
5. Which of the following is used to provide privilege to only a particular attribute?
a) Grant select on employee to Amit
b) Grant update(budget) on department to Raj
c) Grant update(budget,salary,Rate) on department to Raj
d) Grant delete to Amit
6. Which of the following statement is used to remove the privilege from the user Amir?
a) Remove update on department from Amir
b) Revoke update on employee from Amir
c) Delete select on department from Raj
d) Grant update on employee from Amir
7. If we wish to grant a privilege and to allow the recipient to pass the privilege on to other
users, we append the __________ clause to the appropriate grant command.
a) With grant c) Grant pass privilege
b) Grant user d) With grant option
8. The granting and revoking of roles by the user may cause some confusion when that user
role is revoked. To overcome the above situation
a) The privilege must be granted only by roles
b) The privilege is granted by roles and users
c) The user role cannot be removed once given
d) By restricting the user access to the roles
9. The database administrator who authorizes all the new users, modifies the database and
takes grants privilege is
a) Super user c) Operator of operating system
b) Administrator d) All of the mentioned
10. What is used for database security?
a) data encryption c) finger print
b) a view d) all of the above
11. Data security threats include:
a) privacy invasion c) fraudulent manipulation of data
b) hardware protection d) all of the above
12. What are ACID properties of Transactions?
a. Atomicity, Consistency, Isolation, Database
b. Atomicity, Consistency, Isolation, Durability
c. Atomicity, Consistency, Inconsistent, Durability
Prepared By: Prof. R. S. Derle (Department of Computer Technology) Page 29 of 31
d. Automatically, Concurrency, Isolation, Durability
13. Database locking concept is used to solve the problem of
a. Lost Update c. Inconsistent Data
b. Uncommitted Dependency d. All of the above
14. Which of the following is a property of transactions?
a) Atomicity c) Isolation
b) Durability d) All of the mentioned
15. Execution of translation in isolation preserves the _________ of a database
a) Atomicity c) Durability
b) Consistency d) All of the mentioned
16. Which of the following is not a property of a transaction?
a) Atomicity c) Isolation
b) Simplicity d) Durability
17. Which of the following systems is responsible for ensuring durability?
a) Recovery system c) Concurrency control system
b) Atomic system d) Compiler system
18. Which of the following systems is responsible for ensuring isolation?
a) Recovery system c) Concurrency control system
b) Atomic system d) Compiler system
19. Backing up your SQL Server database is essential for _______ your data.
a) Protecting c) Replication
b) Preventing d) None of the mentioned
20. Backup can occur while the database is in ___________ state.
a) Online c) Restoring
b) Offline d) All of the mentioned
21. Which of the following is not a type of backup?
a) Database backup c) Table backup
b) Data backup d) all of the mentioned
22. _________ backups represent the whole database at the time the backup finished.
a) copy-only backup c) Data backup
b) Database backup d) all of the mentioned
23. Which of the following backups contain transaction logs?
a) copy-only backup c) Data backup
b) Database backup d) None of the mentioned
24. A _________ consists of a sequence of query and/or update statements.
a) Transaction b) Commit