Database

Database

Introduction to SQL has 69 Questions

You can add a row using SQL in a database with which of the following?

ADD
CREATE
INSERT
MAKE
The condition in a WHERE clause can refer to only one value.

True
False
The command to remove rows from a table 'CUSTOMER' is:

REMOVE FROM CUSTOMER ...
DROP FROM CUSTOMER ...
DELETE FROM CUSTOMER WHERE ...
UPDATE FROM CUSTOMER ...
The ADD command is used to enter one row of data or to add multiple rows as a result of a query.

True
False
The SQL WHERE clause:

limits the column data that are returned.
limits the row data are returned.
Both A and B are correct.
Neither A nor B are correct.
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.

True
False
Which of the following is the original purpose of SQL?

To specify the syntax and semantics of SQL data definition language
To specify the syntax and semantics of SQL manipulation language
To define the data structures
All of the above.
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.

True
False
The wildcard in a WHERE clause is useful when?

An exact match is necessary in a SELECT statement.
An exact match is not possible in a SELECT statement.
An exact match is necessary in a CREATE statement.
An exact match is not possible in a CREATE statement.
A SELECT statement within another SELECT statement and enclosed in square brackets ([...]) is called a subquery.

True
False
A view is which of the following?

A virtual table that can be accessed via SQL commands
A virtual table that cannot be accessed via SQL commands
A base table that can be accessed via SQL commands
A base table that cannot be accessed via SQL commands
The rows of the result relation produced by a SELECT statement can be sorted, but only by one column.

True
False
The command to eliminate a table from a database is:

REMOVE TABLE CUSTOMER;
DROP TABLE CUSTOMER;
DELETE TABLE CUSTOMER;
UPDATE TABLE CUSTOMER;
There is an equivalent join expression that can be substituted for all subquery expressions.

True
False
ON UPDATE CASCADE ensures which of the following?

Normalization
Data Integrity
Materialized Views
All of the above.
A dynamic view is one whose contents materialize when referenced.

True
False
SQL data definition commands make up a(n) ________ .

DDL
DML
HTML
XML
SQL is a programming language.

True
False
Which of the following is valid SQL for an Index?

CREATE INDEX ID;
CHANGE INDEX ID;
ADD INDEX ID;
REMOVE INDEX ID;
SELECT DISTINCT is used if a user wishes to see duplicate columns in a query.

True
False
The SQL keyword(s) ________ is used with wildcards.

LIKE only
IN only
NOT IN only
IN and NOT IN
Indexes can usually be created for both primary and secondary keys.

True
False
Which of the following is the correct order of keywords for SQL SELECT statements?

SELECT, FROM, WHERE
FROM, WHERE, SELECT
WHERE, FROM,SELECT
SELECT,WHERE,FROM
Each index consumes extra storage space and also requires overhead maintenance time whenever indexed data change value.

True
False
A subquery in an SQL SELECT statement is enclosed in:

braces -- {...}.
CAPITAL LETTERS.
parenthesis -- (...) .
brackets -- [...].
The HAVING clause acts like a WHERE clause, but it identifies groups that meet a criterion, rather than rows.

True
False
The result of a SQL SELECT statement is a(n) ________ .

report
form
file
table
SQL is a data sublanguage.

True
False
Which of the following are the five built-in functions provided by SQL?

COUNT, SUM, AVG, MAX, MIN
SUM, AVG, MIN, MAX, MULT
SUM, AVG, MULT, DIV, MIN
SUM, AVG, MIN, MAX, NAME
The qualifier DISTINCT must be used in an SQL statement when we want to eliminate duplicate rows.

True
False
In an SQL SELECT statement querying a single table, according to the SQL-92 standard the asterisk (*) means that:

all columns of the table are to be returned.
all records meeting the full criteria are to be returned.
all records with even partial criteria met are to be returned.
None of the above is correct.
DISTINCT and its counterpart, ALL, can be used more than once in a SELECT statement.

True
False
The HAVING clause does which of the following?

Acts like a WHERE clause but is used for groups rather than rows.
Acts like a WHERE clause but is used for rows rather than columns.
Acts like a WHERE clause but is used for columns rather than groups.
Acts EXACTLY like a WHERE clause.
The result of every SQL query is a table.

True
False
The SQL -92 wildcards are ____ and ____ .

asterisk (*); percent sign (%)
percent sign (%); underscore (_)
underscore(_); question mark (?)
question mark (?); asterisk (*)
COUNT(field_name) tallies only those rows that contain a value; it ignores all null values.

True
False
To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included.

ONLY
UNIQUE
DISTINCT
SINGLE
SUM, AVG, MIN, and MAX can only be used with numeric columns.

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

Reduced training costs
Increased dependence on a single vendor
Applications are not needed.
All of the above.
Most companies keep at least two versions of any database they are using.

True
False
Which of the following do you need to consider when you make a table in SQL?

Data types
Primary keys
Default values
All of the above.
The format SELECT-FROM-WHERE is the fundamental framework of SQL SELECT statements.

True
False
SQL query and modification commands make up a(n) ________ .

DDL
DML
HTML
XML
Indexes may be created or dropped at any time.

True
False
When three or more AND and OR conditions are combined, it is easier to use the SQL keyword(s):

LIKE only.
IN only.
NOT IN only.
Both IN and NOT IN.
The SQL statement: SELECT Number1 + Number 2 AS Total FROM NUMBER_TABLE; adds two numbers from each row together and lists the results in a column named Total.

True
False
The Microsoft Access wildcards are ____ and ____ .

asterisk (*); percent sign (%)
percent sign (%); underscore (_)
underscore(_); question mark (?)
question mark (?); asterisk (*)
ORDER BY can be combined with the SELECT statements.

True
False
Find the SQL statement below that is equal to the following: SELECT NAME FROM CUSTOMER WHERE STATE = 'VA';

SELECT NAME IN CUSTOMER WHERE STATE IN ('VA');
SELECT NAME IN CUSTOMER WHERE STATE = 'VA';
SELECT NAME IN CUSTOMER WHERE STATE = 'V';
SELECT NAME FROM CUSTOMER WHERE STATE IN ('VA');
Data manipulation language (DML) commands are used to define a database, including creating, altering, and dropping tables and establishing constraints.

True
False
Which one of the following sorts rows in SQL?

SORT BY
ALIGN BY
ORDER BY
GROUP BY
Scalar aggregate are multiple values returned from an SQL query that includes an aggregate function.

True
False
To sort the results of a query use:

SORT BY.
GROUP BY.
ORDER BY.
None of the above is correct.
The keyword LIKE can be used in a WHERE clause to refer to a range of values.

True
False
To define what columns should be displayed in an SQL SELECT statement:

use FROM to name the source table(s) and list the columns to be shown after SELECT.
use USING to name the source table(s) and list the columns to be shown after SELECT.
use SELECT to name the source table(s) and list the columns to be shown after USING.
use USING to name the source table(s) and list the columns to be shown after WHERE.
The SQL statement: SELECT Name, COUNT(*) FROM NAME_TABLE; counts the number of name rows and displays this total in a table with a single row and a single column.

True
False
SQL can be used to:

create database structures only.
query database data only.
modify database data only.
All of the above can be done by SQL.
The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value in a column.

True
False
The SQL statement that queries or reads data from a table is ________ .

SELECT
READ
QUERY
None of the above is correct.
The wildcard asterisk (*) is the SQL-92 standard for indicating "any sequence of characters."

True
False
The SQL keyword BETWEEN is used:

for ranges.
to limit the columns displayed.
as a wildcard.
None of the above is correct.
Microsoft Access has become ubiquitous, and being able to program in Access is a critical skill.

True
False
A subquery in an SQL SELECT statement:

can only be used with two tables.
can always be duplicated by a join.
has a distinct form that cannot be duplicated by a join.
cannot have its results sorted using ORDER BY.
SQL provides five built-in functions: COUNT, SUM, AVG, MAX, MIN.

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

Oracle
SQL
Microsoft Access
DBase
The keyword BETWEEN can be used in a WHERE clause to refer to a range of values.

True
False
SQL is:

a programming language.
an operating system.
a data sublanguage.
a DBMS.
To establish a range of values, < and > can be used.

True
False
If you are going to use a combination of three or more AND and OR conditions, it is often easier to use the NOT and NOT IN operators.

True
False