DBMS all in one
DBMS all in one
s m sadman sakib
Question Format
MCQ
a. weak entity.
b. strong entity.
c. ID-dependent entity.
d. ID-independent entity.
answer: a
c. functional dependencies.
answer: a
3. A keys:(2024)
c. identifies a row.
d. identifies a column.
answer: c
b. 2NF.
c. 3NF.
d. BCNF.
answer: d
a. transitive dependency.
b. insertion anomaly.
d. normal form.
answer: c
a. tables.
b. rows.
c. relations.
d. attributes.
answer:d
a.primary key
b.candidate key
c.foreign key
d.alternate key
e.unique key
answer:b
a.data files
b.indices
c.data dictionary
d.metadata files
answer:c
9.In the relational model ,relationship between relations or tables
are created by:(2022,2018)
a.composite key
b.determinants
c.candidate keys
d.foreign keys
answer:d
a.association
b.product formalization
c.joins
d.protocol
answer:c
a.keys
b.key revisited
c.superset keys
d.none of these
answer:a
12.Database ------- is the logical design of the data and the database
----------
a.instance, schema
b.relation, schema
c.relation, domain
d.schema, instance
answer:d
a.any
b.same
c.sorted
d.constant
answer:a
identify a record:(2018,2023)
a.candidate key
b.sub key
c.super key
d.foreign key
answer:c
answer:d
a.Domain
b.Relation
c.Set
d.Schema
answer:a
b.Super
c.Primary
d.Sub
answer:c
a.1NF
b.2NF
c.3NF
answer:c
a.connection
b.relationship
c.agreement
d.integration
answer:b
20.A collection of tables to represent data and relationship among
data is represented through model----------(2023)
a.ER model
b.Relational model
c.semistructered model
answer:b
ANSWER:
Armstrong's Axioms:
demonstration:
1.X->Z
2.Z->WY
3.x->wy (transitivity)
Demonstration:
1. {X→Z} |= WX→WZ (augmentation)
2. {Z ⃀ WZ} |= WZ → Z (reflexivity)
3. {WX→WZ, WZ→Z} |= WX→Z (transitivity)
Solution (b):
Solution (c):
Since no transitive dependencies exist, tables T-1, T-2 and T-2 are
in 3NF.
jedi(name,side,home-planet)
write and algebraic expression which will query(by listing their names) to find
all “wookie” (which is a specie) jedi on the light side of the force!
4. From an SQL user’s perspective , does relational model provide logical and
physical independence?why? 2 points
yes.
Logical Independence: Users can change the logical schema (e.g., add new
fields or tables) without affecting the application programs.
Physical Independence: Users can change the physical storage (e.g., how
data is stored or indexed) without affecting the logical schema or
application programs.
Answer (a):
Answer (b):
c.doctor(doctorID,doctorName)
patient(patientId, patientName)
3. WAREHOUSE Database:
.
Given details:
Functional Dependencies:
Normalized tables:
a. WarehouseManager(manager_id(fk), manager_name)
b. Warehouse(warehose_name(pk), warehouse_address,
manager_id(fk))
c. Part(warehose_name(pk+fk),part_no(pk), inventory_date,
quantity_on_hand, supplier_name)
11. CD Database:
Artist Details: Artist name where the name can repeat for Many
CD’s, thus need to have Identifier for an artist
Genre Details: Genre details where same genre can have many
CD’s thus need to have an identifier for Genre
Track Details: Track details including title, length and adding an
identifier as it is assumed that various CD’s can have same track
name(title). track table will be separated.
Functional Dependencies:
a. ArtistID-> Name
b. GenreID ->Name
Normalized tables:
a. . Artist(ArtistID(pk), Name)
b. Genre(GenreID(pk), Name)
.
.
{applicantNo,interviewDate,interviewTime}
{staffNo,interviewDate,interviewTime}
{roomNo,interviewDate,interviewTime}
13. Design an E-R Diagram for a marketplace company (such as e-
Bay)where individuals can sell and buy products.
The ER must be able to keep track of customers who sell items and
customers who bought them; some customers may do both.
Customer info must include street address, city, state, and zip
code.
Product info must include name, description, color, and size.
Each product sold or for sale must be identifiable, so the E-R must
be able to store the sale date if sold, and the current status of the
sales process (available, ordered, shipped, delivered).
Develop an ER diagram for each of these questions based on Ebay.
1. Define entity sets that contain all data objects that you need.
Define attributes and a primary key for each
entity set
2. Define relationships between entities that reflect the
requirements completely
3. Define total and partial participation in the relationships
an approximated answer
14.solve the question
15.Given the relational schema.
Driver(Name,LicenseNumber,Address)
Car(LicensePlate,Type,Manufacturer)
Owner(Licenseplate,LicenseNumber,Year_of_purchase)
solution:
&Year_of_purchase=2013 (Driver ⨝ Owner ⨝ Car))
π Name(σ Address='Debrecen' &Type='Lexus'
16.Provide a set of relational tables for the high level data model
shown below .Identify primary , alternate and foreign key
in the table.
a)
Below is the relational schema of the given high level data model.
Professor(name,office,rank,course#,rating)
Assistant(name,office,years)
Course(course#,dept)
ATeach(name,course#)
Given relation is
a.
- It is not in 3NF (3rd Normal Form) because the keys are partially
functional dependent.
b.
- Decompose to 2NF:
- Decompose to 3NF:
- Decomposition:
F = { M→ Mp , { M , Y } → P , Mp → C }
Answer:-------------
a.
i) {M} is not a candidate key since it does not functionally
determine attributes Y or P.
ii) {M, Y} is a candidate key since it functionally determines the
remaining attributes P, MP, and C. From F it is clear that MP and P
are functionally determined by M andY. By transitivity (M -> MP and
MP -> C) we also know that M -> C.
iii) {M, C} is not a candidate key since it does not functionally
determine attributes Y or P.
b.
BCNF can be directly tested by using all of the given dependencies
and finding out if the left hand side of each is a super key. Take the
two FD’s M -> MP and MP -> C, since neither M nor MP is a super
key, we can conclude that REFRIG is is neither in 3NF nor in BCNF.
Alternatively, REFRIG is not in 2NF, because {M,Y} is a key. So, we
can see here, Partial Functional dependency exists i.e ( M -> MP ).
So it is not also in 2NF,
Therefore, Given relation is in 1NF.
c).
Given the decomposition of REFRIG into D:
R1 (M, Y, P)
R2 (M, MP, C)
Using the test for Binary Decomposition, we calculate:
(R1∩ R2) = {M} ;(R1 – R2) = {Y, P};(R2 – R1) = { MP, C}
Then, we have: {M} -> {MP} (given) {M} -> {C}
{M} -> {MP} and {MP} {C}) {M}-> {MP, C}
So,(R1∩ R2) -> ((R2 – R1) or the decomposition D is lossless.
d)Employee(Enum,Ename,Bdate,Dnumber*)
Department(Dnumber,Department,Dhomepage)
e)
22. The following table stores details of doctors, patients
and dates of appointments. The Primary Key is
(doctorID, patientID).
c.Doctor(doctorID pk,doctorName)
Appointment(doctorID,patientID,date)
A. Weak Entity.
B. Strong Entity.
C. Entity.
D. None of the given.
Ans:---Option D. (Itself).
Explanation:--A recursive relationship is a relationship between an
entity and itself. In relational databases, when a table is involved in
a relationship with itself, it is called a recursive relationship. For
example, in a supervisor-supervisee relationship, a table storing
employee records is involved in a relationship with itself.
Composite Entity.:-This entity lies between the two entities that are
of interest and this composite entity shares the primary keys from
both the connecting tables.
A weak entity has a primary key that contains only one foreign key.
The entity DEPENDENT, for example, is a weak entity because it
uses the primary key of the EMPLOYEE entity as part of its own
primary key.
In general (though not necessarily) a weak entity does not have any
items in its primary key other than its inherited primary key and a
sequence number.
The Relationship that connects the weak entity to its owner identity
is called Total Participation inthe identifying relationship.
QUESTION 6...Which of the following is True regarding Associative
entity ?
A. Called bridge entity
B. Primary key is a composite attribute
C. Used to resolve complexity in many to many relationship
D. All of the given
Explanation:---
24.