Object-Oriented and Object-Relational Databases # MCQs Practice set

Q.1 What is the primary advantage of object-oriented databases over traditional relational databases?

Easier SQL queries
Support for complex data types and inheritance
Faster indexing for numeric data
Lower storage requirements
Explanation - Object-oriented databases can store complex objects and support inheritance, which relational databases cannot do directly.
Correct answer is: Support for complex data types and inheritance

Q.2 Which of the following is an example of an object-relational database?

MySQL
PostgreSQL
MongoDB
Cassandra
Explanation - PostgreSQL extends relational databases with object-oriented features like user-defined types and inheritance.
Correct answer is: PostgreSQL

Q.3 In object-oriented databases, what is an 'object identity'?

A primary key in a table
A unique reference to an object
The name of the object class
The object's attributes
Explanation - Object identity is a system-generated unique identifier that distinguishes each object regardless of its attribute values.
Correct answer is: A unique reference to an object

Q.4 Which feature allows object-oriented databases to represent real-world entities more naturally?

Normalization
Encapsulation
Triggers
Joins
Explanation - Encapsulation allows objects to bundle data and methods, modeling real-world entities closely.
Correct answer is: Encapsulation

Q.5 Which language is specifically designed for object-oriented databases?

SQL
OQL (Object Query Language)
NoSQL
DML
Explanation - OQL is used to query object-oriented databases, similar to how SQL is used in relational databases.
Correct answer is: OQL (Object Query Language)

Q.6 Which of the following is NOT a feature of object-relational databases?

Support for complex data types
Inheritance of classes
Traditional relational tables
Automatic object garbage collection
Explanation - Object-relational databases support object features like inheritance, but they do not automatically manage memory like programming languages.
Correct answer is: Automatic object garbage collection

Q.7 In object-relational databases, what is a 'user-defined type' (UDT)?

A built-in SQL type
A custom data type defined by the user
A predefined object class
A database schema
Explanation - UDTs allow users to define their own data structures for complex objects.
Correct answer is: A custom data type defined by the user

Q.8 Which of the following best describes 'inheritance' in object-oriented databases?

Sharing a primary key between tables
A subclass inherits attributes and methods from a superclass
Copying rows from one table to another
Indexing object attributes
Explanation - Inheritance allows an object class to reuse the properties and behaviors of another class.
Correct answer is: A subclass inherits attributes and methods from a superclass

Q.9 What does the term 'polymorphism' mean in object-oriented databases?

Objects can take multiple forms
Data is stored in multiple tables
Tables can have multiple primary keys
Queries can return multiple result sets
Explanation - Polymorphism allows objects of different classes to be treated uniformly through a common interface.
Correct answer is: Objects can take multiple forms

Q.10 Which scenario is ideal for using an object-oriented database?

Storing large numeric datasets
Applications with complex multimedia objects
Simple inventory systems
Transaction processing in banks
Explanation - Object-oriented databases are well-suited for applications requiring complex objects like multimedia, CAD designs, or engineering data.
Correct answer is: Applications with complex multimedia objects

Q.11 Which of these is a benefit of object-relational databases over purely relational databases?

Better support for structured and complex data types
Faster execution of simple queries
No need for normalization
Automatic indexing of all attributes
Explanation - Object-relational databases extend relational databases with support for objects, complex types, and inheritance.
Correct answer is: Better support for structured and complex data types

Q.12 In object-oriented databases, what is a 'method'?

A data type
A function or procedure associated with an object
A primary key constraint
A database query
Explanation - Methods define behaviors of objects and can manipulate the object's internal data.
Correct answer is: A function or procedure associated with an object

Q.13 Which of the following is a disadvantage of object-oriented databases?

Cannot handle complex data types
Limited standardization and adoption
No support for inheritance
Slower than relational databases in all scenarios
Explanation - Object-oriented databases have limited standardization and are less commonly adopted compared to relational databases.
Correct answer is: Limited standardization and adoption

Q.14 Which object-relational feature allows storing arrays, sets, or nested tables in a database?

Encapsulation
Collection types
Triggers
Foreign keys
Explanation - Collection types enable object-relational databases to store multi-valued attributes like arrays, sets, or lists.
Correct answer is: Collection types

Q.15 What is the main difference between object-oriented and object-relational databases?

Object-oriented databases are always faster
Object-relational databases extend relational systems with object features
Object-oriented databases do not support inheritance
Object-relational databases cannot store complex objects
Explanation - Object-relational databases combine relational tables with object-oriented features, while object-oriented databases are purely object-based.
Correct answer is: Object-relational databases extend relational systems with object features

Q.16 Which of the following is a common application of object-oriented databases?

Bank transaction systems
Computer-aided design (CAD) and multimedia systems
Online shopping cart systems
Payroll processing
Explanation - Object-oriented databases are suited for applications handling complex objects such as CAD models, videos, and images.
Correct answer is: Computer-aided design (CAD) and multimedia systems

Q.17 In an object-relational database, what is an 'inheritance hierarchy'?

A tree structure of database indexes
A structure showing subclasses inheriting from superclasses
A sequence of SQL queries
A chain of foreign key references
Explanation - Inheritance hierarchy represents how object classes derive attributes and methods from parent classes.
Correct answer is: A structure showing subclasses inheriting from superclasses

Q.18 Which of these database models allows polymorphic behavior directly?

Relational database
Hierarchical database
Object-oriented database
Network database
Explanation - Object-oriented databases support polymorphism, allowing objects of different types to be treated through a common interface.
Correct answer is: Object-oriented database

Q.19 What is the main purpose of 'encapsulation' in object-oriented databases?

To separate storage and processing of objects
To hide internal object details and expose methods
To allow multiple inheritance
To optimize query execution
Explanation - Encapsulation protects an object's internal state by providing controlled access through methods.
Correct answer is: To hide internal object details and expose methods

Q.20 Which of the following is an object-oriented database system?

Oracle 12c
db4o
MySQL
SQLite
Explanation - db4o is an object-oriented database that stores objects natively without converting them to relational tables.
Correct answer is: db4o

Q.21 What type of query language is OQL?

Procedural
Non-procedural
Object-oriented
Hierarchical
Explanation - OQL (Object Query Language) is designed for querying object-oriented databases.
Correct answer is: Object-oriented

Q.22 Which of the following best describes a 'complex object' in object-oriented databases?

A table with multiple foreign keys
An object containing nested objects, sets, or arrays
A single numeric value
A database index
Explanation - Complex objects can encapsulate multiple related objects or collections, allowing richer data modeling.
Correct answer is: An object containing nested objects, sets, or arrays

Q.23 Which of the following allows an object-relational database to maintain both relational and object-oriented features?

Object tables
Materialized views
Stored procedures
Triggers
Explanation - Object tables allow storage of objects with attributes and methods while still supporting traditional relational operations.
Correct answer is: Object tables

Q.24 What is a 'persistent object' in object-oriented databases?

An object that exists only during runtime
An object stored permanently in the database
A temporary table
A query result set
Explanation - Persistent objects remain stored in the database even after the application that created them terminates.
Correct answer is: An object stored permanently in the database