Machine-translated by Google. Questions are authored in English.
Top

Introduction to SQL Questions and Answers

21.

Which SQL command is used to add new records to a table ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: D

New records are added with INSERT.

INSERT INTO table (columns) VALUES (...) adds one or more new rows to an existing table.

CREATE builds new database objects such as tables and views, not rows. UPDATE changes values in rows that already exist. ADD is not a command on its own; it appears inside ALTER TABLE ... ADD to add a column or constraint, not a record.

Please log in or register to report this question.

22.

What type of JOIN returns all records from both tables ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: D

The join that returns all records from both tables is the FULL OUTER JOIN.

A full outer join returns every matching pair of rows, plus every unmatched row from the left table and every unmatched row from the right table, with NULLs filling the columns that have no match.

An INNER JOIN keeps only the rows that match in both tables. A LEFT JOIN keeps all rows of the left table but only the matching rows of the right, and a RIGHT JOIN does the reverse.

Please log in or register to report this question.

23.

Which SQL clause is used with aggregate functions to filter grouped results ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: C

Grouped results are filtered with HAVING.

HAVING applies a condition to the groups formed by GROUP BY, and it can use aggregate functions: SELECT dept, AVG(salary) FROM emp GROUP BY dept HAVING AVG(salary) > 50000 keeps only the departments that meet the condition.

WHERE filters individual rows before grouping and cannot contain aggregate functions. GROUP BY forms the groups but does not filter them, and ORDER BY only sorts the output.

Please log in or register to report this question.

24.

WHERE construct in SQL is equivalent to following relational algebra operator ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: B

WHERE corresponds to selection, \(\sigma\).

The WHERE clause picks out the rows (tuples) that satisfy a condition, which is exactly the selection operator: SELECT * FROM R WHERE C is \(\sigma_{C}(R)\).

\(\Pi\) (projection) corresponds to the column list after SELECT. \(\times\) (Cartesian product) corresponds to listing several tables in FROM, and \(\bowtie\) (join) to JOIN ... ON, which is a selection applied to a product.

Please log in or register to report this question.

25.

Which language has errantly become the defacto standard for interfacing application programs with Relational Database Management System (RDMS) ?

Exam Year(s)

Tripura Public Service Commission - 2019,

Answer: B

The language is SQL.

Structured Query Language, standardised by ANSI and ISO, is the de facto standard through which application programs query and update a relational database, whichever vendor's system it is; programs embed it or pass it through interfaces such as ODBC and JDBC.

Oracle is a database management system, not a language, and dBASE is an early PC database product with its own command language. The fourth option names no standard language.

Please log in or register to report this question.

26.

Which of the following is valid SQL for an Index?

Answer: A

Correct answer: CREATE INDEX ID;

CREATE INDEX is the statement that builds an index, following the same CREATE pattern as tables and views - in full, CREATE INDEX name ON table (column).

An index is a separate structure that lets the engine find rows by a column's value without scanning the whole table, at the cost of space and of slower writes, since every insert and update must maintain it. The counterpart is DROP INDEX. CHANGE, ADD and REMOVE are not SQL statements in their own right.

Please log in or register to report this question.

Answer: C

Correct answer: has a distinct form that cannot be duplicated by a join.

Many subqueries can be rewritten as joins, but not all. A correlated EXISTS or NOT EXISTS, and a comparison against an aggregate of a related set - WHERE salary > (SELECT AVG(salary) FROM emp) - have no direct join equivalent.

The reason is that a join combines rows while a subquery can compute a value or test existence without producing rows. Subqueries are also not limited to two tables, and their outer query can certainly be sorted with ORDER BY.

Please log in or register to report this question.

28.

A subquery in an SQL SELECT statement is enclosed in:

Answer: C

Correct answer: parenthesis -- (...) .

A subquery is written inside ordinary parentheses, as in WHERE id IN (SELECT id FROM other).

Braces and square brackets have other roles: square brackets delimit identifiers in some dialects, such as SQL Server's [Order Details], and braces appear in ODBC escape sequences - neither encloses a subquery in standard SQL. The parentheses are not decoration; they mark where the inner query ends, which is what lets subqueries nest inside one another.

Please log in or register to report this question.

29.

________ was adopted as a national standard by ANSI in 1992.

Answer: B

Correct answer: SQL

SQL was adopted as an ANSI standard in 1986 and substantially revised as SQL-92, which ANSI adopted in 1992 and which remains the reference point for the language's core.

SQL-92 fixed much of what is now taken for granted: the JOIN syntax in the FROM clause, the % and _ wildcards, and standard data types. The other options are products rather than standards - Oracle, Access and dBase are implementations, and it is precisely the standard that lets skills move between them.

Please log in or register to report this question.

30.

The benefits of a standard relational language include which of the following?

Answer: A

Correct answer: Reduced training costs

A standard language means the skill transfers. Someone who knows SQL can work with Oracle, PostgreSQL, MySQL or SQL Server without learning a new query language for each, so training costs fall and staff are easier to recruit.

The second option states the opposite of a benefit: a standard reduces dependence on a single vendor, since applications can be moved. And applications are certainly still needed - SQL queries the data; it does not supply the interface or the business logic around it.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Introduction to SQL Questions and Answers || Introduction to SQL MCQ Questions and Answers || Introduction to SQL GK Questions and Answers || Introduction to SQL GK MCQ Questions || Introduction to SQL Multiple Choice Questions and Answers || Introduction to SQL GK || GK on Introduction to SQL || Database Questions and Answers || Database MCQ Questions and Answers || Database GK Questions and Answers || GK on Database