DSSSB TGT / PGT · Computer Science

DBMS & SQL Previous Year Questions (page 5)

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

  • 227 questions
  • Official answer key
  • Free

Other Computer Science topics

Q201DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following is NOT an attribute that included by the HR tag which puts a horizontal line on the page?
  1. ASHADE
  2. BSIZE
  3. CALIGN
  4. DWIDT H
Show answerHide answer

Correct answer: (A) SHADE

Explanation

The HR tag supports SIZE, WIDTH, ALIGN and NOSHADE. There is no SHADE attribute.

Q202DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Data frame in Pandas has a method which takes a column name (for a regular index) or a list of column names to create a new, re-indexed data frame, which of the following is correct method?
  1. AdFb
  2. Bdata.index ( )
  3. Cset_index ( )
  4. DdFmi
Show answerHide answer

Correct answer: (C) set_index ( )

Explanation

set_index() takes a column name or list of column names and returns a new DataFrame indexed by those columns.

Q203DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which operation is provided in Pandas, when multiple tables can be concatenated both column wise and row wise as database?
  1. ASUM
  2. BMERGE
  3. CGROUP BY
  4. DSELECT
Show answerHide answer

Correct answer: (B) MERGE

Explanation

pandas merge() joins DataFrames on common columns, like SQL joins, so tables can be combined as in a database.

Q204DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following maths function in SQL returns the smallest integer greater than, or equal to, the specified numeric expression?
  1. AROUND
  2. BCEILING
  3. CABS
  4. DFLOOR
Show answerHide answer

Correct answer: (B) CEILING

Explanation

CEILING returns the smallest integer greater than or equal to the value, e.g. CEILING(4.2) = 5. FLOOR returns the largest integer less than or equal to it.

Q205DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following symbol is used with SELECT command of SQL, to retrieve all the attribute values of the selected tuples?
  1. A#
  2. B%
  3. C*
  4. D:
Show answerHide answer

Correct answer: (C) *

Explanation

SELECT * retrieves all attributes (columns) of the selected tuples.

Q206DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following phase of the compiler, gathers type information and saves it in either the syntax tree or the symbol table, for subsequent use during intermediate code generation?
  1. ASemantic Analyzer
  2. BCode Analyzer
  3. CSyntax Analyzer
  4. DLexical Analyzer
Show answerHide answer

Correct answer: (A) Semantic Analyzer

Explanation

The semantic analyzer checks meaning and gathers type information, storing it in the syntax tree or symbol table for intermediate code generation.

Q207DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following is NOT an aggregate function in SQL?
  1. ACROSS PRODUCT
  2. BMAXIMUM
  3. CCOUNT
  4. DSUM
Show answerHide answer

Correct answer: (A) CROSS PRODUCT

Explanation

SQL aggregate functions include COUNT, SUM, AVG, MAX and MIN. Cross product is a relational join operation, not an aggregate.

Q208DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
In Database Management System (DBMS), which of the following term de fines a collection of entities that have the same attributes in the database?
  1. AEntity type
  2. BValue set
  3. CEntity set
  4. DValue type
Show answerHide answer

Correct answer: (A) Entity type

Explanation

Per Elmasri-Navathe, an entity type defines a collection of entities that have the same attributes; the actual set of entities at a moment is the entity set.

Q209DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following term of ER model (Entity – Relationship) is corresponding to the foreign key (or relationship relation) in the relational model of database?
  1. AComposite attribute
  2. BEntity type
  3. C1 : 1 (one to one) or 1 : N (one to many) relationship type
  4. DM : N (many to many) relationship type
Show answerHide answer

Correct answer: (C) 1 : 1 (one to one) or 1 : N (one to many) relationship type

Explanation

In ER-to-relational mapping, a 1:1 or 1:N relationship type corresponds to a foreign key (or a relationship relation) in the relational model.

Q210DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
In relational databases, which of the following integrity constraint is specified between two relations and is used to maintain the consistency among tuples in the two relations?
  1. AEntity integrity constraint
  2. BSemantic integrity constraint
  3. CFunctional integrity constraint
  4. DReferential integrity constraint
Show answerHide answer

Correct answer: (D) Referential integrity constraint

Explanation

Referential integrity is specified between two relations: a foreign key value must match an existing primary key in the referenced relation, keeping tuples consistent.

Q211DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following operator is used as concatenation operator in SQL?
  1. A++
  2. B“ ”
  3. C# #
  4. D| |
Show answerHide answer

Correct answer: (D) | |

Explanation

|| is the standard SQL string concatenation operator, e.g. 'ab' || 'cd' gives 'abcd'.

Q212DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following operator of SQL is used in WHERE clause for match a character pattern in database?
  1. ALIKE
  2. BIN
  3. CIS NULL
  4. DOR
Show answerHide answer

Correct answer: (A) LIKE

Explanation

LIKE is used in WHERE for pattern matching with wildcards % and _, e.g. WHERE name LIKE 'A%'.

Q213DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
In SQL, which of the following is correct command for schema evolution, if the RESTRICT option is chosen than the schema is dropped only if schema has no element in it?
  1. ADELET E
  2. BUPDAT E
  3. CALT ER
  4. DDROP
Show answerHide answer

Correct answer: (D) DROP

Explanation

DROP SCHEMA name RESTRICT removes the schema only if it has no elements; CASCADE would drop it with all its contents.

Q214DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
The excess of Revenue Income over expense is called ______, and it could be calculated for each transaction or for business as a whole.
  1. Atransaction
  2. Bprofit
  3. Casset
  4. Dgoods
Show answerHide answer

Correct answer: (B) profit

Explanation

Profit is the excess of revenue over expenses. It can be worked out for a single transaction or for the whole business over a period.

Q215DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
What is the difference between a primary key and a foreign key in a database?
  1. AA primary key is used to sort records in a table, while a foreign key is used to filter records in a table.
  2. BA primary key is a unique identifier for each record in a table, while a foreign key is used to link records in one table to records in another table.
  3. CThere is no difference between a primary key and a foreign key.
  4. DA primary key is used to link records in one table to records in another table, while a foreign key is a unique identifier for each record in a table.
Show answerHide answer

Correct answer: (B) A primary key is a unique identifier for each record in a table, while a foreign key is used to link records in one table to records in another table.

Explanation

A primary key uniquely identifies each row in its table. A foreign key refers to a primary key in another table, which links the tables.

Q216DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
What is the difference between a join and a subque1Y in a database?
  1. AA join is used to retrieve data from a single table based on a condition, while a subquery is used to combine data from multiple tables based on a common column.
  2. BA join is used to sort data in a table, while a subquery is used to filter data in a table.
  3. CA join is used to combine data from multiple tables based on a common column, while a subquery is used to retrieve data from a single table based on a condition.
  4. DThere is no difference between a join and a subquery.
Show answerHide answer

Correct answer: (C) A join is used to combine data from multiple tables based on a common column, while a subquery is used to retrieve data from a single table based on a condition.

Explanation

A join combines rows from several tables on a related (common) column. A subquery is a query nested inside another query, often used to filter on a condition.

Q217DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
What is the difference between a B-tree and a Hash index in a database?
  1. AA B-tree index is used to sort data in a table, while a Hash index is used to filter data in a table.
  2. BA B-tree index is used for exact match queries and sorts data using a hash function, while a Hash index is used for range queries and sorts data in a hierarchical structure.
  3. CA B-tree index is used for range queries and sorts data in a hierarchical structure, while a Hash index is used for exact match queries and sorts data using a hash function.
  4. DThere is no difference between a B-tree and a Hash index.
Show answerHide answer

Correct answer: (C) A B-tree index is used for range queries and sorts data in a hierarchical structure, while a Hash index is used for exact match queries and sorts data using a hash function.

Explanation

B-tree indexes keep keys in sorted, hierarchical order, so they handle range queries well. Hash indexes use a hash function, which is good for exact-match lookups but not ranges.

Q218DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
Which of the following is a column in a table that points to the primary key of another table?
  1. ACandidate key
  2. BForeign key
  3. CSuper key
  4. DPrimary key
Show answerHide answer

Correct answer: (B) Foreign key

Explanation

A foreign key is a column in one table that refers to the primary key of another table.

Q219DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
Which one of the following is NOT a prerequisite for a good MIS?
  1. ADatabase
  2. BControl and maintenance of MIS
  3. CMIS executives
  4. DSupport from staff
Show answerHide answer

Correct answer: (D) Support from staff

Explanation

Per the key, a database, MIS executives and control and maintenance of the MIS are the core prerequisites of a good MIS, while staff support is not counted as one.

Q220DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
What is the relation between A and E where E is the shift operator and A is the forward difference operator?
  1. AQuestion content
  2. BQuestion content
  3. CQuestion content
  4. DQuestion content
Show answerHide answer

Correct answer: (D)

Explanation

The shift operator satisfies Ef(x) = f(x + h), and Δf(x) = f(x + h) − f(x) = (E − 1)f(x). So Δ = E − 1, which means E = 1 + Δ.

Q221DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
A/An ______ is a process that has completed its task but still, it shows an entry in a process table.
  1. Azombie
  2. Bdaemon
  3. Corphan
  4. Ddaemon and orphan both
Show answerHide answer

Correct answer: (A) zombie

Explanation

A zombie process has finished executing, but its entry stays in the process table until the parent reads its exit status with wait().

Q222DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
Which of the following is used to define the structure of a relation as well as delete relations and relate schemas?
  1. AIntegrity constraint
  2. BView
  3. CDML (Data Manipulation Language)
  4. DDDL (Data Definition Language)
Show answerHide answer

Correct answer: (D) DDL (Data Definition Language)

Explanation

DDL commands (CREATE, ALTER, DROP) define and change the structure (schema) of relations and remove them. DML only queries and modifies the data stored in them.

Q223DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
______ reads XML documents and provides access to their content and structure.
  1. AXML schema
  2. BXML pre-processor
  3. CXML processor
  4. DXML codes
Show answerHide answer

Correct answer: (C) XML processor

Explanation

An XML processor (parser) reads XML documents and gives applications access to their content and structure, for example through DOM or SAX. An XML schema only defines the valid structure.

Q224DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
What makes a database a relational database?
  1. ATables
  2. BField
  3. CRecords
  4. DTriple
Show answerHide answer

Correct answer: (A) Tables

Explanation

In a relational database, data is stored in tables (relations) of rows and columns, and the tables are linked through keys. Fields and records are just parts of a table.

Q225DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
Which of the following DBMS scenarios will NOT really follow Armstrong's Axiom?
  1. AReflexivity rule
  2. BPseudo transitivity rule
  3. CTransitivity rule
  4. DArmstrong's axioms
Show answerHide answer

Correct answer: (B) Pseudo transitivity rule

Explanation

Armstrong's axioms are only reflexivity, augmentation and transitivity. Pseudo-transitivity is a derived rule (inferred from these axioms), not one of the axioms themselves.

Q226DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
______ and ______ are used in conjunction for making a complete process subroutine.
  1. Afork(), join()
  2. Bfork(), sleep()
  3. Csleep(), join()
  4. Djoin(), fork()
Show answerHide answer

Correct answer: (A) fork(), join()

Explanation

fork() splits a process into concurrent parts, and join() waits for them to finish and recombine. Together they form a complete concurrent subroutine; sleep() only suspends execution.

Q227DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
______ are a database applications' universal front end that connects to the back end via the internet.
  1. AWeb browsers
  2. BWeb server
  3. CSoftware programs
  4. DWeb application
Show answerHide answer

Correct answer: (A) Web browsers

Explanation

Web browsers act as a universal client (front end) for web-based database applications. They send requests over the Internet to the web or application server that connects to the back-end database.

How to use these DSSSB TGT / PGT Computer Science questions

Every question here was asked in a real DSSSB TGT / PGT 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 DSSSB TGT / PGT papers as timed tests to check your speed under exam conditions.

More DSSSB TGT / PGT subjects