Past_papers (Midterm2) Flashcards
If a non-prime attribute is partially determined by a key in a relation R, then R is in ____.
a) 1NF
b) 4NF
c) BCNF
d) 3NF
e) 2NF
e) 2NF (not 100 sure)
4NF is specifically deisgned to cope with:
a) Multivalued dependency
b) Partial dependency
c) Transitive dependency
d) Fully functional dependency
e) Inclusion dependency
a) Multivalued dependency
If R = ABCD and the following set of functional dependencies are given; F = {AB -> CD, AC -> B, C -> D). What are the candidate keys of R?
a) AB and AC
b) A, B and C
c) AC and CB
d) ABC
e) AB and CD
a) AB and AC
If R = ABC and the following set of functional dependencies are given, F = (AB -> C, AC -> B, BC -> A). What is the storngest (highest) normal form (NF) satisfying relation R?
a) BCNF
b) 4NF
c) 1NF
d) 2NF
e) 3NF
a) BCNF
If R1 = ABCEG and the following set of functional dependencies F1 are given; F1 = { AB -> C, AC -> B, BC -> A, E -> G}. What are the candidate keys of R?
a) AB, AC, BC and E
b) AB, AC, and BC
c) ABE, ACE and BCE
d) None
e) AB, BCE and AC
c) ABE, ACE and BCE
Let us suppose that R = DCEGH is a relation that satisfies the set F of functional dependencies F = { E -> G}. What is the strongest (highest) normal form that relation R satisfies?
a) 2NF
b) 3NF
c) 1NF
d) BCNF
e) 4NF
idk
Which of the following may not be always correct as one of the criteria for a good relational schema design?
a) No additive (spurious) tuples should be possible when joining relations
b) There should be no addition, deletion or modification anomalies on the basic relations.
c) A relational schema should be decomposed as much as possible
d) The deisgn of the relational database must satisfy the lossless join property.
e) Relations should not have unnecessarily many null values.
c) A relational schema should be decomposed as much as possible
Considering the following database application
Students (stud-no: integer, dept-name: string, stud-number: integer, dept-rep-no: integer)
Enrolled: (stud-no: integer, dept-no: integer, dept-enrollment-ave: real)
Which attribute(s) of the above relations can be given as an example for a foreign key?
a) stud-no
b) dept-no
c) dept-name
d) dept-enrolment-ave
e) dept-no
b) dept-no
Which of the following 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 eevent occurs.
c) Database triggers are introduced for querying databases more efficiently and they always increase the performance of the database
d) The action part in a trigger shows what will happen if the trigger runs
e) A common use of triggers is to maintain a database consistent and they are activated by a specific kind of statement (insert, delete, update)
c) Database triggers are introduced for querying databases more efficiently and they always increase the performance of the database
Which of the following may be incorrect?
a) A database integrity constraint is just an expression that might be required and engorced only for some of specific users
b) A database constraint cannot be created if it is already violated
c) A database constraint has a unqiue name
d) A database constraint is enforced from the point of creation forward.
e) A database constraints cannot reference parameters or host variables; they are application independent.
a) A database integrity constraint is just an expression that might be required and engorced only for some of specific users (ChatGPT)
Which may not be true?
a) Whenever any of these index structures is created, an index name is given for that index structure
b) Any of these index structures can be created per table, and it may include multiple columns
c) The index structures are always used with a special physical ordering with no alternatives
d) These index structures control the physical order of rows
e) Any of these index structures is generally implemented as a B+ tree or some variations of it.
c) The index structures are always used with a special physical ordering with no alternatives (CHatGPT)
Which of the folloeing may not be a reason for creating views?
a) Hide some data from some users
b) Modularity of database access
c) Simplify queries
d) Make some queries easier/ more natural
e) Keep database updated through the use of views more efficently and safely
e) Keep database updated through the use of views more efficently and safely
Which operator below can be used to perform pattern matching?
a) LIKE
b) SIMILAR
c) BETWEEN
d) MATCH
e) PATTERN
a) LIKE
Which SQL keyword is used to retrieve unqiue student ages?
a) SELECT UNQUE age FROM Students
b) SELECT DISTINCT age FROM Student
c) SELECT DISTINCTIVE age FROM Student
d) SELECT DIFFERENT age FROM Student
e) SELECT NON-REBUNDANT age FROM Students
b) SELECT DISTINCT age FROM Student
Which SQL keyword is used in a SQL query to sort the result set (output of the query)?
a) SORT
b) ORDERING
c) SORT BY
d) ORDER BY
e) ORDER
d) ORDER BY