Persistence Flashcards

1
Q

What do we call a primary key that consists of multiple columns in a table?
composite key

consisting key

foreign key

double-primary key

composting key

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ACID stands for

Atomicity, Consistency, Isolation, Durability

Authentic, Consistency, Immutable, Duplicable

Atomicity, Compatable, Immutable, Durability

Automated, Compatable, Isolation, Deterministic

A

Atomicity, Consistency, Isolation, Durability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In a prepared statement, data is replaced with

Question marks

Variable names

Dollar signs

Excalamation points

A

Question marks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In JDBC, a Statement is unsafe because

It is vulnerable to SQL injection attacks

Unlike Prepared Statements, data sent by a Statement query is unencrypted

Statements are safe

Statements may throw an exception which must be handled, while PreparedStatements will never throw exceptions

A

It is vulnerable to SQL injection attacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Referential integrity stipulates

Foreign keys must always reference a valid unique key

Every table must have a primary key

Joins should only be used with foreign and primary keys

Columns should be atomic

A

Foreign keys must always reference a valid unique key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

MAX(), SUM(), and COUNT() are examples of

Aggregate functions

Scalar functions

Operators

Sequences

A

Aggregate functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

UPPER(), ABS(), CONCAT() are examples of

Scalar functions

Aggregate Functions

Constraints

Filters

A

Scalar functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Insert is a part of this sublanguage

DML

DQL

TCL

DDL

A

DML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is required of a primary key? (Select all that apply)

Unique Value

Integer Data Type

Not Null

A

Unique Value

Not Null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A join can be used to combine information from two separate tables

TRUE

FALSE

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Use the AS keyword to specify an alias

TRUE

FALSE

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

CRUD stands for:

Create, Read, Update, Delete

Create, Retrieve, Update, Derive

Create, Retrieve, Undo, Delete

Control, Read, Undo, Delete

A

Create, Read, Update, Delete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which of the following retrieves all columns and all rows from the Customers table?

SELECT * FROM Customers

SELECT all FROM Customers

SELECT % FROM Customers

SELECT all columns FROM Customers

A

SELECT * FROM Customers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following clauses are added to sort the results of a SELECT statement?

ORDER BY

HAVING

GROUP BY

WHERE

A

ORDER BY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following returns the number of records in the result from a SELECT query?

COUNT()

SUM(

ADD(

TOTAL(

A

COUNT()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which command is used to remove a table from memory?

DELETE

DROP

TRUNCATE

REMOVE

A

DROP

17
Q

DDL Statements include commands like INSERT, UPDATE, and DELETE?

TRUE

FALSE

A

FALSE

18
Q

n a one-to-one relationship, you typically use a third table as an association or join table.

TRUE

FALSE

A

FALSE

19
Q

In a one-to-many relationship, rows in one table can refer to multiple rows in another, but that other table can only refer to at most one row in the former table

TRUE

FALSE

A

TRUE

20
Q

A primary key is used to uniquely identify a particular entry or row in a table.

TRUE

FALSE

A

TRUE

21
Q

Which of the following are typical commands of DML?

CREATE

DROP

ALTER

UPDATE

A

?

22
Q

The SQL UPDATE statement can…

Update only one row at a time

Update multiple rows at a time

Delete a row based on a where clause

Update the current system time of the database

A

Update multiple rows at a time

23
Q

What is SQL Injection?

Using inline queries in a SqlCommand object

Injecting a SQL Statement as user input

Using Parameters to take inputs from users

Installing a plugin to SQL Server Management Studio

A

Injecting a SQL Statement as user input

24
Q

Which of the following is NOT a type of SQL constraint?

PRIMARY KEY

ALTERNATE KEY

FOREIGN KEY

UNIQUE

A

ALTERNATE KEY

25
Q

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true

TRUE

FALSE

A

TRUE

26
Q

DDL stands for

Data Definition Language

Data Defined Language

Data Directed Language

Derived Data Language

A

Data Definition Language

27
Q

DML stands for

Data Manipulation Language

Data Manipulated Language

data Morphed Language

Defined Manipulation Language

A

Data Manipulation Language

28
Q

What JDBC object is used to reference the rows returned by a query?

Query

ResultSet

QuerySet

Results

A

?

29
Q

JDBC Exceptions
JDBC statements throw which exception(s)

IOException

JDBCConnectionException

SQLException

SQLSyntaxException

A

SQLException

30
Q

What is returned by executeUpdate?

ResultSet

a collection

Iterator

int

A

int

31
Q

True or False: Every database needs its own driver, to translate JDBC commands into something that database can understand.

TRUE

FALSE

A

TRUE

32
Q

A benefit of using JDBC is?

It abstracts the process of opening a socket connection to a database manually, and handling each request/response.

It provides features for managing transaction safety and performance

It reduces the amount of work required to make changes to your configuration

All of the above

A

All of the Above