DSSSB TGT / PGT · Computer Science

DBMS & SQL Previous Year Questions (page 4)

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

Q151DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following SQL statements will retrieve the lowest value from a column named 'Price' in a table named 'Products'?
  1. ASELECT MIN(Price) FROM Products;
  2. BSELECT LOWEST(Price) FROM Products;
  3. CSELECT TOP 1 Price FROM Products ORDER BY Price ASC;
  4. DSELECT Price FROM Products WHERE Price = MIN(Price);
Show answerHide answer

Correct answer: (A) SELECT MIN(Price) FROM Products;

Explanation

The aggregate function MIN() returns the smallest value in a column. LOWEST() does not exist, and an aggregate cannot be used directly in a WHERE clause.

Q152DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Select the correct SQL query that returns all students whose results are greater than the average result of their respective departments.
  1. ASELECT stu_id             FROM student             WHERE result > (SELECT AVG(result) FROM student GROUP BY dept_id);
  2. BSELECT stu_id             FROM student             WHERE result > AVG(result) GROUP BY dept_id;
  3. CSELECT stu_id             FROM student s             WHERE result > (SELECT AVG(s.result) FROM student);
  4. DSELECT stu_id              FROM student s              WHERE result > (SELECT AVG(result) FROM student WHERE dept_id = s.dept_id);
Show answerHide answer

Correct answer: (D) SELECT stu_id              FROM student s              WHERE result > (SELECT AVG(result) FROM student WHERE dept_id = s.dept_id);

Explanation

To compare each student with their own department's average, the subquery must be correlated: WHERE dept_id = s.dept_id links it to the outer row. Option A's subquery returns several averages, and B uses an aggregate in WHERE, which is not allowed.

Q153DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following is true about the page table?
  1. AThe page table contains the data of each process.
  2. BThe page table maps virtual addresses to physical addresses.
  3. CThe page table is used only in non-paging systems.
  4. DThe page table stores the instructions for memory management.
Show answerHide answer

Correct answer: (B) The page table maps virtual addresses to physical addresses.

Explanation

A page table holds, for each page of a process, the frame number in physical memory, so it translates virtual (logical) addresses into physical addresses. It holds no process data or instructions.

Q154DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which attribute determines who can read, write or execute a file?
  1. AFile location
  2. BFile permissions
  3. CFile type
  4. DFile size
Show answerHide answer

Correct answer: (B) File permissions

Explanation

File permissions (for example read, write and execute for owner, group and others in Unix) control who may access a file and in what way.

Q155DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What is the purpose of the COMMIT command in SQL?
  1. ATo create a new table
  2. BTo assign privileges
  3. CTo rollback the changes
  4. DTo permanently save changes made in a transaction
Show answerHide answer

Correct answer: (D) To permanently save changes made in a transaction

Explanation

COMMIT ends a transaction and makes all its changes permanent in the database. ROLLBACK is the command that undoes them.

Q156DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
In order to grant a user named 'Deepak' the ability to read data from a table called 'Customers', which SQL statement should be used?
  1. AGRANT SELECT ON Customers TO Deepak;
  2. BGRANT READ ON Customers TO Deepak;
  3. CGRANT ACCESS ON Customers TO Deepak;
  4. DGIVE SELECT ON Customers TO Deepak;
Show answerHide answer

Correct answer: (A) GRANT SELECT ON Customers TO Deepak;

Explanation

SELECT is the privilege that allows reading rows from a table, so GRANT SELECT ON Customers TO Deepak; is correct. READ and ACCESS are not SQL privileges, and GIVE is not an SQL command.

Q157DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What is the main purpose of client-side scripting in JavaScript?
  1. ATo execute code on the server
  2. BTo store data on the server
  3. CTo run code on the user's web browser
  4. DTo interact with the database directly
Show answerHide answer

Correct answer: (C) To run code on the user's web browser

Explanation

Client-side JavaScript runs inside the user's web browser, where it handles events, checks forms and updates the page without going to the server.

Q158DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of following accounting concept states that every accounting transaction has two aspects?
  1. AMatching concept
  2. BConservatism concept
  3. CDual aspect concept
  4. DRealization concept
Show answerHide answer

Correct answer: (C) Dual aspect concept

Explanation

The dual aspect concept says every transaction has two equal effects, a debit and a credit, which is the basis of the equation Assets = Liabilities + Capital.

Q159DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
Which is NOT a valid way to include a comment in SQL-99?
  1. AMultiline Comments or Block Comments: Multiline comments start with /* and end with */
  2. BSingle-line comments start with -- double hyphens
  3. CInline Comments: Inline comments start with -- after the SQL statement on the same line
  4. D// This is used for giving a comment
Show answerHide answer

Correct answer: (D) // This is used for giving a comment

Explanation

Standard SQL supports -- for single-line (and end-of-line) comments and /* ... */ for block comments. // is a comment in C++/Java/JavaScript, not in SQL-99.

Q160DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
___________ is an invalid statement in standard SQL:1999.
  1. ADELETE FROM Customer WHERE 1=1;
  2. BUPDATE Customer SET Bill = Bill - 5000 WHERE Account = 'High privilege';
  3. CINSERT INTO Employees VALUES (DEFAULT, 'John', 'IT');
  4. DINSERT Employees VALUES ('John', DEFAULT, 'IT');
Show answerHide answer

Correct answer: (D) INSERT Employees VALUES ('John', DEFAULT, 'IT');

Explanation

Standard SQL requires the keyword INTO in an INSERT statement: INSERT INTO table VALUES (...). Omitting INTO is only accepted by some vendors such as MySQL or SQL Server, so D is invalid in standard SQL.

Q161DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
Which of the following is INCORRECT, as per a 2-input OR gate truth table?
  1. AIf input A=1, B=0, then output Y=1.
  2. BIf input A=0, B=0, then output Y=1.
  3. CIf input A=1, B=1, then output Y=1.
  4. DIf input A=0 , B=1, then output Y=1.
Show answerHide answer

Correct answer: (B) If input A=0, B=0, then output Y=1.

Explanation

An OR gate gives 0 only when all inputs are 0. So A = 0, B = 0 gives Y = 0, and the statement Y = 1 is incorrect.

Q162DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
Which of the following statements about WITH CHECK OPTION in SQL views is true?
  1. AIt ensures that inserted/updated rows satisfy the view’s WHERE clause.
  2. BIt prevents any alter through the view.
  3. CIt allows only ALTER operations on the view.
  4. DIt makes the view read-only.
Show answerHide answer

Correct answer: (A) It ensures that inserted/updated rows satisfy the view’s WHERE clause.

Explanation

WITH CHECK OPTION rejects any INSERT or UPDATE through the view that would produce a row not satisfying the view's WHERE condition (a row that would vanish from the view).

Q163DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
SELECT MAX(result) FROM student WHERE result < (SELECT MAX(result) FROM student);
  1. ASELECT result FROM student WHERE ROWNUM = 2 ORDER BY result DESC;
  2. BSELECT TOP 2 result FROM student ORDER BY result DESC;
  3. CSELECT result FROM student ORDER BY result DESC LIMIT 1 OFFSET 1;
  4. DSELECT MAX(result) FROM student WHERE result < (SELECT MAX(result) FROM student);
Show answerHide answer

Correct answer: (D) SELECT MAX(result) FROM student WHERE result < (SELECT MAX(result) FROM student);

Explanation

Note: the question statement is missing in the source paper; only the SQL query shown above and the options were printed. The official answer key marks option 4 (the same query as the one shown).

Q164DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
While creating a new table ProductOrder_2026, which SQL statement correctly inserts all the records from the ProductOrder_2026 table into ProductOrder?
  1. ACREATE TABLE ProductOrder_2026 AS CREATE * FROM ProductOrder;
  2. BCREATE TABLE ProductOrder_2026 AS SELECT * FROM ProductOrder;
  3. CCREATE TABLE ProductOrder_2026 AS UPDATE * FROM ProductOrder;
  4. DCREATE TABLE ProductOrder_2026 AS INSERT * FROM ProductOrder ;
Show answerHide answer

Correct answer: (B) CREATE TABLE ProductOrder_2026 AS SELECT * FROM ProductOrder;

Explanation

CREATE TABLE new_table AS SELECT * FROM old_table creates the new table and copies all rows of the old one into it. CREATE, UPDATE or INSERT cannot follow AS here.

Q165DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
Given the array a = [10, 20, 30, 40, 50, 60] with 6 elements, What will the array look like after inserting the value 45 at index 4?
  1. A[10, 20, 30, 40, 45, 50, 60]
  2. B[10, 20, 25, 30, 40, 45, 50]
  3. C[10, 20, 25, 30, 40, 45, 60]
  4. D[10, 25, 20, 30, 40, 45, 50]
Show answerHide answer

Correct answer: (A) [10, 20, 30, 40, 45, 50, 60]

Explanation

Inserting 45 at index 4 shifts 50 and 60 one place right, giving [10, 20, 30, 40, 45, 50, 60]. The other options contain 25, which was never in the array.

Q166DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
The normal form of the matrix [ 1 1 0 -2 ] [ 2 0 2 2 ] [ 4 1 3 1 ] is ________.
  1. A[ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 0 0 ]
  2. B[ 1 0 0 0 ] [ 0 0 0 0 ] [ 0 0 0 0 ]
  3. C[ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 1 0 ]
  4. D[ 1 0 0 0 ] [ 0 1 1 0 ] [ 0 0 1 0 ]
Show answerHide answer

Correct answer: (A) [ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 0 0 ]

Explanation

R2 - 2R1 gives [0, -2, 2, 6] and R3 - 4R1 gives [0, -3, 3, 9], which is 1.5 times the new R2, so one row becomes zero. The rank is 2, so the normal form is [I2 0; 0 0].

Q167DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
How should the withdrawal of goods from stock by the owner of the business, for personal use, be recorded in books of accounts of an entity?
  1. ADebiting Drawing account and crediting cash account
  2. BDebiting Purchases account and crediting capital account
  3. CDebiting Capital account and crediting drawing account
  4. DDebiting Drawing account and crediting purchases/stock account
Show answerHide answer

Correct answer: (D) Debiting Drawing account and crediting purchases/stock account

Explanation

Goods taken for personal use reduce the goods available for sale, so the entry is Drawings A/c Dr. to Purchases A/c (at cost). No cash is involved.

Q168DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
Which of the following statements is/are true? P: The size of a linked list can grow and shrink dynamically during runtime based on the operations performed. Q: Unlike arrays, linked lists allow for constant-time access to elements by index. R: The dynamic nature of linked lists means that memory for nodes is allocated only when necessary, leading to better space utilisation.
  1. AP, Q, R
  2. BOnly P and Q
  3. COnly P and R
  4. DOnly P
Show answerHide answer

Correct answer: (C) Only P and R

Explanation

P is true (lists grow and shrink at run time) and R is true (nodes are allocated only when needed). Q is false: linked lists need O(n) traversal to reach an index; arrays give constant-time indexed access.

Q169DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
Which of the following is an example of System Software?
  1. ADatabase Management System (DBMS)
  2. BCompiler
  3. CWeb Browser
  4. DWord Processor
Show answerHide answer

Correct answer: (B) Compiler

Explanation

A compiler is system software (a language translator) that supports program development. DBMS, web browsers and word processors are application software.

Q170DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
Which of the following SQL expressions evaluates to TRUE, according to SQL-99?
  1. ANULL <= NULL returns UNKNOWN
  2. BNULL >= NULL returns UNKNOWN
  3. CNULL IS NULL returns FALSE
  4. DNULL IS NULL returns TRUE
Show answerHide answer

Correct answer: (D) NULL IS NULL returns TRUE

Explanation

Any ordinary comparison involving NULL (=, <=, >= etc.) gives UNKNOWN, not TRUE. The IS NULL predicate is the special test for nulls, so NULL IS NULL is TRUE.

Q171DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
What is the overall design of a database called?
  1. ADatabase Schema
  2. BDatabase Instance
  3. CDatabase Table
  4. DDatabase Model
Show answerHide answer

Correct answer: (A) Database Schema

Explanation

The schema is the overall logical design (structure) of the database, which rarely changes. An instance is the data stored in the database at a particular moment.

Q172DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
____________ is NOT allowed in a SQL:1999 view definition.
  1. AUse of subqueries
  2. BUse of nested queries
  3. CUse of aggregate formulas
  4. DUse of ORDER BY clause
Show answerHide answer

Correct answer: (D) Use of ORDER BY clause

Explanation

A view is a virtual table, and standard SQL (SQL:1999) does not allow ORDER BY in the view's defining query; ordering is applied when the view is queried. Subqueries and aggregates are allowed.

Q173DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
Select the correct SQL statement which will correctly insert a new row into the Customer table with only the CustomerID, Name, and Product columns specified, assuming the table allows NULLs for other columns.
  1. AINSERT Customer SET CustomerID=101, Name='Alice', Product='Pen';
  2. BINSERT INTO Customer VALUES (101, 'Alice', 'Pen');
  3. CINSERT INTO Customer (101, 'Alice', 'Pen');
  4. DINSERT INTO Customer (CustomerID, Name, Product) VALUES (101, 'Alice', 'Pen');
Show answerHide answer

Correct answer: (D) INSERT INTO Customer (CustomerID, Name, Product) VALUES (101, 'Alice', 'Pen');

Explanation

To insert values into only some columns, list those columns after the table name and give matching values: INSERT INTO table (cols) VALUES (...). Option B gives no column list, so it expects values for all columns.

Q174DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
Which SQL statement is used to update data in a table?
  1. ACHANGE
  2. BMODIFY
  3. CUPDATE
  4. DSET
Show answerHide answer

Correct answer: (C) UPDATE

Explanation

UPDATE ... SET ... WHERE ... is the DML command that changes existing rows. SET is only a clause of UPDATE, and MODIFY is used with ALTER TABLE in some systems.

Q175DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
Which of the following statements is correct about the divide and conquer approach of binary search technique?
  1. AThe recurrence relation of binary search is written as T(n) = 2T(n/2) + O(1), where n is the number of elements in the array.
  2. BThe worst-case time complexity of binary search is O(log n).
  3. CThe best-case time complexity of binary search is O(log n).
  4. DThe average-case time complexity of binary search is O(n).
Show answerHide answer

Correct answer: (B) The worst-case time complexity of binary search is O(log n).

Explanation

Each step compares with the middle element and discards half the array, so T(n) = T(n/2) + O(1), giving O(log n) in the worst case. The best case is O(1) and the average case is O(log n), and the recurrence has T(n/2) once, not twice.

Q176DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
On 15 December 2024, a fire occurred in the godown of M Ltd., and the entire stock was destroyed. The value of the stock salvaged was ₹3,00,000. The following transactions took place between 1 October 2024 and 15 December 2024 (Purchases, Sales, Wages, Opening Stock, Gross Profit). [The figures of this table are not reproduced in the source paper.] The value of stock lost by fire was ____.
  1. A₹2,55,000
  2. B₹6,30,000
  3. C₹6,75,000
  4. D₹5,92,000
Show answerHide answer

Correct answer: (B) ₹6,30,000

Explanation

Note: the figures of the table (Purchases, Sales, Wages, Opening Stock, Gross Profit) are missing in the source paper. The official answer key marks ₹6,30,000.

Q177DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
Select the INCORRECT option among the phases of the CPU Instruction Cycle.
  1. AExecute
  2. BEncode
  3. CStore
  4. DFetch
Show answerHide answer

Correct answer: (B) Encode

Explanation

The instruction cycle consists of fetch, decode, execute (and store/write-back of results). "Encode" is not a phase; the correct step is decode.

Q178DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
Select an appropriate ROM type from the options, where data can be erased or destroyed using ultraviolet light.
  1. AEEPROM
  2. BFlash ROM
  3. CEPROM
  4. DPROM
Show answerHide answer

Correct answer: (C) EPROM

Explanation

EPROM (Erasable PROM) is erased by exposing its quartz window to ultraviolet light. EEPROM and flash are erased electrically, and PROM cannot be erased.

Q179DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
Which of the following is a relational operator in the C programming language?
  1. A&&
  2. B!
  3. C!=
  4. D||
Show answerHide answer

Correct answer: (C) !=

Explanation

!= (not equal to) is a relational operator. && and || are logical AND/OR, and ! is logical NOT.

Q180DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
Which of the following is a software application that helps developers to build attractive website layouts and apps with ease?
  1. ADatabase design tools
  2. BFront-end development tools
  3. CLogic programming tools
  4. DBack-end development tools
Show answerHide answer

Correct answer: (B) Front-end development tools

Explanation

Front-end development tools help developers build attractive website layouts and user interfaces quickly. Back-end tools deal with servers and databases.

Q181DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
Which of the following is a valid syntax for the XML element in a DTD?
  1. A<!ELEMENT element-name category>
  2. B<!ATTLIST element-name attribute-name attribute-type attribute-value>
  3. C<#ELEMENT element-name category>
  4. D<!ENTITY entity-name "entity-value">
Show answerHide answer

Correct answer: (A) <!ELEMENT element-name category>

Explanation

In a DTD an element is declared as <!ELEMENT element-name category>. <!ATTLIST> declares attributes and <!ENTITY> declares entities.

Q182DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
Which of the following can be used for the frontend or user interface while developing a web application?
  1. AJavaScript
  2. BPHP
  3. CDjango
  4. DSQL
Show answerHide answer

Correct answer: (A) JavaScript

Explanation

JavaScript runs in the browser and is used to build the front end. PHP and Django are server-side, and SQL is for databases.

Q183DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
Which of the following is the proper sequence of the accounting cycle?
  1. ARecording of Transaction → Journal → Ledger → Trial Balance → Adjusted Trial Balance → Adjustment Entries → Closing Entries → Financial Statement
  2. BRecording of Transaction → Journal → Ledger → Trial Balance → Adjustment Entries → Adjusted Trial Balance → Closing Entries → Financial Statement
  3. CRecording of Transaction → Journal → Ledger → Trial Balance → Adjustment Entries → Closing Entries → Adjusted Trial Balance → Financial Statement
  4. DRecording of Transaction → Journal → Ledger → Trial Balance → Adjustment Entries → Adjusted Trial Balance → Financial Statement → Closing Entries
Show answerHide answer

Correct answer: (B) Recording of Transaction → Journal → Ledger → Trial Balance → Adjustment Entries → Adjusted Trial Balance → Closing Entries → Financial Statement

Explanation

The cycle is: transactions → journal → ledger → trial balance → adjustment entries → adjusted trial balance → closing entries → financial statements, as in (B).

Q184DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
The 'DEFAULT constraint' of SQL will
  1. Aensure that a column cannot have a NULL value
  2. Bensure that all the values in a column satisfy certain conditions
  3. Censure that all values in a column are different
  4. Dprovide a default value for a column when none is specified
Show answerHide answer

Correct answer: (D) provide a default value for a column when none is specified

Explanation

The DEFAULT constraint supplies a default value for a column when no value is given in an INSERT. NOT NULL, CHECK and UNIQUE do the other jobs.

Q185DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
Which of the following controls in VB.NET is used to select one option from a number of choices?
  1. ALabel
  2. BButton
  3. CListBox
  4. DRadioButton
Show answerHide answer

Correct answer: (D) RadioButton

Explanation

A group of RadioButtons lets the user choose exactly one option from several choices.

Q186DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
Which of the following is a symbolic name given to a memory location in any programming language?
  1. AVariable
  2. BConstant
  3. CLiteral
  4. DAttribute
Show answerHide answer

Correct answer: (A) Variable

Explanation

A variable is a symbolic name for a memory location whose value can change while the program runs.

Q187DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)
Which of the following refers to a planned system of collecting, storing and disseminating data in the form of information needed to carry out the functions of management?
  1. AComputer Networks
  2. BSoftware Engineering
  3. CManagement Information System
  4. DDatabase Management System
Show answerHide answer

Correct answer: (C) Management Information System

Explanation

A Management Information System is a planned system for collecting, storing and sharing information that managers need to do their work.

Q188DSSSB TGT Computer Science, 24 Jun 2023, Shift 3 (4:30 PM)
Select the true statement about try-catch blocks.
  1. AA try block must have at least 1 catch to have a finally block.
  2. BA try block must have only 1 finally block for each catch block.
  3. CA try block can have many catches but only 1 finally block.
  4. DA try block can have many catches and many finally blocks.
Show answerHide answer

Correct answer: (C) A try block can have many catches but only 1 finally block.

Explanation

A try block can be followed by many catch blocks but at most one finally block. A try with only a finally (no catch) is also allowed, so A is wrong.

Q189DSSSB TGT Computer Science, 24 Jun 2023, Shift 3 (4:30 PM)
According to the double entry system, every transaction will have ______ entries.
  1. ARight and Left
  2. BUp and Down
  3. CDebt and Credit
  4. DUp and Left
Show answerHide answer

Correct answer: (C) Debt and Credit

Explanation

Under the double-entry system, every transaction has two aspects, a debit and a credit, of equal amounts.

Q190DSSSB TGT Computer Science, 24 Jun 2023, Shift 3 (4:30 PM)
Consider the relation R (PQRSTU) with the set of functional dependencies F = {P → RT, Q → S, R → PS, QS → TU}. Find the closures of PQ.
  1. APQRST
  2. BPQRTU
  3. CPQRSU
  4. DPQRSTU
Show answerHide answer

Correct answer: (D) PQRSTU

Explanation

PQ⁺: P → RT adds R and T, and Q → S adds S. QS → TU then adds U, so PQ⁺ = PQRSTU (PQ is a key).

Q191DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following data function in SQL returns the current database system timestamp as a ‘datetime’ value without the database time zone offset?
  1. AGET T IME
  2. BGET DAT E
  3. CCAST DAT E
  4. DCAST T IME
Show answerHide answer

Correct answer: (B) GET DAT E

Explanation

GETDATE() in SQL Server returns the current database system timestamp as a datetime value without the time zone offset.

Q192DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
A ______ index is an ordered file whose records are of fixed length with two fields primary key and a pointer to a disk block.
  1. ASecondary
  2. BMultilevel
  3. CPrimary
  4. DClustering
Show answerHide answer

Correct answer: (C) Primary

Explanation

A primary index is an ordered file of fixed-length records with two fields: the primary key value and a pointer to the disk block holding that record.

Q193DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Select the correct output for the following python code?
  1. ASyntax
  2. BNo
  3. CYes
  4. DError
Show answerHide answer

Correct answer: (B) No

Explanation

Since a = 20 and b = 35, the condition a >= b is False, so the else branch runs and prints "No".

Q194DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following type conversion function in the Python language, is used to convert a character into an integer?
  1. Atuple ( )
  2. Bdict ( )
  3. Cset ( )
  4. Dord ( )
Show answerHide answer

Correct answer: (D) ord ( )

Explanation

ord() converts a character to its integer Unicode code, e.g. ord("A") = 65. tuple(), dict() and set() build collections.

Q195DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following statement is correct for DATEDIFF function in SQL? I. This function reports difference between the arguments ‘startdate’ and ‘enddate’. II. In this, ‘datepart’ argument/value can be specified in a variable.
  1. AOnly I
  2. BNeither I nor II
  3. CBoth I and II
  4. DOnly II
Show answerHide answer

Correct answer: (A) Only I

Explanation

DATEDIFF returns the difference between startdate and enddate in the given datepart, so I is correct. The datepart cannot be supplied through a user-defined variable or quoted string, so II is wrong.

Q196DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
In Python language, which of the following method of lists is used to add an element to the end of the list?
  1. Aindex ( )
  2. Bsort ( )
  3. Cpop ( )
  4. Dappend ( )
Show answerHide answer

Correct answer: (D) append ( )

Explanation

append() adds a single element to the end of a list. pop() removes an element, sort() orders the list, index() finds a position.

Q197DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Choose the correct output for the following Python code. tuple_var_mix = (“Example”, 1, “Tuple”) print (tuple_var_mix)
  1. A{Example, 1, Tuple}
  2. B(Example, 1, tuple)
  3. C(‘Example’, 1, ‘Tuple’)
  4. D[Example, 1, ‘Tuple’]
Show answerHide answer

Correct answer: (C) (‘Example’, 1, ‘Tuple’)

Explanation

print() of a tuple shows its repr: parentheses, with strings in single quotes, so the output is ('Example', 1, 'Tuple').

Q198DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following notation of ERD (Entity – Relationship Diagram) shows the ‘Weak Entity’?
  1. AQuestion content
  2. BQuestion content
  3. CQuestion content
  4. DQuestion content
Show answerHide answer

Correct answer: (C)

Explanation

A weak entity is drawn as a double rectangle (option C). A single rectangle is a strong entity, a diamond a relationship, and a double diamond an identifying relationship.

Q199DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
In HTML body tag, which of the following attribute indicates the colour of the hyperlinks after the mouse is clicked on it?
  1. AVLINK
  2. BALINK
  3. CLINK
  4. DHLINK
Show answerHide answer

Correct answer: (A) VLINK

Explanation

VLINK sets the colour of visited links (those already clicked). LINK is for unvisited links and ALINK for the active link while it is being clicked.

Q200DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)
Which of the following normal form of normalization in relational model, disallows relations within relations or relations as attribute values within tuples?
  1. AFourth
  2. BFirst
  3. CSecond
  4. DThird
Show answerHide answer

Correct answer: (B) First

Explanation

First Normal Form requires atomic attribute values, so it disallows nested relations or relations as attribute values within tuples.

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