DBI_PT2

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan 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

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

a

In UML, what is the difference between an aggregation and a composition? A.In composition, when the owning object is destroyed, so are the contained objects. In aggregation, this is not necessarily true. B.In aggregation, when the owning object is destroyed, so are the contained objects. In composition, this is not necessarily true. C.All of the others D.There is no difference between an aggregation and a composition

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=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

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

Database integrity ensures that: a. data entered into the database is accurate, valid, and consistent b. data entered into the database is accurate, and consistent c. data entered into the database is valid, and consistent d. data entered into the database is accurate, and valid

a

Foreign key constraints are created by using "_____" keyword to refer to the primary key of another table a. REFERENCES b. POINT TO c. REFER d. None of the others

a

Here are three relations, R(A,B), S(C,D). Their current values are: R A B ------------------- 1 4 2 5 3 6 4 7 S C D ------------------- 0 1 1 0 2 1 Compute the result of the query: SELECT A, B, C, D FROM R LEFT OUTER JOIN S ON R.A = S.C Identify, in the list below, the row that appears in the result. a. (4, 7, null, null) b. (4, 7, 0, 1) c. (4, 7, 1, 0) d. (4, 7, 2, 1)

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

Pay attention into the following query: SELECT * FROM R WHERE A LIKE '%a%'; So, in the above case, the wildcard % represents what? a. % (percent sign) represents zero, one, or more character b. % (percent sign) represents exactly 1 character

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

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 BETWEEN operator: a. Specifies a range to test. b. Specifies which tables we are selecting from. c. Specifies that a column is a primary key. d. None of the others

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

Three basic types of database integrity constraints are: (a)Entity integrity (b) Domain integrity (c) Referential integrity (d) Primary key integrity a. (a) and (b) and (c) are true b. (a) and (b) and (d) are true c. (a) and (c) and (d) are true d. (b) and (c) and (d) are true

a

To drop a DEFAULT constraint, use the following SQL: a. ALTER TABLE Persons ALTER COLUMN City DROP DEFAULT b. ALTER TABLE Persons DELETE COLUMN City DROP DEFAULT c. ALTER TABLE Persons REMOVE COLUMN City DROP DEFAULT d. ALTER TABLE Persons MODIFY COLUMN City DROP DEFAULT

a

What are the drawbacks of indexes? (a)Indexes require more disk space (b) Indexes make UPDATE, INSERT, DELETE statement slower (c)Indexes have no any drawback (d) Indexes make SELECT statement slower a. (a) and (b) are true b. (a) and (c) are true c. (b) and (c) are true d. (b) and (d) are true

a

What does the keyword ESCAPE mean? a. The keyword ESCAPE is used to match any string that contains the characters "%" or "_" b. There is no keyword named ESCAPE c. The keyword ESCAPE is used to match any string that contains the characters "?" or "*" d. The keyword ESCAPE is used to match any string that contains the characters "@" or "$"

a

What is difference between PRIMARY KEY and UNIQUE KEY ? a. A table can have more than one UNIQUE KEY constraint but only one PRIMARY KEY b. A table can have more than one PRIMARY KEY constraint but only one UNIQUE KEY c. UNIQUE KEY and PRIMARY KEY are the same d. None of the others

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=27 (8552) Choose one correct statement: a. Two null values are equal b. Comparisons between two null values, or between a NULL and any other value, return unknown c. Comparisons between two null values, or between a NULL and any other value, return FALSE

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

Regardless of whatever any other transaction is doing, a transaction must be able to continue with the exact same data set it started with. The above describes which property of a transaction? a. Atomic b. Isolation c. Consistency d. Durability

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

Well-designed ____ can reduce disk I/O operations and consume fewer system resources therefore improving query performance a. Triggers b. Indexes c. Views d. Stored Procedures

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

A database transaction, by definition, must be ACID (atomic, consistent, isolated and durable). What does "Durable" mean? a. "Durable" means that: Transactions provide an "all-or-nothing" proposition, stating that each work-unit performed in a database must either complete in its entirety or have no effect whatsoever b. "Durable" means that: Transactions must not violate any integrity constraints during its execution c. "Durable" means that: Transactions that have committed will survive permanently d. All of the others

c

Column A of a relation has the following list of values in the six rows of the table: NULL, NULL, 10, 10, 20, 30 In SQL Server, which of the following is the correct value of AVG(DISTINCT A)? A.15 B.NULL C.20 D.10

c

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

Suppose the relation S(B,C,D) has tuples: B C D ----------------------------------- a 4 6 c 6 8 c 5 5 e 9 9 f 10 10 c 7 9 Compute the result of the following query: SELECT D, SUM(C) FROM S GROUP BY D Choose rows that are appear in the computed result A.(9,12) B.(9,14) C.(9,16) D.(9,18)

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

What operator tests column for the absence of data? a. IS BLANK operator b. IS ZERO operator c. IS NULL operator d. ISNULL operator

c

A database transaction, by definition, must be ACID (atomic, consistent, isolated and durable). What does "Isolated" mean? a. "Isolated" means that: Transactions provide an "all-or-nothing" proposition, stating that each work-unit performed in a database must either complete in its entirety or have no effect whatsoever b. "Isolated" means that: Transactions must not violate any integrity constraints during its execution c. "Isolated" means that: Transactions that have committed will survive permanently d. "Isolated" means that: how/when the changes made by one operation in one transaction become visible to other concurrent operations in other transactions

d

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

Consider the following statement: "Entity Sets and their attributes should reflect the reality" That above statement describes which principle? A.Avoid Redundancy Principle B.Simplicity Count Principle C.Limit the use of weak entity sets principle D.Faithfulness principle

d

Consider the following statement: "Entity Sets and their attributes should reflect the reality" That above statement describes which principle? a.Avoid Redundancy Principle b.Simplicity Count Principle c.Limit the use of weak entity sets principle d.Faithfulness principle

d

Referential integrity Constraints control relationships between .... a. attributes in a table b. operations of an object c. database instances d. tables in a database

d

Which of the following statements is the most correct? a. Poorly designed indexes and a lack of indexes are primary sources of database application bottlenecks. b. Designing efficient indexes is paramount to achieve good database and application performance c. The selection of the right indexes for a database and its workload is a complex balancing act between query speed and update cost d. All of the others

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

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"? a. SELECT * FROM Persons WHERE FirstName='a' b. SELECT * FROM Persons WHERE FirstName LIKE '%a' c. SELECT * FROM Persons WHERE FirstName='%a%' d. SELECT * FROM Persons WHERE FirstName LIKE 'a%'

d

Choose the most correct statement about PRIMARY KEY: a. The PRIMARY KEY constraint uniquely identifies each record in a database table b. Primary keys must contain unique values c. A primary key column cannot contain NULL values d. Each table should have a primary key, and each table can have only ONE primary key e. All of the others

e

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


Set pelajaran terkait

Chapter 38: Agents to control Blood Glucose

View Set

HW3: Physical Development and Biological Aging

View Set

History of Graphic Design - ART3643: Chapter 11

View Set

SAFe Lesson 4: Building Solutions with Agile Product Delivery

View Set

Chapter 14: Composing Your Speech

View Set