0% found this document useful (0 votes)
744 views

DBMS Bca Question Bank

Uploaded by

harsh1234mathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
744 views

DBMS Bca Question Bank

Uploaded by

harsh1234mathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

DBMS

QUESTION BANK
III SEM (BCA)
1. What is the full form of DBMS?
a) Data of Binary Management System
b) Database Management System
c) Database Management Service
d) Data Backup Management System
Answer: b
Explanation: DBMS is abbreviated as Database Management System. Database Management
System stores the data and allows authorized users to manipulate and modify the data.
2. What is a database?
a) Organized collection of information that cannot be accessed, updated, and managed
b) Collection of data or information without organizing
c) Organized collection of data or information that can be accessed, updated, and managed
d) Organized collection of data that cannot be updated
Answer: c
Explanation: It is defined as an organized collection of data or information for easy access,
updating, and management in a computer.
3. What is DBMS?
a) DBMS is a collection of queries
b) DBMS is a high-level language
c) DBMS is a programming language
d) DBMS stores, modifies and retrieves data
Answer: d
Explanation: DBMS is nothing but a storehouse wherein the authorized user can create a
database to store, modify or retrieve the organized data in the table. It can be modified or
retrieved by users who have access to DBMS only.
4. Who created the first DBMS?
a) Edgar Frank Codd
b) Charles Bachman
c) Charles Babbage
d) Sharon B. Codd
Answer: b
Explanation: Charles Bachman along with his team invented the first DBMS known as
Integrated Data Store (IDS).
5. Which type of data can be stored in the database?
a) Image oriented data
b) Text, files containing data
c) Data in the form of audio or video
d) All of the above
Answer: d
Explanation: The reason for creating the database management system was to store large data
and these data can be of any form image, text, audio, or video files, etc. DBMS allows the users
to store and access the data of any format.
advertisement
6. In which of the following formats data is stored in the database management system?
a) Image
b) Text
c) Table
d) Graph
Answer: c
Explanation: The data is stored in a table format intended to manage the storage of data and
manipulate stored data to generate information.
7. Which of the following is not a type of database?
a) Hierarchical
b) Network
c) Distributed
d) Decentralized
Answer: d
Explanation: Different types are:
1) Centralized
2) Distributed
3) Relational
4) NoSQL
5) Cloud
6) Object-oriented
7) Hierarchical
8) Network
8. Which of the following is not an example of DBMS?
a) MySQL
b) Microsoft Acess
c) IBM DB2
d) Google
Answer: d
Explanation: MySQL, Microsoft Access, IBM DB2 are database management systems while
Google is a search engine. MySQL is a Linux-based database management system, Microsoft
Access is a tool that is a part of Microsoft Office used to store data, IBM DB2 is a database
management system developed by IBM. Google’s Bigtable is the database that runs Google’s
Internet search, Google Maps, YouTube, Gmail, and other products.
9. Which of the following is not a feature of DBMS?
a) Minimum Duplication and Redundancy of Data
b) High Level of Security
c) Single-user Access only
d) Support ACID Property
Answer: c
Explanation: Single-user Access only” is not a feature of DBMS. DBMS allows multiple users to
access and manipulate the database concurrently. It provides mechanisms to handle concurrent
access and ensure data consistency and integrity among multiple users.
The important features of a database management system are:

 Minimum Duplication and Redundancy of Data


 High Level of Security
 Mulitple-user Access
 Support ACID Property
10. Which of the following is a feature of the database?
a) No-backup for the data stored
b) User interface provided
c) Lack of Authentication
d) Store data in multiple locations
Answer: b
Explanation: The important features are:
1) Provides backup for the data stored by the user and the user can retrieve the data whenever
required.
2) Provides User-interface to access the data.
3) Only authorized users can access the stored data.
4) Data is stored in one central location but multiple authorized users can access the data.
11. Which of the following is not a function of the database?
a) Managing stored data
b) Manipulating data
c) Security for stored data
d) Analysing code
Answer: d
Explanation: It allows authorized users to update, store, manipulate, or access data. Since data
is stored in table format it is easy to access the data and perform the required functions. It also
removes duplicate and redundant data.
12. Which of the following is a function of the DBMS?
a) Storing data
b) Providing multi-users access control
c) Data Integrity
d) All of the above
Answer: d
Explanation: The purpose of creating DBMS was to store the data. The data stored in the
database management system can be can accessed by multiple users if the access is provided.
The data stored will be accurate and complete hence providing data integrity.
13. Which of the following is a component of the DBMS?
a) Data
b) Data Languages
c) Data Manager
d) All of the above
Answer: d
Explanation: The components of DBMS are as follows:
1) Hardware: Like a hard drive, monitor, etc.
2) Software: Provides a user interface
3) Data Manager: Manages operations of DBMS.
4) Data: The collection of information on the DB is known as data.
5) Data Languages: Languages like DDL, DML, DAL, and DCL allow to perform operations like
creating, modifying, storing, or retrieving data.
14. Which of the following is known as a set of entities of the same type that share same
properties, or attributes?
a) Relation set
b) Tuples
c) Entity set
d) Entity Relation model
Answer: c
Explanation: In the actual world, an entity is a distinct “thing” or “object” from all other objects.
For example: Each employee of an organization is an entity.
15. What is information about data called?
a) Hyper data
b) Tera data
c) Meta data
d) Relations
Answer: c
Explanation: Information about data is known as Metadata. Metadata describes the data in
detail by providing additional information like type, length of the data, etc. Metadata helps the
user to understand the data.
16. What does an RDBMS consist of?
a) Collection of Records
b) Collection of Keys
c) Collection of Tables
d) Collection of Fields
Answer: c
Explanation: It consists of a collection of tables i.e., the data is organized in tabular format. The
columns of the relation are known as Fields and rows of the relation are known as Records.
Constraints in a relation are known as Keys.
17. The values appearing in given attributes of any tuple in the referencing relation must
likewise occur in specified attributes of at least one tuple in the referenced relation, according to
_____________________ integrity constraint.
a) Referential
b) Primary
c) Referencing
d) Specific
Answer: a
Explanation: Consider 2 relations r1 and r2. r1 may include among its attributes the primary key
of relation r2. This attribute is called a foreign key from r1, referencing r2. The relation r1 is also
called the referencing relation of the foreign key dependency, and r2 is called the referenced
relation of the foreign key.
18. _____________ is a hardware component that is most important for the operation of a
database management system.
a) Microphone
b) High speed, large capacity disk to store data
c) High-resolution video display
d) Printer
Answer: b
Explanation: Since all the data are stored in form of memory in the disk, a high speed, and
large-capacity disk is required for the operation of the database management system.
19. The DBMS acts as an interface between ________________ and ________________ of an
enterprise-class system.
a) Data and the DBMS
b) Application and SQL
c) Database application and the database
d) The user and the software
Answer: c
Explanation: A database management system is an application that acts as an interface
between the user and the database. The user interacts with the application to access data.
20. The ability to query data, as well as insert, delete, and alter tuples, is offered by
____________
a) TCL (Transaction Control Language)
b) DCL (Data Control Language)
c) DDL (Data Definition Langauge)
d) DML (Data Manipulation Langauge)
Answer: d
Explanation: A query is a request for data or information. Relational Schema is the design and
structure of the relation. DDL consists of commands that help in modifying. DML performs the
change in the values of the relation.
21. ______________ is a set of one or more attributes taken collectively to uniquely identify a
record.
a) Primary Key
b) Foreign key
c) Super key
d) Candidate key
Answer: c
Explanation: Foreign key creates a relationship between two relations. Super key is the
superset of all the keys in a relation. A candidate key is used to identify tuples in a relation.
22. Which command is used to remove a relation from an SQL?
a) Drop table
b) Delete
c) Purge
d) Remove
Answer: a
Explanation: Delete command is used to delete the existing record from the table. The drop
table deletes the whole structure of the relation. Purge removes the table which cannot be
obtained again.
23. Which of the following set should be associated with weak entity set for weak entity to be
meaningful?
a) Neighbour set
b) Strong entity set
c) Owner set
d) Identifying set
Answer: d
Explanation: Every weak entity must be linked to an identifying entity; in other words, the
existence of the weak entity set is contingent on the presence of the identifying entity set. The
weak entity set that the identifying entity set identifies is said to be owned by the identifying
entity set. Owner entity set is another name for it.
24. Which of the following command is correct to delete the values in the relation teaches?
a) Delete from teaches;
b) Delete from teaches where Id =’Null’;
c) Remove table teaches;
d) Drop table teaches;
Answer: a
Explanation: To delete the entries from the table Delete from table command should be used.
25. Procedural language among the following is __________
a) Domain relational calculus
b) Tuple relational calculus
c) Relational algebra
d) Query language
Answer: c
Explanation: Non-Procedural Languages are Domain relational calculus and Tuple relational
calculus. Relational algebra is a procedural language that takes input in the form of relation and
output generated is also a relation.
26. _________________ operations do not preserve non-matched tuples.
a) Left outer join
b) Inner join
c) Natural join
d) Right outer join
Answer: b
Explanation: Left outer join returns all the rows from the table that is on the left side and
matching rows on the right side of the join. Inner join returns all rows when there is at least one
match in BOTH tables. Natural join returns the common columns from the tables being joined. A
right outer join returns all the rows from the table that is on the right side and matching rows on
the left side of the join.
27. Which forms have a relation that contains information about a single entity?
a) 4NF
b) 2NF
c) 5NF
d) 3NF
Answer: d
Explanation: A table is in its 3rd NF if it has already completed in 2NF, and non-key attributes
are not dependent on any non-key attributes. This means that all non-key attributes must
depend on primary key. When a table represents a single entity, the primary key will identify the
instance row and all attributes in 3NF are dependent on the primary key. So, the primary key in
the 3th NF captures the whole information of this single entity.
28. The top level of the hierarchy consists of ______ each of which can contain _____.
a) Schemas, Catalogs
b) Schemas, Environment
c) Environment, Schemas
d) Catalogs, Schemas
Answer: d
Explanation: Schemas represent the logical configuration of the DBMS. Catalogs consist of
metadata of the objects and system settings used.
29. _______ indicates the maximum number of entities that can be involved in a relationship.
a) Greater Entity Count
b) Minimum cardinality
c) Maximum cardinality
d) ERD
Answer: c
Explanation: The term cardinality refers to the uniqueness of data values included in a single
column (attribute) of a table in SQL (Structured Query Language).
30. The user IDs can be added or removed using which of the following fixed roles?
a) db_sysadmin
b) db_accessadmin
c) db_securityadmin
d) db_setupadmin
Answer: b
Explanation: Along with security, as the name suggests the db_accessadmin role also handles
access. db_sysadmin refers to the system administrator. db_securityadmin as the name
suggests it involves granting or declining permission to access the data ensuring security.
31. Why the following statement is erroneous?

SELECT dept_name, ID, avg (salary)


FROM instructor
GROUP BY dept_name;

a) Dept_id should not be used in group by clause


b) Group by clause is not valid in this query
c) Avg(salary) should not be selected
d) None

Answer: a
Explanation: Any property that does not occur in the group by clause must only appear in an
aggregate function if it also appears in the select clause; otherwise, the query is considered
incorrect.

32. The traditional storage of data organized by the customer, stored in separate folders in filing
cabinets is an example of ______________ type of ‘database’ management system.
a) Object-oriented database management system
b) Relational database management system
c) Network database management system
d) Hierarchical database management system
Answer: d
Explanation: In an object-oriented database management system, the data is stored in the form
of objects. In a relational DBMS, the data is stored in the form of tables. Hierarchy is obtained
by Parent-Child Relationship. Parent-Child Relationship Type is basically a 1:N relationship.

33. After groups have been established, SQL applies predicates in the ___________ clause,
allowing aggregate functions to be used.
a) Where
b) Having
c) Group by
d) With
Answer: b
Explanation: In SQL, after grouping data using the GROUP BY clause, the HAVING clause is
used to filter the groups based on specific conditions. It allows the use of aggregate functions
and selects only the groups that satisfy the given criteria.

34. Which of the following is not the utility of DBMS?


a) Backup
b) Data Loading
c) Process Organization
d) File organization
Answer: c
Explanation: Backup utility is used to create a copy of the db as a backup. Loading utility is used
to load existing file. File organization is used to relocate the files and create new access path.
Processing is not an utility.

35. What does a foreign key combined with a primary key create?
a) Network model between the tables that connect them
b) Parent-Child relationship between the tables that connects them
c) One to many relationship between the tables that connects them
d) All of the mentioned
Answer: b
Explanation: When the foreign key of one table references the primary key of another table, the
foreign key creates a parent-child relationship. The table containing the primary key is
considered the parent table where as the table containing the foreign key is considered the child
table.

36. Which of the following is correct according to the technology deployed by DBMS?
a) Pointers are used to maintain transactional integrity and consistency
b) Cursors are used to maintain transactional integrity and consistency
c) Locks are used to maintain transactional integrity and consistency
d) Triggers are used to maintain transactional integrity and consistency
Answer: c
Explanation: Pointers are used to access data with great speed and accuracy. Consistency is
maintained using locks.

37. Which of the following is correct regarding the file produced by a spreadsheet?
a) can be used as it is by the DBMS
b) stored on disk in an ASCII text format
c) all of the mentioned
d) none of the mentioned
Answer: a
Explanation: For updating the value in ASCII text format, a regular text file is used.

38. What is the function of the following command?

Delete from r where P;

a) Clears entries from relation


b) Deletes relation
c) Deletes particular tuple from relation
d) All of the mentioned
Answer: c
Explanation: In the command the P gives condition to delete a particular tuple.

39. ______ resembles Create view.


a) Create table . . . as
b) Create view as
c) Create table . . .like
d) With data
Answer: a
Explanation: The ‘create table… as’ statement is similar to the ‘create view… as’ statement in
that both are defined with queries. The main distinction is that table contents are set when the
table is built, whereas view contents always reflect the current query result.

40. The query specifying the SQL view is said to be updatable if it meets which of the following
conditions?
a) select clause contains relation attribute names but not have expressions, aggregates, or
distinct specification
b) from clause has 1 relation
c) query does not have group by or having clause
d) All of the mentioned
Answer: d
Explanation: To update the view in sql all the conditions must be satisfied.

41. When the “ROLLUP” operator for expression or columns within a “GROUP BY” clause is
used?
a) Find the groups that make up the subtotal in a row
b) Create group-wise grand totals for the groups indicated in a GROUP BY clause
c) Group expressions or columns specified in a GROUP BY clause in one direction, from right to
left, for computing the subtotals
d) To produce a cross-tabular report for computing subtotals by grouping phrases or columns
given within a GROUP BY clause in all available directions
Answer: c
Explanation: A view can be thought of as a virtual table that gets its data from one or more table
columns.

42. Which of the following is the best way to represent the attributes in a large db?
a) Dot representation
b) Concatenation
c) Relational-and
d) All of the mentioned
Answer: b
Explanation: Concatenation in DBMS is used to join two or more table fields of the same table
or different tables. Example inst sec and student sec.

43. Which of the following is the subset of SQL commands used to manipulate Oracle
Structures, including tables?
a) Data Described Language
b) Data Retrieval Language
c) Data Manipulation Language
d) Data Definition Language
Answer: d
Explanation: DDLs are used to define schema and table characters and consist of commands
that help in modifying. DML performs the change in the values of the relation.

44. Which of the following functions construct histograms and use buckets for ranking?
a) Ntil()
b) Newtil()
c) Rank()
d) All of the mentioned
Answer: a
Explanation: ntile(n) returns the number of the bucket in which each tuple is stored, with bucket
numbers beginning with 1.

45. __________ command is used in SQL to issue multiple CREATE TABLE, CREATE VIEW
and GRANT statements in a single transaction.
a) CREATE CLUSTER
b) CREATE PACKAGE
c) CREATE SCHEMA
d) All of the mentioned
Answer: c
Explanation: A schema is a description of a system’s structure in a formal language supported
by the database management system, and it refers to data organization as a blueprint for how a
db is built.

46. Which of the following key is required in to handle the data when the encryption is applied to
the data so that the unauthorised user cannot access the data?
a) Primary key
b) Authorised key
c) Encryption key
d) Decryption key
Answer: c
Explanation: The encryption key is used to encrypt the message. Even if the message is
intercepted by an enemy, the enemy will be unable to decrypt and interpret the message
because he lacks the key.

47. Which of the following is known as the process of viewing cross-tab with a fixed value of one
attribute?
a) Dicing
b) Pivoting
c) Slicing
d) Both Pivoting and Dicing
Answer: c
Explanation: Slice procedure takes one dimension from a cube and turns it into a new sub-cube.
Dice takes two or more dimensions from a cube and creates a new sub-cube from them.

48. For designing a normal RDBMS which of the following normal form is considered adequate?
a) 4NF
b) 3NF
c) 2NF
d) 5NF
Answer: b
Explanation: Because most 3NF tables are free of insertion, update, and deletion anomalies, an
RDBMS table is sometimes regarded as “normalized” if it is in the Third Normal Form.

49. Which of the following is popular for applications such as storage of log files in a database
management system since it offers the best write performance?
a) RAID level 0
b) RAID level 1
c) RAID level 2
d) RAID level 3
Answer: b
Explanation: RAID level 0 refers to data stripping. RAID level 1 refers to disk mirroring with
block striping. RAID level 2 refers to bit-level stripping and RAID level 3 refers to byte-level
striping with dedicated parity.

50. Which of the following represents a query in the tuple relational calculus?
a) { }{P(t) | t }
b) {t | P(t)}
c) t | P() | t
d) All of the mentioned
Answer: b
Explanation: A nonprocedural query language is the tuple relational calculus. It specifies the
needed information but does not provide a detailed strategy for obtaining it.

51. The oldest DB model is _______________


a) Network
b) Physical
c) Hierarchical
d) Relational

Answer: c
Explanation: Hierarchical database model was developed by IBM in the early 1960s. It had
Parent-Child Relationship.

52. Evaluate the statements issued by the DBA in the given sequence if OE and SCOTT are the
users and the ORDERS table is owned by OE.

CREATE ROLE r1;


GRANT SELECT, INSERT ON oe.orders TO r1;
GRANT r1 TO scott;
GRANT SELECT ON oe.orders TO scott;
REVOKE SELECT ON oe.orders FROM scott;

What would be the outcome after executing the statements?


a) The REVOKE statement would give an error because the SELECT privilege has been
granted to the role r1
b) The REVOKE statement would remove the SELECT privilege from SCOTT as well as from
the role r1
c) SCOTT would be able to query the OE.ORDERS table
d) SCOTT would not be able to query the OE.ORDERS table
Answer: c
Explanation: To perform operations on objects, the REVOKE statement is used to revoke rights
from a single user or role, or from all users. After revocation, SCOTT still has the r1 role with
SELECT and INSERT privilege on the OE.ORDERS table. So, SCOTT will still be able to query
the OE.ORDERS table.

53. Which of the following establishes a top-to-bottom relationship among the items?
a) Relational schema
b) Network schema
c) Hierarchical schema
d) All of the mentioned
Answer: c
Explanation: A data model in which the data is structured into a tree-like structure is known as a
hierarchical model. The structure allows information to be represented using parent-child
relationships.

54. A major goal of the db system is to minimize the number of block transfers between the disk
and memory. Which of the following helps in achieving this goal?
a) Secondary storage
b) Storage
c) Catalog
d) Buffer
Answer: d
Explanation: Every block has a copy on disc, however, the copy on the disc may be an earlier
version of the block than the version in the buffer.

55. What happens if a piece of data is stored in two places in the db?
a) Storage space is wasted & Changing the data in one spot will cause data inconsistency
b) In can be more easily accessed
c) Changing the data in one spot will cause data inconsistency
d) Storage space is wasted
Answer: a
Explanation: One of the main features of a database management system is minimum data
duplication and redundancy. Hence, is always consistent and so there is no duplication.

56. The logical design, and the snapshot of the data at a given instant in time is known as?
a) Instance & Relation
b) Relation & Schema
c) Domain & Schema
d) Schema & Instance
Answer: d
Explanation: Instance is an instance of time, the relation is also known as table consists of data
with similar characteristics, Domain is the collection of values that an attribute can contain and
schema is a representation.

1. Which of the following is the full form of RDBMS?


a) Relational Data Management System
b) Relational Database Management System
c) Relative Database Management System
d) Regional Data Management System
View Answer
Answer: b
Explanation: A relational database management system (RDBMS) is a set of
applications and features that allow IT professionals and others to develop, edit,
administer, and interact with relational databases.
2. What is an RDBMS?
a) Database that stores data elements that are not linked
b) Database that accesses data elements that are not linked
c) Database that stores and allows access to data elements that are linked
d) None of the mentioned
View Answer
Answer: c
Explanation: A relational database is a form of database that stores and allows
access to data elements that are linked. The relational model, a simple and
obvious means of representing data in tables, is the foundation of relational
databases.
3. Does RDBMS have ACID properties?
a) Follows ACID properties
b) Doesn’t follow ACID properties
c) Depends on the data stored in the database
d) Can’t say
View Answer
Answer: c
Explanation: Relational database transactions are defined by four key properties:
atomicity, consistency, isolation, and durability (also known as ACID).
i) All of the elements that make up a full database transaction are defined by
atomicity.
ii) The principles for keeping data points in a valid condition following a
transaction are defined by consistency.
iii) To minimize confusion, isolation makes the consequence of a transaction
invisible to others until it is committed.
iv) Once a transaction is committed, durability ensures that data changes are
permanent.
4. What is a relation in RDBMS?
a) Key
b) Table
c) Row
d) Data Types
View Answer
Answer: b
Explanation: In a relational database, each table, also known as a relation,
includes one or more data types in the form of columns or attributes. Each row,
also known as a record or tuple, includes a single instance of data — or key —
for each of the columns categories.
5. Which of the following systems use RDMS?
a) Oracle
b) Microsoft SQLServer
c) IBM
d) All of the mentioned
View Answer
Answer: d
Explanation: Manufacturing, human resources, and banking are all industries that
use relational database management systems. IBM, Oracle, MySQL, Microsoft
SQLServer, and PostgreSQL are some examples of RDBMS-based systems.
advertisement
6. Dynamic hashing allows us to?
a) Accommodate the growth of the database
b) Accommodate the shrinkage of the database
c) Allows modification of hash function
d) All of the mentioned
View Answer
Answer: d
Explanation: Dynamic hashing allows us to accommodate the growth of the
database and the shrinkage of the database by allowing us to change the hash
function dynamically.
7. Which of the following constraints RDBS doesn’t check before creating the
tables?
a) Not null
b) Primary keys
c) Data Structure
d) Data integrity
View Answer
Answer: c
Explanation: Before creating the tables, the RDBMS will check the following
constraints:
1. Primary keys
2. Foreign keys
3. Not null
4. Check
5. Data integrity
8. Which of the following is the correct option for the given query?

SELECT DISTINCT name


FROM RDBMS
WHERE ID IS NOT NULL;

a) The query gives all the possible RDBMS names where a finite value exists for
ID
b) The query gives the RDBMS names where a finite value exists for ID and it
excludes identical names
c) The query gives the names of the RDBMS that have a null ID and it also
excludes identical names
d) The query is syntactically wrong
View Answer
Answer: b
Explanation: The distinct keyword is used to remove tuples that have identical
values. The is not null clause checks only for ID’s that are not null values.
9. Which of the following is the correct output for the given query?
(SELECT databaseid
FROM RDBMS
WHERE SECTION = 'c')
EXCEPT
(SELECT databaseid
FROM RDBMS
WHERE id < 10);

a) All the values of the databaseid for which section is c and id > 10
b) All the values of the databaseid for which section not c and id > 10
c) All the values of the databaseid for which section is c and id < 10
d) All the values of the databaseid for which section not c and id < 10
View Answer
Answer: a
Explanation: The except operation excludes all the tuples that are present in the
result of the second query from the result of the first query. It also excludes all
duplicates from the relation.
10. Which of the following commands do we use to delete a relation (RDBMS)
from a database?
a) delete table RDBMS
b) drop table RDBMS
c) delete from RDBMS
d) drop relation RDBMS
View Answer
Answer: b
Explanation: The drop table command is used to delete a relation from a
database whereas the delete table removes all the tuples from a relation
11. If RDBMS1, RDBMS2, RDBMS3 are attributes in a relation and S is another
relation, which of the following is an incorrect specification of an integrity
constraint?
a) foreign key(RDBMS1, RDBMS2)
b) foreign key(RDBMS1, RDBMS2) references S
c) primary key(RDBMS1, RDBMS2, RDBMS3)
d) primary key(RDBMS1)
View Answer
Answer: a
Explanation: Whenever the integrity constraint foreign key is mentioned, the
attributes that are the foreign keys should always be referenced from the relation
in which they are primary keys.
12. Which of the following is the time of temporal data that record when a fact
was recorded in a database?
a) Enter time
b) Exit time
c) Valid time
d) Transaction time
View Answer
Answer: d
Explanation: The transaction time is the time of temporal data that records when
a fact was recorded in a database.
13. ________ deletes a data item from a database.
a) Insert(RDBMS)
b) Drop(RDBMS)
c) Delete(RDBMS)
d) None of the mentioned
View Answer
Answer: c
Explanation: Delete(RDBMS) deletes a data item from a database.
Insert(RDBMS) inserts a new data item RDBMS into the database and assigns
RDBMS an initial value.
14. What is the result of the following query?

SELECT studentdatabasename
FROM RDBMS
WHERE marks > SOME (SELECT marks
FROM student
WHERE SECTION = 'c');

a) The query gives all the studentdatabasename for which marks are greater
than all the students in section c
b) The query gives all the studentdatabasename for which the marks are greater
than at least on student in section c
c) The query gives all the studentdatabasename for which the marks are less
than all the students in section c
d) The query is syntactically incorrect
View Answer
Answer: b
Explanation: The “some” comparison is used to check for at least one condition.
The > symbol is used to test whether the marks are greater than the right-hand
side or not.
15. ________ is a predicate that we expect the database to always satisfy
a) Reason
b) Mandate
c) Assertion
d) Verify
View Answer
Answer: c
Explanation: An assertion is a predicate that we expect the database to always
satisfy. Domain constraints and referential integrity constraints are special forms
of assertions.
16. Which of the following is a good database management practice?
a) Adding redundant attributes
b) Not specifying primary keys
c) Removing redundant attributes
d) None of the mentioned
View Answer
Answer: c
Explanation: Removing redundant attributes from a relation makes data
extraction more efficient and faster. Thus, it is a good database management
technique.
17. What is an Instance of a Database?
a) The state of the database system at any given point of time
b) The entire set of attributes of the Database put together in a single relation
c) The initial values inserted into the Database immediately after its creation
d) The logical design of the database system
View Answer
Answer: a
Explanation: The state of the database system at any given point of time is called
as an Instance of the database.
18. The schema for the relationship set linking a weak entity set to its
corresponding strong entity set is redundant.
a) False
b) True
View Answer
Answer: b
Explanation: The schema for the relationship set linking a weak entity set to its
corresponding strong entity set is redundant and it need not be present in the
relational database design derived from an ER diagram.
19. Which of the following information does the database system catalog store?
a) Number of blocks
b) Size of a tuple of a relation
c) Number of tuples
d) All of the mentioned
View Answer
Answer: d
Explanation: The database system catalog stores the number of tuples, number
of blocks, size of a tuple in a relation, and the blocking factor in it as statistical
data.
20. If the database modifications occur while the transaction is still active, the
transaction is said to use the __________ modification technique
a) Immediate
b) Deferred
c) More than one of the mentioned
d) None of the mentioned
View Answer
Answer: a
Explanation: If the database modifications occur while the transaction is still
active, the transaction is said to use the immediate modification technique.
Deferred modification has overhead whereas immediate modification doesn’t
have any overhead.
21. If a transaction does not modify the database until it has committed it is said
to use a _______ modification technique
a) Immediate
b) Deferred
c) More than one of the mentioned
d) None of the mentioned
View Answer
Answer: b
Explanation: If a transaction does not modify the database until it has committed
it is said to use a deferred modification technique. Deferred modification has the
overhead that transactions need to make local copies of all updated data items.
22. The dependency rules specified by the database designer are known as
_______
a) Functional dependencies
b) Designer dependencies
c) Database rules
d) None of the mentioned
View Answer
Answer: a
Explanation: The dependency rules specified by the database designer are
known as functional dependencies. The normal forms are based on functional
dependencies.
23. During the _______ phase, the local variables that hold the write operations
are copied to the database
a) Validation phase
b) Write phase
c) Read phase
d) None of the mentioned
View Answer
Answer: b
Explanation: During the write phase, the local variables that hold the write
operations are copied to the database. Read only operations omit this phase.
24. What is the format of entering date into a database while inserting data into
it?
a) “YYYY-MM-DD”
b) YYYY-MM-DD
c) “DD-MM-YYYY”
d) ‘YYYY-MM-DD’
View Answer
Answer: d
Explanation: The correct format for entering date into the database while
inserting data is
‘YYYY-MM-DD’.
25. What does the following query do?

UPDATE student
SET marks = marks*1.10;

a) It decreases the marks of all the students by 90%


b) It increases the marks of all the students by 10%
c) It is syntactically wrong
d) It increases the marks of all the students by 110%
View Answer
Answer: b
Explanation: The updated clause is used to edit a specific value in the tuple. The
set command is used to set the value of an attribute in a tuple.
26. Which of the following cannot be used to modify the data in a database?
a) delete
b) update
c) drop
d) insert
View Answer
Answer: c
Explanation: The drop keyword is used to delete the entire relation leaving no
trace of it in the memory. Thus it cannot be used to edit the data in the relation.
27. Observe the given SQL query and choose the correct option.
SELECT database_name, RDBMS (DISTINCT bankuser_name)
FROM depositor, account
WHERE depositor.account_number = account.account_number
GROUP BY branch_id

a) The query is syntactically correct and gives the correct answer


b) The query is syntactically wrong
c) The query is syntactically correct but gives the wrong answer
d) The query contains one or more wrongly named clauses
View Answer
Answer: b
Explanation: The query is syntactically wrong. The attribute in the group by
clause must be one of the attributes specified in the select clause.
28. for each tuple tr in r do begin

FOR each tuple ts IN s do BEGIN


test pair (tr , ts ) TO see IF they satisfy the JOIN condition _
IF they do, ADD tr • ts TO the RESULT;
END
END

What type of join is this?


a) Block nested loop join
b) Nested loop join
c) Hash join
d) Equi join
View Answer
Answer: b
Explanation: The given algorithm is called as a nested loop join because it
basically consists of two nested for loops in it i.e. one for loop is inside another
for loop.
29. Choose the correct option regarding the query

SELECT branch_name, COUNT (DISTINCT customer_name)


FROM depositor, account
WHERE depositor.account_number = account.account_number
GROUP BY branch_id
HAVING avg(balance) = 10000;

a) The having clause allows only those tuples that have an average balance of
10000
b) The having clause checks whether the query result is true or not
c) The having clause does not check for any condition
d) None of the mentioned
Answer: a
Explanation: The having clause is used to check for conditions that need to be
set on aggregate functions.

Which of the following gives a logical structure of the database graphically?


a) Entity-relationship diagram
b) Entity diagram
c) Database diagram
d) Architectural representation
View Answer
Answer: a
Explanation: E-R diagrams are simple and clear—qualities that may well account in large
part for the widespread use of the E-R model.

2. The entity relationship set is represented in E-R diagram as


a) Double diamonds
b) Undivided rectangles
c) Dashed lines
d) Diamond
View Answer
Answer: d
Explanation: Dashed lines link attributes of a relationship set to the relationship set.

3. The Rectangles divided into two parts represents


a) Entity set
b) Relationship set
c) Attributes of a relationship set
d) Primary key
View Answer
Answer: a
Explanation: The first part of the rectangle, contains the name of the entity set. The second
part contains the names of all the attributes of the entity set.
advertisement
4. Consider a directed line(->) from the relationship set advisor to both entity sets instructor
and student. This indicates _________ cardinality
a) One to many
b) One to one
c) Many to many
d) Many to one
View Answer
Answer: b
Explanation: This indicates that an instructor may advise at most one student, and a student
may have at most one advisor.

5. We indicate roles in E-R diagrams by labeling the lines that connect ___________ to
__________
a) Diamond , diamond
b) Rectangle, diamond
c) Rectangle, rectangle
d) Diamond, rectangle
View Answer
Answer: d
Explanation: Diamond represents a relationship set and rectangle represents a entity set.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate


Now!

6. An entity set that does not have sufficient attributes to form a primary key is termed a
__________
a) Strong entity set
b) Variant set
c) Weak entity set
d) Variable set
View Answer
Answer: c
Explanation: An entity set that has a primary key is termed a strong entity set.

7. For a weak entity set to be meaningful, it must be associated with another entity set,
called the
a) Identifying set
b) Owner set
c) Neighbour set
d) Strong entity set
View Answer
Answer: a
Explanation: Every weak entity must be associated with an identifying entity; that is, the
weak entity set is said to be existence dependent on the identifying entity set. The
identifying entity set is said to own the weak entity set that it identifies. It is also called as
owner entity set.

8. Weak entity set is represented as


a) Underline
b) Double line
c) Double diamond
d) Double rectangle
View Answer
Answer: d
Explanation: Weak entity set is represented as a double rectangle in entity relationship
diagram.

9. If you were collecting and storing information about your music collection, an album
would be considered a(n) _____
a) Relation
b) Entity
c) Instance
d) Attribute
View Answer
Answer: b
Explanation: An entity set is a logical container for instances of an entity type and instances
of any type derived from that entity type.

10. What term is used to refer to a specific record in your music database; for instance;
information stored about a specific album?
a) Relation
b) Instance
c) Table
d) Column
View Answer
Answer: b
Explanation: The environment of database is said to be an instance. A database instance or
an ‘instance’ is made up of the background processes needed by the database.

This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “SQL
Queries”.

1.

Name

Annie

Bob

Callie

Derek
Which of these query will display the the table given above ?
a) Select employee from name
b) Select name
c) Select name from employee
d) Select employee
View Answer
Answer: c
Explanation: The field to be displayed is included in select and the table is included in the
from clause.

2. Here which of the following displays the unique values of the column?

advertisement
SELECT ________ dept_name
FROM instructor;
a) All
b) From
c) Distinct
d) Name
View Answer
Answer: c
Explanation: Distinct keyword selects only the entries that are unique.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate


Now!

3. The ______ clause allows us to select only those rows in the result relation of the ____
clause that satisfy a specified predicate.
a) Where, from
b) From, select
c) Select, from
d) From, where
View Answer
Answer: a
Explanation: Where selects the rows on a particular condition. From gives the relation which
involves the operation.

4. The query given below will not give an error. Which one of the following has to be
replaced to get the desired output?

SELECT ID, name, dept_name, salary * 1.1


WHERE instructor;

a) Salary*1.1
b) ID
c) Where
d) Instructor
View Answer
Answer: c
Explanation: Where selects the rows on a particular condition. From gives the relation which
involves the operation. Since Instructor is a relation it has to have from clause.

5. The ________ clause is used to list the attributes desired in the result of a query.
a) Where
b) Select
c) From
d) Distinct
View Answer
Answer: b
Explanation: None

6. This Query can be replaced by which one of the following?

SELECT name, course_id


FROM instructor, teaches
WHERE instructor_ID= teaches_ID;

a) Select name,course_id from teaches,instructor where instructor_id=course_id;


b) Select name, course_id from instructor natural join teaches;
c) Select name, course_id from instructor;
d) Select course_id from instructor join teaches;
View Answer
Answer: b
Explanation: Join clause joins two tables by matching the common column.

7.

SELECT * FROM employee WHERE salary>10000 AND dept_id=101;

Which of the following fields are displayed as output?


a) Salary, dept_id
b) Employee
c) Salary
d) All the field of employee relation
View Answer
Answer: d
Explanation: Here * is used to select all the fields of the relation.

8.

Employee_id Name Salary

1001 Annie 6000

1009 Ross 4500

1018 Zeith 7000


This is Employee table.
Which of the following employee_id will be displayed for the given query?

SELECT * FROM employee WHERE employee_id>1009;

a) 1009, 1001, 1018


b) 1009, 1018
c) 1001
d) 1018
View Answer
Answer: d
Explanation: Greater than symbol does not include the given value unlike >=.

9. Which of the following statements contains an error?


a) Select * from emp where empid = 10003;
b) Select empid from emp where empid = 10006;
c) Select empid from emp;
d) Select empid where empid = 1009 and lastname = ‘GELLER’;
View Answer
Answer: d
Explanation: This query do not have from clause which specifies the relation from which the
values has to be selected.

10. In the given query which of the keyword has to be inserted?

INSERT INTO employee _____ (1002,Joey,2000);

a) Table
b) Values
c) Relation
d) Field
View Answer
Answer: b
Explanation: Value keyword has to be used to insert the values into the table.

1. A management procedure called ___ control is required to


control the process of concurrently performing operations on a
database.

A. Database
B. Conspiracy
C. Concurrency
D. Relational

Answer: C) Concurrency

Explanation:

A management procedure called concurrency control is required to


control the process of concurrently performing operations on a
database.

Discuss this Question

2. The concurrent execution of the database in a ____-user


system refers to the fact that multiple users are able to access
and use it at the same time.

A. Single
B. Two
C. Three
D. Multiple

Answer: D) Multiple

Explanation:

The concurrent execution of the database in a multi-user system refers


to the fact that multiple users are able to access and use it at the same
time.

Discuss this Question

3. When dealing with database transactions, there is often a


need for multiple users to use a database to perform different
operations. In this case, ___ of the database occurs.

A. Concurrent Connection
B. Concurrent Reduction
C. Concurrent Execution
D. Concurrent Revolution

Answer: C) Concurrent Execution

Explanation:

When dealing with database transactions, there is often a need for


multiple users to use a database to perform different operations. In this
case, concurrent execution of the database occurs.

Discuss this Question

4. During simultaneous execution, each operation should be


performed interleaved with the others, ensuring that there is
no interference with the other operations. This maintains a
database ___.

A. Consistency
B. Redundancy
C. Concurrency
D. None

Answer: C) Concurrency

Explanation:

During simultaneous execution, each operation should be performed


interleaved with the others, ensuring that there is no interference with
the other operations. This maintains database consistency.

Discuss this Question

5. What are the two main operations in the database


transaction?

A. READ
B. WRITE
C. Both A and B
D. None of the above

Answer: C) Both A and B

Explanation:

The two main operations in the database transactions are READ and
WRITE.

Discuss this Question

6. How many concurrency problems are there?

A. 4
B. 5
C. 6
D. 7

Answer: B) 5
Explanation:

5 concurrency problems are there.

Discuss this Question

7. Which of the following is a concurrency problem?

A. Temporary Update Problem


B. Incorrect Summary Problem
C. Lost Update Problem
D. All of the above

Answer: D) All of the above

Explanation:

These are the concurrency problems -

i. Temporary Update Problem


ii. Incorrect Summary Problem
iii. Lost Update Problem
iv. Unrepeatable Read Problem
v. Phantom Read Problem

Discuss this Question

8. What is the Lost Update Problem also known as?

A. W-W Conflict
B. W-R Conflict
C. R-R Conflict
D. None

Answer: A) W-W Conflict

Explanation:

Lost Update Problem is also known as W-W Conflict.


Discuss this Question

9. This occurs when more than one database transaction


attempts to read or write the same database item
simultaneously (i.e., concurrent execution), causing the values
of the item to become incorrect, resulting in a/an ___ database.

A. Consistent
B. Inconsistent
C. Concurrent
D. Not-concurrent

Answer: B) Inconsistent

Explanation:

This occurs when more than one database transaction attempts to


read or write the same database item simultaneously (i.e., concurrent
execution), causing the values of the item to become incorrect,
resulting in an inconsistent database.

Discuss this Question

10. What is the Dirty Read Problem also known as?

A. W-W Conflict
B. W-R Conflict
C. R-R Conflict
D. None

Answer: B) W-R Conflict

Explanation:

Dirty Read Problem is also known as W-R Conflict.

Discuss this Question


11. When one transaction updates a database item, and
somehow the transaction fails, and the data doesn't get ___
back, another transaction tries to access the updated database
item.

A. Rolled
B. Committed
C. Aborted
D. None

Answer: A) Rolled

Explanation:

When one transaction updates a database item, and somehow the


transaction fails, and the data doesn't get rolled back, another
transaction tries to access the updated database item.

Discuss this Question

12. What is the Unrepeatable Read Problem also known as?

A. Consistent Retrieval Problems


B. Inconsistent Retrieval Problems
C. Concurrent Retrieval Problems
D. Non-concurrent Retrieval Problems

Answer: B) Inconsistent Retrieval Problems

Explanation:

The Unrepeatable Read Problem is also known as Inconsistent Retrieval


Problems.

Discuss this Question

13. An unrepeatable read problem occurs when the same


database item is read ____ during a transaction.

A. Once
B. Twice
C. Thrice
D. Multiple

Answer: B) Twice

Explanation:

An unrepeatable read problem occurs when the same database item is


read twice during a transaction.

Discuss this Question

14. ___ concurrent database operations are required for


avoiding inconsistencies in a database by utilizing the
concurrency control concept.

A. Controlling
B. Managing
C. Both A and B
D. None of the above

Answer: C) Both A and B

Explanation:

Controlling and managing concurrent database operations are required


for avoiding inconsistencies in a database by utilizing the concurrency
control concept.

Discuss this Question

15. The concurrency ___ allows us to maintain the concurrency


of the database.

A. Protocols
B. Controls
C. Control Protocols
D. None
Answer: C) Control Protocols

Explanation:

The concurrency control protocols allow us to maintain the


concurrency of the database.

Discuss this Question

16. As part of concurrency control protocols, the concurrent


execution of database transactions will be ___, durable, and
serializable.

A. Atomic
B. Consistent
C. Isolated
D. All of the above

Answer: D) All of the above

Explanation:

As part of these protocols, the concurrent execution of database


transactions will be atomic, consistent, isolated, durable, and
serializable.

Discuss this Question

17. How many categories of concurrency control protocols are


there?

A. 3
B. 4
C. 5
D. 6

Answer: A) 3

Explanation:
There are 3 categories of concurrency control protocols.

Discuss this Question

18. Which of the following is a concurrency control protocol?

A. Lock Based Concurrency Control Protocol


B. Timestamp Concurrency Control Protocol
C. Validation Based Concurrency Control Protocol
D. All of the above

Answer: D) All of the above

Explanation:

These are the concurrency control protocols -

i. Lock Based Concurrency Control Protocol


ii. Timestamp Concurrency Control Protocol
iii. Validation Based Concurrency Control Protocol

You might also like