Mid Term Exam Sem 2 #2

1. Examine the data from the LINE_ITEM table:

LINE_ITEM_ID ORDER_ID PRODUCT_ID PRICE DISCOUNT
890898 847589 848399 8.99 0.10
768385 862459 849869 5.60 0.05
867950 985490 945809 5.60
954039 439203 438925 5.25 0.15
543949 349302 453235 4.50

You query the LINE_ITEM table and a value of 3 is returned. Which SQL statement did you execute?

♦SELECT COUNT(discount)
FROM line_item; (*)

♦SELECT COUNT(*)
FROM line_item;

♦SELECT SUM(discount)
FROM line_item;

♦SELECT AVG(discount)
FROM line_item;

2. Evaluate this SELECT statement:

SELECT COUNT(*)
FROM employees
WHERE salary > 30000;

Which results will the query display?

♦The number of employees that have a salary less than 30000.
♦The total of the SALARY column for all employees that have a salary greater than 30000.
♦The number of rows in the EMPLOYEES table that have a salary greater than 30000. (*)
♦The query generates an error and returns no results.

3. Group functions can avoid computations involving duplicate values by including which keyword?

♦NULL
♦DISTINCT (*)
♦SELECT
♦UNLIKE

4. Which SELECT statement will calculate the number of rows in the PRODUCTS table?

♦SELECT COUNT(products);
♦SELECT COUNT FROM products;
♦SELECT COUNT (*) FROM products; (*)
♦SELECT ROWCOUNT FROM products;

5. Which group function would you use to display the total of all salary values in the EMPLOYEES table?

♦SUM (*)
♦AVG
♦COUNT
♦MAX

6. Examine the data in the PAYMENT table:

PAYMENT_ID CUSTOMER_ID PAYMENT_DATE PAYMENT_TYPE PAYMENT_AMOUNT
86590586 8908090 10-JUN-03 BASIC 859.00
89453485 8549038 15-FEB-03 INTEREST 596.00
85490345 5489304 20-MAR-03 BASIC 568.00

You need to determine the average payment amount made by each customer in January, February and March of 2003.
Which SELECT statement should you use?

♦SELECT AVG(payment_amount)
FROM payment
WHERE payment_date
BETWEEN ’01-JAN-2003′ AND ’31-MAR-2003′;
(*)

♦SELECT AVG(payment_amount)
FROM payment;

♦SELECT SUM(payment_amount)
FROM payment
WHERE payment_date BETWEEN ’01-JAN-2003′ and ’31-MAR-2003′;

♦SELECT AVG(payment_amount)
FROM payment
WHERE TO_CHAR(payment_date) IN (JAN, FEB, MAR);

7. The CUSTOMERS table contains these columns:

CUSTOMER_ID NUMBER(9)
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(30)
CREDIT_LIMIT NUMBER (7,2)
CATEGORY VARCHAR2(20)

You need to calculate the average credit limit for all the customers in each category. The average should be calculated based on all the rows in the table excluding any customers who have not yet been assigned a credit limit value. Which group function should you use to calculate this value?

♦AVG (*)
♦SUM
♦COUNT
♦STDDEV

8. Which group function would you use to display the average price of all products in the PRODUCTS table?

♦SUM
♦AVG (*)
♦COUNT
♦MAX

9. The EMPLOYEES table contains these columns:

EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
SALARY NUMBER(9,2)
HIRE_DATE DATE
BONUS NUMBER(7,2)
COMM_PCT NUMBER(4,2)

Which three functions could be used with the HIRE_DATE, LAST_NAME, or SALARY columns? (Choose three.)
(Choose all correct answers)

♦MAX (*)
♦SUM
♦AVG
♦MIN (*)
♦COUNT (*)

10. Which of the following statements contains a comparison operator that is used to restrict rows based on a list of values returned from an inner query?

♦SELECT description
FROM d_types
WHERE code
IN (SELECT type_code FROM d_songs);

♦SELECT description
FROM d_types
WHERE code = ANY (SELECT type_code FROM d_songs);

♦SELECT description
FROM d_types
WHERE code <> ALL (SELECT type_code FROM d_songs);

♦All of the above. (*)

11. You need to create a SELECT statement that contains a multiple-row subquery, which comparison operator(s) can you use?

♦IN, ANY, and ALL (*)
♦LIKE
♦BETWEEN…AND…?
♦=, <, and >

12. Which of the following is a valid reason why the query below will not execute successfully?

SELECT employee_id, last_name, salary
FROM employees
WHERE department_id =
(SELECT department_id FROM employees WHERE last_name like ‘%u%’)

♦First subquery not enclosed in parentheses.
♦Single rather than multiple value operator used. (*)
♦Second subquery found on the right instead of the left side of the operator.
♦The greater than operator is not valid.

13. Examine the data in the PAYMENT table:

PAYMENT_ID CUSTOMER_ID PAYMENT_DATE PAYMENT_TYPE PAYMENT_AMOUNT
86590586 8908090 10-JUN-03 BASIC 859.00
89453485 8549038 15-FEB-03 INTEREST 596.00
85490345 5489304 20-MAR-03 BASIC 568.00

This statement fails when executed:

SELECT customer_id, payment_type
FROM payment
WHERE payment_id =
(SELECT payment_id
FROM payment
WHERE payment_amount = 596.00 OR payment_date = ’20-MAR-2003′);

Which change could correct the problem?

♦Change the outer query WHERE clause to ‘WHERE payment_id IN’. (*)
♦Remove the quotes surrounding the date value in the OR clause.
♦Remove the parentheses surrounding the nested SELECT statement.
♦Change the comparison operator to a single-row operator.

14. Evaluate this SELECT statement:

SELECT player_id, name
FROM players
WHERE team_id IN
(SELECT team_id
FROM teams
WHERE team_id > 300 AND salary_cap > 400000);

What would happen if the inner query returned a NULL value?
♦No rows would be returned by the outer query. (*)
♦A syntax error in the outer query would be returned.
♦A syntax error in the inner query would be returned.
♦All the rows in the PLAYER table would be returned by the outer query.

15. Evaluate this SQL statement:

SELECT employee_id, last_name, salary
FROM employees
WHERE department_id IN
(SELECT department_id
FROM employees
WHERE salary > 30000 AND salary < 50000); Which values will be displayed?

♦Only employees who earn more than $30,000.
♦Only employees who earn less than $50,000.
♦All employees who work in a department with employees who earn more than $30,000 and more than $50,000.
♦All employees who work in a department with employees who earn more than $30,000, but less than $50,000. (*)

16. Which operator or keyword cannot be used with a multiple-row subquery?

♦ALL
♦ANY
♦= (*)
♦>

17. What is wrong with the following query?

SELECT employee_id, last_name
FROM employees
WHERE salary =
(SELECT MIN(salary) FROM employees GROUP BY department_id);

♦Single rows contain multiple values and a logical operator is used.
♦Subquery returns more than one row and single row comparison operator is used. (*)
♦Subquery references the wrong table in the WHERE clause.
♦Nothing, it will run without problems.

18. Evaluate this SELECT statement that includes a subquery:

SELECT last_name, first_name
FROM customer
WHERE area_code IN
(SELECT area_code
FROM sales
WHERE salesperson_id = 20);

Which statement is true about the given subquery?

♦The outer query executes before the nested subquery.
♦The results of the inner query are returned to the outer query. (*)
♦An error occurs if the either the inner or outer queries do not return a value.
♦Both the inner and outer queries must return a value, or an error occurs.

19. Which of the following best describes the meaning of the ANY operator?

♦Equal to any member in the list
♦Compare value to each value returned by the subquery (*)
♦Compare value to the first value returned by the subquery
♦Equal to each value in the list

20. Evaluate this SELECT statement:

SELECT student_id, last_name, first_name
FROM student
WHERE major_id NOT IN
(SELECT major_id
FROM majors
WHERE department_head_id = 30 AND title = ‘ADJUNCT’);

What would happen if the inner query returned a NULL value row?

♦A syntax error would be returned.
♦No rows would be returned from the STUDENT table. (*)
♦All the rows in the STUDENT table would be displayed.
♦Only the rows with STUDENT_ID values equal to NULL would be displayed.

21. Which operator can be used with subqueries that return only one row?

♦LIKE (*)
♦ANY
♦ALL
♦IN

22. Which operator can be used with a multiple-row subquery?

♦IN (*)
♦<>
♦=
♦LIKE

23. The TEACHERS and CLASS_ASSIGNMENTS tables contain these columns:

TEACHERS
TEACHER_ID NUMBER(5) Primary Key
NAME VARCHAR2 (25)
SUBJECT_ID NUMBER(5)

CLASS_ASSIGNMENTS
CLASS_ID NUMBER (5) Primary Key
TEACHER_ID NUMBER (5)
START_DATE DATE
MAX_CAPACITY NUMBER (3)

All MAX_CAPACITY values are greater than 10. Which two SQL statements correctly use subqueries? (Choose two)

(Choose all correct answers)

♦SELECT *
FROM class_assignments
WHERE max_capacity = (SELECT AVG(max_capacity) FROM class_assignments);
(*)

♦SELECT *
FROM teachers
WHERE teacher_id = (SELECT teacher_id FROM class_assignments WHERE class_id = 45963);
(*)

♦SELECT *
FROM teachers
WHERE teacher_id = (SELECT teacher_id FROM class_assignments WHERE max_capacity > 0);

♦SELECT *
FROM teachers
WHERE teacher_id LIKE (SELECT teacher_id FROM class_assignments WHERE max_capacity > 0);

♦SELECT *
FROM class_assignments
WHERE max_capacity = (SELECT AVG(max_capacity) FROM class_assignments GROUP BY teacher_id);

24. You need to create a report to display the names of products with a cost value greater than the average cost of all products. Which SELECT statement should you use?

♦SELECT product_name
FROM products
WHERE cost > (SELECT AVG(cost)
FROM product);
(*)

♦SELECT product_name
FROM products
WHERE cost > AVG(cost);

♦SELECT AVG(cost), product_name
FROM products
WHERE cost > AVG(cost)
GROUP by product_name;

♦SELECT product_name
FROM (SELECT AVG(cost) FROM product)
WHERE cost > AVG(cost);

25. Which statement about subqueries is true?

♦Subqueries should be enclosed in double quotation marks.
♦Subqueries cannot contain group functions.
♦Subqueries are often used in a WHERE clause to return values for an unknown conditional value. (*)
♦Subqueries generally execute last, after the main or outer query executes.

26. The EMPLOYEES table contains the following columns:

EMPLOYEE_ID NUMBER(10) PRIMARY KEY
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
DEPTARTMENT VARCHAR2(20)
HIRE_DATE DATE
SALARY NUMBER(10)

You want to create a report that includes each employee’s last name, employee identification number, date of hire and salary. The report should include only those employees who have been with the company for more than one year and whose salary exceeds $40,000.

Which of the following SELECT statements will accomplish this task?

♦SELECT employee_id, last_name, salary
FROM employees
WHERE salary > 40000
AND hire_date = (SELECT hire_date FROM employees
WHERE (sysdate-hire_date) / 365 > 1);

♦SELECT employee_id, last_name, hire_date, salary
FROM employees
WHERE salary > 40000
AND hire_date = (SELECT hire_date FROM employees
WHERE (sysdate-hire_date) / 365 > 1);

♦SELECT employee_id, last_name, hire_date, salary
FROM employees
WHERE salary > 40000
AND (sysdate-hire_date) / 365 > 1;
(*)

♦SELECT employee_id, last_name, salary
FROM employees
WHERE salary > 40000
AND hire_date IN (sysdate-hire_date) / 365 > 1);

27. The PRODUCTS table contains these columns:

PRODUCT_ID NUMBER(9) PK
CATEGORY_ID VARCHAR2(10)
LOCATION_ID NUMBER(9)
DESCRIPTION VARCHAR2(30)
COST NUMBER(7,2)
PRICE NUMBER(7,2)
QUANTITY NUMBER

You display the total of the extended costs for each product category by location.
You need to include only the products that have a price less than $25.00.
The extended cost of each item equals the quantity value multiplied by the cost value.

Which SQL statement will display the desired result?

♦SELECT category_id, SUM(cost * quantity) TOTAL,location_id
FROM products
WHERE price > 25.00
GROUP BY category_id, location_id;

♦SELECT SUM(cost * quantity) TOTAL, location_id
FROM products
WHERE price < 25.00
GROUP BY location_id;

♦SELECT category_id, SUM(cost * quantity) TOTAL, location_id
FROM products
WHERE price < 25.00
GROUP BY category_id, location_id;
(*)

♦SELECT SUM(cost * quantity) TOTAL
FROM products
WHERE price < 25.00;

28. Evaluate this SELECT statement: SELECT COUNT(employee_id), department_id FROM employees GROUP BY department_id; You only want to include employees who earn more than 15000. Which clause should you include in the SELECT statement?

♦WHERE salary > 15000 (*)
♦HAVING salary > 15000
♦WHERE SUM(salary) > 15000
♦HAVING SUM(salary) > 15000

29. Which statement about the GROUP BY clause is true?

♦To exclude rows before dividing them into groups using the GROUP BY clause, you should use a WHERE clause. (*)
♦You can use a column alias in a GROUP BY clause.
♦By default, rows are not sorted when a GROUP BY clause is used.
♦You must use the HAVING clause with the GROUP BY clause.

30. Evaluate this SELECT statement:

SELECT SUM(salary), department_id, manager_id
FROM employees
GROUP BY department_id, manager_id;

Which SELECT clause allows you to restrict the rows returned, based on a group function?

♦HAVING SUM(salary) > 100000 (*)
♦WHERE SUM(salary) > 100000
♦WHERE salary > 100000
♦HAVING salary > 100000

31. The MANUFACTURER table contains these columns:

MANUFACTURER_ID NUMBER
MANUFACTURER_NAME VARCHAR2(30)
TYPE VARCHAR2(25)
LOCATION_ID NUMBER

You need to display the number of unique types of manufacturers at each location. Which SELECT statement should you use?

♦SELECT location_id, COUNT(DISTINCT type)
FROM manufacturer
GROUP BY location_id;
(*)

♦SELECT location_id, COUNT(DISTINCT type)
FROM manufacturer;

♦SELECT location_id, COUNT(type)
FROM manufacturer
GROUP BY location_id;

♦SELECT location_id, COUNT(DISTINCT type)
FROM manufacturer
GROUP BY type;

32. 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?

♦SELECT
♦FROM
♦WHERE
♦GROUP BY (*)

33. Evaluate this statement:

SELECT department_id, AVG(salary)
FROM employees
WHERE job_id <> 69879
GROUP BY job_id, department_id
HAVING AVG(salary) > 35000
ORDER BY department_id;

Which clauses restricts the result? (Choose two)
(Choose all correct answers)

♦SELECT department_id, AVG(salary)
♦WHERE job_id <> 69879 (*)
♦GROUP BY job_id, department_id
♦HAVING AVG(salary) > 35000 (*)

34. Examine the following EMPLOYEES table:

EMPLOYEES
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
SUPERVISOR_ID NUMBER(9)

You need to produce a report that contains all employee-related information for those employees who have Brad Carter as a supervisor. However, you are not sure which supervisor ID belongs to Brad Carter. Which query should you issue to accomplish this task?

♦SELECT *
FROM employees
WHERE supervisor_id = (SELECT supervisor_id
&nbspFROM employees
&nbspWHERE last_name = ‘Carter’);

♦SELECT *
FROM supervisors
WHERE supervisor_id =
(SELECT supervisor_id
&nbspFROM employees
&nbspWHERE last_name = ‘Carter’);

♦SELECT *
FROM supervisors
WHERE supervisor_id =
(SELECT employee_id
&nbspFROM supervisors
&nbspWHERE last_name = ‘Carter’);

♦SELECT *
FROM employees
WHERE supervisor_id =
(SELECT employee_id
&nbspFROM employees
&nbspWHERE last_name = ‘Carter’);
(*)

35. Examine the structure of the EMPLOYEE, DEPARTMENT, and ORDERS tables.

EMPLOYEE:
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)

DEPARTMENT:
DEPARTMENT_ID NUMBER(9)
DEPARTMENT_NAME VARCHAR2(25)
CREATION_DATE DATE

ORDERS:
ORDER_ID NUMBER(9)
EMPLOYEE_ID NUMBER(9)
DATE DATE
CUSTOMER_ID NUMBER(9)

You want to display all employees who had an order after the Sales department was established. Which of the following constructs would you use?

♦a group function
♦a single-row subquery (*)
♦the HAVING clause
♦a MERGE statement

36. Which best describes a single-row subquery?

♦A query that returns only one row from the inner SELECT statement (*)
♦A query that returns one or more rows from the inner SELECT statement
♦A query that returns only one column value from the inner SELECT statement
♦A query that returns one or more column values from the inner SELECT statement

37. What would happen if you issued a DELETE statement without a WHERE clause?

♦All the rows in the table would be deleted. (*)
♦An error message would be returned.
♦No rows would be deleted.
♦Only one row would be deleted.

38. Which 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;

39. You need to delete a record in the EMPLOYEES table for Tim Jones, whose unique employee identification number is 348. The EMPLOYEES table contains these columns:

EMPLOYEE_ID NUMBER(5) PRIMARY KEY
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
ADDRESS VARCHAR2(30)
PHONE NUMBER(10)

Which DELETE statement will delete the appropriate record without deleting any additional records?

♦DELETE FROM employees
WHERE employee_id = 348;
(*)

♦DELETE FROM employees
WHERE last_name = jones;

♦DELETE *
FROM employees
WHERE employee_id = 348;

♦DELETE ‘jones’
FROM employees;

40. Examine the structures of the PRODUCTS and SUPPLIERS tables:

SUPPLIERS
SUPPLIER_ID NUMBER NOT NULL, Primary Key
SUPPLIER_NAME VARCHAR2 (25)
ADDRESS VARCHAR2 (30)
CITY VARCHAR2 (25)
REGION VARCHAR2 (10)
POSTAL_CODE VARCHAR2 (11)

PRODUCTS
PRODUCT_ID NUMBER NOT NULL, Primary Key
PRODUCT_NAME VARCHAR2 (25)
SUPPLIER_ID NUMBER Foreign key to SUPPLIER_ID of the SUPPLIERS table
CATEGORY_ID NUMBER
QTY_PER_UNIT NUMBER
UNIT_PRICE NUMBER (7,2)
QTY_IN_STOCK NUMBER
QTY_ON_ORDER NUMBER
REORDER_LEVEL NUMBER

You want to delete any products supplied by the five suppliers located in Atlanta. Which script should you use?

♦DELETE FROM products
WHERE supplier_id IN
(SELECT supplier_id FROM suppliers WHERE UPPER(city) = ‘ATLANTA’);
(*)

♦DELETE FROM products
WHERE UPPER(city) = ‘ATLANTA’;

♦DELETE FROM products
WHERE supplier_id =
(SELECT supplier_id FROM suppliers WHERE UPPER(city) = ‘ATLANTA’);

♦DELETE FROM suppliers
WHERE supplier_id IN
(SELECT supplier_id FROM suppliers WHERE UPPER(city) = ‘ALANTA’);

41. The EMPLOYEES table contains the following columns:

EMPLOYEE_ID NUMBER(10) PRIMARY KEY
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
DEPARTMENT_ID VARCHAR2(20)
HIRE_DATE DATE
SALARY NUMBER(9,2)
BONUS NUMBER(9,2)

You want to execute one DML statement to change the salary of all employees in department 10 to equal the new salary of employee number 89898. Currently, all employees in department 10 have the same salary value. Which statement should you execute?

♦UPDATE employees
SET salary = SELECT salary FROM employees WHERE employee_id = 89898;

♦UPDATE employees
SET salary = (SELECT salary FROM employees WHERE employee_id = 89898);

♦UPDATE employees
SET salary = (SELECT salary FROM employees WHERE employee_id = 89898)
WHERE department_id = 10;
(*)

♦UPDATE employees
SET salary = (SELECT salary FROM employees WHERE employee_id = 89898 AND deptartment_id = 10);

42. When the WHERE clause is missing in a DELETE statement, what is the result?

♦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.

43. You need to update both the DEPARTMENT_ID and LOCATION_ID columns in the EMPLOYEES table using one UPDATE statement. Which clause should you include in the UPDATE statement to update multiple columns?

♦The USING clause
♦The ON clause
♦The WHERE clause
♦The SET clause (*)

44. Evaluate this statement:

DELETE FROM customer;

Which statement is true?

♦The statement deletes all the rows from the CUSTOMER table. (*)
♦The statement deletes the CUSTOMER column.
♦The statement deletes the first row in the CUSTOMERS table.
♦The statement removes the structure of the CUSTOMER table from the database.

45. You need to remove a row from the EMPLOYEES table. Which statement would you use?

♦UPDATE with a WHERE clause
♦INSERT with a WHERE clause
♦DELETE with a WHERE clause (*)
♦MERGE with a WHERE clause

46. One of the sales representatives, Janet Roper, has informed you that she was recently married, and she has requested that you update her name in the employee database. Her new last name is Cooper. Janet is the only person with the last name of Roper that is employed by the company. The EMPLOYEES table contains these columns and all data is stored in lowercase:

EMPLOYEE_ID NUMBER(10) PRIMARY KEY
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
DEPARTMENT_ID VARCHAR2 (20)
HIRE_DATE DATE
SALARY NUMBER(10)

Which UPDATE statement will accomplish your objective?

♦UPDATE employees
SET last_name = ‘cooper’
WHERE last_name = ‘roper’;
(*)

♦UPDATE employees last_name = ‘cooper’
WHERE last_name = ‘roper’;

♦UPDATE employees
SET last_name = ‘roper’
WHERE last_name = ‘cooper’;

♦UPDATE employees
SET cooper = ‘last_name’
WHERE last_name = ‘roper’;

47. You need to copy rows from the EMPLOYEE table to the EMPLOYEE_HIST table. What could you use in the INSERT statement to accomplish this task?

♦An ON clause
♦A SET clause
♦A subquery (*)
♦A function

48. The PRODUCTS table contains these columns:

PROD_ID NUMBER(4)
PROD_NAME VARCHAR2(25)
PROD_PRICE NUMBER(3)

You want to add the following row data to the PRODUCTS table:

(1) a NULL value in the PROD_ID column
(2) “6-foot nylon leash” in the PROD_NAME column
(3) “10” in the PROD_PRICE column

You issue this statement:

INSERT INTO products
VALUES (null,’6-foot nylon leash’, 10);

What row data did you add to the table?

♦The row was created with the correct data in all three columns. (*)
♦The row was created with the correct data in two of three columns.
♦The row was created with the correct data in one of the three columns.
♦The row was created completely wrong. No data ended up in the correct columns.

49. You have been instructed to add a new customer to the CUSTOMERS table. Because the new customer has not had a credit check, you should not add an amount to the CREDIT column.
The CUSTOMERS table contains these columns:

CUST_ID NUMBER(10)
COMPANY VARCHAR2(30)
CREDIT NUMBER(10)
POC VARCHAR2(30)
LOCATION VARCHAR2(30)

Which two INSERT statements will accomplish your objective?
(Choose all correct answers)

♦INSERT INTO customers (cust_id, company, poc, location)
VALUES (200, ‘InterCargo’, ‘tflanders’, ‘samerica’);
(*)

♦INSERT INTO customers
VALUES (200, ‘InterCargo’, null, ‘tflanders’, ‘samerica’);
(*)

♦INSERT INTO customers
VALUES (cust_id, company, credit, poc, location) (200, ‘InterCargo’, 0, ‘tflanders’, ‘samerica’);

♦INSERT INTO customers
VALUES (200, InterCargo, 0, tflanders, samerica);

50. The PRODUCTS table contains these columns:

PRODUCT_ID NUMBER NOT NULL
PRODUCT_NAME VARCHAR2 (25)
SUPPLIER_ID NUMBER NOT NULL
LIST_PRICE NUMBER (7,2)
COST NUMBER (5,2)
QTY_IN_STOCK NUMBER(4)
LAST_ORDER_DT DATE NOT NULL DEFAULT SYSDATE

Which INSERT statement will execute successfully?

♦INSERT INTO products
VALUES (2958, ‘Cable’, 8690, 7.09, 4.04, 700);
(*)

♦INSERT INTO products
VALUES (2958, ‘Cable’, 8690, 7.09, 4.04, SYSDATE);

♦INSERT INTO products(product_id, product_name)
VALUES (2958, ‘Cable’);

♦INSERT INTO products(product_id, product_name, supplier_id
VALUES (2958, ‘Cable’, 8690, SYSDATE);

 

Leave a comment