Rezolvari Final Sem Exam Oracle

Embed Size (px)

DESCRIPTION

Rezolvarile examelului de la sfarsit de semestru 1 pentru Oracle.

Citation preview

Review your answers, feedback, and question scores below. An asterisk (*) indica tes a correct answer. Section 11 (Answer all questions in this section) 1. One-to-One relationships are transformed into Check Con straints in the tables created at either end of that relationship. True or False ? Mark for Review (1) Points True False (*)CorrectCorrect2. It is possible to implement non-transferability via a s imple Foreign Key Relationship. True or False? Mark for Review (1) Points True False (*)CorrectCorrect 3. In a physical data model, an attribute becomes a ______ Mark for Review_______. (1) Points TableForeign Key Constraint Column (*)CorrectCorrect4. Why would this table name NOT work in an Oracle databas e? this_year_end+next_year Mark for Review(1) Points Table names must begin with an alphabetic character. It is too long. The Plus sign + is not allowed in object names. (*) None of the above.CorrectCorrect5. The transformation from an ER diagram to a physical des ign involves changing terminology. Primary Unique Identifiers in the ER diagram become __________ and relationships become ____________. Mark for Review (1) Points Foreign keys, Primary keys Primary keys, Foreign keys (*) Foreign keys, mandatory business rules Unique Keys, Primary keysIncorrect 6. Mark for Review (1) Points True False (*)Incorrect. Refer to Section 11 Lesson 2. A table must have a primary key. True or False?CorrectCorrect7. The text below is an example of what constraint type? The value in the manager_id column of the EMPLOYEES table must match a value in the employee_id column in the EMPLOYEES table.Mark for Review (1) Points Entity integrity User-defined integrity Column integrity Referential integrity (*)CorrectCorrect8. The text below is an example of what constraint type? If the number of BOOKS lent to a BORROWER in the LIBRARY exceeds 5, then we must send him a letter requesting the return of the BOOKS; this will require extra p rogramming to enforce. Mark for Review (1) Points Entity integrity User-defined integrity (*) Column integrity Referential integrityCorrectCorrect9. Identify all of the incorrect statements that complete this sentence: A primary key is: (Choose three) Mark for Review (1) Points (Choose all correct answers) A single column that uniquely identifies each column in a table. (*) One or more columns in a table that uniquely identifies each row in that table.A set of columns in one table that uniquely identifies each row in anoth er table. (*) Only one column that must be null. (*)IncorrectIncorrect. Refer to Section 11 Lesson 1.10. If a primary key is a set of columns, then one column m ust be null. True or False? Mark for Review (1) Points True False (*)Correct Page 1 of 5Correct Next SummaryReview your answers, feedback, and question scores below. An asterisk (*) indica tes a correct answer. Section 11 (Answer all questions in this section) 11. When mapping supertypes, relationships at the supertype level transform as usual. Relationships at subtype level are implemented as for eign keys, but the foreign key columns all become mandatory. True or False? Mark for Review (1) Points True False (*)CorrectCorrectSection 12 (Answer all questions in this section) ID 1 2 12. Name Address Cole Bee Zoe Twee The f_customers table contains the following data: City State Zip 123 Main Street Orlando FL 32838 1009 Oliver Avenue Boston MA 021163 Sandra Lee 22 Main Street Tampa If you run the following statement: DELETE FROM F_CUSTOMERS WHERE ID = '01-MAR-2000' and hire_date = '01-MAR-2000' and hire_date 50 AND salary BETWEEN 10000 AND 25000 WHERE department_id = 50 AND salary BETWEEN 25001 AND 10001 WHERE department_id = 50 AND salary BETWEEN 10000 AND 25000 (*)CorrectCorrect.34. You need to display all the rows in the EMPLOYEES table that contain a null value in the DEPARTMENT_ID column. Which comparison operato r should you use? Mark for Review (1) Points "= NULL" NULL! ISNULL IS NULL (*)CorrectCorrect. 35. Which clause would you include in a SELECT statement torestrict the data returned to only the employees in department 10? r Review (1) Points WHERE (*) FROM SELECT ISMark foCorrectCorrect. 36. What does the DISTINCT keyword do when it is used in a Mark for ReviewSELECT clause? (1) PointsHides NULL values Eliminates all unique values and compares values Eliminates duplicate rows in the result (*) Eliminates only unique rows in the resultCorrectCorrect.Section 17 (Answer all questions in this section) 37. Evaluate this SELECT statement: SELECT last_name, first_name, email FROM employees ORDER BY email; If the EMAIL column contains null values, which statement is true? Mark for Review (1) Points Null email values will be displayed first in the result.Null email values will be displayed last in the result. (*) Null email values will not be displayed in the result. The result will not be sorted.CorrectCorrect.38. What value will the following SQL statement return? SELECT employee_id FROM employees WHERE employee_id BETWEEN 100 AND 150 OR employee_id IN(119, 175, 205) AND (employee_id BETWEEN 150 AND 200); Mark for Review (1) Points 19 No rows will be returned 100, 101, 102, 103, 104, 107, 124, 141, 142, 143, 144, 149 (*) 200, 201, 202, 203, 204, 205, 206CorrectCorrect.39. Evaluate this SELECT statement: SELECT last_name, first_name, department_id, manager_id FROM employees; You need to sort data by manager id values and then alphabetically by employee l ast name and first name values. Which ORDER BY clause could you use? Mark for Review (1) Points ORDER BY department_id, last_name ORDER BY manager_id, last_name, first_name (*) ORDER BY last_name, first_name, manager_idORDER BY manager_id, first_name, last_nameCorrectCorrect. Evaluate this SELECT statement:40. SELECT * FROM employees WHERE salary > 30000 AND department_id = 10 OR email IS NOT NULL; Which statement is true? Mark for Review (1) PointsThe OR condition will be evaluated before the AND condition. The AND condition will be evaluated before the OR condition. (*) The OR and AND conditions have the same precedence and will be evaluated from left to right The OR and AND conditions have the same precedence and will be evaluated from right to leftCorrect PreviousCorrect. Page 4 of 5 Next SummaryTest: Final Exam Semester 1 Review your answers, feedback, and question scores below. An asterisk (*) indica tes a correct answer. Section 17 (Answer all questions in this section) 41. Which SELECT statement should you use to limit the disp lay of product information to those products with a price of less than 50? Mark for Review (1) Points SELECT product_id, product_name FROM products WHERE price < 50; (*)SELECT product_id, product_name FROM products HAVING price < 50; SELECT product_id, product_name FROM products WHERE price