Final Exam Db Design and Programming.docx
Transcript of Final Exam Db Design and Programming.docx
Test: English Database Design and Database Programming with SQL Custom Event Final Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Top of FormDatabase Design Section 2
(Answer all questions in this section)
1. In a physical data model, an entity becomes a/an? Mark for Review(1) Points
Experience
Instance
Table (*)
None of the above
Correct
2. The entity/relationship model is created before the physical database design model? True or False? Mark for Review(1) Points
True (*)
False
Correct
Database Design Section 3
(Answer all questions in this section)
3. Which of the following are true about Cardinality? (Choose two) Mark for Review(1) Points
(Choose all correct answers)
Cardinality tells "how many". (*)
Cardinality specifies only singularity or plurality, but not a specific plural number. (*)
Cardinality specifies a counting number (like 1, 2, 3, 4 etc.) in a relationship.
Cardinality specifies whether something is required or not.
Correct
4. Matrix Diagrams are mandatory when doing data modelling. True or False? Mark for Review(1) Points
True
False (*)
Correct
Database Design Section 4
(Answer all questions in this section)
5. A supertype can only have two subtypes and no more. True or False? Mark for Review(1) Points
True
False (*)
Correct
Bottom of Form
Database Design Section 4
(Answer all questions in this section)
6. All ER diagrams must have one of each of the following: (Choose two) Mark for Review(1) Points
(Choose all correct answers)
One or more Entities (*)
Relationships between entities (*)
Arcs
At least one supertype and subtype
Correct
7. A new system would have a mixture of both Procedural and Structural Business Rules as part of the documentation of that new system. True or False? Mark for Review(1) Points
True (*)
False
Correct
Database Design Section 5
(Answer all questions in this section)
8. Intersection Entities often have the relationships participating in the UID, so the relationships are often barred. True or False? Mark for Review(1) Points
True (*)
False
Correct
9. Which of the following pairs of entities is most likely to be modeled as a M:M relationship? Mark for Review(1) Points
CAR and WHEEL
TREE and BRANCH
PERSON and FINGERPRINT
TEACHER and SUBJECT AREA (*)
Correct
10. A non-transferable relationship means the detail can be changed to point to a new master. True or False? Mark for Review(1) Points
True
False (*)
Incorrect. Refer to Section 5 Lesson 1.
Database Design Section 6
(Answer all questions in this section)
11. The candidate UID that is chosen to identify an entity is called the Primary UID; other candidate UIDs are called Secondary UIDs. Mark for Review(1) Points
Yes, this is the way UID's are named. (*)
No, it is not possible to have more than one UID for an Entity.
No, after UIDs are first sorted, the first one is called the Primary UID, the second is the Secondary UID, etc.
No, each Entity can only have one UID, the secondary one.
Correct
12. Normalizing an Entity to 1st Normal Form is done by removing any attributes that contain muliple values. True or False? Mark for Review(1) Points
True (*)
False
Correct
13. Any Non-UID attribute must be dependent upon the entire UID. True or False? Mark for Review(1) Points
True (*)
False
Correct
14. No commercial database systems in the world will accept tables that are not on 3rd Normal Form. True or False? Mark for Review(1) Points
True
False (*)
Correct
Database Design Section 7
(Answer all questions in this section)
15. Which of the following would be good as a Unique Identifier for its Entity? (Choose Three) Mark for Review(1) Points
(Choose all correct answers)
Personal Identification number for Person (*)
Vehicle Registration Number for Car (*)
ISBN Number for Book (*)
Date of birth for Baby
Correct
Database Design Section 7
(Answer all questions in this section)
16. Historical data must never be kept. True or False? Mark for Review(1) Points
True
False (*)
Correct
17. Primary UIDs are: Mark for Review(1) Points
Something that each Entity should have, but is not mandatory (*)
Useful as an alternative means of identifying instances of an entity, independent of their datatype
Mandatory in data modeling
Always comprised of numbers
Correct
18. All relationships participating in an arc must be mandatory. True or False? Mark for Review(1) Points
True
False (*)
Correct
Database Design Section 9
(Answer all questions in this section)
19. All systems must have an entity called WEEK with a holiday attribute, so you know when to give your employees a holiday. True or False? Mark for Review(1) Points
True
False (*)
Correct
20. Which of the following is a logical constraint that could result from considering how time impacts an example of data storage? Mark for Review(1) Points
An ASSIGNMENT may only refer to an EMPLOYEE with a valid employee record at the Start Date of the ASSIGNMENT. (*)
EMPLOYEE periods can overlap causing the database to crash.
End Date must be before the Start Date.
Dates must be stored with Time.
Correct
Database Design Section 10
(Answer all questions in this section)
21. A datamodel containing generic modeling techniques must not be mixed in with non-generic models. The generic entities MUST be drawn on a diagram of their own. True or False? Mark for Review(1) Points
True
False (*)
Correct
Database Design Section 11
(Answer all questions in this section)
22. In an Oracle database, why would 1_TABLE not work as a table name? Mark for Review(1) Points
The database does not understand all capital letters.
There is no problem here. You can create a table called 1_TABLE.
Object names must not start with a number. They must begin with a letter. (*)
TABLE is a reserved word.
Correct
23. 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.
It is too long.
The Plus sign + is not allowed in object names. (*)
None of the above.
Correct
24. The explanation below is a User Defined integrity rule and must, therefore, be manually coded; the Database cannot enforce this rule automatically. True or False?A primary key must be unique, and no part of the primary key can be null. Mark for Review(1) Points
True
False (*)
Correct
25. A table must have at least one candidate key, as well as its primary key. True or False? Mark for Review(1) Points
True
False (*)
Correct
Database Design Section 11
(Answer all questions in this section)
26. The Oracle Database can implement a many-to-many relationship. You simply create two foreign keys between the two tables. True or False? Mark for Review(1) Points
True
False (*)
Correct
Database Design Section 12
(Answer all questions in this section)
27. System Documentation is developed right at the end once the system has gone live and users have been using it for a little while. You are more likely to get it correct that way. True or False? Mark for Review(1) Points
True
False (*)
Correct.
Database Design Section 15
(Answer all questions in this section)
28. Which SQL keyword specifies that an alias will be substituted for a column name in the output of a SQL query? Mark for Review(1) Points
AS (*)
OR
AND
SUBSTITUTE
Correct.
29. You query the database with this SQL statement: SELECT * FROM students; Why would you use this statement? Mark for Review(1) Points
To insert data
To view data (*)
To display the table structure
To delete data
Correct.
Database Design Section 16
(Answer all questions in this section)
30. The EMPLOYEES table includes these columns: EMPLOYEE_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(15) NOT NULL FIRST_NAME VARCHAR2(10) NOT NULL HIRE_DATE DATE NOT NULL You want to produce a report that provides the last names, first names, and hire dates of those employees who were hired between March 1, 2000, and August 30, 2000. Which statements can you issue to accomplish this task? Mark for Review(1) Points
SELECT last_name, first_name, hire_date FROM employees WHERE hire_date BETWEEN '01-MAR-2000' AND '30-AUG-2000'; (*)
SELECT last_name, first_name, hire_date FROM employees WHERE hire_date BETWEEN '30-AUG-2000' AND '01-MAR-2000';
SELECT last_name, first_name, hire_date FROM employees GROUP BY hire_date >= '01-MAR-2000' and hire_date = '01-MAR-2000' and hire_date 50); Which two values could the statement return? (Choose two.) Mark for Review(1) Points
(Choose all correct answers)
1
50
25 (*)
10
250 (*)
Correct.
Database Programming with SQL Section 1
(Answer all questions in this section)
35. Which SQL function is used to return the position where a specific character string begins within a larger character string? Mark for Review(1) Points
CONCAT
INSTR (*)
LENGTH
SUBSTR
Correct
Database Programming with SQL Section 1
(Answer all questions in this section)
36. The PRICE table contains this data: PRODUCT_IDMANUFACTURER_ID
8695059604
You query the database and return the value 95. Which script did you use? Mark for Review(1) Points
SELECT SUBSTR(product_id, 3, 2) FROM price WHERE manufacturer_id = 59604; (*)
SELECT LENGTH(product_id, 3, 2) FROM price WHERE manufacturer_id = 59604;
SELECT SUBSTR(product_id, -1, 3) FROM price WHERE manufacturer_id = 59604;
SELECT TRIM(product_id, -3, 2) FROM price WHERE manufacturer_id = 59604;
Correct
37. You issue this SQL statement: SELECT TRUNC(751.367,-1) FROM dual;Which value does this statement display? Mark for Review(1) Points
700
750 (*)
751
751.3
Incorrect. Refer to Section 1 Lesson 2.
38. Which of the following SQL statements will correctly display the last name and the number of weeks employed for all employees in department 90? Mark for Review(1) Points
SELECT last_name, (SYSDATE-hire_date)/7 AS WEEKS FROM employees WHERE department_id = 90; (*)
SELECT last name, (SYSDATE-hire_date)/7 DISPLAY WEEKS FROM employees WHERE department id = 90;
SELECT last_name, # of WEEKS FROM employees WHERE department_id = 90;
SELECT last_name, (SYSDATE-hire_date)AS WEEK FROM employees WHERE department_id = 90;
Correct
39. You need to display the current year as a character value (for example: Two Thousand and One). Which element would you use? Mark for Review(1) Points
RR
YY
YYYY
YEAR (*)
Incorrect. Refer to Section 1 Lesson 3.
Database Programming with SQL Section 2
(Answer all questions in this section)
40. Which arithmetic operation will return a numeric value? Mark for Review(1) Points
TO_DATE('01-JUN-2004') - TO_DATE('01-OCT-2004') (*)
NEXT_DAY(hire_date) + 5
SYSDATE - 6
SYSDATE + 30 / 24
Correct
Database Programming with SQL Section 2
(Answer all questions in this section)
41. Which statement concerning single row functions is true? Mark for Review(1) Points
Single row functions can accept only one argument, but can return multiple values.
Single row functions cannot modify a data type.
Single row functions can be nested. (*)
Single row functions return one or more results per row.
Correct
42. The PRODUCT table contains this column: PRICE NUMBER(7,2) Evaluate this statement: SELECT NVL(10 / price, '0') FROM PRODUCT; What would happen if the PRICE column contains null values? Mark for Review(1) Points
The statement would fail because values cannot be divided by 0.
A value of 0 would be displayed. (*)
A value of 10 would be displayed.
The statement would fail because values cannot be divided by null.
Correct
Database Programming with SQL Section 3
(Answer all questions in this section)
43. You need to join the EMPLOYEE_HIST and EMPLOYEES tables. The EMPLOYEE_HIST table will be the first table in the FROM clause. All the matched and unmatched rows in the EMPLOYEES table need to be displayed. Which type of join will you use? Mark for Review(1) Points
A cross join
An inner join
A left outer join
A right outer join (*)
Correct
44. Which SELECT statement implements a self join? Mark for Review(1) Points
SELECT p.part_id, t.product_id FROM part p, part t WHERE p.part_id = t.product_id; (*)
SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id = t.product_id;
SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id = t.product_id (+);
SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id =! t.product_id;
Incorrect. Refer to Section 3 Lesson 4.
45. You created the CUSTOMERS and ORDERS tables by issuing these CREATE TABLE statements in sequence: CREATE TABLE customers (custid varchar2(5), companyname varchar2(30), contactname varchar2(30), address varchar2(30),city varchar2(20), state varchar2(30), phone varchar2(20), constraint pk_customers_01 primary key (custid));CREATE TABLE orders (orderid varchar2(5) constraint pk_orders_01 primary key, orderdate date, total number(15), custid varchar2(5) references customers (custid)); You have been instructed to compile a report to present the information about orders placed by customers who reside in Nashville. Which query should you issue to achieve the desired results? Mark for Review(1) Points
SELECT custid, companyname FROM customers WHERE city = 'Nashville';
SELECT orderid, orderdate, total FROM orders o NATURAL JOIN customers c ON o.custid = c.custid WHERE city = 'Nashville';
SELECT orderid, orderdate, total FROM orders o JOIN customers c ON o.custid = c.custid WHERE city = 'Nashville'; (*)
SELECT orderid, orderdate, total FROM orders WHERE city = 'Nashville';
Correct
Database Programming with SQL Section 3
(Answer all questions in this section)
46. The primary advantages of using JOIN ON is: (Select two) Mark for Review(1) Points
(Choose all correct answers)
The join happens automatically based on matching column names and data types.
It will display rows that do not meet the join condition.
It permits columns with different names to be joined. (*)
It permits columns that dont have matching data types to be joined. (*)
Correct
47. You want to create a report that displays all employees who were hired before January 1, 2000 and whose annual salaries are greater than 50000. The EMPLOYEES table contains these columns: EMPLOYEE_ID VARCHAR2(5) PRIMARY KEY LAST_NAME VARCHAR2(35) HIREDATE DATE DEPARTMENT_ID NUMBER(4)The SALARY table contains these columns: SALARYID VARCHAR2(5) PRIMARY KEY SALARY NUMBER(5, 2) EMPLOYEE_ID VARCHAR2(5) FOREIGN KEY Which query should you issue?Mark for Review(1) Points
SELECT last_name, hiredate, salary FROM employees NATURAL JOIN salary USING employee_id WHERE hiredate < 01-jan-2000 AND salary > 50000;
SELECT last_name, hiredate, salary FROM employees JOIN salary ON employee_id = employee_id WHERE hiredate < '01-jan-2000' AND salary > 50000;
SELECT last_name, hiredate, salary FROM employees NATURAL JOIN salary WHERE hiredate < '01-jan-2000' AND salary > 50000; (*)
SELECT last_name, hiredate, salary FROM employees (+) salary WHERE hiredate < '01-jan-2000' AND salary > 50000;
Correct
Database Programming with SQL Section 4
(Answer all questions in this section)
48. Which statement about the COUNT function is true? Mark for Review(1) Points
The COUNT function ignores duplicates by default.
The COUNT function always ignores null values by default. (*)
The COUNT function can be used to find the maximum value in each column.
The COUNT function can be used to determine the number of unique, non-null values in a column.
Incorrect. Refer to Section 4 Lesson 3.
49. The AVG, SUM, VARIANCE, and STDDEV functions can be used with which of the following? Mark for Review(1) Points
Only numeric data types (*)
Integers only
Any data type
All except numeric
Correct
50. Group functions return a value for ________________ and ________________ null values in their computations. Mark for Review(1) Points
a row set, ignore (*)
each row, ignore
a row set, include
each row, include
Correct
Database Programming with SQL Section 5
(Answer all questions in this section)
51. Evaluate this SELECT statement: SELECT SUM(salary), department_id, department_name FROM employees WHERE department_id = 1 GROUP BY department; Which clause of the SELECT statement contains a syntax error? Mark for Review(1) Points
SELECT
FROM
WHERE
GROUP BY (*)
Correct
52. You want to write a report that returns the average salary of all employees in the company, sorted by departments. The EMPLOYEES table contains the following columns: EMPLOYEES: EMP_ID NUMBER(10) PRIMARY KEY LNAME VARCHAR2(20) FNAME VARCHAR2(20) DEPT VARCHAR2(20) HIRE_DATE DATE SALARY NUMBER(10) Which SELECT statement will return the information that you require? Mark for Review(1) Points
SELECT salary(AVG), dept FROM employees GROUP BY dept;
SELECT dept, AVG(salary)FROM employees GROUP BY dept; (*)
SELECT AVG (salary) FROM employees BY dept;
SELECT AVG salary FROM employees BY dept;
Correct
53. What is the best explanation as to why this SQL statement will NOT execute? SELECT department_id "Department", AVG (salary)"Average" FROM employees GROUP BY Department; Mark for Review(1) Points
Salaries cannot be averaged as not all the numbers will divide evenly.
You cannot use a column alias in the GROUP BY clause. (*)
The GROUP BY clause must have something to GROUP.
The department id is not listed in the departments table.
Incorrect. Refer to Section 5 Lesson 1.
54. You use GROUPING functions to ______ database rows from tabulated rows. Mark for Review(1) Points
CREATE
DISTINGUISH (*)
COMPUTE
COUNT
Correct
55. CUBE can be applied to all aggregate functions including AVG, SUM, MIN, MAX, and COUNT. True or False? Mark for Review(1) Points
True (*)
False
Correct
Database Programming with SQL Section 5
(Answer all questions in this section)
56. When using SET operators, the names of the matching columns must be identical in all of the SELECT statements used in the query. True or False? Mark for Review(1) Points
True
False (*)
Incorrect. Refer to Section 5 Lesson 3.
Database Programming with SQL Section 6
(Answer all questions in this section)
57. If a single-row subquery returns a null value and uses the equality comparison operator, what will the outer query return? Mark for Review(1) Points
No rows (*)
All the rows in the table
A null value
An error
Incorrect. Refer to Section 6 Lesson 2.
58. Oracle allows you to write named subqueries in one single statement, as long as you start your statement with the keyword WITH. True or False? Mark for Review(1) Points
True (*)
False
Correct
59. You need to display all the players whose salaries are greater than or equal to John Brown's salary. Which comparison operator should you use? Mark for Review(1) Points
=
>
= (*)
Correct
60. Which comparison operator would you use to compare a value to every value returned by a subquery? Mark for Review(1) Points
SOME
ANY
ALL (*)
IN
Incorrect. Refer to Section 6 Lesson 3.
Database Programming with SQL Section 7
(Answer all questions in this section)
61. Which statement about the VALUES clause of an INSERT statement is true? Mark for Review(1) Points
If no column list is specified, the values must be listed in the same order that the columns are listed in the table. (*)
The VALUES clause in an INSERT statement is mandatory in a subquery.
Character, date, and numeric data must be enclosed within single quotes in the VALUES clause.
To specify a null value in the VALUES clause, use an empty string (" ").
Correct
62. Assume all the column names are correct. The following SQL statement will execute which of the following? INSERT INTO departments(department_id, department_name, manager_id, location_id) VALUES (70, 'Public Relations', 100, 1700); Mark for Review(1) Points
100 will be inserted into the department_id column.
1700 will be inserted into the manager_id column.
70 will be inserted into the department_id column. (*)
"Public Relations" will be inserted into the manager_name column.
Correct
63. Multi-table inserts are used when the same source data should be inserted into _____________ target table. Mark for Review(1) Points
Ten
A very large
More than one (*)
A data warehouse
Correct
64. Aliases can be used with MERGE statements. True or False? Mark for Review(1) Points
True (*)
False
Correct
65. Which of the following represents the correct syntax for an INSERT statement? Mark for Review(1) Points
INSERT VALUES INTO customers (3178 J. Smith 123 Main Street Nashville TN 37777;
INSERT INTO customers VALUES '3178' 'J.' 'Smith' '123 Main Street' 'Nashville' 'TN' '37777';
INSERT INTO customers VALUES ('3178', 'J.', 'Smith', '123 Main Street', 'Nashville', 'TN', '37777'); (*)
INSERT customers VALUES 3178, J., Smith, 123 Main Street, Nashville, TN, 37777;
Correct
Database Programming with SQL Section 7
(Answer all questions in this section)
66. When the WHERE clause is missing in a DELETE statement, what is the result? Mark for Review(1) Points
All rows are deleted from the table. (*)
The table is removed from the database.
An error message is displayed indicating incorrect syntax.
Nothing. The statement will not execute.
Correct
Database Programming with SQL Section 8
(Answer all questions in this section)
67. Which data types stores variable-length character data? Select two. Mark for Review(1) Points
(Choose all correct answers)
CHAR
NCHAR
CLOB (*)
VARCHAR2 (*)
Incorrect. Refer to Section 8 Lesson 2.
68. Evaluate this statement: ALTER TABLE inventory MODIFY backorder_amount NUMBER(8,2); Which task will this statement accomplish? Mark for Review(1) Points
Alters the definition of the BACKORDER_AMOUNT column to NUMBER(8 2)
Alters the definition of the BACKORDER_AMOUNT column to NUMBER
Alters the definition of the BACKORDER_AMOUNT column to NUMBER(2,8)
Alters the definition of the BACKORDER_AMOUNT column to NUMBER(8.2)
Changes the definition of the BACKORDER_AMOUNT column to NUMBER(8,2) (*)
Correct
69. You need to remove all the data in the SCHEDULE table, the structure of the table, and the indexes associated with the table. Which statement should you use? Mark for Review(1) Points
DROP TABLE (*)
TRUNCATE TABLE
ALTER TABLE
DELETE TABLE
Correct
70. You want to create a database table that will contain information regarding products that your company released during 2001. Which name can you assign to the table that you create? Mark for Review(1) Points
2001_PRODUCTS
PRODUCTS_2001 (*)
PRODUCTS_(2001)
PRODUCTS--2001
Correct
Database Programming with SQL Section 8
(Answer all questions in this section)
71. You want to create a table named TRAVEL that is a child of the EMPLOYEES table. Which of the following statements should you issue? Mark for Review(1) Points
CREATE TABLE travel (destination_id primary key, departure_date date, return_date date, emp_id REFERENCES employees (emp_id));
CREATE TABLE travel (destination_id number primary key, departure_date date, return_date date, t.emp_id = e.emp_id);
CREATE TABLE travel (destination_id number primary key, departure_date date, return_date date, JOIN emp_id number(10) ON employees (emp_id));
CREATE TABLE travel (destination_id number primary key, departure_date date, return_date date, emp_id number(10) REFERENCES employees (emp_id)); (*)
Incorrect. Refer to Section 8 Lesson 1.
Database Programming with SQL Section 10
(Answer all questions in this section)
72. What is the syntax for removing a PRIMARY KEY constraint and all its dependent constraints? Mark for Review(1) Points
ALTER TABLE table_name DROP CONSTRAINT constraint_name CASCADE; (*)
ALTER TABLE table_name DROP CONSTRAINT FOREIGN KEY CASCADE;
DROP CONSTRAINT table_name (constraint_name);
ALTER TABLE table_name DROP CONSTRAINT constraint_name;
Correct
73. You need to add a NOT NULL constraint to the EMAIL column in the EMPLOYEES table. Which clause should you use? Mark for Review(1) Points
ADD
CHANGE
MODIFY (*)
DISABLE
Correct
74. You need to remove the EMP_FK_DEPT constraint from the EMPLOYEE table in your schema. Which statement should you use? Mark for Review(1) Points
DROP CONSTRAINT EMP_FK_DEPT FROM employees;
DELETE CONSTRAINT EMP_FK_DEPT FROM employees;
ALTER TABLE employees DROP CONSTRAINT EMP_FK_DEPT; (*)
ALTER TABLE employees REMOVE CONSTRAINT EMP_FK_DEPT;
Correct
75. Which clause could you use to ensure that cost values are greater than 1.00? Mark for Review(1) Points
CONSTRAINT CHECK cost > 1.00
CONSTRAINT part_cost_ck CHECK (cost > 1.00) (*)
CHECK CONSTRAINT part_cost_ck (cost > 1.00)
CONSTRAINT CHECK part_cost_ck (cost > 1.00)
Incorrect. Refer to Section 10 Lesson 2.
Database Programming with SQL Section 10
(Answer all questions in this section)
76. Which of the following best describes the function of a CHECK constraint? Mark for Review(1) Points
A CHECK constraint enforces referential data integrity.
A CHECK constraint defines restrictions on the values that can be entered in a column or combination of columns. (*)
A CHECK constraint enforces uniqueness of the values that can be entered in a column or combination of columns.
A CHECK constraint is created automatically when a PRIMARY KEY constraint is created.
Incorrect. Refer to Section 10 Lesson 2.
77. What must exist on the Parent table before Oracle will allow you to create a FOREIGN KEY constraint from a Child table? Mark for Review(1) Points
A FOREIGN KEY constraint allows the constrained column to contain values that exist in the primary key column of the parent table.
A PRIMARY or UNIQUE KEY constraint must exist on the Parent table. (*)
An index must exist on the Parent table
A CHECK constraint must exist on the Parent table.
Correct
78. Which constraint can only be created at the column level? Mark for Review(1) Points
NOT NULL (*)
FOREIGN KEY
UNIQUE
CHECK
Incorrect. Refer to Section 10 Lesson 1.
79. You need to ensure that the LAST_NAME column only contains certain character values. No numbers or special characters are allowed. Which type of constraint should you define on the LAST_NAME column? Mark for Review(1) Points
CHECK (*)
UNIQUE
NOT NULL
PRIMARY KEY
Correct
80. You need to ensure that each value in the SEAT_ID column is unique or null. Which constraint should you define on the SEAT_ID column? Mark for Review(1) Points
CHECK
UNIQUE (*)
NOT NULL
PRIMARY KEY
Correct
Database Programming with SQL Section 11
(Answer all questions in this section)
81. The CUSTOMER_FINANCE table contains these columns: CUSTOMER_ID NUMBER(9) NEW_BALANCE NUMBER(7,2) PREV_BALANCE NUMBER(7,2) PAYMENTS NUMBER(7,2) FINANCE_CHARGE NUMBER(7,2) CREDIT_LIMIT NUMBER(7) You created a Top-n query report that displays the account numbers and new balance of the 800 accounts that have the highest new balance value. The results are sorted by payments value from highest to lowest.Which SELECT statement clause is included in your query? Mark for Review(1) Points
Inner query: ORDER BY new_balance DESC (*)
Inner query: WHERE ROWNUM = 800
Outer query: ORDER BY new_balance DESC
Inner query: SELECT customer_id, new_balance ROWNUM
Incorrect. Refer to Section 11 Lesson 3.
82. The CUSTOMER_FINANCE table contains these columns: CUSTOMER_ID NUMBER(9) NEW_BALANCE NUMBER(7,2) PREV_BALANCE NUMBER(7,2) PAYMENTS NUMBER(7,2) FINANCE_CHARGE NUMBER(7,2) CREDIT_LIMIT NUMBER(7) You execute this statement:SELECT ROWNUM "Rank", customer_id, new_balance FROM (SELECT customer_id, new_balance FROM customer_finance) WHERE ROWNUM