Database Questions & Answers – A Simple Transaction Model

This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “A Simple Transaction Model”.

1. In SQL, which command is used to issue multiple CREATE TABLE, CREATE VIEW and GRANT statements in a single transaction?
a) CREATE PACKAGE
b) CREATE SCHEMA
c) CREATE CLUSTER
d) All of the mentioned
View Answer

Answer: b
Explanation: A database schema of a database system is its structure described in a formal language supported by the database management system and refers to the organization of data as a blueprint of how a database is constructed.

2. In SQL, the CREATE TABLESPACE is used
a) To create a place in the database for storage of scheme objects, rollback segments, and naming the data files to comprise the tablespace
b) To create a database trigger
c) To add/rename data files, to change storage
d) All of the mentioned
View Answer

Answer: a
Explanation: Triggers are used to initialize the actions for an activity.

3. Which character function can be used to return a specified portion of a character string?
a) INSTR
b) SUBSTRING
c) SUBSTR
d) POS
View Answer

Answer: c
Explanation: SUBSTR are used to match the particular characters in a string.
advertisement
advertisement

4. Which of the following is TRUE for the System Variable $date$?
a) Can be assigned to a global variable
b) Can be assigned to any field only during design time
c) Can be assigned to any variable or field during run time
d) Can be assigned to a local variable
View Answer

Answer: b
Explanation: A database schema of a database system is its structure described in a formal language supported by the database management system and refers to the organization of data as a blueprint of how a database is constructed.

5. What are the different events in Triggers?
a) Define, Create
b) Drop, Comment
c) Insert, Update, Delete
d) Select, Commit
View Answer

Answer: c
Explanation: A database trigger is a procedural code that is automatically executed in response to certain events on a particular table or view in a database.

6. Which is the subset of SQL commands used to manipulate Oracle Database Structures, including tables?
a) Data Definition Language
b) Data Manipulation Language
c) Data Described Language
d) Data Retrieval Language
View Answer

Answer: a
Explanation: DDL are used to define schema and table characters.

7. The SQL statement SELECT SUBSTR(‘123456789’, INSTR(‘abcabcabc’,’b’), 4) FROM EMP; prints
a) 6789
b) 2345
c) 1234
d) 456789
View Answer

Answer: b
Explanation: SUBSTR are used to match the particular characters in a string.
advertisement

8. Which of the following SQL command can be used to modify existing data in a database table?
a) MODIFY
b) UPDATE
c) CHANGE
d) NEW
View Answer

Answer: b
Explanation: Syntax : UPDATE table_name
SET column1=value1,column2=value2,…
WHERE some_column=some_value; .

9. When SQL statements are embedded inside 3GL, we call such a program as
a) Nested query
b) Nested programming
c) Distinct query
d) Embedded SQL
View Answer

Answer: d
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
advertisement

10. _______________ provides option for entering SQL queries as execution time, rather than at the development stage.
a) PL/SQL
b) SQL*Plus
c) SQL
d) Dynamic SQL
View Answer

Answer: d
Explanation: Dynamic SQL enables you to write programs that reference SQL statements whose full text is not known until runtime.

Sanfoundry Global Education & Learning Series – Database Management System.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.