Persistence Flashcards
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
?
ACID stands for
Atomicity, Consistency, Isolation, Durability
Authentic, Consistency, Immutable, Duplicable
Atomicity, Compatable, Immutable, Durability
Automated, Compatable, Isolation, Deterministic
Atomicity, Consistency, Isolation, Durability
In a prepared statement, data is replaced with
Question marks
Variable names
Dollar signs
Excalamation points
Question marks
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
It is vulnerable to SQL injection attacks
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
Foreign keys must always reference a valid unique key
MAX(), SUM(), and COUNT() are examples of
Aggregate functions
Scalar functions
Operators
Sequences
Aggregate functions
UPPER(), ABS(), CONCAT() are examples of
Scalar functions
Aggregate Functions
Constraints
Filters
Scalar functions
Insert is a part of this sublanguage
DML
DQL
TCL
DDL
DML
What is required of a primary key? (Select all that apply)
Unique Value
Integer Data Type
Not Null
Unique Value
Not Null
A join can be used to combine information from two separate tables
TRUE
FALSE
TRUE
Use the AS keyword to specify an alias
TRUE
FALSE
TRUE
CRUD stands for:
Create, Read, Update, Delete
Create, Retrieve, Update, Derive
Create, Retrieve, Undo, Delete
Control, Read, Undo, Delete
Create, Read, Update, Delete
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
SELECT * FROM Customers
Which of the following clauses are added to sort the results of a SELECT statement?
ORDER BY
HAVING
GROUP BY
WHERE
ORDER BY
Which of the following returns the number of records in the result from a SELECT query?
COUNT()
SUM(
ADD(
TOTAL(
COUNT()
Which command is used to remove a table from memory?
DELETE
DROP
TRUNCATE
REMOVE
DROP
DDL Statements include commands like INSERT, UPDATE, and DELETE?
TRUE
FALSE
FALSE
n a one-to-one relationship, you typically use a third table as an association or join table.
TRUE
FALSE
FALSE
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
TRUE
A primary key is used to uniquely identify a particular entry or row in a table.
TRUE
FALSE
TRUE
Which of the following are typical commands of DML?
CREATE
DROP
ALTER
UPDATE
?
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
Update multiple rows at a time
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
Injecting a SQL Statement as user input
Which of the following is NOT a type of SQL constraint?
PRIMARY KEY
ALTERNATE KEY
FOREIGN KEY
UNIQUE
ALTERNATE KEY
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
TRUE
DDL stands for
Data Definition Language
Data Defined Language
Data Directed Language
Derived Data Language
Data Definition Language
DML stands for
Data Manipulation Language
Data Manipulated Language
data Morphed Language
Defined Manipulation Language
Data Manipulation Language
What JDBC object is used to reference the rows returned by a query?
Query
ResultSet
QuerySet
Results
?
JDBC Exceptions
JDBC statements throw which exception(s)
IOException
JDBCConnectionException
SQLException
SQLSyntaxException
SQLException
What is returned by executeUpdate?
ResultSet
a collection
Iterator
int
int
True or False: Every database needs its own driver, to translate JDBC commands into something that database can understand.
TRUE
FALSE
TRUE
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
All of the Above