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

Introduction to SQL Questions and Answers

Answer: A

Correct answer: for ranges.

BETWEEN tests whether a value falls within a range, and the range is inclusive at both ends: WHERE age BETWEEN 18 AND 65 is the same as age >= 18 AND age <= 65.

That inclusivity is the point most often got wrong, particularly with dates, where BETWEEN '2026-01-01' AND '2026-01-31' excludes anything timestamped later on the last day. It filters rows, so it does not limit columns, and it takes exact values rather than patterns, so it is not a wildcard construct.

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.

63.

________ 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.

Answer: C

Correct answer: a data sublanguage.

SQL is called a data sublanguage because it does one part of the job and relies on a host language for the rest. It expresses what data is wanted, but has no general control flow, no user interface and no way to build an application on its own.

So it is embedded in C, Java or Python, which supply the loops, the branching and the presentation. It is not an operating system, and it is not a DBMS - Oracle and PostgreSQL are DBMSs, and SQL is the language through which they are addressed.

Please log in or register to report this question.

65.

The condition in a WHERE clause can refer to only one value.

Answer: B

Correct answer: False

A WHERE condition can refer to as many values as needed. IN takes a list, BETWEEN takes two bounds, and AND and OR combine any number of conditions across any number of columns.

A condition may also refer to values it does not name, through a subquery: WHERE id IN (SELECT id FROM other) tests against a whole set computed at run time. The single-value comparison is merely the simplest case, not the limit of the clause.

Please log in or register to report this question.

66.

The ADD command is used to enter one row of data or to add multiple rows as a result of a query.

Answer: B

Correct answer: False

There is no ADD statement in SQL. The statement that enters rows is INSERT - a single row with VALUES, or many at once with a SELECT supplying them, which is exactly the behaviour the sentence describes.

ADD appears only as a keyword within ALTER TABLE ... ADD COLUMN, which changes the table's structure rather than its contents. The sentence is a correct description of INSERT attached to the wrong keyword.

Please log in or register to report this question.

67.

SQL provides the AS keyword, which can be used to assign meaningful column names to the results of queries using the SQL built-in functions.

Answer: A

Correct answer: True

AS assigns an alias, and it is particularly useful with aggregates, whose default column names are the expressions themselves - COUNT(*) or worse. SELECT COUNT(*) AS order_count gives the result a name a program or a report can use.

It also aliases tables, as in FROM customer AS c, which is what makes a self-join possible. The keyword is optional in most dialects for both purposes, but writing it makes the intent explicit and avoids a missing comma silently becoming an alias.

Please log in or register to report this question.

68.

The SELECT command, with its various clauses, allows users to query the data contained in the tables and ask many different questions or ad hoc queries.

Answer: A

Correct answer: True

This is what distinguishes a relational database from the file-based systems it replaced. SELECT, with its clauses for filtering, grouping, ordering and joining, lets a user pose a question the database designer never anticipated.

That is what "ad hoc" means here: the query is composed when the question arises, not built into the application in advance. Earlier models required navigating predefined access paths, so a new question often meant new code. Declaring what is wanted rather than how to fetch it is the whole point.

Please log in or register to report this question.

69.

A SELECT statement within another SELECT statement and enclosed in square brackets ([...]) is called a subquery.

Answer: B

Correct answer: False

A subquery is enclosed in ordinary parentheses, not square brackets: WHERE id IN (SELECT id FROM other).

The rest of the sentence is right - a subquery is indeed a SELECT nested inside another statement - so the single wrong detail is the delimiter. Square brackets do appear in SQL Server and Access, but to quote identifiers containing spaces or reserved words, as in [Order Details], which is an unrelated use.

Please log in or register to report this question.

70.

The rows of the result relation produced by a SELECT statement can be sorted, but only by one column.

Answer: B

Correct answer: False

ORDER BY accepts a list of columns, each with its own direction: ORDER BY dept ASC, salary DESC sorts by department and then, within each department, by descending salary.

The later columns act as tie-breakers, which is what makes multi-column sorting useful rather than merely possible. Expressions and column positions are also permitted, so ORDER BY LENGTH(name) or ORDER BY 2 are valid, though the numeric form is fragile when the SELECT list changes.

Please log in or register to report this question.

Loading…
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