DBI202- part 7/7

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

(TRUE AND NULL) returns: ??? a. NULL b. TRUE c. FALSE d. None of the others

a

(TRUE OR NULL) return: a. TRUE b. FALSE c. NULL d. None of the others

a

Choose the correct statement A.Except for COUNT, aggregate functions ignore null values B.Except for SUM, aggregate functions ignore null values C.Except for AVG, aggregate functions ignore null values D.Except for MIN, aggregate functions ignore null values E.Except for MAX, aggregate functions ignore null values

a

In PSM, the difference between a stored procedure and a function is that: a. A function has the return statement. b. We can declare local variables in a function. c. Loops are not allowed in a function. d. All of the others.

a

In UML, a _____ between classes is called an association a.binary relationship b.multi-way relationship c.none of the others

a

Often, a DBMS allows us to build a single index on ____ attribute(s) (choose the most correct answer) a. only one b. two c. three d. multiple

a

QN=18 (8537) What is a "join"? a. 'join' used to connect two or more tables logically with or without common field(s) a b. 'join' used to connect two or more tables logically with common field(s) c. 'join' used to connect two or more tables logically without common field(s) d. 'join' used to connect two or more tables logically with aliases

a

QN=43 (8610) In order to modify or delete an existing constraint, it is necessary that: a. the constraint has a name b. the constraint has an ID c. the constraint has some attributes

a

Relation R(x,y) currently consists of only one tuple (NULL, NULL). Which of the following queries will produce a nonempty output? That is, at least one tuple will be produced, although the tuple(s) may have NULL's. a. SELECT * FROM R WHERE x IS NULL b. SELECT * FROM R WHERE x = NULL c. SELECT * FROM R WHERE x = y d. SELECT * FROM R WHERE x <> 10

a

The SQL operations that are performed while a connection is active form a ____ a. Session b. Catalog c. Module d. None of the others

a

The table R(X,Y) currently has the following tuples (note there are duplicates).The relation S(A,B,C) has the following tuples: (See picture) Which is the result when we execute the following query: SELECT * FROM R UNION SELECT * FROM S [file:8524.jpg] a. There is an error a b. The output has 15 rows c. The output has 16 rows d. The output has 17 rows

a

What is the difference between Where and Having Clause? A.WHERE is for Rows and HAVING is for Groups B.WHERE is for Groups and HAVING is for Rows C.WHERE and HAVING are the same D.We can use aggregation functions in WHERE clause

a

What structure can you implement for the database to speed up table reads? a. indexes b. triggers c. store-procedures d. synonyms

a

When join R and S, we want to display all the records in R we must use: a. LEFT OUTER JOIN a b. RIGHT OUTER JOIN c. INNER JOIN d. None of the others

a

Suppose relation R(A,B) has the tuples: A B ------------------- 1 a 3 b 5 c 7 d and the relation S(B,C,D) has tuples: B C D ----------------------------------- a 4 6 c 6 8 c 5 5 c 7 9 Compute the right outer join of R and S, where the condition is: R.B = S.B. Then identify two tuples of R that do not appear in the computed result. a. (3,b) b. (1,a) c. (5,c) d. (7,d)

a,d

A weak entity A.does not depend on other entities B.does not have enough key attribute(s) C.is an entity that has not any key-attribute D.None of the others

b

Consider the following statement: "When drawing ERD, if an entity has no non-key attribute and it is the 'one' in many-one relationship, then we should set it to the attribute of other entities" That above statement describes which principle? A.Avoid Redundancy Principle B.Picking the right kind of element principle C.Limit the use of weak entity sets principle D.Faithfulness principle

b

Here are three relations, R(A,B), S(C,D), and T(E,F). Their current values are: R A B ------------------- 0 1 1 0 1 1 S C D ------------------- 0 1 1 0 1 1 T E F ------------------- 0 1 1 0 1 1 Compute the result of the query: SELECT A, F, SUM(C), SUM(D) FROM R, S, T WHERE B = C AND D = E GROUP BY A, F HAVING COUNT(*) > 1 Identify, in the list below, the row that appears in the result. A.(1,1,2,1) B.(1,1,2,2) C.(1,1,1,1) D.None of the others

b

QN=37 (8611) Look at the following tables and then choose the correct statment: ARTISTS Airtist_id Airtist_Name ----------------------------------- 1 Bono 2 Cher ALBUM artist_id Album_name ------------------------------------ 3 Eat the rich a. The above picture is an example of a database that has not enforced referential integrity b. The above picture is an example of a database that has not enforced entity integrity c. The above picture is an example of a database that has not enforced domain integrity d. All of the others

b

The relation R(A,B) may have duplicate tuples. Choose the query that create non-duplicated results, regardless of what tuples R contains? A.SELECT A, B FROM R B.SELECT A, B FROM R GROUP BY A, B C.SELECT A FROM R WHERE A NOT IN (SELECT B FROM R) D.SELECT TOP 3 A, B FROM R

b

When an entity is called "weak"? (a) When it is used to represent weak objects, such as patients, elders (b) When all of its attributes can not identify itself (c) When It always needs support from other entity (d) When It is not really necessary in the ERD a.(a) and (b) are correct b.(b) and (c) are correct c.(c) and (d) are correct d.(d) and (a) are correct

b

When drawing an ERD: (a)Entity sets and their attributes should reflect reality (b)Redundancy is not important, so we can ignore it (c) Avoid introducing more elements into the design than is absolutely necessary (d) Choosing the right relationships A.(a) and (b) and (c) are correct B.(a) and (c) and (d) are correct C.(a) and (b) and (d) are correct D.(b) and (c) and (d) are correct

b

Given relations R(A,B) and S(B,C,D). The result of natural join of the relations R and S has a. Only attribute B b. Only two attributes R.B and S.B c. Attributes A, B, C, D d. None of the others

c

QN=33 (8576) The IN SQL keyword a. Is used with the DISTINCT SQL keyword only b. Is used with the INSERT SQL keyword only c. Determines if a value any of the values in a list or a sub-query d. Defines the tables we are selecting or deleting data from

c

Suppose an updatable view ParamountMovies is associated with Movies relation. Choose a correct answer. a. Drop Movies relation also delete the view ParamountMovies b. Drop ParamountMovies also delete Movies c. An update on ParamountMovies is translated into Movies d. None of the others

c

Suppose relation R(a,b,c) has the following tuples: A B C ----------------------------------- 1 1 3 1 2 3 2 1 4 2 3 5 2 4 1 3 2 4 3 3 6 Which tuple is contained in the result of the following query: SELECT a, COUNT(DISTINCT B) FROM R GROUP BY a HAVING SUM(B) >3; A.(2,10) B.(3,7) C.(2,3) D.(3,12)

c

What does the following SQL statement do: SELECT Customer, COUNT(Order) FROM Sales GROUP BY Customer HAVING COUNT(Order) > 5 A.Selects the total number of orders from the Sales table, if this number is greater than 5 B.Selects all Customers from the Sales table C.Selects all customers from table Sales that have made more than 5 orders. D.None of the other three

c

What is a view? a. A view is a database diagram b. A view is a special stored procedure executed when certain event occurs c. A view is a virtual table which results of executing a pre-compiled query. A view is not a part of the physical database schema, while the regular tables are. d. None of the others

c

Choose the in-correct statement: a. In SQL Server, every DML operation is a transaction regardless of whether it has a BEGIN TRANSACTION or not b. COMMITTING a transaction makes permanent the changes resulting from all SQL statements in the transaction c. ROLLING back a transaction rejects any of the changes resulting from the SQL statements in the transaction d. When the sequence of tasks is complete, the SAVE POINT closes the transaction

d

Which of the following statements is the most correct? a. Using Stored procedures reduces network traffic b. Using Stored procedures improves security c. Using Stored procedures improves performance d. All of the others

d

Why we should use stored procedures? a. They allow faster execution b. They can reduce network traffic c. They allow modular programming d. They can be used as a security mechanism e. All of the others

e


Ensembles d'études connexes

BTT Vocabulary/Comprehension:Chapters 9-10

View Set

Quiz Chapter 8: The Global Classroom

View Set

Strength Training Conditioning & Programming

View Set

SL American Government Quiz 2 (Topics 4-7)

View Set

Businesss Foundations Seminar Mid Term PCR S7&8 Quiz Review

View Set

shoulder and arm bony landmarks, muscles, joint/ligaments

View Set

biology learnsmart cell respiration

View Set