BPSC TRE · Computer Science

DBMS & SQL Previous Year Questions

48 DBMS & SQL (Computer Science) questions asked in BPSC TRE previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.

  • 48 questions
  • Official answer key
  • Free

Other Computer Science topics

Q1BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following refers to the wrapping of data and its functionality into a single individual entity?
  1. AModularity
  2. BAbstraction
  3. CEncapsulation
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Encapsulation

Explanation

Bundling data and the functions that work on it into one unit is encapsulation.

Q2BPSC TRE 2.0 (2023) Computer Class 9-10
What is a database?
  1. AOrganized collection of information that cannot be accessed, updated and managed
  2. BOrganized collection of data or information that can be accessed, updated and managed
  3. COrganized collection of data that cannot be updated
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Organized collection of data or information that can be accessed, updated and managed

Explanation

A database is an organised collection of data that can be accessed, updated and managed.

Q3BPSC TRE 2.0 (2023) Computer Class 9-10
Which type of data can be stored in the database?
  1. AImage-oriented data
  2. BText, files containing data
  3. CData in the form of audio or video
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (D) More than one of the above

Explanation

A database can hold images, text/files and audio or video data, so more than one option is correct.

Q4BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is not an example of DBMS?
  1. AMicrosoft access
  2. BIBM Db2
  3. CGoogle
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Google

Explanation

Microsoft Access and IBM Db2 are DBMS products; Google is a search engine company, not a DBMS.

Q5BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is not a feature of DBMS?
  1. AMinimum duplication and redundancy of data
  2. BSingle-user access only
  3. CSupport ACID property
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Single-user access only

Explanation

A DBMS supports many users at once, so 'single-user access only' is not a feature.

Q6BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is not a function of the database?
  1. AManipulating data
  2. BSecurity for stored data
  3. CAnalysing code
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Analysing code

Explanation

Databases manipulate and secure data; analysing code is not a database function.

Q7BPSC TRE 2.0 (2023) Computer Class 9-10
The DBMS acts as an interface between _____ and _____ of an enterprise-class system.
  1. Adata, the DBMS
  2. Bdatabase application, the database
  3. Cthe user, the software
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) database application, the database

Explanation

A DBMS sits between the database applications (users' programs) and the stored database.

Q8BPSC TRE 2.0 (2023) Computer Class 9-10
_____ is a set of one or more attribute(s) taken collectively to uniquely identify a record.
  1. APrimary key
  2. BForeign key
  3. CSuperkey
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Superkey

Explanation

A superkey is any set of attributes that together uniquely identify a record.

Q9BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following commands is correct to delete the values in the relation teaches?
  1. ADelete from teaches;
  2. BDelete from teaches where Id='Null';
  3. CRemove table teaches;
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Delete from teaches;

Explanation

'DELETE FROM teaches;' removes all rows (values) of the relation; the other forms are wrong or remove different things.

Q10BPSC TRE 2.0 (2023) Computer Class 9-10
After groups have been established, SQL applies predicates in the _____ clause, allowing aggregate functions to be used.
  1. AHAVING
  2. BGROUP BY
  3. CWITH
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) HAVING

Explanation

The HAVING clause filters groups after GROUP BY and may use aggregate functions.

Q11BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is not the utility of DBMS? I. Backup II. Loading III. Process organization IV. File organization
  1. AI, II and IV only
  2. BI, II and III only
  3. CI, III and IV only
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

Only III (process organization) is not a DBMS utility, but none of the options A-C lists exactly that, so the answer is None of the above.

Q12BPSC TRE 2.0 (2023) Computer Class 9-10
For designing a normal RDBMS, which of the following normal forms is considered adequate?
  1. A4NF
  2. B3NF
  3. C2NF
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) 3NF

Explanation

Third normal form (3NF) is generally considered adequate for a normal relational design.

Q13BPSC TRE 3.0 (2024) Computer Science Class 11-12
An OR gate has 4 inputs. The number of words in truth table will be _______.
  1. A4
  2. B8
  3. C16
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) 16

Explanation

A truth table with n inputs has 2ⁿ rows, so 4 inputs give 2⁴ = 16 rows.

Q14BPSC TRE 3.0 (2024) Computer Science Class 11-12
How many select lines are required for an 8-to-1 multiplexer?
  1. A2
  2. B3
  3. C4
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) 3

Explanation

An 8-to-1 multiplexer needs n select lines where 2ⁿ = 8, so n = 3.

Q15BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which data structure is used for efficient searching, insertion, and deletion of elements?
  1. AStack
  2. BQueue
  3. CHash Table
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Hash Table

Explanation

A hash table supports search, insertion and deletion in O(1) average time. A stack or queue only gives access at its ends.

Q16BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is an advantage of using arrays?
  1. AConstant time insertion and deletion
  2. BAbility to store elements of different data types
  3. CRandom access to elements using an index
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Random access to elements using an index

Explanation

Array elements sit in contiguous memory, so any element can be accessed directly by its index in O(1). Insertion and deletion cost O(n), and the elements must all be the same type.

Q17BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a type of DBMS?
  1. ARelational DBMS
  2. BObject-Oriented DBMS
  3. CSequential DBMS
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Sequential DBMS

Explanation

Relational, object-oriented, hierarchical and network are types of DBMS. "Sequential" describes a file organisation, not a DBMS model.

Q18BPSC TRE 3.0 (2024) Computer Science Class 11-12
In a relational database, what is a primary key?
  1. AA key used to uniquely identify each record in a table
  2. BA key used to establish relationships between tables
  3. CA key used to sort records in a table
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) A key used to uniquely identify each record in a table

Explanation

A primary key uniquely identifies each record (row) in a table and cannot be NULL. Linking tables is the job of a foreign key.

Q19BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which normal form ensures that every non-prime attribute in a table is fully functionally dependent on the primary key?
  1. AFirst Normal Form (1NF)
  2. BSecond Normal Form (2NF)
  3. CThird Normal Form (3NF)
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Second Normal Form (2NF)

Explanation

2NF requires 1NF and that every non-prime attribute depend fully on the whole primary key, with no partial dependency on part of a composite key.

Q20BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which SQL command is used to add new rows to a database table?
  1. AADD
  2. BCREATE
  3. CINSERT
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) INSERT

Explanation

INSERT INTO table VALUES (...) adds new rows. CREATE makes database objects such as tables.

Q21BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a disadvantage of using a distributed database system?
  1. AImproved data accessibility
  2. BIncreased data security
  3. CData inconsistency
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Data inconsistency

Explanation

Copies of the same data at several sites can get out of sync, which causes data inconsistency. Better data accessibility is an advantage.

Q22BPSC TRE 1.0 (2023) Computer Science Class 11-12
Select the true statement for compiler.
  1. AThe input of the compiler is source program.
  2. BIt translates the source code into object code as a whole.
  3. CThe output of the compiler is object code.
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (D) More than one of the above

Explanation

All three statements are true: a compiler takes the source program as input, translates the whole of it at once, and produces object code as output.

Q23BPSC TRE 1.0 (2023) Computer Science Class 11-12
What is the addressing called that is used in an instruction of the form ADD X Y?
  1. AIndirect
  2. BIndex
  3. CAbsolute
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Absolute

Explanation

In ADD X Y the operands are given by their memory addresses X and Y, which is absolute (direct) addressing.

Q24BPSC TRE 1.0 (2023) Computer Science Class 11-12
SQL views are also known as
  1. Asimple tables
  2. Bvirtual tables
  3. Ccomplex tables
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) virtual tables

Explanation

A view is a virtual table, the stored result of a query. It does not hold its own data and is built from the base tables when used.

Q25BPSC TRE 1.0 (2023) Computer Science Class 11-12
How many primary keys can be there in a table?
  1. AOnly 1
  2. BOnly 2
  3. CDepends on number of columns
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Only 1

Explanation

A table can have only one primary key, although that key may be made of several columns (a composite key).

Q26BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is not constraint in SQL?
  1. APrimary key
  2. BNot null
  3. CUnion
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Union

Explanation

UNION is a set operator that combines the results of queries. PRIMARY KEY and NOT NULL are constraints.

Q27BPSC TRE 1.0 (2023) Computer Science Class 11-12
If we have not specified ASC or DESC after an SQL ORDER BY clause, which of the following is used by default?
  1. ADESC
  2. BASC
  3. CThere is no default value
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) ASC

Explanation

ORDER BY sorts in ascending (ASC) order by default.

Q28BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is true about the HAVING clause?
  1. ASimilar to the WHERE clause but is used for columns rather than groups
  2. BSimilar to WHERE clause but is used for rows rather than columns
  3. CSimilar to WHERE clause but is used for groups rather than rows
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Similar to WHERE clause but is used for groups rather than rows

Explanation

HAVING filters groups made by GROUP BY, while WHERE filters individual rows before they are grouped.

Q29BPSC TRE 1.0 (2023) Computer Science Class 11-12
_____ clause creates temporary relation for the query on which it is defined.
  1. AWITH
  2. BFROM
  3. CWHERE
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) WITH

Explanation

The WITH clause (a common table expression) defines a temporary named relation that exists only for that query.

Q30BPSC TRE 1.0 (2023) Computer Science Class 11-12
The SQL statement SELECT ROUND (65.726, -1) FROM DUAL; prints
  1. A70
  2. Bgarbage
  3. C726
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) 70

Explanation

ROUND(65.726, −1) rounds to the nearest ten, because a negative position counts left of the decimal point, so 65.726 becomes 70.

Q31BPSC TRE 1.0 (2023) Computer Science Class 11-12
_____ command makes the updates performed by the transaction permanent in the database.
  1. AROLLBACK
  2. BCOMMIT
  3. CTRUNCATE
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) COMMIT

Explanation

COMMIT makes the changes made by a transaction permanent. ROLLBACK undoes them, and TRUNCATE removes all rows from a table.

Q32BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is the basic approach for joining tables?
  1. AUnion JOIN
  2. BNatural JOIN
  3. CSubqueries
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (D) More than one of the above

Explanation

Tables can be joined with join operations such as natural join and union join, or by using subqueries, so more than one option applies.

Q33BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is the advantage of the array data structure?
  1. AElements of mixed data types can be stored
  2. BEasier to access the elements in an array
  3. CIndex of the first element starts from 1
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Easier to access the elements in an array

Explanation

Array elements are stored next to each other, so any element can be reached directly by its index in O(1) time. Arrays hold only one data type, and indexing starts at 0.

Q34BPSC TRE 1.0 (2023) Computer Science Class 11-12
If circular queue is implemented using array having size MAX_SIZE in which array index starts with 0, front points to the first element in the queue, and rear points to the last element in the queue. Which one of the following conditions is used to specify that the circular queue is empty?
  1. AFront = rear = −1
  2. BFront = rear = 0
  3. CFront = rear + 1
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Front = rear = −1

Explanation

With this convention, front and rear start at −1. Front = rear = −1 means the queue is empty, and front = rear ≥ 0 means it holds one element.

Q35BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is not a feature of DBMS?
  1. AMinimum duplication and redundancy of data
  2. BHigh-level of security
  3. CSingle-user access only
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Single-user access only

Explanation

A DBMS supports access by many users at once (concurrency control). Single-user-only access is not a DBMS feature.

Q36BPSC TRE 1.0 (2023) Computer Science Class 11-12
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.
  1. Areferential
  2. Bprimary
  3. Creferencing
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) referential

Explanation

Referential integrity requires every foreign key value in the referencing relation to appear as a key value in the referenced relation.

Q37BPSC TRE 2.0 (2023) Computer Science Class 11-12
A hard disk becomes totally inaccessible when a computer virus corrupts
  1. Apartition table
  2. Bfile allocation table
  3. Croot directory
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) partition table

Explanation

The partition table in the MBR describes where each partition lies on the disk. If it is corrupted, the system cannot find any partition, so the whole disk becomes inaccessible.

Q38BPSC TRE 2.0 (2023) Computer Science Class 11-12
An attribute of one table matching the primary key of another table is called as
  1. Aforeign key
  2. Bsecondary key
  3. Ccandidate key
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) foreign key

Explanation

A foreign key is an attribute in one table that refers to the primary key of another table. It links the two tables and enforces referential integrity.

Q39BPSC TRE 2.0 (2023) Computer Science Class 11-12
If every non-key attribute is fully dependent on the primary key, then the relation will be in
  1. AFirst Normal Form (1NF)
  2. BSecond Normal Form (2NF)
  3. CThird Normal Form (3NF)
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Second Normal Form (2NF)

Explanation

2NF requires 1NF plus full functional dependency of every non-key attribute on the whole primary key, so there are no partial dependencies.

Q40BPSC TRE 2.0 (2023) Computer Science Class 11-12
In relational database, the data type of values in each column of a table is called
  1. Aattribute
  2. Bdomain
  3. Crelation
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) domain

Explanation

A domain is the set of allowed values, or data type, for an attribute (column) in a relation.

Q41BPSC TRE 2.0 (2023) Computer Science Class 11-12
In relational database, the number of attributes of a relation is called the _____ of relation.
  1. Adomain
  2. Bdegree
  3. Ccardinality
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) degree

Explanation

Degree is the number of attributes (columns) in a relation. Cardinality is the number of tuples (rows).

Q42BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which of the following SQL commands is used to change the attribute values of one or more rows in a table?
  1. AUpdate
  2. BInsert
  3. CAlter
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Update

Explanation

UPDATE changes the values of existing rows, for example UPDATE t SET col = val WHERE .... INSERT adds rows and ALTER changes the table structure.

Q43BPSC TRE 2.0 (2023) Computer Science Class 11-12
To retrieve information from a database, which of the following SQL commands is used?
  1. ADisplay
  2. BShow
  3. CSelect
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Select

Explanation

SELECT retrieves (queries) data from one or more tables. DISPLAY and SHOW are not standard SQL query commands.

Q44BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which of the following SQL commands is used to modify the structure of a table?
  1. AAlter
  2. BModify
  3. CUpdate
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Alter

Explanation

ALTER TABLE changes a table's structure, for example to add, drop or modify columns. UPDATE changes data, not structure.

Q45BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which of the following SQL keywords is used to display data from a table based on certain pattern?
  1. AIN
  2. BLIKE
  3. CBETWEEN
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) LIKE

Explanation

LIKE matches patterns using the wildcards % (any sequence) and _ (one character). IN tests a list and BETWEEN tests a range.

Q46BPSC TRE 2.0 (2023) Computer Science Class 11-12
Degree and cardinality of a relation in relational database are 4 and 3 respectively. If 3 attributes and 4 tuples are added to the relation, what will be its new cardinality and degree?
  1. A7, 6
  2. B7, 7
  3. C8, 6
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) 7, 7

Explanation

Degree (attributes) becomes 4 + 3 = 7 and cardinality (tuples) becomes 3 + 4 = 7, so both are 7.

Q47BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which SQL command is used to remove a table from a database?
  1. ADELETE
  2. BDROP
  3. CERASE
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) DROP

Explanation

DROP TABLE removes the whole table, structure and data. DELETE removes only rows, and ERASE is not an SQL command.

Q48BPSC TRE 2.0 (2023) Computer Science Class 11-12
The register which holds the address of location of memory to and from which data are to be transferred is known as
  1. Aindex register
  2. Bmemory address register
  3. Cmemory buffer register
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) memory address register

Explanation

The memory address register (MAR) holds the address of the memory location being read or written. The memory buffer register (MBR) holds the data itself.

How to use these BPSC TRE Computer Science questions

Every question here was asked in a real BPSC TRE paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full BPSC TRE papers as timed tests to check your speed under exam conditions.

More BPSC TRE subjects