Midterm2 Flashcards
There are five employees in table E = (First_name, Last_name). The names of the employees are ALIBEK, ALUA, ARNA, ASLAN and ASYLZHAN. If the following query is executed, which name(s) will you see as the result of it?
SELECT First_name
FROM E
WHERE First_name LIKE ‘ A%_L%’
a) ALIBEK, ALUA
b) ASLAN ASYLZHAN
c) NONE
d) ALUA
e) ALIBEK, ALUA, ASLAN, ASYLZHAN
f) ASLAN
g) ASYLZHAN
h) ALIBEK
b) ASLAN ASYLZHAN
A transaction completes its execution is said to be in _____ state.
a) Temporary
b) Finished
c) Active
d) Ended
e) Committed
e) Committed
Consider the table EMPLOYEE = (name, surname). Which of the following SQL commands can be used to delete column Surname from this table?
a) ALTER TABLE EMPLOYEE
DROP COLUMN Surname
b) MODIFY EMPLOYEE
DELETE Surname
c) DROP COLUMN Surname
FROM EMPLOYEE
d) DELETE COLUMN Surname
FROM EMPLOYEE
e) DROP Surname
FROM TABLE EMPLOYEE
a) ALTER TABLE EMPLOYEE
DROP COLUMN Surname
4NF is specifically related to coping with?
a) Join dependencies
b) Inclusion dependencies
c) Multivalued dependencies
d) None
e) Functional dependencies
c) Multivalued dependencies
Choose the correct order of the SQL commands below used in a query
a) SELECT, FROM, WHERE, HACING, GROUP BY, ORDER BY
b) SELECT, WHERE, FROM, HAVING, ORDER BY, GROUP BY
c) ORDER BY, SELECT, WHERE, FROM, HAVING, GROUP BY
d) SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY
e) SELECT, FROM, WHERE, HAVING, ORDER BY, GROUP BY
d) SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY
What is the SQL operator that applies a specific condition to rows grouped together based on identical values in certain columns?
a) HAVING
b) PARTITION BY
c) GROUP BY
d) DISTINCT
e) ORDER BY
a) HAVING
Which of the followinf may not be correct about database triggers?
a) A trigger checks the condition specified in the trigger and it should run only if the condition is evaluated to be true
b) A database trigger is a procedure that starts automatically if specified changes take place or an event occurs
c) The action part in a trigger shows what will happen if the trigger runs
d) A common use of triggers is to maintain a database consistent and they are activated by a specific kind of statement (insert, delete, update)
e) Database triggers are introduced for querying databases more efficiently and they always increase the performance of the database.
e) Database triggers are introduced for querying databases more efficiently and they always increase the performance of the database.
A typical trigger has the following three components?
a) Assertion, Index, Action
b) Condition, Index, Action
c) None
d) Event(s), Condition, Action
e) Event(s), Condition, Assertion
d) Event(s), Condition, Action
Based on the discussion in our lectures, which one is NOT correct about materialized views?
a) If V is a materialized view, then V will be used as a table
b) Precomputed offline - faster at runtime
c) Used in data warehouses
d) Always up to date
e) All are correct
d) Always up to date
Consider the following interleaved transactions to be executed as given. What kind of drastic probelm can occur, where R(A) stands for reading item A, W(A) stands for writing item A and C stands for Commit?
T1: R(A) R(A), W(A),C
T2: R(A), W(A), C
a) Unrepeatable read problem
b) None
c) Update problem
d) The temporary update (or dirty read) problem
e) Dirty write problem
a) Unrepeatable read problem
Consider the following interleaved transactions to be executed as given. What kind of drastic probelm can occur, where R(A) stands for reading item A, W(A) stands for writing item A and C stands for Commit?
T1: R(A), W(A), R(A), W(A),Abort
T2: R(A), W(A), C
a) Unrepeatable read problem
b) None
c) Update problem
d) The temporary update (or dirty read) problem
e) Dirty write problem
d) The temporary update (or dirty read) problem
Which of the following statements is incorrect about the inference rules for functional dependencies?
a) reflexitivity: if Y is-subset of X, then X -> Y
b) Decomposition: if XY -> Z, then X -> Z and Y -> Z
c) Union: if X -> Y and X -> Z, then X ->YZ
d) Augmentation: if X-> Y, then WX-> WY
e) Pseudo transitivity: If X -> Y and WY -> Z, then WX -> Z
b) Decomposition: if XY -> Z, then X -> Z and Y -> Z
In SQL, which of the following keywords is used in SQL in the database autorization process?
a) ACCESS RIGHT
b) AUTHORIZE
c) PERMIT
d) SELECT
e) REVOKE
e) REVOKE
What are ACID properties of Transactions?
a) Atomicity, Completeness. Inconsistenct, Data Independence
b) Atomicity, Consistency, Isolation, Durability
c) Atomicity, Completeness, Isolation, Data Independence
d) Atomicity, Completeness, Isolation, Durability
e) Atomicity, Concurrency, Isolation, Data Independence
b) Atomicity, Consistency, Isolation, Durability
Please choose the correct option for three-valued logic
a) None
b) FALSE AND UNKNOWN = UNKNOWN
FALSE OR UNKNOWN = UNKNOWN
c) FALSE AND UNKNOWN = FALSE
FALSE OR UNKNOWN = FALSE
d) FALSE AND UNKNOWN = UNKNOWN
FALSE OR UNKNOWN = FALSE
e) FALSE AND UNKNOWN = FALSE
FALSE OR UNKNOWN = UNKNOWN
e) FALSE AND UNKNOWN = FALSE
FALSE OR UNKNOWN = UNKNOWN