Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. A ________________________ constraint specifies that every entity in the supe

ID: 3838355 • Letter: 1

Question

1. A ________________________ constraint specifies that every entity in the superclass must be a member of at least one subclass in the specialization.

2. A _____________clause in the UPDATE command specifies the attributes to be modified and their new values.

   Suppose we have a relation with schema:

                        R( A, B, C, D, E)

If we issue a query of the form

SELECT ???

FROM R

WHERE …

GROUP BY C, D;

What terms can appear in the SELECT list (represented by ??? in the above query)? Identify, in the list below, the term that CAN NOT appear

SUM(A)

A

Count (E)

C

The latest scores from the Japanese Baseball League are in the table with schema

Scores(Team, Day, Opponent, Runs)

The data in this table is as follows:

What is the result of executing the following query on this data:

SELECT S1.Team

FROM Scores S1, Scores S2

WHERE S2.Team = 'Dragons' AND S1.Team <> S2.team AND S1.Runs > S2.Runs;

     Identify in the list below a tuple of the result.

) Bay Stars

Golden Eagles

Buffaloes

Dragons

The Conceptual data model is the set of concepts that

a.

Describe the structure of a database and the associated retrieval and update transactions


b.

Describe the structure of a database and the associated insert and update transactions



c.

Describe the structure of a database and the associated retrieval transactions

d.

is the actual implementation of the database, using a commercial DBMS.

The attribute on the left-hand side of the arrow in a functional dependency is the ________.

determinant

primary key

candidate key

foreign key

Let R(ABCD) be a relation with functional dependencies


A B, C D, AD C, BC A

Which of the following is a lossless-join decomposition of R into Boyce-Codd Normal Form (BCNF)?

a.

{AB, AC, AD, CD}

b.

{AB, ACD, BC, BD}

c.

{AB, AD, CD}

d.

{AC, BD, CD}

Which of the following relations is in Third normal form (3NF)?

a.

R(ABCD) FD's: AD C ; D A ; A C ; ABC D

b.

R(ABCD) FD's: AB C ; BCD A ; D A ; B C

c.

R(ABCD) FD's: AB C ; ABD C ; ABC D ; AC D

d.

R(ABCD) FD's: ABD C ; CD A ; AC B ; AC D

To maintain consistency of data, it is important to ensure that no insertion, deletion, or modification anomalies are present in the relation.

True

0r

False

Let R(ABCDE) be a relation in Boyce-Codd Normal Form (BCNF). If ABC is the only key for R, describe all the non-trivial functional dependencies that hold for R. Identify one of these FD's from the following list.

a.

BCDE A

b.

ABDE C

c.

ACD E

d.

ABC E

The latest scores from the Japanese Baseball League are in the table with schema

Scores(Team, Opponent, RunsFor, RunsAgainst)

The data in this table is as follows:

What is the result of executing the following query on this data?

         SELECT Team, Opponent

         FROM Scores

         WHERE Team LIKE '% %' OR Opponent LIKE '_i%';

           

         Identify, in the list below, a row of the result.

a.

Buffaloes              Ham Fighters


b.

Giant              Bay Stars


c.

Hawks              Marines  

  

d.

Dragons             Tigers

Consider the following E-R diagram:

The number of candidate keys for the entity type Employees is

eight.

two.

six.

one.

  

The relation R(a,b) may have duplicate tuples. Which of the following queries has a result that is guaranteed not to have duplicates, regardless of what tuples R contains?

a.

SELECT b

FROM R

WHERE a = b;


b.

SELECT *

FROM R

WHERE a <> b;


c.

(SELECT b

FROM R

WHERE a = 1)

UNION

( SELECT b

  FROM R

WHERE a = 2);


d.

SELECT MAX(b)

FROM R

GROUP BY a;


The latest scores from the Japanese Baseball League are in the table with schema

Scores(Team, Day, Opponent, Runs)

Gives the scores in the Japanese Baseball League for two consecutive days. The data in this table is as follows:

Determine the result of the following query:

          SELECT Team, Day

          FROM Scores S1

          WHERE NOT EXISTS (SELECT * FROM Scores S2

                                                   WHERE S1.Runs = S2.Runs AND

                                                                  ( S1.Team <> S2.Team OR S1.Day <> S2.Day));

Hint: When trying to understand what a query does, it is often easiest to work "inside-out." That is, first understand the subquery. Notice that the subquery in this problem has an "input," S1.Day, that is determined outside the subquery and depends on which row of scores the alias variable S1 refers to.

Identify, in the list below, one of the tuples in the result.

a.

( Swallows, Sunday)


b.

( Giants, Sunday)

c.

(Tigers, Sunday)


d.

(Bay stars, Monday)


a.

Describe the structure of a database and the associated retrieval and update transactions


b.

Describe the structure of a database and the associated insert and update transactions



c.

Describe the structure of a database and the associated retrieval transactions

d.

is the actual implementation of the database, using a commercial DBMS.

Explanation / Answer

1. A static constraint specifies that every entity in the superclass must be a member of at least one subclass in the specialization.


2. A set clause in the UPDATE command specifies the attributes to be modified and their new values.


3. in the list below, the term that CAN NOT appear : A because ont include in group by clouse.


4. The Conceptual data model is the set of concepts that
(a) Describe the structure of a database and the associated retrieval and update transactions.

5. (a) Determinant : The attribute on the left-hand side of the arrow in a functional dependency.  

6. To maintain consistency of data, it is important to ensure that no insertion, deletion, or modification anomalies are present in the relation
   --> TRUE
  
7. SELECT Team, Opponent
    FROM Scores
    WHERE Team LIKE '% %' OR Opponent LIKE '_i%';
  
   (D) Dragons             Tigers
  
8. SELECT S1.Team
   FROM Scores S1, Scores S2
   WHERE S2.Team = 'Dragons' AND S1.Team <> S2.team AND S1.Runs > S2.Runs;
  
   (D) Dragons