Академический Документы
Профессиональный Документы
Культура Документы
Experience
Instance
Table (*)
None of the above
Correct
2.The entity/relationship model is created before the physical database design model?
True or False?
True (*)
False
Correct
Correct
4.Matrix Diagrams are mandatory when doing data modelling. True or False?
True
False (*)
Correct
True
False (*)
Correct
Database Design Section 4
(Answer all questions in this section)
6. All ER diagrams must have one of each of the following: (Choose two)
True (*)
False
Correct
True (*)
False
Correct
9. Which of the following pairs of entities is most likely to be modeled as a M:M
relationship?
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.
Correct
12Normalizing an Entity to 1st Normal Form is done by removing any
. attributes that contain muliple values. True or False?
True (*)
False
Correct
13Any Non-UID attribute must be dependent upon the entire UID. True
. or False?
True (*)
False
Correct
14No commercial database systems in the world will accept tables that
. are not on 3rd Normal Form. True or False?
True
False (*)
Correct
True
False (*)
Correct
17Primary UIDs are:
.
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
18All relationships participating in an arc must be mandatory. True or False?
.
True
False (*)
Correct
True
False (*)
Correct
20Which of the following is a logical constraint that could result from considering
. how time impacts an example of data storage?
True
False (*)
Correct
24The 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.
True
False (*)
Correct
25A table must have at least one candidate key, as well as its primary key. True or
. False?
True
False (*)
Correct
True
False (*)
Correct
AS (*)
OR
AND
SUBSTITUTE
Correct.
29You query the database with this SQL statement:
. SELECT * FROM students;
Why would you use this statement?
To insert data
To view data (*)
To display the table structure
To delete data
Correct.
Which SELECT statement should you use if you want to display unique
combinations of the TEAM_ID and MANAGER_ID columns?
SELECT * FROM players;
SELECT team_id, manager_id FROM players;
SELECT DISTINCT team_id, manager_id FROM players; (*)
SELECT team_id, DISTINCT manager_id FROM players;
SELECT team_id, manager_id DISTINCT FROM players;
Correct.
ORDER BY (*)
WHERE
FROM
HAVING
Correct.
34You query the database with this SQL statement:
.
SELECT price
FROM products
WHERE price IN(1, 25, 50, 250)
AND (price BETWEEN 25 AND 40 OR price > 50);
CONCAT
INSTR (*)
LENGTH
SUBSTR
Correct
Database Programming with SQL Section 1
(Answer all questions in this section)
36The PRICE table contains this data:
MANUFACTURER_ID
. PRODUCT_ID
86950
59604
You query the database and return the value 95. Which script did you use?
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
37You issue this SQL statement:
.
SELECT TRUNC(751.367,-1) FROM dual;
Which value does this statement display?
700
750 (*)
751
751.3
Incorrect. Refer to Section 1 Lesson 2.
38Which of the following SQL statements will correctly display the last name and the
. number of weeks employed for all employees in department 90?
RR
YY
YYYY
YEAR (*)
Incorrect. Refer to Section 1 Lesson 3.
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
42The PRODUCT table contains this column: PRICE NUMBER(7,2)
. Evaluate this statement:
SELECT NVL(10 / price, '0')
FROM PRODUCT;
A cross join
An inner join
A left outer join
A right outer join (*)
Correct
44Which SELECT statement implements a self join?
.
(*)
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.
45You 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?
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)
46The primary advantages of using JOIN ON is: (Select two)
.
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
BY dept;
SELECT AVG salary
FROM employees
BY dept;
Correct
53What 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;
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.
54You use GROUPING functions to ______ database rows from tabulated rows.
.
CREATE
DISTINGUISH (*)
COMPUTE
COUNT
Correct
55CUBE can be applied to all aggregate functions including AVG, SUM, MIN, MAX,
. and COUNT. True or False?
True (*)
False
Correct
Database Programming with SQL Section 5
(Answer all questions in this section)
56When 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?
True
False (*)
Incorrect. Refer to Section 5 Lesson 3.
No rows (*)
All the rows in the table
A null value
An error
Incorrect. Refer to Section 6 Lesson 2.
58Oracle allows you to write named subqueries in one single statement, as long as you
. start your statement with the keyword WITH. True or False?
True (*)
False
Correct
59You need to display all the players whose salaries are greater than or equal to John
. Brown's salary. Which comparison operator should you use?
=
>
<=
>= (*)
Correct
60Which comparison operator would you use to compare a value to every value
. returned by a subquery?
SOME
ANY
ALL (*)
IN
Incorrect. Refer to Section 6 Lesson 3.
Database Programming with SQL Section 7
(Answer all questions in this section)
61Which statement about the VALUES clause of an INSERT statement is true?
.
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
62Assume 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);
Ten
A very large
More than one (*)
A data warehouse
Correct
64Aliases can be used with MERGE statements. True or False?
.
(1) Points
True (*)
False
Correct
65Which of the following represents the correct syntax for an INSERT statement?
.
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)
66When the WHERE clause is missing in a DELETE statement, what is the result?
.
CLOB (*)
VARCHAR2 (*)
Incorrect. Refer to Section 8 Lesson 2.
68Evaluate this statement:
.
ALTER TABLE inventory
MODIFY backorder_amount NUMBER(8,2);
ADD
CHANGE
MODIFY (*)
DISABLE
Correct
74You need to remove the EMP_FK_DEPT constraint from the EMPLOYEE table in
. your schema. Which statement should you use?
(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
78Which constraint can only be created at the column level?
.
CHECK (*)
UNIQUE
NOT NULL
PRIMARY KEY
Correct
80You 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?
CHECK
UNIQUE (*)
NOT NULL
PRIMARY KEY
Correct
Database Programming with SQL Section 11
(Answer all questions in this section)
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?
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.
82The 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 <= 25
ORDER BY new_balance DESC;
What statement is true?
The statement failed to execute because an inline view was used.
The statement will not necessarily return the 25 highest new balance values, as
the inline view has no ORDER BY clause. (*)
The 25 greatest new balance values were displayed from the highest to the
lowest.
The statement failed to execute because the ORDER BY clause does NOT use
the Top-n column.
FORCE (*)
NOFORCE
OR REPLACE
WITH READ ONLY
Correct
FORCE
OR REPLACE
WITH READ ONLY
WITH CHECK OPTION (*)
Incorrect. Refer to Section 11 Lesson 2.
87You create a view on the EMPLOYEES and DEPARTMENTS tables to display
. salary information per department.
What will happen if you issue the following statement?
FORCE
NOFORCE
WITH READ ONLY (*)
WITH ADMIN OPTION
Incorrect. Refer to Section 11 Lesson 2.
USER_INDEXES
USER_TABLES
USER_OBJECTS
USER_IND_COLUMNS (*)
Incorrect. Refer to Section 12 Lesson 2.
True (*)
False
Correct
93Which statement would you use to remove an object privilege granted to a user?
.
ALTER USER
REVOKE (*)
REMOVE
DROP
Correct
94Which statement would you use to grant a role to users?
.
GRANT (*)
ALTER USER
CREATE USER
ASSIGN
Correct
95You want to grant privileges to user CHAN that will allow CHAN to update the
. data in the EMPLOYEES table. Which type of privileges will you grant to CHAN?
User privileges
Object privileges (*)
System privileges
Administrator privileges
Incorrect. Refer to Section 13 Lesson 1.
Database Programming with SQL Section 13
BETWEEN...AND... and IN
IN and =
Correct
99. What is the minimum number of join conditions required to join 5 tables together?
3
4 (*)
5
One more than the number of tables
Correct
100You need to join the EMPLOYEES table and the SCHEDULES table, but the two
. tables do not have any corresponding columns. Which type of join will you create?
An equijoin
It is not possible to join these two tables.
A non-equijoin (*)
A full outer join
Incorrect. Refer to Section 15 Lesson 2.