1/145
SQL Practice Quiz1 - Creating & Populating DB Tables Quiz, SQL Practice Quiz2 - Creating Single Table Queries Quiz, SQL Practice Quiz3 - Creating Multi-Table Queries, SQL Practice Quiz4 - Creating Queries to Update Data
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the original name of SQL?
SEQUEL
The ____ data type stores only the actual character string.
VARCHAR
SQL was developed in the mid-____.
1970s
In SQL, table names cannot exceed ____ characters.
30
A ____ file is a text file with a .sql extension that contains SQL commands.
script
To display all the rows and columns in a table, type the word SELECT, followed by a(n) ____, followed by the word FROM and then the name of the table containing the data you want to view.
asterisk
For any column whose data type is CHAR, values must be enclosed in ____.
single quotation marks ‘__‘
The correct data type for the BALANCE column in the CUSTOMER table is ____.
DECIMAL
To delete an entire table, use the ____ command and then re-create the table.
DROP TABLE
You indicate the end of a command by typing a ____.
semicolon
To change a value in a table, use the CHANGE command.
False
To create a table, type the command DESCRIBE TABLE followed by the name of the table to be created and then by the names and data types of the columns that will comprise the table.
False
In Oracle, the data type STRING(n) stores a character string n characters long.
False
InOracle, execute the DESC command to list all the columns in a table.
True
In SQL, you cannot enter an apostrophe into a column whose type is character (CHAR).
False
Table names cannot contain spaces.
True
When adding rows to character columns, make sure you enclose the values in single quotation marks.
True
In Oracle, the date, November 12, 2015 would be stored as ‘12-NOV-2015’.
True
Dropping a table also deletes any data that you entered into the table.
True
To list all the columns in a table, use the LIST COLUMNS command.
False
The DESCRIBE TABLE command defines a table’s structure by listing its columns, data types, and column lengths.
False
When you enter a new row into a table or modify an existing row, the values for one or more columns can be unknown or unavailable.
True
The data type DECIMAL(5,2) represents a number with three places to the left and two places to the right of the decimal.
True
To view data in a table, use the VIEW command.
False
If you added a row that should not be in a table, use a REMOVE command to remove it.
False
Instead of including every column in the SELECT clause, you can use an ampersand (&) to indicate that you want to include all columns.
False
A simple condition has the form: column name, comparison operator, and then either another column name or a value.
True
The WHERE clause is used to retrieve rows that satisfy some condition.
True
An arithmetic column is a column that does not exist in the database but can be computed using data in existing columns.
False
In a nested query, the outer query is evaluated first.
False
When the OR operator connects simple conditions, the compound condition will be true whenever any one of the simple conditions is true.
True
The only arithmetic operators that can be used in SELECT statements are + for addition and - for subtraction.
False
SQL requires that you follow special formatting rules.
True
When data is sorted on two columns, the more important column is called the major sort key.
True
A query is a question represented in a way that the DBMS can understand.
True
The HAVING clause is used to restrict groups that are included in a query result.
True
It is possible to use both a WHERE clause and a HAVING clause in a SELECT statement.
True
The COUNT function only applies to columns with numeric values.
False
The UNIQUE operator eliminates duplicate values in a query.
False
The WHERE clause applies to both rows and groups.
False
To produce the same results as the MINUS operator, use NOT, the IN operator and a subquery.
True
You must use a comma or a period to separate a table name from its alias.
False
For two tables to be union compatible, the columns of the two tables must be identical.
False
In a full outer join, all rows from both tables will be included regardless of whether they match rows from the other table.
True
To ensure that query results are listed in a desired order, use the ORDER BY clause.
True
Oracle does not support the MINUS operator.
False
There is only one approach to joining tables.
False
To relate two tables, in the FROM clause list all columns involved in the query.
False
In small databases, there is a significant time difference between different query approaches.
False
You can use the EXISTS operator to retrieve data from more than one table.
True
You can use the IN operator to retrieve data from multiple tables.
True
Oracle supports the INTERSECT operator.
True
When the innermost subquery is evaluated, a permanent table is produced.
False
You must join tables by finding rows in the two tables that have identical values in matching columns.
True
One reason for using an alias is when you are joining a table to itself.
True
In a(n) ____ join, all rows from both tables are included regardless of whether they match rows from the other table.
full outer
Two tables are ____ compatible if they have the same number of columns and if their corresponding columns have identical data types and lengths.
union
union
The ____ of two tables is the set of all rows that are in the first table but that are not in the second table.
difference
You create an alias by typing the name of the table, pressing the ____, and then typing the name of the alias.
Spacebar
To qualify a column name, precede the name of the column with the name of the table, followed by a(n) ____.
period (.)
You can precede a subquery with the ____ operator to create a condition that is true if one or more rows are obtained when the subquery is executed.
EXISTS
You can join tables by using a condition in the ____ clause.
WHERE
A(n) ____ clause can include statistics calculated for only the groups or columns whose values are identical for each row in a group.
SELECT
The product of two tables is formally called the ____ Product.
Cartesian
For an SQL implementation to truly support the union operation, it must remove ____ rows automatically.
duplicate
If you change the value of a column to NULL, you must enclose the NULL value in single quotation marks.
False
To verify that the correct change was made to data in a table, use the DISPLAY command.
False
The command, CREATE TABLE AS LEVEL1_CUSTOMER USING CUSTOMER; creates a table called LEVEL1_CUSTOMER that has the same structure as CUSTOMER.
False
You cannot commit and roll back data in Oracle
False
To add a new column, use the ADD NEW COLUMN clause of the ALTER TABLE command.
False
You can use REMOVE ROW to remove a row from a table.
False
You use the APPEND command to add additional rows to tables.
False
It is a good idea to use a SELECT command to display the data you changed to verify that the correct update was made.
True
When necessary, include a WHERE clause into the UPDATE command to indicate the column on which the change is to take place.
False
If you decrease the size of a column, it is possible to lose some data currently in the column.
True
In SQL Server, the word NULL appears in the results when a column contains a null value.
True
You cannot use a compound condition with an UPDATE command.
False
You can create a new table using data in an existing table.
True
To permanently remove both a table and its data, you must issue both a DROP TABLE command and a DELETE command.
False
By default, Oracle commits each action query as soon as the user executes the query.
True
Which of the following is a valid SQL command?
COMMIT;
You can use the ____ clause of the ALTER TABLE command to change a column that currently rejects null values so that it will accept null values.
MODIFY
Which of the following commands executes a rollback?
ROLLBACK;
You can use the ____ command to create a new table using data in an existing table.
CREATE TABLE
If you have verified that the update you made is correct, you can use the ____ command to make the update permanent.
COMMIT
To add data from an existing table to a new table, use a SELECT command in a(n) ____ command.
INSERT
If you have not run the COMMIT command, executing the ____ command will reverse all updates made during the current work session.
ROLLBACK
You can use the ____ command to delete an entire table and its data.
DROP TABLE
If you specified ____ for a column when you created a table, then changing a value in a column to null is prohibited.
NOT NULL
Which of the following is a valid SQL command?
DROP TABLE LEVEL1_CUSTOMER;
To create a view in Access, create a query to define the view and then save the query object in the database.
True
There are table structure changes that are beyond the capabilities of SQL.
True
You can use the existing value in a column and a calculation to update a value.
True
When you connect two or more simple conditions with the AND operator, each condition must be listed on a separate line.
False
Oracle stores script files is a special location called Saved Commands.
False
When you enter a new row into a table or modify an existing row, the values for one or more columns can be unknown or unavailable.
True
After the word FROM in a SELECT statement, you list any conditions (restrictions) that apply to the data you want to retrieve.
False
All SELECT statements require a WHERE clause.
False
A view is a derived table.
True
The DROP TABLE command creates an empty table.
False