flervalsfrågor 2020 Flashcards
A relational database consists of a collection of:
Fields
Records
Tables
Keys
Tables
Consider two student tables:
StudID Course
Ida IS
Fredrik Econ
and
StudID Course
Michelle Physik
Frank CompSci
Oscar AeroEng
Which operator would yield the empty table?
Difference
Intersection
None of the mentioned
Union
Intersection
There are similarities between the instructor entity set and the secretary entity set in the sense that they have several attributes that are conceptually the same across the two entity sets: namely, the identifier, name, and salary attributes. This process is called:
Similarity
Commonality
Specialisation
Generalisation
Generalisation
Which relationship is used to represent a specialization entity?
WHOIS
ISA
ONIS
AIS
ISA
Consider a phone number that can take one or more values. Treating a phone number as a _________ permits a database to have several phone numbers associated to a person or organisation.
Relation
Attribute
Entity
Value
Entity
By maximising the differences between members of the entity set person, it can be classified as both student and employee. This process is called _________ .
Inheritance
Object oriented
Specialisation
Generalisation
Specialisation
A ________ in a table represents a relationship among a set of values.
Row
Entry
Key
Column
Row
Course_id Sec_id Semester Year
BIO-101 1 Spring 2021
CS-102 4 Summer 2020
EE-201 3 Fall 2020
FIN-301 1 Spring 2019
The primary key in the above table is ____________.
Sec_id and Semester
Sec_id
Course_id
All of the attributes
Course_id
Tables in Third Normal Form (3NF) are already in 1NF and 2NF and in which the values in all non-primary-key columns can be worked out from _______ the ________ key column(s).
All, Candidate
Only, Foreign
Some of, Primary
Only, Primary
Only, Primary
Which of the following indicates the maximum number of entities that can be involved in a relationship?
Modality
Minimum Cardinality
Maximum Cardinality
Participation
Maximum Cardinality
What is a relationship called when it is maintained between two entities?
Ternary
Binary
Unary
Quaternary
Binary
Which of the following can be a multivalued attribute?
Name
Phone_number
Date_of_birth
All of the mentioned
Phone_number
What is the optimised version of the relation algebra expression:
π A1 (π A2 (σ F1 (σ F2 (r)))),
where A1, A2 are sets of attributes in r with A1 ⊂ A2 and F1, F2 are Boolean expressions based on the attributes in r?
π A1 (σ (F1 ∨ F2) (r))
π A2 (σ (F1∧ F2) (r))
π A2 (σ (F1 ∨ F2) (r))
π A1 (σ (F1 ∧ F2) (r))
π A1 (σ (F1 ∧ F2) (r))
In order to maintain transactional integrity and database consistency, what technology does a DBMS deploy?
Cursors
Triggers
Locks
Pointers
Locks
Consider a relational table with a single record for each registered student with the following attributes:
- Registration_Num: Unique registration number of each registered student
- UID: Unique identity number, unique at the national level for each citizen
- BankAccount_Num: Unique account number at the bank. A student can have multiple accounts or joint accounts. This attribute stores the primary account number.
- Name: Name of the student
- Hostel_Room: Room number of the hostel
Which of the following options is INCORRECT?
UID is a candidate key if all students are from the same country
Registration_Num can be a primary key
BankAccount_Num is a candidate key
If S is a superkey such that S∩UID is NULL then S∪UID is also a superkey
BankAccount_Num is a candidate key
Which is the name given to the bottom-up approach to database design that begins by examining the relationship between attributes?
Decomposition
Normalisation
Functional Dependency
Database modelling
Normalisation
A member of Staff could be described in EER as either Manager or Assistant. Moreover an entity occurrence of Staff could be a member of both Manager and Assistant subclasses. What is placed next to the participation constraint within the curly brackets?
Both
All
Or
And
And
Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation:
employee (empId, empName, empAge)
dependent(depId, eId, depName, depAge)
Consider the following relational algebra query:
π empId (employee) −
π empId (employee ⋈ ((empId=eID) ∧ (empAge ≤ depAge)) Dependent)
The above query evaluates to the set of empIds of employees whose age is greater than that of
Some of his/her dependents
All of his/her dependents
All dependents
Some dependents
All of his/her dependents
Consider the following case. Transaction A might hold a lock on some rows in the Accounts table and needs to update some rows in the Orders table to finish. Transaction B holds locks on those very rows in the Orders table but needs to update the rows in the Accounts table held by Transaction A. What problem has arisen?
Stamp lock
Exclusive lock
Gridlock
Deadlock
Deadlock
The attribute name could be structured as an attribute consisting of first name, middle initial, and last name.
This type of attribute is called
Composite attribute
Simple attribute
Derived attribute
Multivalued attribute
Composite attribute
The attribute AGE is calculated from DATE_OF_BIRTH. The attribute AGE is _________ .
Multi-valued
Single-valued
Derived
Composite
Derived
The basic locking mechanism allows a transaction that needs to access a data item to request either a shared or exclusive lock. Once granted the transaction will hold the lock until it explicitly releases it. This method does not guarantee serializability as it permits transaction to interfere with one another. Which two ACID properties are therefore not supported?
Consistency and Durability
Atomicity and Consistency
Isolation and Durability
Atomicity and Isolation
Atomicity and Isolation
The terms information, knowledge and data are frequently used for overlapping concepts. The main difference is in the level of abstraction being considered. The most abstract is _______, while ______ is below, and the most concrete is known as ______.
Data, Information, Knowledge
Knowledge, Data, Information
Knowledge, Information, Data
Information, Data, Knowledge
Knowledge, Information, Data
A _____________ constraint requires that an entity occurrence can be a member of only one of the subclasses.
Uniqueness
Special
Disjointness
Hierarchical
Disjointness
The term _______ is used to refer to a row.
Instance
Tuple
Attribute
Field
Tuple
Course (course_id, sec_id, semester)
Here the course_id, sec_id and semester are __________ and Course is a _________.
Tuple, Attributes
Relations, Attribute
Tuple, Relation
Attributes, Relation
Attributes, Relation
What is the aim of Normalisation?
Produce a set of tables that have update anomalies
Produce a set of tables with minimal redundancy
Remove redundant data from the tables
Produce a minimal set of tables
Produce a set of tables with minimal redundancy
Which of the following protocols ensures conflict serializability and safety from deadlocks?
Two-phase locking protocol
None of the mentioned
Time-stamp ordering protocol
Graph based protocol
Time-stamp ordering protocol
The term attribute refers to a ___________ of a table.
Tuple
Key
Column
Record
Column
What is the name of a relationship where the same entity participates more than once in different roles. For example, Staff supervises Staff?
ISA
Onto
One to One
Recursive
Recursive