{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

Relational Algebra and Relational Calculus MCQs Flashcards

(36 cards)

1
Q

What is relational algebra?

o A) A language for database creation
o B) A procedural query language for relational databases
o C) A data modeling technique
o D) A type of normalization

A

A procedural query language for relational databases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following is NOT a fundamental operation in relational algebra?

o A) SELECT
o B) PROJECT
o C) JOIN
o D) INSERT

A

INSERT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the SELECT operation do in relational algebra?

o A) Chooses specific columns
o B) Chooses specific rows
o C) Combines two relations
o D) Divides relations

A

Chooses specific rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the PROJECT operation do?

o A) Combines two tables
o B) Filters rows based on a condition
o C) Selects specific columns from a table
o D) Sorts the result set

A

Selects specific columns from a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which symbol represents the UNION operation in relational algebra?

o A) ∩
o B) ∪
o C) ∖
o D) ⊕

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which type of JOIN returns all rows from both relations?

o A) INNER JOIN
o B) LEFT JOIN
o C) FULL OUTER JOIN
o D) CROSS JOIN

A

FULL OUTER JOIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of the RENAME operation?

o A) To change the name of a relation
o B) To filter rows in a relation
o C) To sort the result
o D) To combine two relations

A

To change the name of a relation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the INTERSECT operation do?

o A) Returns rows that are in both relations
o B) Returns rows unique to each relation
o C) Combines rows from two relations
o D) Sorts the results of two relations

A

Returns rows that are in both relations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In relational calculus, what does the term “tuple” refer to?

o A) A database table
o B) A single row in a relation
o C) A column in a table
o D) A data type

A

A single row in a relation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the term “domain” refer to in relational calculus?

o A) The set of all possible values for an attribute
o B) A specific row in a relation
o C) A type of relationship
o D) A database schema

A

The set of all possible values for an attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following symbols represents the existential quantifier in relational

o A) ∀
o B) ∃
o C) ∈
o D) ⊆

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the purpose of the universal quantifier in relational calculus?

o A) To specify that a condition holds for at least one tuple
o B) To specify that a condition holds for all tuples
o C) To filter specific rows
o D) To project columns

A

To specify that a condition holds for all tuples

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In tuple relational calculus, how is a query expressed?

o A) Using logical predicates
o B) Using algebraic expressions
o C) Using SQL syntax
o D) Using mathematical formulas

A

Using logical predicates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which operation can be used to combine two relations with the same attributes?

o A) UNION
o B) INTERSECT
o C) JOIN
o D) PROJECT

A

UNION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the result of a CROSS JOIN?

o A) A combination of rows from two relations without conditions
o B) A filtered set of rows based on a condition
o C) A set of common rows from two relations
o D) None of the above

A

A combination of rows from two relations without conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following statements about relational calculus is true?

o A) It is a procedural language.
o B) It is a declarative language.
o C) It uses SQL syntax.
o D) It cannot express complex queries.

A

It is a declarative language.

17
Q

What is the main advantage of relational algebra?

o A) It is easier to learn than SQL.
o B) It provides a clear procedural approach to queries.
o C) It can express complex queries.
o D) It is used for database design.

A

It provides a clear procedural approach to queries.

18
Q

In relational algebra, what does the term “set difference” refer to?

o A) The result of removing common rows from two relations
o B) The combination of two relations
o C) The intersection of two relations
o D) The filtering of specific rows

A

The result of removing common rows from two relations

19
Q

What type of queries can relational calculus express?

o A) Only simple queries
o B) Complex queries involving multiple relations
o C) Only updates and deletes
o D) None of the above

A

Complex queries involving multiple relations

20
Q

Which of the following is a valid tuple relational calculus expression?

o A) {t | t ∈ Student ∧ t.Age > 20}
o B) SELECT * FROM Student WHERE Age > 20
o C) Student ∪ Graduate
o D) ALL OF THE ABOVE

A

{t | t ∈ Student ∧ t.Age > 20}

21
Q

What does the term “result set” refer to in the context of relational algebra?

o A) The final output of a query
o B) A temporary table
o C) A set of rules for operations
o D) A representation of data types

A

The final output of a query

22
Q

Which of the following is NOT a characteristic of relational algebra?

o A) It is procedural.
o B) It uses mathematical symbols.
o C) It is non-procedural.
o D) It combines relations.

A

It is non-procedural.

23
Q

What is the main purpose of using the aggregate functions in relational algebra?

o A) To filter rows
o B) To perform calculations on a set of values
o C) To combine relations
o D) To project columns

A

To perform calculations on a set of values

24
Q

What is the significance of the ORDER BY clause in SQL?

o A) To filter results
o B) To sort the output of a query
o C) To combine relations
o D) To group results

A

To sort the output of a query

25
Which of the following is an example of an aggregate function? ## Footnote o A) COUNT() o B) SUM() o C) AVG() o D) All of the above
All of the above
26
In relational calculus, which of the following is true about the variables used? ## Footnote o A) They can only be constants. o B) They must be attributes. o C) They can represent tuples from a relation. o D) They cannot be used in expressions.
They can represent tuples from a relation.
27
What is the difference between a LEFT JOIN and a RIGHT JOIN? ## Footnote o A) They return different sets of rows. o B) They are identical operations. o C) LEFT JOIN returns all rows from the left table and matched rows from the right. o D) RIGHT JOIN returns all rows from the left table and matched rows from the right.
LEFT JOIN returns all rows from the left table and matched rows from the right.
28
Which operation is used to count the number of tuples in a relation? ## Footnote o A) COUNT o B) SUM o C) AVG o D) DISTINCT
COUNT
29
What is a primary key? ## Footnote o A) A unique identifier for a table o B) An attribute that can be null o C) A key that links two tables o D) A composite of multiple attributes
A unique identifier for a table
30
What is the main advantage of using relational algebra? ## Footnote o A) It is easier to learn than SQL. o B) It provides a clear procedural approach to queries. o C) It can express complex queries.
It provides a clear procedural approach to queries.
31
What is the purpose of the GROUP BY clause in SQL? ## Footnote o A) To filter rows o B) To group rows that have the same values in specified columns o C) To sort the result set o D) To combine multiple tables
To group rows that have the same values in specified columns
32
Which of the following is a property of the UNION operation? ## Footnote o A) It combines relations without removing duplicates. o B) It requires the same number of attributes in both relations. o C) It can only be performed on relations with different schemas. o D) It can include null values.
It requires the same number of attributes in both relations.
33
What is the significance of using the DISTINCT keyword in SQL? ## Footnote o A) It sorts the results. o B) It removes duplicate rows from the result set. o C) It limits the number of rows returned. o D) It groups the results.
It removes duplicate rows from the result set.
34
In relational algebra, what does the term "join" refer to? ## Footnote o A) Combining two relations based on a common attribute o B) Filtering rows from a relation o C) Projecting specific columns o D) Aggregating data
Combining two relations based on a common attribute
35
What is a foreign key? ## Footnote o A) A primary key that references another table o B) A unique identifier in a table o C) An attribute that can be null o D) A composite key made of multiple attributes
A primary key that references another table
36
What does a natural join do? ## Footnote o A) Combines two relations based on a common attribute o B) Combines two relations without duplicates o C) Filters rows based on a condition o D) Projects specific columns
Combines two relations based on a common attribute