1.What is the primary purpose of relational algebra?

A) To perform calculations on relational data

B) To manipulate graphical structures

C) To analyze functions and their properties

D) To model real-world networks

Answer: A) To perform calculations on relational data

Explanation: Relational algebra is primarily used for performing operations and calculations on relational databases.

2.Which operation in relational algebra is used to combine tuples from two relations based on a common attribute value?

A) Intersection

B) Union

C) Join

D) Projection

Answer: C) Join

Explanation: The join operation combines tuples from two relations based on a common attribute value.

3.What is the result of applying the Cartesian product in relational algebra?

A) A set of tuples containing all possible combinations of tuples from two relations

B) A set of tuples containing only unique values from both relations

C) A set of tuples containing the union of two relations

D) A set of tuples containing the intersection of two relations

Answer: A) A set of tuples containing all possible combinations of tuples from two relations

Explanation: The Cartesian product combines every tuple from one relation with every tuple from another relation, resulting in all possible combinations.

4.In relational algebra, what does the σ (selection) operation do?

A) Projects specific attributes from a relation

B) Adds new tuples to a relation

C) Filters rows based on a condition

D) Sorts the tuples in a relation

Answer: C) Filters rows based on a condition

Explanation: The σ (selection) operation filters rows from a relation based on a specified condition.

5.Which of the following statements is true about a function?

A) A function can have multiple outputs for a given input.

B) A function maps each input to exactly one output.

C) A function cannot have inputs.

D) A function always returns the same output regardless of the input.

Answer: B) A function maps each input to exactly one output.

Explanation: By definition, a function assigns exactly one output value to each input value.

6.In graph theory, what is the degree of a vertex?

A) The number of edges incident to the vertex

B) The number of vertices in the graph

C) The weight assigned to the vertex

D) The distance of the vertex from the origin

Answer: A) The number of edges incident to the vertex

Explanation: The degree of a vertex in a graph is the number of edges incident to that vertex.

7.Which of the following is NOT a type of graph?

A) Directed graph

B) Undirected graph

C) Bipartite graph

D) Cyclic graph

Answer: D) Cyclic graph

Explanation: A cyclic graph is not a distinct type of graph; rather, it is a property that some graphs may possess (having cycles).

8.What is a path in a graph?

A) A cycle that starts and ends at the same vertex

B) A sequence of edges connecting two vertices

C) A vertex with no incident edges

D) A disconnected component of the graph

Answer: B) A sequence of edges connecting two vertices

Explanation: A path in a graph is a sequence of edges that connect two vertices without revisiting any vertex.

9.What is the complement of a graph?

A) A graph with all possible edges

B) A graph with no edges

C) A graph with the same vertices but no edges that were in the original graph

D) A graph with the same edges but different vertices

Answer: C) A graph with the same vertices but no edges that were in the original graph

Explanation: The complement of a graph has the same vertices but contains edges that were not present in the original graph.

10.In relational algebra, which operation is used to remove duplicate tuples from a relation?

A) Union

B) Intersection

C) Difference

D) Projection

Answer: D) Projection

Explanation: Projection in relational algebra projects only the distinct tuples of a relation, effectively removing duplicates.

11.What is the range of a function?

A) The set of all possible inputs

B) The set of all possible outputs

C) The set of ordered pairs representing the function

D) The set of all possible domains

Answer: B) The set of all possible outputs

Explanation: The range of a function is the set of all possible output values it can produce.

12.Which of the following is an example of a bipartite graph?

A) Complete graph

B) Cycle graph

C) Star graph

D) Complete bipartite graph

Answer: D) Complete bipartite graph

Explanation: A complete bipartite graph is an example of a bipartite graph where the vertices can be partitioned into two sets, and edges only connect vertices from different sets.

13.What is the Eulerian path in a graph?

A) A path that visits every vertex exactly once and ends at the same vertex where it started

B) A path that visits every edge exactly once and ends at the same vertex where it started

C) A path that visits every vertex exactly once

D) A path that visits every edge exactly once

Answer: D) A path that visits every edge exactly once

Explanation: An Eulerian path in a graph is a path that traverses every edge of the graph exactly once.

14.Which operation in relational algebra is used to combine tuples from two relations without removing duplicates?

A) Union

B) Intersection

C) Cartesian product

D) Difference

Answer: A) Union

Explanation: The union operation in relational algebra combines tuples from two relations, including duplicates.

15.What does the composition of functions represent?

A) The inverse of a function

B) The combination of two functions to produce a new function

C) The domain of a function

D) The range of a function

Answer: B) The combination of two functions to produce a new function

Explanation: The composition of functions represents applying one function to the output of another, producing a new function.

16.In graph theory, what is a spanning tree?

A) A tree with the minimum number of vertices

B) A tree that includes all vertices of the original graph

C) A tree with the maximum number of edges

D) A tree with no cycles

Answer: B) A tree that includes all vertices of the original graph

Explanation: A spanning tree of a graph is a subgraph that is a tree containing all the vertices of the original graph.

17.What is the characteristic of a surjective function?

A) It maps each input to exactly one output.

B) It is a one-to-one function.

C) It covers the entire range of the function.

D) It has no inverse.

Answer: C) It covers the entire range of the function.

Explanation: A surjective function covers the entire range of the function, meaning every possible output value is attained.

18.Which of the following is NOT a property of a relation in relational algebra?

A) Reflexivity

B) Symmetry

C) Transitivity

D) Completeness

Answer: D) Completeness

Explanation: Completeness is not a property typically associated with relations in relational algebra.

19.In graph theory, what does the term “connected graph” mean?

A) A graph with no cycles

B) A graph with every vertex having the same degree

C) A graph in which every pair of vertices is connected by a path

D) A graph with no edges

Answer: C) A graph in which every pair of vertices is connected by a path

Explanation: A connected graph is one in which there is a path between every pair of vertices.