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.
For designing a normal RDBMS, which of the following normal forms is considered adequate?
A4NF
B3NF
C2NF
DMore than one of the above
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 _______.
A4
B8
C16
DMore than one of the above
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?
A2
B3
C4
DMore than one of the above
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?
AStack
BQueue
CHash Table
DMore than one of the above
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?
AConstant time insertion and deletion
BAbility to store elements of different data types
CRandom access to elements using an index
DMore than one of the above
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?
ARelational DBMS
BObject-Oriented DBMS
CSequential DBMS
DMore than one of the above
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?
AA key used to uniquely identify each record in a table
BA key used to establish relationships between tables
CA key used to sort records in a table
DMore than one of the above
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?
AFirst Normal Form (1NF)
BSecond Normal Form (2NF)
CThird Normal Form (3NF)
DMore than one of the above
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?
AADD
BCREATE
CINSERT
DMore than one of the above
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?
AImproved data accessibility
BIncreased data security
CData inconsistency
DMore than one of the above
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.
AThe input of the compiler is source program.
BIt translates the source code into object code as a whole.
CThe output of the compiler is object code.
DMore than one of the above
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?
AIndirect
BIndex
CAbsolute
DMore than one of the above
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
Asimple tables
Bvirtual tables
Ccomplex tables
DMore than one of the above
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?
AOnly 1
BOnly 2
CDepends on number of columns
DMore than one of the above
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?
APrimary key
BNot null
CUnion
DMore than one of the above
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?
ADESC
BASC
CThere is no default value
DMore than one of the above
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?
ASimilar to the WHERE clause but is used for columns rather than groups
BSimilar to WHERE clause but is used for rows rather than columns
CSimilar to WHERE clause but is used for groups rather than rows
DMore than one of the above
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.
AWITH
BFROM
CWHERE
DMore than one of the above
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
A70
Bgarbage
C726
DMore than one of the above
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.
AROLLBACK
BCOMMIT
CTRUNCATE
DMore than one of the above
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?
AUnion JOIN
BNatural JOIN
CSubqueries
DMore than one of the above
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?
AElements of mixed data types can be stored
BEasier to access the elements in an array
CIndex of the first element starts from 1
DMore than one of the above
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?
AFront = rear = −1
BFront = rear = 0
CFront = rear + 1
DMore than one of the above
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?
AMinimum duplication and redundancy of data
BHigh-level of security
CSingle-user access only
DMore than one of the above
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.
Areferential
Bprimary
Creferencing
DMore than one of the above
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
Apartition table
Bfile allocation table
Croot directory
DMore than one of the above
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
Aforeign key
Bsecondary key
Ccandidate key
DMore than one of the above
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
AFirst Normal Form (1NF)
BSecond Normal Form (2NF)
CThird Normal Form (3NF)
DMore than one of the above
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
Aattribute
Bdomain
Crelation
DMore than one of the above
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.
Adomain
Bdegree
Ccardinality
DMore than one of the above
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?
AUpdate
BInsert
CAlter
DMore than one of the above
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?
ADisplay
BShow
CSelect
DMore than one of the above
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?
AAlter
BModify
CUpdate
DMore than one of the above
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?
AIN
BLIKE
CBETWEEN
DMore than one of the above
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?
A7, 6
B7, 7
C8, 6
DMore than one of the above
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?
ADELETE
BDROP
CERASE
DMore than one of the above
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
Aindex register
Bmemory address register
Cmemory buffer register
DMore than one of the above
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.