Database SQL
Which SQL keyword is used to change the structure, properties or constraints of a table?
ALTER
In an SQL query, which SQL keyword is used to link two conditions that both must be true for the rows to be selected?
AND
In an SQL query, the built-in functions SUM and AVG work with columns containing data of which of the following data types?
Both Integer and Numeric are correct
In an SQL query of two tables, which SQL keyword indicates that we want data from all the rows of one table to be included in the result, even if the row does not correspond to any data in the other table?
Both LEFT JOIN and RIGHT JOIN are correct
The SQL keyword used to limit column values to specific values is ________.
CHECK
Which SQL keyword is used to impose restrictions on a table, data or relationship?
CONSTRAINT
Which keyword is used to remove one or more rows from a table
DELETE
Which SQL keyword is used to delete a table's structure?
DROP
Suppose your company stores EMPLOYEE and CUSTOMER data in separate tables. If you want to find all customers who are not also employees, which SQL keyword would you most likely use?
EXCEPT
Referential integrity constraints are implemented in SQL using the ________ syntax
FOREIGN KEY
In an SQL query, which SQL keyword is used to specify the table(s) to be used?
FROM
In an SQL query, which SQL keyword is used with built-in functions to group together rows that have the same value in a specified column or columns?
GROUP BY
In an SQL query, which SQL keyword is used with GROUP BY to select groups meeting specified criteria?
HAVING
In an SQL query, which SQL keyword is used to determine if a column value is equal to any one of a set of values?
IN
Which SQL keyword is used to add one or more rows of data to a table?
INSERT
Suppose your company stores EMPLOYEE and CUSTOMER data in separate tables. If you want to find all employees who are also customers, which SQL keyword would you most likely use
INTERSECT
In an SQL query, which SQL keyword is used to sort the result table by the values in one or more columns
ORDER BY
Which SQL keyword is used to change the values of an entire column?
SET
In an SQL query, which built-in function is used to total numeric columns?
SUM
When the correct SQL command is used to delete a table's structure, what happens to the data in the table?
The data in the table is also deleted.
Assuming the "Quantity" column of an ORDER table contains integer data, what does COUNT(Quantity) compute?
The number of non-null values in the Quantity column
Suppose tables EMPLOYEE and CUSTOMER both store address information, and you want to send a letter to all employees and customers of your company to make a major announcement. Which SQL keyword would you most likely use here?
UNION
Which SQL keyword is used to change one or more rows in a table?
UPDATE
In an SQL query, which SQL keyword is used to specify the column names to be used in a join?
WHERE
In an SQL query, which SQL keyword is used to state the condition that specifies which rows are to be selected?
WHERE
In an SQL query, which of the following symbols is used by ANSI SQL to represent a single unspecified character?
_ (underscore)
A WHERE clause can contain only one condition
false
SQL can only query a single table
false
The DELETE keyword is used to delete a table's structure
false
The MODIFY keyword is used to change a column value.
false
The MODIFY keyword is used to change the structure, properties or constraints of a table.
false
The SQL keyword WHERE is used to specify the table(s) that contain(s) the data to be retrieved
false
The built-in function SUM can be used with any column
false
One advantage of using the CONSTRAINT phrase to define a primary key is that the database designer controls the
name of the constraint
When one SQL query is embedded in another SQL query, this is referred to as a
subquery
One advantage of using the CONSTRAINT command to define a primary key is that the database designer controls the name of the constraint
true
One or more rows can be added to a table by using the INSERT statement
true
Rows in a table can be changed by using the UPDATE statement
true
SQL includes a data definition language, a data manipulation language, and SQL/Persistent stored modules
true
SQL is not a complete programming language. Rather it is a data sublanguage
true
The CHECK keyword is used to limit column values to specific values.
true
The CONSTRAINT keyword can be used in conjunction with the SQL keywords PRIMARY KEY and FOREIGN KEY
true
The CREATE TABLE statement is used to name a new table and describe the table's columns
true
The PRIMARY KEY keyword is used to designate the column(s) that are the primary key for the table.
true
The SET keyword is used to specify a new value when changing a column value
true
The SQL built-in function AVG computes the average of values in numeric columns
true
The SQL built-in function COUNT computes the number of rows in a query
true
The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value in a column
true
The SQL keyword LIKE is used in SQL expressions to select partial string values
true
The SQL keyword SELECT is used to specify the columns to be listed in the query results
true
The UNIQUE keyword is used to define alternate keys.
true
To obtain all columns, use an asterisk (*) wildcard character instead of listing all the column names
true
Unless it is being used to copy data from one table to another, the INSERT statement can be used to insert only a single row into a table
true
If you have a foreign key in a CUSTOMER table that references the primary key in a SALESREP table, the ON DELETE CASCADE syntax means that
when a SALESREP is deleted, all CUSTOMERs of that SALESREP are also deleted