P. 1
Design Final

Design Final

|Views: 15,770|Likes:
Published by Barış Gündüz

More info:

Published by: Barış Gündüz on Sep 05, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

05/19/2013

pdf

text

original

eview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Formun Üstü

Semester 1 Final Exam covers Sections 11-17 of Database Design. Section 11 1. A table must have a primary key. True or False? Mark for Review (1) Points True False (*)

Correct 2. 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 another table (*) Only one column that must be null (*)

Correct 3. If a primary key is a set of columns then one column must be null. True or False?

Mark for Review (1) Points

True False (*)

Correct 4. 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/her a letter requesting the return of the BOOKS, which will require extra programming to enforce. Entity integrity User-defined integrity (*) Column integrity Referential integrity

Mark for Review (1) Points

Correct 5. The explanation below is a User Defined integrity rule and must therefore be manually coded, the Database cannot enforce this rule automatically: A primary key must be unique, and no part of the primary key can be null. True or False? True False (*)

Mark for Review (1) Points

Correct 6. Why would this table name NOT work in an Oracle database? this_year_end+next_year

Mark for Review (1) Points

Table names must begin with an alphabetic character Too long The Plus sign + is not allowed in object names (*) None of the above

Mark for Review (1) Points Table Foreign Key Constraint Column (*) Correct 8. True or False? True False (*) Mark for Review (1) Points Correct . 9. In a physical data model. You simply create two foreign keys between the two tables. The Oracle Database can implement a many to many relationship.Correct 7. Secondary Unique Identifiers become Columns Tables Unique Constraints (*) Primary Key Constraints Mark for Review (1) Points Incorrect. The transformation from an ER diagram to a physical design involves changing terminology. Refer to Section 11 Lesson 2. an attribute becomes a _____________.

When translating an arc relationship to a physical design. you must also create two Unique Key Constraints to ensure the Arc is implemented correctly. you must turn the arc relationships into foreign keys. What command will return data from the database to you? (1) Points FETCH Mark for Review . in the tables created at either end of that relationship. Assuming you are implementing an Exclusive Design. What command can be used to create a new row in a Mark for Review Correct. True or False? True False (*) Mark for Review (1) Points Correct Section 11 11. True or False? (1) Points True False (*) Mark for Review Correct Section 12 table in the database? (1) Points CREATE NEW ADD INSERT (*) 12.10 One-to-One relationships are transformed into Check Constraints . 13.

it is not possible to alter the definition of it. The _______ clause can be added to a SELECT statement to return a subset of the data. Refer to Section 12 Lesson 2. If you need to add a new column you must delete the table definition and create a new. 15. Once you have created a table. Mark for Review (1) Points ANYWHERE WHICH WHERE (*) EVERY Correct. 14. The SQL statement ALTER TABLE EMPLOYEES DELETE COLUMN SALARY is a valid statement. 16. True or False? (1) Points True Mark for Review . True or False? (1) Points True False (*) Mark for Review Incorrect.GET SELECT (*) RETURN Correct. correct table.

18. True or False? (1) Points True False (*) Mark for Review Incorrect.False (*) Incorrect. Refer to Section 12 Lesson 2. what is the result of 2 + 3 * 2? . Refer to Section 13 Lesson 1. True or False? Review (1) Points True False (*) Mark for Correct. System Documentation is developed right at the end once the system has gone live and users have been using it for a little while. Section 13 17. In a SELECT clause. Section 15 Mark for Review (1) Points 6 8 (*) 10 13 19. You are more likely to get it correct that way. No further work is required once the development is finished. Systems are always just rolled out as soon as the programming phase is finished.

SELECT salary + bonus + commission_pct * salary . (*) Statement 1 will display a different column heading. 2. Statement 2 will return a higher value than statement 1.bonus) income FROM employees. The EMPLOYEES table contains these columns: SALARY NUMBER(7. Bonus = 50. SELECT (salary + bonus ) + commission_pct * (salary . In which clause of a SELECT statement would you specify the name Mark for Review of the table or tables being queried? (1) Points The FROM clause (*) The SELECT clause The WHERE clause .2) COMMISSION_PCT NUMBER(2. Commission_pct = .2) All three columns contain values greater than zero. Section 15 21. 20.5 Evaluate these two SQL statements: 1.2) BONUS NUMBER(7. What will be the result? Mark for Review (1) Points Statement 1 will return a higher value than statement 2.bonus AS income FROM employees.Correct. There is one row of data in the table and the values are as follows: Salary = 500. Correct. One of the statements will NOT execute.

22.Any of the above options. (*) select star from sky. which operator would be evaluated first? Mark for Review (1) Points Subtractions and Addition are at the same level and would be evaluated first based on left to right order Multiplications and Division are at the same level and would be evaluated first based on left to right order (*) . SELECT * FROM sky. SELECT star FROM sky. Correct. When listing columns in the SELECT list. what should you use to separate the columns? Mark for Review (1) Points Commas (*) Semicolons Dashes Underscores Correct. you can list tables wherever you want to in a SELECT statement. Mark for Review Correct. Which SQL statement will return an error? (1) Points SEL * FR sky. 23. In the default order of precedence. 24.

27. Which comparison condition would you use to select rows that match a character pattern? (1) Points Mark for Review . Section 16 25. Which clause would you include in a SELECT Mark for statement to restrict the data returned to only the employees in department 10? Review (1) Points WHERE (*) FROM SELECT IS Correct.Additions and Multiplications are at the same level and would be evaluated first based on left to right order Divisions and Subtractions are at the same level and would be evaluated first based on left to right order Correct. 26. Which symbol represents the not equal to condition? (1) Points # +' != (*) ~ Mark for Review Correct.

IN LIKE (*) ALMOST SIMILAR Correct. Which operator is used to combine columns of character strings to other columns? (1) Points * / + || (*) Mark for Review Correct. 28. Where in a SQL statement can you not use arithmetic operators? Review (1) Points SELECT FROM (*) WHERE NONE Mark for Correct. 29. .

46. You need write a SELECT statement that should only return rows that contain 34. How will the heading for the SALARY column appear in the display by default in Oracle Application Express? Mark for Review (1) Points The heading will display with the first character capitalized and centered. Correct. or 48 for the DEPARTMENT_ID column. Correct. (*) The heading will display as uppercase and left justified. Evaluate this SELECT statement: SELECT last_name.30. 32. Which operator should you use in the WHERE clause to compare the DEPARTMENT_ID column to this specific list of values? Mark for Review (1) Points = . The heading will display with the first character capitalized and left justified. Mark for Review Links two or more columns or literals to form a single output column (*) Is represented by the asterisk (*) symbol Separates columns. Section 16 31. first_name. salary FROM employees. The heading will display as uppercase and centered. The Concatenation Operator does which of the following? (1) Points Links rows of data together inside the database.

34. '|| "job_id" + "Employee and Title" FROM employees. salary and the results of adding 300 to the salary of the first employee row Incorrect. '|| "job_id" + "Employee and Title" FROM emp. Modify the salary column by adding 300 and only display the last name and the new salary. (*) SELECT " last name" ||'. Which of the following commands will display the last name concatenated with the job ID from the employees table. . salary. SELECT last_name||". salary and the new salary. Mark for Review (1) Points Display the last name.!= IN (*) BETWEEN.. Correct.AND. and label the resulting column "Employee and Title"? Mark for Review (1) Points SELECT " last name" ||'. What will be the result of the SELECT statement and what will display? SELECT last_name. 33. Correct.. separated by a comma and space. salary and the results of adding 300 to each salary for all the employees (*) Modify the salary column by adding 300 and displaying the last name."|| job_id "Employee and Title" FROM employees. salary + 300 FROM employees. SELECT last_name||'. Display the last name. See Section 16 Lesson 2. '|| job_id "Employee and Title" FROM employees.

.35. Which comparison condition means "Less Than or Correct.it breaks the Normalization rules (*) Mark Correct Section 17 Equal To"? (1) Points "=)" "+<" ">=" "<=" (*) Mark for Review 37. Would it be a good idea to model age as an attribute of STUDENT? for Review (1) Points Yes Maybe it could stop us having to calculate someone's age every time we need it Sometimes No . True or False? for Review (1) Points True (*) False Mark Correct 36. Any Non-UID must be dependant on the entire UID.

and AND. 39. The order of operator precedence is AND. OR. Which keyword should you include in . You need to change the default sort order of the ORDER BY clause so that the data is displayed in reverse alphabetical order. The ORDER BY clause always comes last. True or False? (1) Points True (*) False Mark for Review Correct. AND.38. (*) Mark for Review Correct. and OR. Which statement about the logical operators is true? (1) Points The order of operator precedence is AND. OR. The order of operator precedence is NOT. Which logical operator returns TRUE if either condition is true? Review (1) Points OR (*) AND NOT BOTH Mark for Correct. and NOT. The order of operator precedence is NOT. Section 17 41. and OR. 40. NOT.

salary 'Yearly Salary' (*) FROM employees . first_name. 3. last_name. Which clause contains an error? Mark for Review (1) Points SELECT employee_id.the ORDER BY clause? (1) Points DESC (*) ASC SORT CHANGE Mark for Review Correct. Mark for Review Correct. salary 'Yearly Salary' FROM employees WHERE salary IS NOT NULL ORDER BY last_name. last_name. 42. Evaluate this SELECT statement: SELECT employee_id. first_name. Character values are displayed in reverse alphabetical order. The earliest date values are displayed first. (*) Null values are displayed first. 43. Which statement about the default sort order is true? (1) Points The lowest numeric values are displayed last.

1996.'|| last_name "Employee". hire_date ||' / '|| salary "Start Date and Salary" FROM employees WHERE hire_date <= '01-JAN-96'. SELECT employee_id ||'"."|| last_name "Employee". (*) Correct. hire_date ||' '|| salary "Start Date and Salary" FROM employees WHERE hire_date <= 01-JAN-96'. The data should display in this format: Employee 14837 .'|| last_name 'Employee'. SELECT employee_id ||' . hire_date ||' / '|| salary 'Start Date and Salary" FROM employees WHERE hire_date <= '01-JAN-96'. You need to create a report to display all employees that were hired on or after January 1. 44. Which SELECT statement should you use to limit the display of product information to those products with a price of less than 50? (1) Points Mark for Review .WHERE salary IS NOT NULL ORDER BY last_name. SELECT employee_id ||' . 45.|| last_name "Employee". 3.Smith Start Date and Salary 10-MAY-92 / 5000 Which SELECT statement could you use? Mark for Review (1) Points SELECT employee_id || . Correct. SELECT employee_id ||' '|| last_name "Employee". hire_date || / || salary "Start Date and Salary FROM employees WHERE hire_date <= '01-JAN-96'. hire_date ||" / "|| salary Start Date and Salary" FROM employees WHERE hire_date <= '01-JAN-96'.

product_name FROM products GROUP BY price < 50. You query the database with this SQL statement: SELECT price FROM products WHERE price IN(1. SELECT product_id. product_name FROM products WHERE price <= 50. Which two values could the statement return? (Choose two. product_name FROM products WHERE price < 50.SELECT product_id. SELECT product_id. 50. 25. (*) SELECT product_id. product_name FROM products HAVING price < 50. Correct. SELECT product_id.) Mark for Review (1) Points 1 50 25 (*) 10 250 (*) (Choose all correct answers) Correct. 250) AND (price BETWEEN 25 AND 40 OR price > 50). .00 GROUP BY price. 46. product_name FROM products WHERE price < 50.

Which statement should you use to achieve the required results? Mark for Review (1) Points SELECT last_name.. AND . first_name FROM players WHERE position_id > 6900 .. 48. Evaluate this SELECT statement: SELECT * FROM employees WHERE department_id = 34 OR department_id = 45 OR department_id = 67.2) TEAM_ID NUMBER(4) MANAGER_ID NUMBER(9) POSITION_ID NUMBER(4) You want to display all players' names with position 6900 or greater. Correct. You want the players names to be displayed alphabetically by last name and then by first name. first_name. The PLAYERS table contains these columns: PLAYERS TABLE: LAST_NAME VARCHAR2 (20) FIRST_NAME VARCHAR2 (20) SALARY NUMBER(8..47. (*) SELECT last_name. first_name FROM players WHERE position_id >= 6900 ORDER BY last_name. Which operator is the equivalent of the OR conditions used in this SELECT statement? Mark for Review (1) Points IN (*) AND LIKE BETWEEN ..

2) TEAM_ID NUMBER(4) MANAGER_ID NUMBER(9) POSITION_ID NUMBER(4) You must display the player name. Which statement should you use to display the desired result? .employee_id = m. Correct. SELECT last_name. Which change will correct the problem? Mark for Review (1) Points Reorder the clauses in the query. 50. Evaluate this SQL statement: SELECT e. employees m ORDER BY e. SELECT last_name.last_name. first_name.first_name WHERE e. Remove the table aliases in the ORDER BY clause. first_name FROM players WHERE position_id >= 6900 ORDER BY last_name DESC. 49. first_name.employee_id. e.manager_id. The results must be sorted by team id from lowest to highest and then further sorted by salary from highest to lowest. This statement fails when executed. (*) Remove the table aliases in the WHERE clause. first_name FROM players WHERE position_id <= 6900 ORDER BY last_name. team id.last_name. The PLAYERS table contains these columns: PLAYERS TABLE: LAST_NAME VARCHAR2 (20) FIRST_NAME VARCHAR2 (20) SALARY NUMBER(8. Correct. e. Include a HAVING clause. m.manager_id FROM employees e. first_name. e. and salary for players whose salary is in the range from 25000 through 100000 and whose team id is in the range of 1200 through 1500.ORDER BY last_name.first_name.

salary FROM players WHERE salary BETWEEN 25000 AND 100000 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id. first_name. team_id. first_name. salary DESC.Mark for Review (1) Points SELECT last_name.99 AND salary < 100000 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id ASC. SELECT last_name. Correct. first_name. Formun Altı . salary FROM players WHERE salary BETWEEN 24999. team_id. salary FROM players WHERE (salary > 25000 OR salary < 100000) AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id. first_name. SELECT last_name. salary FROM players WHERE salary > 24999. salary. salary DESC. (*) SELECT last_name. team_id.01 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id DESC. salary DESC. team_id.99 AND 100000.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->