πŸ—„οΈ

Database Management System MCQs

749+ questions with answers

51

The predicate in a where clause can involve Boolean operations such as and. The result of true and unknown is_______ false and unknown is _____ while unknown and unknown is _____

a Unknown, unknown, false
b True, false, unknown
c True, unknown, unknown
d Unknown, false, unknown
Medium
View Details β†’
52

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 Distinct
Medium
View Details β†’
53

Using the ______ clause retains only one copy of such identical tuples.

a Null
b Unique
c Not null
d Distinct
Medium
View Details β†’
54

The primary key must be

a Unique
b Not null
c Both Unique and Not null
d Either Unique or Not null
Medium
View Details β†’
55

You attempt to query the database with this command: SELECT nvl (100 / quantity, NONE) FROM inventory;

a The expression attempts to divide by a null value
b The data types in the conversion function are incompatible
c The character string none should be enclosed in single quotes (β€˜ β€˜)
d A null value used in an expression cannot be converted to an actual value
Medium
View Details β†’
56

The result of _____unknown is unknown.

a Xor
b Or
c And
d Not
Medium
View Details β†’
57

Aggregate functions are functions that take a ___________ as input and return a single value.

a Collection of values
b Single value
c Aggregate value
d Both Collection of values & Single value
Medium
View Details β†’
58

All aggregate functions except _____ ignore null values in their input collection.

a Count(attribute)
b Count(*)
c Avg
d Sum
Medium
View Details β†’
59

A Boolean data type that can take values true, false, and________

a 1
b 0
c Null
d Unknown
Medium
View Details β†’
60

The ____ connective tests for set membership, where the set is a collection of values produced by a select clause. The ____ connective tests for the absence of set membership.

a Or, in
b Not in, in
c In, not in
d In, or
Medium
View Details β†’
61

The phrase β€œgreater than at least one” is represented in SQL by _____

a < all
b < some
c > all
d > some
Medium
View Details β†’
62

We can test for the nonexistence of tuples in a subquery by using the _____ construct.

a Not exist
b Not exists
c Exists
d Exist
Medium
View Details β†’
63

SQL applies predicates in the _______ clause after groups have been formed, so aggregate functions may be used.

a Group by
b With
c Where
d Having
Medium
View Details β†’
64

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, where
Medium
View Details β†’
65

The ________ keyword is used to access attributes of preceding tables or subqueries in the from clause.

a In
b Lateral
c Having
d With
Medium
View Details β†’
66

Which of the following creates a temporary relation for the query on which it is defined?

a With
b From
c Where
d Select
Medium
View Details β†’
67

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.
Medium
View Details β†’
68

Which of the following is not an aggregate function?

a Avg
b Sum
c With
d Min
Medium
View Details β†’
69

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 met
Medium
View Details β†’
70

How can you find rows that do not match some specified condition?

a EXISTS
b Double use of NOT EXISTS
c NOT EXISTS
d None of the mentioned
Medium
View Details β†’
71

Which of the following creates a virtual relation for storing the query?

a Function
b View
c Procedure
d None of the mentioned
Medium
View Details β†’
72

Which of the following is the syntax for views where v is view name?

a Create view v as β€œquery name”;
b Create β€œquery expression” as view;
c Create view v as β€œquery expression”;
d Create view β€œquery expression”;
Medium
View Details β†’
73

Materialised views make sure that

a View definition is kept stable
b View definition is kept up-to-date
c View definition is verified for error
d View is deleted after specified time
Medium
View Details β†’
74

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
Medium
View Details β†’
75

SQL view is said to be updatable (that is, inserts, updates or deletes can be applied on the view) if which of the following conditions are satisfied by the query defining the view?

a The from clause has only one database relation
b The query does not have a group by or having clause
c The select clause contains only attribute names of the relation and does not have any expressions, aggregates, or distinct spec
d All of the mentioned
Medium
View Details β†’
76

For the view Create view instructor_info as SELECT ID, name, building FROM instructor, department WHERE instructor.dept name= department.dept name;

a Default value
b Null
c Error statement
d 0
Medium
View Details β†’
77

A _________ consists of a sequence of query and/or update statements.

a Transaction
b Commit
c Rollback
d Flashback
Medium
View Details β†’
78

Which of the following makes the transaction permanent in the database?

a View
b Commit
c Rollback
d Flashback
Medium
View Details β†’
79

In order to undo the work of transaction after last commit which one should be used?

a View
b Commit
c Rollback
d Flashback
Medium
View Details β†’
80

Consider the following action: TRANSACTION..... Commit; ROLLBACK;

a Undoes the transactions before commit
b Clears all transactions
c Redoes the transactions before commit
d No action
Medium
View Details β†’
81

In case of any shut down during transaction before commit which of the following statement is done automatically?

a View
b Commit
c Rollback
d Flashback
Medium
View Details β†’
82

In order to maintain the consistency during transactions, database provides

a Commit
b Atomic
c Flashback
d Retain
Medium
View Details β†’
83

A transaction completes its execution is said to be

a Committed
b Aborted
c Rolled back
d Failed
Medium
View Details β†’
84

Which of the following is used to get back all the transactions back after rollback?

a Commit
b Rollback
c Flashback
d Redo
Medium
View Details β†’
85

______ will undo all statements up to commit?

a Transaction
b Flashback
c Rollback
d Abort
Medium
View Details β†’
86

To include integrity constraint in an existing relation use :

a Create table
b Modify table
c Alter table
d Drop table
Medium
View Details β†’
87

Which of the following is not an integrity constraint?

a Not null
b Positive
c Unique
d Check β€˜predicate’
Medium
View Details β†’
88

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 constraint
Medium
View Details β†’
89

Domain constraints, functional dependency and referential integrity are special forms of _________

a Foreign key
b Primary key
c Assertion
d Referential constraint
Medium
View Details β†’
90

Which of the following is the right syntax for the assertion?

a Create assertion β€˜assertion-name’ check β€˜predicate’;
b Create assertion check β€˜predicate’ β€˜assertion-name’;
c Create assertions β€˜predicates’;
d All of the mentioned
Medium
View Details β†’
91

Data integrity constraints are used to:

a Control who is allowed access to the data
b Ensure that duplicate records are not entered into the table
c Improve the quality of data entered for a specific property (i.e., table column)
d Prevent users from changing the values stored in the table
Medium
View Details β†’
92

Which of the following can be addressed by enforcing a referential integrity constraint?

a All phone numbers must include the area code
b Certain fields are required (such as the email address, or phone number) before the record is accepted
c Information on the customer must be known before anything can be sold to that customer
d When entering an order quantity, the user must input a number and not some text (i.e., 12 rather than β€˜a dozen’)
Medium
View Details β†’
93

Dates must be specified in the format

a mm/dd/yy
b yyyy/mm/dd
c dd/mm/yy
d yy/dd/mm
Medium
View Details β†’
94

A ________ on an attribute of a relation is a data structure that allows the database system to find those tuples in the relation that have a specified value for that attribute efficiently, without scanning through all the tuples of the relation.

a Index
b Reference
c Assertion
d Timestamp
Medium
View Details β†’
95

Which of the following is used to store movie and image files?

a Clob
b Blob
c Binary
d Image
Medium
View Details β†’
96

The user defined data type can be created using

a Create datatype
b Create data
c Create definetype
d Create type
Medium
View Details β†’
97

Values of one type can be converted to another domain using which of the following?

a Cast
b Drop type
c Alter type
d Convert
Medium
View Details β†’
98

Which of the following closely resembles Create view?

a Create table . . .like
b Create table . . . as
c With data
d Create view as
Medium
View Details β†’
99

In contemporary databases, the top level of the hierarchy consists of ______ each of which can contain _____

a Catalogs, schemas
b Schemas, catalogs
c Environment, schemas
d Schemas, Environment
Medium
View Details β†’
100

Which of the following statements creates a new table temp instructor that has the same schema as an instructor.

a create table temp_instructor;
b Create table temp_instructor like instructor;
c Create Table as temp_instructor;
d Create table like temp_instructor;
Medium
View Details β†’