Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

51.

The intersection operator is used to get the _____ tuples.(a) Different(b) Common(c) All(d) RepeatingThe question was posed to me by my college professor while I was bunking the class.I need to ask this question from Set Operations in section SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct answer is (B) Common

Explanation: INTERSECTION operator ignores unique tuples and TAKES only common ones.

52.

Which of the following header must be included in java program to establish database connectivity using JDBC ?(a) Import java.sql.*;(b) Import java.sql.odbc.jdbc.*;(c) Import java.jdbc.*;(d) Import java.sql.jdbc.*;The question was asked in final exam.The above asked question is from Access SQL From a Programming Language in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct choice is (a) Import java.sql.*;

The BEST I can explain: The Java PROGRAM must import java.sql.*, which contains the interface DEFINITIONS for the functionality PROVIDED by JDBC.

53.

Transaction processing is associated with everything below except(a) Conforming an action or triggering a response(b) Producing detail summary or exception report(c) Recording a business activity(d) Maintaining a dataThe question was posed to me in exam.Enquiry is from Transactions topic in portion SQL : Queries, Constraints and Triggers of Database Management

Answer» CORRECT choice is (a) Conforming an action or triggering a response

To EXPLAIN: NONE.
54.

The operation which is not considered a basic operation of relational algebra is(a) Join(b) Selection(c) Union(d) Cross productI got this question in homework.This is a very interesting question from Join Expressions in section SQL : Queries, Constraints and Triggers of Database Management

Answer» RIGHT CHOICE is (a) Join

To EXPLAIN: NONE.
55.

A _____ indicates an absent value that may exist but be unknown or that may not exist at all.(a) Empty tuple(b) New value(c) Null value(d) Old valueThis question was posed to me during an interview.Question is from Null Values Operations topic in section SQL : Queries, Constraints and Triggers of Database Management

Answer» CORRECT CHOICE is (c) Null value

Easy explanation - None.
56.

What do data warehouses support?(a) OLAP(b) OLTP(c) OLAP and OLTP(d) Operational databasesThis question was addressed to me in examination.This question is from OLAP in division SQL : Queries, Constraints and Triggers of Database Management

Answer» CORRECT CHOICE is (a) OLAP

The BEST I can EXPLAIN: NONE.
57.

What are the after triggers?(a) Triggers generated after a particular operation(b) These triggers run after an insert, update or delete on a table(c) These triggers run after an insert, views, update or delete on a table(d) All of the mentionedThis question was addressed to me in an online quiz.I would like to ask this question from Triggers topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct option is (B) These TRIGGERS RUN after an insert, UPDATE or delete on a table

The explanation is: AFTER TRIGGERS can be classified further into three types as: AFTER INSERT Trigger, AFTER UPDATE Trigger, AFTER DELETE Trigger.

58.

Foreign key is the one in which the ________ of one relation is referenced in another relation.(a) Foreign key(b) Primary key(c) References(d) Check constraintThe question was asked in quiz.This key question is from Integrity Constraints in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct answer is (b) Primary key

The BEST I can explain: The foreign-key declaration specifies that for each COURSE TUPLE, the department NAME specified in the tuple must exist in the department RELATION.

59.

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(b) On, for insert(c) For, insert(d) None of the mentionedThis question was posed to me in an online interview.My question comes from Triggers topic in chapter SQL : Queries, Constraints and Triggers of Database Management

Answer»

The correct answer is (B) On, for INSERT

The explanation is: The triggers run after an insert, update or delete on a table. They are not supported for VIEWS.

60.

A __________ is a special kind of a store procedure that executes in response to certain action on the table like insertion, deletion or updation of data.(a) Procedures(b) Triggers(c) Functions(d) None of the mentionedI had been asked this question in semester exam.I'd like to ask this question from Triggers in chapter SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct answer is (B) TRIGGERS

The best EXPLANATION: Triggers are automatically generated when a particular OPERATION takes PLACE.

61.

Which of the following is used to access the database server at the time of executing the program and get the data from the server accordingly?(a) Embedded SQL(b) Dynamic SQL(c) SQL declarations(d) SQL data analysisThis question was addressed to me in quiz.I'd like to ask this question from Access SQL From a Programming Language topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct OPTION is (b) Dynamic SQL

Easiest explanation - Embedded SQL, the SQL statements are identified at compile time using a preprocessor. The preprocessor submits the SQL statements to the database system for precompilation and OPTIMIZATION; then it REPLACES the SQL statements in the application program with APPROPRIATE code and function CALLS before invoking the programming-language compiler.

62.

Which of the following is used to avoid cascading of authorizations from the user?(a) Granted by current role(b) Revoke select on department from Amit, Satoshi restrict;(c) Revoke grant option for select on department from Amit;(d) Revoke select on department from Amit, Satoshi cascade;I have been asked this question in exam.Question is taken from Authorizations topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

The CORRECT option is (b) Revoke select on department from Amit, Satoshi restrict;

For explanation: The revoke statement MAY specify restrict in order to PREVENT cascading revocation. The keyword CASCADE can be used instead of restrict to indicate that revocation should cascade.

63.

Which of the following is used to get back all the transactions back after rollback?(a) Commit(b) Rollback(c) Flashback(d) RedoI have been asked this question in an internship interview.Question is taken from Transactions in portion SQL : Queries, Constraints and Triggers of Database Management

Answer»

The CORRECT OPTION is (c) Flashback

The BEST I can explain: None.

64.

The operation of moving from finer-granularity data to a coarser granularity (by means of aggregation) is called a ________(a) Rollup(b) Drill down(c) Dicing(d) PivotingI got this question in quiz.I'm obligated to ask this question of OLAP topic in portion SQL : Queries, Constraints and Triggers of Database Management

Answer»

The correct OPTION is (a) Rollup

The best EXPLANATION: The OPPOSITE operation—that of moving fromcoarser-granularity DATA to finer-granularity data—is called a DRILL down.

65.

Using the ______ clause retains only one copy of such identical tuples.(a) Null(b) Unique(c) Not null(d) DistinctThis question was addressed to me in an international level competition.The doubt is from Null Values Operations in portion SQL : Queries, Constraints and Triggers of Database Management

Answer» RIGHT OPTION is (d) Distinct

Best EXPLANATION: UNIQUE is a CONSTRAINT.
66.

Which are the join types in join condition:(a) Cross join(b) Natural join(c) Join with USING clause(d) All of the mentionedI had been asked this question during a job interview.The query is from Join Expressions in section SQL : Queries, Constraints and Triggers of Database Management

Answer»

Right option is (d) All of the mentioned

The EXPLANATION is: There are TOTALLY four JOIN types in SQL.

67.

The__________ function that does not create gaps in the ordering.(a) Intense_rank()(b) Continue_rank()(c) Default_rank()(d) Dense_rank()This question was posed to me at a job interview.Question is taken from Recursive Queries and Aggregation Features in chapter SQL : Queries, Constraints and Triggers of Database Management

Answer» CORRECT choice is (d) Dense_rank()

The best I can EXPLAIN: For dense_rank() the tuples with the second HIGHEST value all get RANK 2, and tuples with the third highest value get rank 3, and so on.
68.

Which of the following is a following statement is a prepared statements?(a) Insert into department values(?,?,?)(b) Insert into department values(x,x,x)(c) SQLSetConnectOption(conn, SQL AUTOCOMMIT, 0)(d) SQLTransact(conn, SQL ROLLBACK)I had been asked this question during an internship interview.The origin of the question is Access SQL From a Programming Language topic in chapter SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct answer is (a) INSERT into DEPARTMENT values(?,?,?)

EASY EXPLANATION - ? is used as a PLACEHOLDER whose value can be provided later.

69.

In an employee table to include the attributes whose value always have some value which of the following constraint must be used?(a) Null(b) Not null(c) Unique(d) DistinctI got this question during a job interview.My query is from Null Values Operations topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct option is (b) Not null

To EXPLAIN: Not null CONSTRAINT removes the tuples of null VALUES.

70.

An attribute A of datatype varchar(20) has the value “Avi”. The attribute B of datatype char(20) has value”Reed”. Here attribute A has____ spaces and attribute B has ____ spaces.(a) 3, 20(b) 20, 4(c) 20, 20(d) 3, 4I had been asked this question in quiz.My question is taken from SQL Basics and SQL Data Definition in portion SQL : Queries, Constraints and Triggers of Database Management

Answer» RIGHT answer is (a) 3, 20

Easy EXPLANATION - Varchar changes its length accordingly whereas char has a specific length which has to be FILLED by either letters or SPACES.
71.

Subqueries cannot:(a) Use group by or group functions(b) Retrieve data from a table different from the one in the outer query(c) Join tables(d) Appear in select, update, delete, insert statements.The question was posed to me in unit test.This intriguing question originated from Aggregate Functions and Nested Subqueries in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

Right choice is (C) Join tables

Easiest EXPLANATION - None.

72.

The default extension for an Oracle SQL*Plus file is:(a) .txt(b) .pls(c) .ora(d) .sqlI got this question in semester exam.My question is from Triggers topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer» RIGHT OPTION is (d) .sql

Easy EXPLANATION - EXAMPLE :NONE.
73.

A transaction completes its execution is said to be(a) Committed(b) Aborted(c) Rolled back(d) FailedThis question was posed to me in exam.Question is taken from Transactions in section SQL : Queries, Constraints and Triggers of Database Management

Answer»

The CORRECT answer is (a) Committed

For explanation: A COMPLETE TRANSACTION ALWAYS COMMITS.

74.

Values of one type can be converted to another domain using which of the following?(a) Cast(b) Drop type(c) Alter type(d) ConvertI had been asked this question by my college professor while I was bunking the class.I'd like to ask this question from SQL Data Types and Schemas in chapter SQL : Queries, Constraints and Triggers of Database Management

Answer» CORRECT answer is (a) Cast

The best EXPLANATION: Example of cast :cast (department.budget to numeric(12,2)). SQL provides drop TYPE and alter type clauses to drop or modify types that have been created EARLIER.
75.

A _________ consists of a sequence of query and/or update statements.(a) Transaction(b) Commit(c) Rollback(d) FlashbackI had been asked this question during an online interview.This interesting question is from Transactions in division SQL : Queries, Constraints and Triggers of Database Management

Answer» RIGHT choice is (a) TRANSACTION

For EXPLANATION: Transaction is a set of operation until commit.
76.

Aggregate functions can be used in the select list or the_______clause of a select statement or subquery. They cannot be used in a ______ clause.(a) Where, having(b) Having, where(c) Group by, having(d) Group by, whereI got this question in an interview for internship.This interesting question is from Aggregate Functions and Nested Subqueries in chapter SQL : Queries, Constraints and Triggers of Database Management

Answer»

Right option is (b) Having, where

To EXPLAIN: To include aggregate FUNCTIONS having clause MUST be included after where.

77.

The ________ clause is used to list the attributes desired in the result of a query.(a) Where(b) Select(c) From(d) DistinctThis question was addressed to me by my school principal while I was bunking the class.My question is from SQL Queries topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer» RIGHT CHOICE is (B) Select

For EXPLANATION: NONE
78.

To remove a relation from an SQL database, we use the ______ command.(a) Delete(b) Purge(c) Remove(d) Drop tableI got this question in a national level competition.This interesting question is from SQL Basics and SQL Data Definition in section SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct answer is (d) DROP table

The EXPLANATION is: Drop table deletes the whole STRUCTURE of the relation .purge REMOVES the table which cannot be obtained again.

79.

OLAP stands for(a) Online analytical processing(b) Online analysis processing(c) Online transaction processing(d) Online aggregate processingI have been asked this question in exam.My doubt stems from OLAP in portion SQL : Queries, Constraints and Triggers of Database Management

Answer» CORRECT CHOICE is (a) Online ANALYTICAL processing

The EXPLANATION is: OLAP is the manipulation of INFORMATION to support decision making.
80.

The functions which construct histograms and use buckets for ranking is(a) Rank()(b) Newtil()(c) Ntil()(d) None of the mentionedThis question was addressed to me in final exam.I would like to ask this question from Recursive Queries and Aggregation Features topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct option is (c) NTIL()

The EXPLANATION is: For each TUPLE, ntile(n) then GIVES the number of the bucket in which it is placed, with bucket numbers starting with 1.

81.

Triggers ________ enabled or disabled(a) Can be(b) Cannot be(c) Ought to be(d) AlwaysThe question was asked during an online exam.I'm obligated to ask this question of Triggers topic in chapter SQL : Queries, Constraints and Triggers of Database Management

Answer» CORRECT ANSWER is (a) Can be

Easy EXPLANATION - TRIGGERS can be MANIPULATED.
82.

Which of the following is not an integrity constraint?(a) Not null(b) Positive(c) Unique(d) Check ‘predicate’I had been asked this question in an online interview.I want to ask this question from Integrity Constraints in portion SQL : Queries, Constraints and Triggers of Database Management

Answer» RIGHT option is (b) POSITIVE

Best EXPLANATION: Positive is a VALUE and not a CONSTRAINT.
83.

The EXISTS keyword will be true if:(a) Any row in the subquery meets the condition only(b) All rows in the subquery fail the condition only(c) Both of these two conditions are met(d) Neither of these two conditions is metI have been asked this question during an internship interview.This intriguing question comes from Aggregate Functions and Nested Subqueries topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

The correct answer is (a) Any row in the subquery meets the CONDITION only

For explanation: EXISTS KEYWORD CHECKS for existance of a condition.

84.

If the attribute phone number is included in the relation all the values need not be entered into the phone number column. This type of entry is given as(a) 0(b) –(c) Null(d) Empty spaceThe question was posed to me in a job interview.I would like to ask this question from Null Values Operations topic in section SQL : Queries, Constraints and Triggers of Database Management

Answer»

The correct ANSWER is (c) NULL

Easiest explanation - Null is used to REPRESENT the absence of a VALUE.

85.

_________ joins are SQL server default(a) Outer(b) Inner(c) Equi(d) None of the mentionedThis question was posed to me during an online interview.The above asked question is from Set Operations topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

Right answer is (b) INNER

Best explanation: It is OPTIONAL to give the inner KEYWORD with the join as it is DEFAULT.

86.

The union operation automatically __________ unlike the select clause.(a) Adds tuples(b) Eliminates unique tuples(c) Adds common tuples(d) Eliminates duplicateI got this question in quiz.This is a very interesting question from Set Operations topic in division SQL : Queries, Constraints and Triggers of Database Management

Answer»

The CORRECT ANSWER is (d) ELIMINATES duplicate

Best EXPLANATION: NONE.

87.

The union operation is represented by(a) ∩(b) U(c) –(d) *The question was asked in unit test.I would like to ask this question from Set Operations in portion SQL : Queries, Constraints and Triggers of Database Management

Answer»

Correct CHOICE is (b) U

Easy EXPLANATION - Union OPERATOR combines the RELATIONS.