0% found this document useful (0 votes)
25 views

Database Management Assignment Help

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Database Management Assignment Help

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

For any help Assignment Help related queries Call us at :- +1 678 648 4277

You can mail us at:- [email protected]


reach us at :- www.databasehomeworkhelp.com/

Database Management Assignment Help


Q1. Consider the following instances:

Dishes Dips
Name Price Rating
Name Price Ratin
Pasta 800 5 g
Fajita 500 4 Cheese 200 5
Pizza 1000 4
Pasta 200 5 Hummus 150 5

Pasta 150 5
Salsa 80 4
Cheesecake 800 5

Consider the Relational Algebra expression on these given


instances:
П Name(Dishes (П price,Rating (Price>100Dips)))

What is the output of the given Relational Algebra expression?


a) Fajitas.
b) Pasta.
c) Pizza.
d) No row will be selected.
Answer: b) Pasta.
Q2. Consider the following instances:
Dishes Dips
Name Price Rating
Name Price Ratin
Pasta 800 5 g
Fajita 500 4
Pizza 1000 4 Cheese 200 5

Pasta 200 5 Hummus 150 5


Pasta 150 5
Salsa 80 4
Cheesecake 800 5

Which of the following Relational Algebra expression returns only


Cheese and Hummus as output?
a) П Dips.Name("Dips1.Rating>Dips. Rating PDips1(Dips) x
Dips))
b) П Dips.Name("Dishes.PricesDips.Price/Dips.Rating Dishes.
Rating (Dishes Dips))
c) Dishes - ("Dips1.Rating <4vDips 1.Price 100(PDips1 (Dips)))
d) П Dips.Name (Dips (Dips - (Dips1.Rating<4vDips1.Prices100
(PDips1 (Dips)))))

Answer: b) П Dips.Name("Dishes.PricesDips.Price/Dips.Rating
Dishes. Rating (Dishes Dips))
d) П Dips.Name (Dips (Dips - (Dips1.Rating<4vDips1.Prices100
(PDips1 (Dips)))))
Q3. Consider the relational schema Music(Composer, Studio,
Instrument, Singer).
Choose the correct Tuple Relational Calculus expression that
represents the following state
ment:
"Display all Composers who selected Violin as an Instrument for
their Music."

a) {ts Music (t[Composer]=s[Composer] A


s[Instrument]='Violin')}
b) {st < t[Instrument]='Violin'>}
c) {<s, t>3s Music (p[Instrument]='Violin')}
d) {t3s Music (t[Composer]=s[Instrument] A
t[Instrument]='Violin')}

Answer: a) {ts Music (t[Composer]=s[Composer] A


s[Instrument]='Violin')}

Q4. Consider the relational schema Music(Composer, Studio,


Instrument, Singer).
Choose the correct Domain Relational Calculus expression
equivalent to the following SQL
query
SELECT Singer FROM Music
WHERE Studio='Motown‘

a) {s c, d, i (c, d, i, s E Music A Studio='Motown')}


b) {<s>| c, d, i (<c, d, i, s> E Music ^ d='Motown')}
c) {<s>| c, d, i (<c, d, i>Es A Studio='Motown')}
d) {s <c, d, i> (c, d, i, se Music Ʌ d='Motown')}
Answer: b) {<s>| c, d, i (<c, d, i, s> E Music ^ d='Motown')}
Q5. Consider the following Entity Relationship Diagrams:

ERD 1

Movie Song

Movie Song Name


Title
Actor M Singer
Actor F

ERD 2

Song
Movie
Movie Song
Name
Title
Singer
Actor M
Actor F

Producer
Administered BY P Name
Which of the following statements is (are) true?

a) The primary key in the schema for Song in ERD1 is {Name,


Singer).
b) The schema for Administered By in ERD2 is Administered
By(Title, Name, Singer).
c) The schema for Administered By in ERD2 is Administered
By(Title, Name, Singer,
PName).
d) The primary key in the schema for Song in ERD1 is {Name,
Singer, Movie Song, Title}.

Answer: c) The schema for Administered By in ERD2 is


Administered By(Title, Name, Singer, PName).

Q6. A C program, with embedded SQL query allows users to enter


their salary and designation
which are stored in variables sal and des respectively. The SQL
command returns the Names
of those Employees from Employees (Name, Salary, Designation)
whose designation is the
same as that provided by the user but salary is less than that
provided by the user.
Which of the following SQL queries is correct for the purpose?

a) EXEC SQL
DECLARE C CURSOR AS
FROM Employees
WHERE Salary< sal AND Designation-des
END. EXEC
SELECT Name

b) EXEC SQL DECLARE c CURSOR FOR


SELECT Name
WHERE :Salary<:sal & Designation=:des
FROM Employees
END EXEC

c) EXEC SQL
SELECT Name DECLARE C CURSOR AS
WHERE:Salary< sal & Designation=des
END EXEC
FROM Employees

d) EXEC SQL
DECLARE C CURSOR FOR SELECT Name
FROM Employees
WHERE Salary<:sal AND Designation=:des
END EXEC

Answer: d
Q7. Consider the following Entity Relationship diagram:

Which of the following diagrams is equivalent to the given ER diagram?

a) b)

c) d)
Answer: a)

Q8. Consider the Entity Relationship Diagram

Which of the following is (are) not true?

a) The schema for the Device entity will be Device (Model JD) and
DeviceSensor (Sensor Name, Color).
b) The schema for the Device entity will be Device (Model JD, Color)
and
Device Sensor (Model ID, SensorName).
c) The schema for the Dev Owner will be Dev Owner(Model JD,
OID).
d) The schema for the Owner will be Owner(OID, Name, Address).

Answer: a) The schema for the Device entity will be Device (Model
JD) and DeviceSensor (Sensor Name, Color).
Q9. Consider the following scenario: A complex has Floors and
Apartments. A Floor can have
multiple Apartments and an Apartment can be present on a single
Floor. A Floor can be
identified by its No. Floors are associated with Area and Resident.
There can be multiple
Residents in a Floor. An Apartment can be identified by its ANO
and has an Owner. An Owner attribute is composed of the Owner's
Name and DOB. The Name is again composed of FName and
LName.

Which of the following Entity Relationship diagrams depict this


scenario?
Q10. Consider the following instance

Shop
ID Location Branch
124 Kolkata 2
345 Delhi 0
87 Kolkata 1
452 Bangalore 4

How many tuples will be returned by the following Relational


Algebra:
(Pa(Shop) (П Location(Branch>0Shop))) ?

a) 4
b) 8
c) 12
d) 16

Answer: b) 8

You might also like