COSC3380 EXAM 2

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

1/161

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

162 Terms

1
New cards

Data must be in the database for an update query to make an update.

True

2
New cards

What does CRUD stand for?

create, read, update, delete

3
New cards

If the Name column has data type VARCHAR(20), then the expression Name BETWEEN 'Anele' AND 'Jose' is valid.

True

4
New cards

What are the two types of "wildcard characters"?

% and _

5
New cards

If a SELECT statement has no WHERE clause, the aggregate function processes all rows

True

6
New cards

The base tables are specified in the view query's FROM clause.

True

7
New cards

A materialized view is not stored by the database

False

8
New cards

What are the advantages of views?

Protect sensitive data
Save complex queries
Save optimized queries

9
New cards

Using materialized views always improves database performance.

False

Materialized views improve performance of SELECT statements that refer to the view

10
New cards

The performance of a user query on a view is identical to the performance of the corresponding merged query on base tables

True

11
New cards

A view query can reference another view table.

True

12
New cards

If a base table primary key does not appear in a view, an insert to the view generates a NULL primary key value. Since primary keys may not be NULL, the insert is not allowed.

True

13
New cards

Join view deletes are an effective method of deleting unnecessary data

False

The effect of the join view delete is undefined and therefore not allowed.

14
New cards

Reversing the order of the select and project operations alters the result of the expression.

False

Reversing the order of the select and project operations does not alter the result of the expression.

15
New cards

Query optimizers typically choose an optimal expression based on total number of rows processed.

False

16
New cards

The join operation is a low-level database action.

False

17
New cards

____________ languages combine data and procedures into classes.

Object-oriented

18
New cards

____________ languages do not explicitly specify how results are processed.

Declarative

19
New cards

____________ languages contain control flow statements but no classes.

Procedural

20
New cards

Programming languages are either __________ or declarative.

imperative

21
New cards

____________ is the leading declarative language.

SQL

22
New cards

A(n) ____________ determines how to process statements in a declarative language.

optimizer/compiler

23
New cards

C contains control flow statements and SQL does not. This is an example of the ______ gap.

paradigm

24
New cards

SQL uses many keywords, like SELECT, FROM, and WHERE. C relies heavily on punctuation, like {} and #. This is an example of the ______ gap.

syntax

25
New cards

Usually generates a network round trip for each SQL query.

Embedded SQL

26
New cards

Has become less popular with the rise of object-oriented programming.

Embedded SQL

27
New cards

Affords the greatest database security.

Procedural SQL

28
New cards

Procedural SQL is compiled in two steps, with a precompiler followed by a compiler.

False

This is embedded SQL

29
New cards

A stored procedure is compiled every time the procedure is called.

False

30
New cards

____________________ creates variables for a stored procedure.

DECLARE

31
New cards

RETURNS specifies a data type for the return value and appears between the CREATE FUNCTION clause and the body.

True

32
New cards

Stored functions may be executed from the MySQL command line.

True

33
New cards

The <parameter-declaration> has the same syntax in stored procedures and stored functions.

False

Can only contain IN, OUT, or INOUT

34
New cards

Embedded SQL statements appear between EXEC SQL and a semicolon.

True

35
New cards

Embedded SQL is commonly supported in which language?

C

36
New cards

A precompiler translates embedded SQL to ________________________________

Host language

37
New cards

A connection consists of a database address only.

False

A connection specifies authorization credentials for a database as well as the database address.

38
New cards

All embedded SQL statements require an active connection.

True

39
New cards

The ________ statement moves a cursor to the next row of a result table.

FETCH

40
New cards

The ________ statement executes a query.

OPEN

41
New cards

The ________ statement associates a cursor name with a query.

DECLARE

42
New cards

The ________ statement releases resources associated with a cursor.

CLOSE

43
New cards

The _____ statement assigns query results to shared variables.

FETCH

44
New cards

The ________ statement positions a cursor before the first row of a result table.

OPEN

45
New cards

A(n) _______ statement must appear before an EXECUTE statement without the IMMEDIATE keyword.

PREPARE

46
New cards

Shared variables appear in an EXECUTE statement with the ______ clause.

USING

47
New cards

Statements that are written explicitly in program code are ______ SQL.

static

48
New cards

The precompiler cannot compile ______ SQL statements.

dynamic

49
New cards

In the declaration section, shared variables are assigned a data type in:

the host language

50
New cards

Which API supports only one language ?

DB-API

51
New cards

Which API is often used with the C# language ?

ADO.NET

52
New cards

Database APIs support:

Databases and other data sources

53
New cards

A driver connects directly to the database.

True

54
New cards

The driver manager connects the application to the drivers.

True

55
New cards

Each database requires a different driver manager.

False

56
New cards

The driver manager communicates with all drivers using the same commands.

True

57
New cards

Every driver implements the full capabilities of the API.

False

58
New cards

A secondary API can be layered on top of a third API, for a total of three API layers.

True

59
New cards

A connection must always be created within the try clause of a try-except-else statement.

False

60
New cards

A connection must be created prior to executing any database operation.

True

61
New cards

Which MySQLCursor method should always be called prior to closing the cursor's connection?

close()

62
New cards

MySQL supports the semantic type MONEY.

False

63
New cards

Photographs are stored with the BYTEA type in PostgreSQL.

True

64
New cards

XML is a common ___________________ type.

document

65
New cards

Which database has both XML and JSON types?

PostgreSQL

66
New cards

Which database does not support object types?

MySQL

67
New cards

Both user-defined types AND system-defined types can be either simple or complex types

True

68
New cards

The only difference between the multiset and list types is that elements are ordered in a list value and not in a multiset value.

True

69
New cards

In the ______________ set type, the base type must be a group of character strings.

MySQL

70
New cards

Collection type implementations always conform to the SQL standard.

False

Not all collection types are standardized in SQL.

71
New cards

Functions that manipulate XML and JSON values are similar in most relational databases.

False

72
New cards

JSON documents can be stored as a VARCHAR type in MySQL.

True

73
New cards

When a document is inserted to a column with XML or JSON type, databases generate an error if the syntax is incorrect.

True

74
New cards

In MySQL, tables can be joined on columns with type JSON.

True

75
New cards

All spatial data is either two- or three-dimensional.

False

76
New cards

Spatial data types in MySQL, SQL Server, and PostGIS are:

Similar

77
New cards

When no SRID is specified, MySQL assumes SRID zero, which is a Cartesian reference system.

True

78
New cards

What is the distance equation for the Cartesian reference system?

sqrt(x^2 + y^2)

79
New cards

The _______________ function computes distance between two points.

ST_DISTANCE()

80
New cards

The bottom level of an R-tree index is sparse.

False

The bottom level is dense, not sparse.

81
New cards

If all blocks of an R-tree index are full, an insert to the spatial column always causes a block split.

True

82
New cards

When a value is deleted from a column with an R-tree index, MBRs in the top index level may become smaller.

True

83
New cards

A database method is:

Either a function or a procedure

84
New cards

How many methods can an object type have?

Zero, one, or many

85
New cards

NOT FINAL is required for supertypes that have subtypes.

True

86
New cards

What values are required to create a PDO object?

Hostname, database name, username, and password

87
New cards

UPDATE, SELECT, and ORDER BY are __________________ in an SQL statement

keywords

88
New cards

A view table provides which benefit when created in a database with multiple tables?

A consolidated view of specific data without changing the underlying database structure

89
New cards

When a database stores view data, it uses a _____________ that depends on data in a corresponding __________________

materialized view, base table

90
New cards

Which of the following is NOT one of the ways users can be provided with dynamic access to an Oracle database?

PL/SQL Web Toolkit

91
New cards

Which of the following is used to access the database server at time of executing the program and get the data from the server accordingly?

Embedded SQL

92
New cards

Which of the following header must be included in Java program to establish database connectivity using JDBC?

import java.sql*;

93
New cards

DriverManager.getConnection(_________,___________,____________)

What parameters are included?

URL or machine name where server runs, Password, User ID

94
New cards

What is missing from the join statement?

SELECT EmployeeName, Salary FROM Employee, Department WHERE Salary > 50000

A column from Employee is not compared to a column from Department

95
New cards

The EXEC SQL keyword is used in procedural SQL

False

96
New cards

The ______________ statement moves a cursor to the next row of a result table

FETCH

97
New cards

Which API often uses the C# language?

ADO.NET

98
New cards

1415 can be stored as an INT type in Oracle database

False

99
New cards

A stored procedure is compiled every time the procedure is called

False

100
New cards

A(n) ____________ will retrieve rows from a query that has multiple rows in the result set

cursor