COSC3380 EXAM 2

studied byStudied by 7 people
5.0(2)
Get a hint
Hint

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

1 / 161

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

162 Terms

1

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

True

New cards
2

What does CRUD stand for?

create, read, update, delete

New cards
3

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

True

New cards
4

What are the two types of "wildcard characters"?

% and _

New cards
5

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

True

New cards
6

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

True

New cards
7

A materialized view is not stored by the database

False

New cards
8

What are the advantages of views?

Protect sensitive data
Save complex queries
Save optimized queries

New cards
9

Using materialized views always improves database performance.

False

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

New cards
10

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

True

New cards
11

A view query can reference another view table.

True

New cards
12

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

New cards
13

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.

New cards
14

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.

New cards
15

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

False

New cards
16

The join operation is a low-level database action.

False

New cards
17

____________ languages combine data and procedures into classes.

Object-oriented

New cards
18

____________ languages do not explicitly specify how results are processed.

Declarative

New cards
19

____________ languages contain control flow statements but no classes.

Procedural

New cards
20

Programming languages are either __________ or declarative.

imperative

New cards
21

____________ is the leading declarative language.

SQL

New cards
22

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

optimizer/compiler

New cards
23

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

paradigm

New cards
24

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

syntax

New cards
25

Usually generates a network round trip for each SQL query.

Embedded SQL

New cards
26

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

Embedded SQL

New cards
27

Affords the greatest database security.

Procedural SQL

New cards
28

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

False

This is embedded SQL

New cards
29

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

False

New cards
30

____________________ creates variables for a stored procedure.

DECLARE

New cards
31

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

True

New cards
32

Stored functions may be executed from the MySQL command line.

True

New cards
33

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

False

Can only contain IN, OUT, or INOUT

New cards
34

Embedded SQL statements appear between EXEC SQL and a semicolon.

True

New cards
35

Embedded SQL is commonly supported in which language?

C

New cards
36

A precompiler translates embedded SQL to ________________________________

Host language

New cards
37

A connection consists of a database address only.

False

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

New cards
38

All embedded SQL statements require an active connection.

True

New cards
39

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

FETCH

New cards
40

The ________ statement executes a query.

OPEN

New cards
41

The ________ statement associates a cursor name with a query.

DECLARE

New cards
42

The ________ statement releases resources associated with a cursor.

CLOSE

New cards
43

The _____ statement assigns query results to shared variables.

FETCH

New cards
44

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

OPEN

New cards
45

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

PREPARE

New cards
46

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

USING

New cards
47

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

static

New cards
48

The precompiler cannot compile ______ SQL statements.

dynamic

New cards
49

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

the host language

New cards
50

Which API supports only one language ?

DB-API

New cards
51

Which API is often used with the C# language ?

ADO.NET

New cards
52

Database APIs support:

Databases and other data sources

New cards
53

A driver connects directly to the database.

True

New cards
54

The driver manager connects the application to the drivers.

True

New cards
55

Each database requires a different driver manager.

False

New cards
56

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

True

New cards
57

Every driver implements the full capabilities of the API.

False

New cards
58

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

True

New cards
59

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

False

New cards
60

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

True

New cards
61

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

close()

New cards
62

MySQL supports the semantic type MONEY.

False

New cards
63

Photographs are stored with the BYTEA type in PostgreSQL.

True

New cards
64

XML is a common ___________________ type.

document

New cards
65

Which database has both XML and JSON types?

PostgreSQL

New cards
66

Which database does not support object types?

MySQL

New cards
67

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

True

New cards
68

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

New cards
69

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

MySQL

New cards
70

Collection type implementations always conform to the SQL standard.

False

Not all collection types are standardized in SQL.

New cards
71

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

False

New cards
72

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

True

New cards
73

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

True

New cards
74

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

True

New cards
75

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

False

New cards
76

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

Similar

New cards
77

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

True

New cards
78

What is the distance equation for the Cartesian reference system?

sqrt(x^2 + y^2)

New cards
79

The _______________ function computes distance between two points.

ST_DISTANCE()

New cards
80

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

False

The bottom level is dense, not sparse.

New cards
81

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

True

New cards
82

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

True

New cards
83

A database method is:

Either a function or a procedure

New cards
84

How many methods can an object type have?

Zero, one, or many

New cards
85

NOT FINAL is required for supertypes that have subtypes.

True

New cards
86

What values are required to create a PDO object?

Hostname, database name, username, and password

New cards
87

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

keywords

New cards
88

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

New cards
89

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

materialized view, base table

New cards
90

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

New cards
91

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

New cards
92

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

import java.sql*;

New cards
93

DriverManager.getConnection(_________,___________,____________)

What parameters are included?

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

New cards
94

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

New cards
95

The EXEC SQL keyword is used in procedural SQL

False

New cards
96

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

FETCH

New cards
97

Which API often uses the C# language?

ADO.NET

New cards
98

1415 can be stored as an INT type in Oracle database

False

New cards
99

A stored procedure is compiled every time the procedure is called

False

New cards
100

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

cursor

New cards

Explore top notes

note Note
studied byStudied by 1167 people
Updated ... ago
4.9 Stars(15)
note Note
studied byStudied by 16 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 151 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 18 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 90 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 45 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 122063 people
Updated ... ago
4.8 Stars(560)

Explore top flashcards

flashcards Flashcard78 terms
studied byStudied by 17 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard20 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard22 terms
studied byStudied by 109 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard44 terms
studied byStudied by 47 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard27 terms
studied byStudied by 33 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard22 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard115 terms
studied byStudied by 89 people
Updated ... ago
5.0 Stars(1)