Posts

Showing posts from January, 2018

Database Programming with SQL Final Exam

Section 12 (Answer all questions in this section) 1. What keyword in an UPDATE statement speficies the column that you want to change? WHERE SET (*) HAVING SELECT 2. What would happen if you issued a DELETE statement without a WHERE clause? No rows would be deleted. All the rows in the table would be deleted. (*) Only one row would be deleted. An error message would be returned. 3. DELETE statements can use correlated subqueries? (True or False) True (*) False 4. 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 removes the structure of the CUSTOMER table from the database. The statement deletes the first row in the CUSTOMERS ta...

Oracle Database Programming with SQL Section 5 Quiz

Section 5 Quiz (Answer all questions in this section) 1. Which SQL Statement should you use to display the prices in this format: "$00.30"? Mark for Review (1) Points SELECT TO_CHAR(price, '$99,999.99') FROM product; SELECT TO_CHAR(price, '$99,900.99') FROM product; (*) SELECT TO_CHAR(price, '$99,990.99') FROM product; SELECT TO_NUMBER(price, '$99,900.99') FROM product; 2. Which two statements concerning SQL functions are true? (Choose two.) Mark for Review (1) Points (Choose all  answers) Character functions can accept numeric input. Number functions can return number or character values. Not all date functions return date values. (*) Single-row functions manipulate groups of rows to return one result per group of rows. Conversion functions convert a value from one data type to another data type. (*) ...

Database Programming with SQL Section 4

Section 4 Quiz (Answer all questions in this section) 1. You want to create a report that displays all orders and their amounts that were placed during the month of January. You want the orders with the highest amounts to appear first. Which query should you issue? Mark for Review (1) Points SELECT orderid, total FROM orders WHERE order_date IN ( 01-Jan-2002 , 31-Jan-2002 ) ORDER BY total; SELECT orderid, total FROM orders WHERE order_date BETWEEN '31-Jan-2002' AND '01-Jan-2002' ORDER BY total DESC; SELECT orderid, total FROM orders WHERE order_date LIKE '01-Jan-2002' AND '31-Jan-2002' ORDER BY total DESC; SELECT orderid, total FROM orders WHERE order_date BETWEEN '01-Jan-2002' AND '31-Jan-2002' ORDER BY total DESC; (*) 2. Which SELECT statement will NOT return a date value? Mark for Review (1) Points SELECT (SYSDATE - hire_date) + 10*8...

Database Programming with SQL Section 3 Quiz

Section 3 Quiz (Answer all questions in this section) 1. Evaluate this SQL statement: SELECT product_id, product_name, price FROM products ORDER BY product_name, price; What occurs when the statement is executed? The results are sorted alphabetically and then numerically. (*) The results are sorted numerically only. The results are sorted numerically and then alphabetically. The results are sorted alphabetically only. 2. Evaluate this SELECT statement: SELECT * FROM employees WHERE department_id = 34 OR department_id = 45 OR department_id = 67; Which operator is the equivalent of the OR conditions used in this SELECT statement? BETWEEN AND ... IN (*) AND LIKE 3. Which columns can be added to the ORDER BY clause in the following SELECT statement? (Choose Three) SELECT first_name, last_name, salary, hire_date FROM employees WHERE department_id = 50 ORDER BY ?????; Any column in the EMPLOYEES table, any ex...

Database Programming with SQL Midterm Exam

Section 1 (Answer all questions in this section) 1. The DESCRIBE command returns all rows from a table. True or False? Mark for Review  True False (*) 2. What command can be used to create a new row in a table in the database? Mark for Review  CREATE ADD INSERT (*) NEW 3. SELECT * FROM departments; is a: Mark for Review  Keyword Statement (*) Strategy Declaration 4. In which clause of a SELECT statement would you specify the name of the table or tables being queried? Mark for Review  The FROM clause (*) The SELECT clause The WHERE clause Any of the above options; you can list tables wherever you want in a SELECT statement. 5. Every row in a relational database table is unique. Mark for Review  True (*) False Section 2 (Answer all questions in this section) 6...