Database Final

Ace your homework & exams now with Quizwiz!

Which of the following is not supported by API? Manage connections Prepare queries Execute queries Call stored procedures All of the above are supported

All of the above are supported

A ____ statement is an SQL statement that can be customized with parameter values retrieved from user input. customized parameterized prepared none of the above

prepared

____ statements are immune to most SQL injection attacks. customized parameterized prepared none of the above

prepared

Two popular types of imperative languages are

procedural and object-oriented

stored procedures

procedures are compiled by and stored in the database

____ are used to enforce business rules automatically as data is updated, inserted, and deleted. Function triggers stored triggers triggers none of the above

triggers

_____ do not contain control flow statements. declarative language imperative language none of the above

Declarative languages

____ languages contain control flow statements that determine the execution order of program steps Declarative Imperative None of the above

Imperative

T or F? The trigger body may be a simple or compound statement.

TRUE

A _____connect directly to the database driver driver manager application none of the above

application

Recovery system enforces

atomic and durable transaction

A stored procedure's body can contain only one SQL statement can contain one or more SQL statement must contain multiple SQL statements None of the above

can contain one or more SQL statements

object-oriented programming

combine data and procedures into classes.

Saving complete transaction in the database is called a

commit

A(n) ____ identifies the database address and provides logon credentials attach connection link none of the above

connection

Conflicting Schedules

contain the same transactions with some conflicting operations in different order

Equivalent schedules

contains the same transactions with conflicting operations in the same order

Developing applications using both SQL and a procedural or object-oriented language is called ____ database design database development database implementation database programming

database programming

SQL is the leading example of a(n) ____ language. declarative imperative none of the above

declarative

With_____language, the optimizer determines how to process a query declarative imperative none of the above

declarative

A ____ connects directly to the database driver driver manager application none of the above

driver

The ____ connects the application to the drivers a driver administrator driver manager driver supervisor none of the above

driver manager

SQL statements that are generated at run-time are called ____ SQL. run-time dynamic active none of the above

dynamic

The precompiler cannot compile ______ SQL statements.

dynamic

Atomic

either all or none of the operations are executed and applied to the database [partial or incomplete transaction, are rolled back]

____ codes SQL statements directly in a program written in another language. embedded SQL procedural SQL an application programing interface (API) none of the above (not)

embedded SQL

Programming languages fall into what two broad categories

imperative and declarative

Procedural languages and Object-oriented languages are declarative languages imperative languages none of the above

imperative languages

An SQL ____ attack is when a user intentionally enters values that alter the intent of an SQL statement. takeover injection modification none of the above

injection

shared variable

is a host language variable that appears in SQL statements

Lock

is a permission for one transaction to read or write data

A transaction

is a sequence of database operations that must be either completed or rejected as a whole

cursor

is an embedded SQL variable that identifies an individual row of a result table

Two-phase locking

is specific locking technique that ensures serializable transactions

Lock scope

is the collection of data reserved by a lock

Concurrency system enforces

isolated transactions

Procedural programming

languages contain control flow statements but no classes.

Declarative Language

languages do not explicitly specify how results are processed.

In a nonrecoverable schedule...

one or more transactions cannot be rolled back.

phantom read

one transactions inserts or deletes a table row that another transaction is reading

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

optimizer/compiler

A transaction schedule

order of operations for multiple transactions

A stored procedure can be called from other stored procedures C, C++, Java, Python the database mgmt system's command line All of the above

All of the above

Which of the following is NOT specified in DSN when you develop a web page that connects to a database? DSN prefix such as mysql: for SQL Server or sqlserver: for SQL Server Database server's hostname or address Database server's port number Database name All of the above are specified DSN

All of the above are specified DSN

A connection is...

A connection is a communication link between a host program and a database server.

____ can call stored procedures using embedded SQL or built into an API. A hosted program Procedural SQL A server program None of the above

A hosted program

Imperative language

A language based on giving the computer commands or procedures to follow.

____ is a library of procedures or classes. The library links an application programming language to a computer service, such as a database Embedded SQL Procedural SQL An application programming interface (API) None of the above

An application programming interface (API)

Host Language

Any language that contains embedded SQL statements.

How many SQL statements must be in one transaction?

At least one

ACID stands for

Atomicity, Consistency, Isolation, Durability

Embedded SQL is commonly supported in which language?

C

The ________ statement releases resources associated with a cursor.

CLOSE

A stored function is declared with a ____ statement. CREATE FUNCTION CREATE STORED FUNCTION DECLARE FUNCTION DECLARE STORED FUNCTION

CREATE FUNCTION

A stored procedure is declared with a _____ statement, CREATE PROCEDURE CREATE STORED PROCEDURE MAKE PROCEDURE -- MAKE STORE PROCEDURE

CREATE PROCEDURE

A stored procedure is declared with a ________________ statement

CREATE PROCEDURE

A trigger is created by the CREATE STORED TRIGGED CREATE TRIGGER MAKE TRIGGER MAKE STORED TRIGGER

CREATE TRIGGER

Which of the following is NOT a leading database API? ODBC -- JDBC DB-API ADO.NET -- All of the above are leading database APIs --

DB-API

The ________ statement associates a cursor name with a query

DECLARE

A ____ is a string containing database connection information Domain Server Name (DSN) Database Server Name (DSN) Data Source Name (DSN) None of the above

Data Source Name (DSN)

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

FETCH

T of F A connection consists of a database address only.

False

T or F Different database programming techniques cannot be combined in one application.

False

T or F The EXEC SQL keyword is used in procedural SQL.

False

A stored____is like a stored procedure that returns a single value action function routine none of the above

Function

A precompiler translates embedded SQL to:

Host language

After a transaction commits, the transaction can be rolled back: Always Sometimes Never

Never

The ________ statement executes a query.

OPEN

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

PREPARE

________is the leading declarative language.

SQL

After a rollback, the database restarts a transaction: Always Sometimes Never

Sometimes

Statements that are written explicitly in program code are ______ SQL

Static

T or F All embedded SQL statements require an active connection.

True

T or F Each database connection consumes computer resources.

True

T or F Procedural SQL is specified in the SQL standard.

True

T or F Several connections can exist at the same time.

True

T or F? A trigger can retrieve the row's data value in the table prior to an update or delete operation and also after an insert or update operation

True

T or F? A trigger is initiated before or after an INSERT, UPDATE or DELETE statement is executed on a table the trigger is created on.

True

T or F? Procedural SQL and APIs are often used together. A common database task is coded in an SQL procedure. The compiled procedure is called via an API and can be reused in many applications.

True

T or F? Procedural SQL languages differ significantly, depending on the database.

True

T or F? Stored functions are invoked within an SQL expression rather than with a CALL statement.

True

T or F? Stored functions behave like built-in SQL functions, such as COUNT(), SUM(), and AVG(). The only difference is that stored functions are defined by the programmer, while built-in functions are defined by the database.

True

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

USING

Lock manager is...

a component of the concurrency system that tracks, grants, and releases locks

Dirty read

a transaction can read data that is not yet committed

nonrepeatable read

a transaction repeatedly read changing data

Consistent

all rules governing data are valid when the transaction is committed

shared lock

allows a transaction to read, but not write, data.

Rejecting an incomplete transaction is called a

rollback

In a cascading schedule

rollback of one transaction forces rollback of other transactions.

In a strict schedule,

rollback of one transaction never forces rollback of other transactions.

SQL procedures are compiled by and stored in the database are called ____. stored procedures complied procedures SQL procedures None of the above

stored procedures

SQL procedures are compiled by and stored in the database are called ____. stored procedures complied procedures SQL procedures None of the above

stored procedures

Durable

transaction is permanently saved in the database once committed, regardless of system failures.

Isolated

transaction is processed without interference from other transactions

READ COMMITTED

transactions read only committed data

REPEATABLE READ

transactions read only committed data

READ UNCOMMITTED

transactions read uncommitted data

SERIALIZABLE

transactions run in a serializable schedule with concurrent transactions. Isolation is guaranteed.

precompiler

translates SQL statements into host language statements and function calls.


Related study sets

Chapter 23 - Legal Implications in Nursing Practice

View Set

Populations in Research Requiring Additional Considerations and/or Protections

View Set

Beginning of the Revolutionary Era: The American Revolution

View Set