Past_papers (Midterm2) Flashcards

1
Q

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

A

e) 2NF (not 100 sure)

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

4NF is specifically deisgned to cope with:
a) Multivalued dependency
b) Partial dependency
c) Transitive dependency
d) Fully functional dependency
e) Inclusion dependency

A

a) Multivalued dependency

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

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

a) AB and AC

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

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

a) BCNF

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

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

A

c) ABE, ACE and BCE

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

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

A

idk

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

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.

A

c) A relational schema should be decomposed as much as possible

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

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

A

b) dept-no

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

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)

A

c) Database triggers are introduced for querying databases more efficiently and they always increase the performance of the database

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

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) A database integrity constraint is just an expression that might be required and engorced only for some of specific users (ChatGPT)

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

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.

A

c) The index structures are always used with a special physical ordering with no alternatives (CHatGPT)

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

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

A

e) Keep database updated through the use of views more efficently and safely

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

Which operator below can be used to perform pattern matching?
a) LIKE
b) SIMILAR
c) BETWEEN
d) MATCH
e) PATTERN

A

a) LIKE

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

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

A

b) SELECT DISTINCT age FROM Student

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

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

A

d) ORDER BY

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

Which of the following SQL commands can be used in SQL to add new data records to a database table?
a) INSERT INTO
b) APPEND
c) ADD
d) UPDATE
e) ADD TO

A

a) INSERT INTO

16
Q

In SQL which of the following keywords is used in SQL for database authorization?
a) PERMIT
b) AUTHORIZE
c) GRANT
d) SELECT
e) ACCESS

A

c) GRANT