CIS 3060- SQL Practice Quiz 1, 2, 3, 4

5.0(1)
studied byStudied by 3 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/145

flashcard set

Earn XP

Description and Tags

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

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

146 Terms

1
New cards

What is the original name of SQL?

SEQUEL

2
New cards

The ____ data type stores only the actual character string.

VARCHAR

3
New cards

SQL was developed in the mid-____.

1970s

4
New cards

In SQL, table names cannot exceed ____ characters.

30

5
New cards

A ____ file is a text file with a .sql extension that contains SQL commands.

script

6
New cards

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

7
New cards

For any column whose data type is CHAR, values must be enclosed in ____.

 

​single quotation marks ‘__‘

8
New cards

The correct data type for the BALANCE column in the CUSTOMER table is ____.

DECIMAL

9
New cards

To delete an entire table, use the ____ command and then re-create the table.

DROP TABLE

10
New cards

You indicate the end of a command by typing a ____.

semicolon

11
New cards

To change a value in a table, use the CHANGE command.

False

12
New cards

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

13
New cards

In Oracle, the data type STRING(n) stores a character string n characters long.

False

14
New cards

InOracle, execute the DESC command to list all the columns in a table.

True

15
New cards

In SQL, you cannot enter an apostrophe into a column whose type is character (CHAR).

False

16
New cards

Table names cannot contain spaces.

True

17
New cards

When adding rows to character columns, make sure you enclose the values in single quotation marks.

True

18
New cards

In Oracle, the date, November 12, 2015 would be stored as ‘12-NOV-2015’.

True

19
New cards

Dropping a table also deletes any data that you entered into the table.

True

20
New cards

To list all the columns in a table, use the LIST COLUMNS command.

False

21
New cards

The DESCRIBE TABLE command defines a table’s structure by listing its columns, data types, and column lengths.

False

22
New cards

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

23
New cards

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

24
New cards

To view data in a table, use the VIEW command.

False

25
New cards

If you added a row that should not be in a table, use a REMOVE command to remove it.

False

26
New cards

Instead of including every column in the SELECT clause, you can use an ampersand (&) to indicate that you want to include all columns.

False

27
New cards

A simple condition has the form: column name, comparison operator, and then either another column name or a value.

True

28
New cards

The WHERE clause is used to retrieve rows that satisfy some condition.

True

29
New cards

An arithmetic column is a column that does not exist in the database but can be computed using data in existing columns.

False

30
New cards

In a nested query, the outer query is evaluated first.

False

31
New cards

When the OR operator connects simple conditions, the compound condition will be true whenever any one of the simple conditions is true.

True

32
New cards

The only arithmetic operators that can be used in SELECT statements are + for addition and - for subtraction.

False

33
New cards

SQL requires that you follow special formatting rules.

True

34
New cards

When data is sorted on two columns, the more important column is called the major sort key.

True

35
New cards

A query is a question represented in a way that the DBMS can understand.

True

36
New cards

The HAVING clause is used to restrict groups that are included in a query result.

True

37
New cards

It is possible to use both a WHERE clause and a HAVING clause in a SELECT statement.

True

38
New cards

The COUNT function only applies to columns with numeric values.

False

39
New cards

The UNIQUE operator eliminates duplicate values in a query.

False

40
New cards

The WHERE clause applies to both rows and groups.

False

41
New cards

To produce the same results as the MINUS operator, use NOT, the IN operator and a subquery.

True

42
New cards

You must use a comma or a period to separate a table name from its alias.

False

43
New cards

For two tables to be union compatible, the columns of the two tables must be identical.

False

44
New cards

In a full outer join, all rows from both tables will be included regardless of whether they match rows from the other table.

True

45
New cards

To ensure that query results are listed in a desired order, use the ORDER BY clause.

True

46
New cards

Oracle does not support the MINUS operator.

False

47
New cards

There is only one approach to joining tables.

False

48
New cards

To relate two tables, in the FROM clause list all columns involved in the query.

False

49
New cards

In small databases, there is a significant time difference between different query approaches.

False

50
New cards

You can use the EXISTS operator to retrieve data from more than one table.

True

51
New cards

You can use the IN operator to retrieve data from multiple tables.

True

52
New cards

Oracle supports the INTERSECT operator.

True

53
New cards

When the innermost subquery is evaluated, a permanent table is produced.

False

54
New cards

You must join tables by finding rows in the two tables that have identical values in matching columns.

True

55
New cards

One reason for using an alias is when you are joining a table to itself.

True

56
New cards

In a(n) ____ join, all rows from both tables are included regardless of whether they match rows from the other table.

 

​full outer

57
New cards

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

58
New cards

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

59
New cards

You create an alias by typing the name of the table, pressing the ____, and then typing the name of the alias.

Spacebar

60
New cards

To qualify a column name, precede the name of the column with the name of the table, followed by a(n) ____.

​period (.)

61
New cards

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

62
New cards

You can join tables by using a condition in the ____ clause.

WHERE

63
New cards

A(n) ____ clause can include statistics calculated for only the groups or columns whose values are identical for each row in a group.

SELECT

64
New cards

The product of two tables is formally called the ____ Product.

Cartesian

65
New cards

For an SQL implementation to truly support the union operation, it must remove ____ rows automatically.

duplicate

66
New cards

If you change the value of a column to NULL, you must enclose the NULL value in single quotation marks.

False

67
New cards

To verify that the correct change was made to data in a table, use the DISPLAY command.

False

68
New cards

The command, CREATE TABLE AS LEVEL1_CUSTOMER USING CUSTOMER; creates a table called LEVEL1_CUSTOMER that has the same structure as CUSTOMER.

False

69
New cards

You cannot commit and roll back data in Oracle

False

70
New cards

To add a new column, use the ADD NEW COLUMN clause of the ALTER TABLE command.

False

71
New cards

You can use REMOVE ROW to remove a row from a table.

False

72
New cards

You use the APPEND command to add additional rows to tables.

False

73
New cards

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

74
New cards

When necessary, include a WHERE clause into the UPDATE command to indicate the column on which the change is to take place.

False

75
New cards

If you decrease the size of a column, it is possible to lose some data currently in the column.

True

76
New cards

In SQL Server, the word NULL appears in the results when a column contains a null value.

True

77
New cards

You cannot use a compound condition with an UPDATE command.

False

78
New cards

You can create a new table using data in an existing table.

True

79
New cards

To permanently remove both a table and its data, you must issue both a DROP TABLE command and a DELETE command.

False

80
New cards

By default, Oracle commits each action query as soon as the user executes the query.

True

81
New cards

Which of the following is a valid SQL command?

 

​COMMIT;

82
New cards

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

83
New cards

Which of the following commands executes a rollback?

 

​ROLLBACK;

84
New cards

You can use the ____ command to create a new table using data in an existing table.

​CREATE TABLE

85
New cards

If you have verified that the update you made is correct, you can use the ____ command to make the update permanent.

COMMIT

86
New cards

To add data from an existing table to a new table, use a SELECT command in a(n) ____ command.

INSERT

87
New cards

If you have not run the COMMIT command, executing the ____ command will reverse all updates made during the current work session.

ROLLBACK

88
New cards

You can use the ____ command to delete an entire table and its data.

 

​DROP TABLE

89
New cards

If you specified ____ for a column when you created a table, then changing a value in a column to null is prohibited.

NOT NULL

90
New cards

Which of the following is a valid SQL command?

 

​DROP TABLE LEVEL1_CUSTOMER;

91
New cards

To create a view in Access, create a query to define the view and then save the query object in the database.

True

92
New cards

There are table structure changes that are beyond the capabilities of SQL.

True

93
New cards

You can use the existing value in a column and a calculation to update a value.

True

94
New cards

When you connect two or more simple conditions with the AND operator, each condition must be listed on a separate line.

False

95
New cards

Oracle stores script files is a special location called Saved Commands.

False

96
New cards

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

97
New cards

After the word FROM in a SELECT statement, you list any conditions (restrictions) that apply to the data you want to retrieve.

False

98
New cards

All SELECT statements require a WHERE clause.

False

99
New cards

A view is a derived table.

True

100
New cards

The DROP TABLE command creates an empty table.

False