Introduction to Query Languages MCQs: 8 Solved MCQs and 2 Concept Checks

Attempt eight published query-language MCQs, check each answer with a focused explanation, then use two written prompts to test recall of relational algebra.

KnowledgeGate Team

Exam prep & CS education

Updated 16 Oct 20267 min read

Query-language questions look definitional, but their options often mix rows with columns, procedural with declarative thinking, and basic operators with extensions. Query languages involve tuples, procedural and declarative models, expressive power, and basic and extended operators. Attempt Questions 1 to 8 before reading their explanations, then answer Questions 9 and 10 from memory. If you need the complete subject sequence first, use GATE Guidance by Sanchit Sir.

Use three checks before answering a query-language question

First identify the object: tuple, relation, operator or language. Next ask whether the language specifies how to obtain the result or only what result is wanted. Finally, decide whether the operation belongs to basic relational algebra or needs an extension such as aggregation.

Start with tuples, purpose and the procedural label

Question 1: A tuple is one row

Stem: What is a tuple in a relational schema?

  • A. A type of key

  • B. A set of relationships

  • C. A single row in a table

  • D. A single column

Answer: C. In EMPLOYEE(eid, name, deptno, salary), (101, Anu, 10, 60000) is one complete tuple. salary is an attribute or column, while eid = 101 may be a key value. Asked in: BELTRON Programmer 2025, Computer Science, Shift-1.

Question 2: What a DBMS query language supports

Stem: A DBMS query language is designed to

  • A. support end users who use English-like commands

  • B. support in the development of complex applications software

  • C. specify the structure of a database

  • D. all of the above

Answer: D. This question uses “DBMS query language” as the broad database-language interface. Readable commands assist users, applications send statements through database APIs, and data-definition statements such as CREATE TABLE EMPLOYEE (...) specify structure. This does not mean every individual query language includes every feature.

Question 3: Relational algebra is procedural

Stem: Relational Algebra is

  • A. Data Definition Language

  • B. Meta Language

  • C. Procedural query Language

  • D. None

Answer: C. Procedural means the expression supplies an operator sequence, for example select rows where salary > 55000, then project name. By contrast, declarative SQL in SQL Queries and Joins states the wanted result while the DBMS chooses an execution plan. Relational algebra remains the formal model for reasoning about that query.

Separate procedural form from expressive power

Question 4: Which statement is nearer to a programming language?

Stem:

Consider the following statement

S1: Relational Algebra is nearer to a programming language.

S2: Relational Calculus is nearer to programming language.

Which one of the following is true ?

  • A. S1 only

  • B. S2 only

  • C. Both S1 and S2

  • D. Neither S1 nor S2

Answer: A. Algebra specifies an operation sequence, so S1 is true in the procedural sense. Calculus states predicates that answer tuples must satisfy, not an evaluation order, so S2 is false. “Nearer to programming” describes form, not greater expressive power.

Question 5: Algebra and calculus can be equivalent

Stem: Relational algebra and the relational calculus are fundamentally

  • A. Linear to each other

  • B. Restricted to each other

  • C. Opposite to each other

  • D. Equivalent to each other

Answer: D. Relational algebra and safe, domain-independent relational calculus are equivalent in expressive power, although their forms differ. On the worked EMPLOYEE relation below, σ_salary>55000(EMPLOYEE) and {e | EMPLOYEE(e) and e.salary > 55000} both return Anu at 60000 and Charu at 70000. Asked in: MPPSC 2025, Computer Science.

Question 6: Match the language and modelling directions

Stem: Match the following:

List-1

List-2

I) Relational Algebra

Q) Procedural Query Language

II) Relational Calculus

P) Non-Procedural Query Language

III) Generalization

S) Bottom-Up Approach

IV) Specialization

R) Top-Down Approach

  • A. I-Q, II-P, III-R, IV-S

  • B. I-Q, II-P, III-S, IV-R

  • C. I-P, II-Q, III-S, IV-R

  • D. I-P, II-Q, III-R, IV-S

Answer: B. Algebra maps to procedural, while calculus maps to non-procedural. SavingsAccount and CurrentAccount generalise bottom-up into Account; Account specialises top-down into those two types. Asked in: DSSSB 2018, Computer Science.

Recognise the basic operator family

Question 7: The basic manipulation framework

Stem: Which of these operations constitute a basic set of operations for manipulating relational data?

  • A. Predicate calculus

  • B. Relational calculus

  • C. Relational algebra

  • D. None of these

Answer: C. Relational algebra provides operators over relations, including selection, projection, union, set difference and Cartesian product. Calculus is also a query formalism, but “set of operations” points to algebra. Asked in: RSSB 2022, Computer Science, BCI-Paper2.

Use these relations for the next calculation:

EMPLOYEE(eid, name, deptno, salary) = {(101, Anu, 10, 60000), (102, Bharat, 20, 50000), (103, Charu, 10, 70000)}

DEPARTMENT(deptno, deptname, address) = {(10, Systems, Pune), (20, QA, Jaipur)}

For π_name,address(σ_EMPLOYEE.deptno=DEPARTMENT.deptno AND salary>55000(EMPLOYEE × DEPARTMENT)):

  1. Cartesian product gives 3 × 2 = 6 tuple pairs.

  2. Department equality plus salary > 55000 keeps Anu with Systems, Pune, 60000 and Charu with Systems, Pune, 70000.

  3. Projection returns {(Anu, Pune), (Charu, Pune)}.

This uses only product, selection and projection.

Operator tree: EMPLOYEE and DEPARTMENT combine into 6 pairs, selection keeps Anu and Charu, projection returns Anu Pune and Charu Pune.

Question 8: Aggregation is outside the named basic set

Stem:

Given the relations

employee(name, salary, deptno) and

department(deptno, deptname, address)

Which of the following queries cannot be expressed using only the basic relational algebra operations: union (∪), set difference (-), Cartesian product (×), projection (π), selection (σ), and renaming (ρ)?

  • A. Department address of every employee

  • B. Employees whose name is the same as their department name

  • C. The sum of all employees’ salaries

  • D. All employees of a given department

Answer: C. Joins and projection can find addresses, while selection can isolate a department or compare names. But 60000 + 50000 + 70000 = 180000 requires SUM. The six listed basic operators contain no aggregate operator; extended relational algebra can add grouping and aggregation. Asked in: GATE 2000, Computer Science.

Use the two written prompts as concept checks

Questions 9 and 10 test written recall without options and are separate from the eight-MCQ score.

Question 9: Define relational algebra and its main characteristics

Stem: What is Relational Algebra in DBMS, and what are its primary characteristics and operators?

Options: none. Write your answer out in full, then check that it defines relational algebra and identifies its characteristics and operators.

Model-answer checklist: Relational algebra is a formal procedural query language. One or two input relations produce a new relation, demonstrating closure. Unary operators include selection σ and projection π; binary operators include product, union and set difference. A join can be expressed through product followed by selection. Here, σ_deptno=10(EMPLOYEE) gives Anu and Charu, then π_name gives {Anu, Charu}.

Question 10: Classify fundamental and derived operators

Stem: Relational Algebra is often described as the mathematical foundation of SQL. Define Relational Algebra and explain why it is considered a Procedural Query Language. Furthermore, classify its operators into Fundamental and Derived categories, providing a brief definition and the symbol for each.

Options: none. Write your answer out in full, then check that it explains the procedural model and classifies the operators.

Model-answer checklist: Procedural means specifying both the operations and their order. Selection σ filters rows, projection π keeps columns, union ∪ combines compatible rows, set difference - keeps first-only rows, Cartesian product × pairs rows, and rename ρ changes names. These six are fundamental here. Derived operators include intersection ∩ for common rows, theta or natural join ⋈ for related rows, and division ÷ for “all of” queries. A theta join is selection over a Cartesian product; a natural join also removes duplicate join columns. For union-compatible relations, R ∩ S = R - (R - S). SQL is largely declarative, while a DBMS can translate it into an internal algebraic plan.

Trap review: similar words, different ideas

Tuple means row, not column.

Relational algebra is procedural.

Relational calculus is declarative.

Different form does not imply different expressive power.

“Set of operations” points to algebra.

Aggregate functions are outside the basic operator list in Question 8.

Does π_name(σ_salary>55000(EMPLOYEE)) return Bharat? No, it returns Anu and Charu. Can the listed basic operators directly return 180000? No, because the total is an aggregate, not a selected or projected tuple value. For repeated row-versus-column choices and operator order, use the Unary Operators (Selection and Projection) MCQs; retain the trace above for procedural form and the boundary between basic and extended algebra.

Use each missed MCQ to choose the next step

Classify each miss before repeating the set. If you confused tuple with attribute, revise row-versus-column vocabulary. If you confused algebra with calculus, restate the procedural/declarative distinction. If aggregation looked basic, rewrite the six-operator list and explain why SUM needs extended algebra. Then retry only the missed questions and state each reason in one sentence.

Treat Questions 9 and 10 as a separate recall gate. You pass when you can reproduce the procedural definition, closure, all six fundamental operators, and at least two derived operators without looking.

Drill-ready readers can continue with more DBMS MCQ sets and the GATE Test Series. If the concepts are still weak, return to SQL Queries and Joins and structured GATE Guidance. The GATE CS category is the broader route for subject planning.