Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- est: Mid Term Exam Semester 2 - Part II
- Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
- Semester 2 Mid Term Exam Part II covers Sections 5-7 of Database Programming with SQL.
- Section 5
- 1. You use GROUPING function to: Mark for Review
- (1) Points
- Produce subtotal and cross-tabulated values
- Identify the extra row values created by either a ROLLUP or CUBE operation (*)
- Aggregate rows using SUM, MIN, MAX, and COUNT
- Correct Correct
- 2. GROUPING SETS is another extension to the GROUP BY clause and is used to specify multiple groupings of data but provide a single result set. True or False? Mark for Review
- (1) Points
- True (*)
- False
- Incorrect Incorrect. Refer to Section 5 Lesson 2.
- 3. You use GROUPING function to ______ database rows from tabulated rows. Mark for Review
- (1) Points
- CREATE
- DISTINGUISH (*)
- COMPUTE
- COUNT
- Incorrect Incorrect. Refer to Section 5 Lesson 2.
- 4. CUBE will cross-reference the columns listed in the ______ clause to create a superset of groups. Mark for Review
- (1) Points
- GROUP BY (*)
- WHERE
- SELECT
- Correct Correct
- 5. Group functions can be nested to a depth of? Mark for Review
- (1) Points
- Three
- Four
- Two (*)
- Group functions cannot be nested.
- Correct Correct
- 6. The PRODUCTS table contains these columns:
- PROD_ID NUMBER(4)
- PROD_NAME VARCHAR(20)
- PROD_CAT VARCHAR2(15)
- PROD_PRICE NUMBER(5)
- PROD_QTY NUMBER(4)
- You need to identify the minimum product price in each product category.
- Which statement could you use to accomplish this task?
- Mark for Review
- (1) Points
- SELECT prod_cat, MIN (prod_price)
- FROM products
- GROUP BY prod_price;
- SELECT prod_cat, MIN (prod_price)
- FROM products
- GROUP BY prod_cat;
- (*)
- SELECT MIN (prod_price), prod_cat
- FROM products
- GROUP BY MIN (prod_price), prod_cat;
- SELECT prod_price, MIN (prod_cat)
- FROM products
- GROUP BY prod_cat;
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 7. Evaluate this SELECT statement:
- SELECT COUNT(emp_id), mgr_id, dept_id
- FROM employees
- WHERE status = 'I'
- GROUP BY dept_id
- HAVING salary > 30000
- ORDER BY 2;
- Why does this statement return a syntax error?
- Mark for Review
- (1) Points
- MGR_ID must be included in the GROUP BY clause. (*)
- The HAVING clause must specify an aggregate function.
- A single query cannot contain a WHERE clause and a HAVING clause.
- The ORDER BY clause must specify a column name in the EMPLOYEE table.
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 8. Which statement about group functions is true? Mark for Review
- (1) Points
- Group functions ignore null values. (*)
- Group functions can only be used in a SELECT list.
- Group functions can be used in a WHERE clause.
- A query that includes a group function in the SELECT list must include a GROUP BY clause.
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 9. The EMPLOYEES table contains the following columns:
- EMPLOYEE_ID NUMBER(10) PRIMARY KEY
- LAST_NAME VARCHAR2(20)
- FIRST_NAME VARCHAR2(20)
- DEPARTMENT 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?
- Mark for Review
- (1) Points
- 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);
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 10. What will the following SQL Statement do?
- SELECT job_id, COUNT(*)
- FROM employees
- GROUP BY job_id;
- Mark for Review
- (1) Points
- Displays all the employees and groups them by job.
- Displays each job id and the number of people assigned to that job id. (*)
- Displays only the number of job_ids.
- Displays all the jobs with as many people as there are jobs.
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- Section 5
- 11. Which statement about the GROUP BY clause is true? Mark for Review
- (1) Points
- 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.
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 12. The PLAYERS and TEAMS tables contain these columns:
- PLAYERS
- PLAYER_ID NUMBER NOT NULL, PRIMARY KEY
- LAST_NAME VARCHAR2 (30) NOT NULL
- FIRST_NAME VARCHAR2 (25) NOT NULL
- TEAM_ID NUMBER
- POSITION VARCHAR2 (25)
- TEAMS
- TEAM_ID NUMBER NOT NULL, PRIMARY KEY
- TEAM_NAME VARCHAR2 (25)
- You need to create a report that lists the names of each team with more than three goal keepers.
- Which SELECT statement will produce the desired result?
- Mark for Review
- (1) Points
- SELECT t.team_name, COUNT(p.player_id)
- FROM players p, teams t
- ON (p.team_id = t.team_id)
- WHERE UPPER(p.position) = 'GOAL KEEPER'
- GROUP BY t.team_name;
- SELECT t.team_name, COUNT(p.player_id)
- FROM players
- JOIN teams t ON (p.team_id = t.team_id)
- WHERE UPPER(p.position) = 'GOAL KEEPER'
- HAVING COUNT(p.player_id) > 3;
- SELECT t.team_name, COUNT(p.player_id)
- FROM players p, teams t
- ON (p.team_id = t.team_id)
- WHERE UPPER(p.position) = 'GOAL KEEPER'
- GROUP BY t.team_name
- HAVING COUNT(p.player_id) > 3;
- SELECT t.team_name, COUNT(p.player_id)
- FROM players p
- JOIN teams t ON (p.team_id = t.team_id)
- WHERE UPPER(p.position) = 'GOAL KEEPER'
- GROUP BY t.team_name
- HAVING COUNT(p.player_id) > 3;
- (*)
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 13. The PAYMENT table contains these columns:
- PAYMENT_ID NUMBER(9) PK
- PAYMENT_DATE DATE
- CUSTOMER_ID NUMBER(9)
- Which SELECT statement could you use to display the number of times each customer payment was made between January 1, 2003 and June 30, 2003 ?
- Mark for Review
- (1) Points
- SELECT customer_id, COUNT(payment_id)
- FROM payment
- WHERE payment_date BETWEEN '01-JAN-2003' AND '30-JUN-2003'
- GROUP BY customer_id;
- (*)
- SELECT COUNT(payment_id)
- FROM payment
- WHERE payment_date BETWEEN '01-JAN-2003' AND '30-JUN-2003';
- SELECT customer_id, COUNT(payment_id)
- FROM payment
- WHERE payment_date BETWEEN '01-JAN-2003' AND '30-JUN-2003';
- SELECT COUNT(payment_id)
- FROM payment
- WHERE payment_date BETWEEN '01-JAN-2003' AND '30-JUN-2003'
- GROUP BY customer_id;
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 14. 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)
- FROM employees
- GROUP BY dept;
- SELECT AVG (salary)
- FROM employees
- GROUP BY dept;
- (*)
- SELECT AVG (salary)
- FROM employees
- BY dept;
- SELECT AVG salary
- FROM employees
- BY dept;
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 15. Evaluate this SELECT statement:
- SELECT MAX(salary), department_id
- FROM employees
- GROUP BY department_id;
- Which values are displayed?
- Mark for Review
- (1) Points
- The highest salary for all employees.
- The highest salary in each department. (*)
- The employees with the highest salaries.
- The employee with the highest salary for each department.
- Correct Correct
- 16. 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.
- Mark for Review
- (1) Points
- (Choose all correct answers)
- SELECT department_id, AVG(salary)
- WHERE job_id <> 69879 (*)
- GROUP BY job_id, department_id
- HAVING AVG(salary) > 35000 (*)
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 17. The EMPLOYEES table contains these columns:
- ID_NUMBER NUMBER Primary Key
- NAME VARCHAR2 (30)
- DEPARTMENT_ID NUMBER
- SALARY NUMBER (7,2)
- HIRE_DATE DATE
- Evaluate this SQL statement:
- SELECT id_number, name, department_id, SUM(salary)
- FROM employees
- WHERE salary > 25000
- GROUP BY department_id, id_number, name
- ORDER BY hire_date;
- Why will this statement cause an error?
- Mark for Review
- (1) Points
- The HAVING clause is missing.
- The WHERE clause contains a syntax error.
- The SALARY column is NOT included in the GROUP BY clause.
- The HIRE_DATE column is NOT included in the GROUP BY clause. (*)
- Incorrect Incorrect. Refer to Section 5 Lesson 1.
- 18. To control the order of rows returned using SET operators, the ORDER BY clause is used ______ and is placed in the _____ SELECT statement of the query. Mark for Review
- (1) Points
- ONCE; FIRST
- TWICE; FIRST
- ONCE; LAST (*)
- IN ALL; LAST
- Incorrect Incorrect. Refer to Section 5 Lesson 3.
- 19. When using SET operators the number of columns and the data types of the columns must be identical in all of the SELECT statements used in the query. True or False? Mark for Review
- (1) Points
- True (*)
- False
- Correct Correct
- Section 6
- 20. 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?
- Mark for Review
- (1) Points
- 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. (*)
- Incorrect Incorrect. Refer to Section 6 Lesson 3.
- Section 6
- 21. You are looking for Executive information using a subquery.
- What will the following SQL statement display?
- SELECT department_id, last_name, job_id
- FROM employees
- WHERE department_id IN
- (SELECT department_id FROM departments WHERE department_name = 'Executive');
- Mark for Review
- (1) Points
- The department ID, department name and last name for every employee in the Executive department.
- The department ID, last name, department name for every Executive in the employees table.
- The department ID, last name, job ID from departments for Executive employees.
- The department ID, last name, job ID for every employee in the Executive department. (*)
- Incorrect Incorrect. Refer to Section 6 Lesson 3.
- 22. 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?
- Mark for Review
- (1) Points
- 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.
- Correct Correct
- 23. Which statement is false? Mark for Review
- (1) Points
- The WITH clause retrieves the results of one or more query blocks.
- The WITH clause decreases performance. (*)
- The WITH clause makes the query simple to read .
- Stores the results for the user who runs the query.
- Correct Correct
- 24. A correlated subquery is evaluated _____ for each row processed by the parent statement. Mark for Review
- (1) Points
- EVERY TIME
- ONCE (*)
- COMPLETELY
- Incorrect Incorrect. Refer to Section 6 Lesson 4.
- 25. 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 Correct
- 26. A correlated subquery will _______ a candidate row from an outer query, _______ the inner query using candidate row value, and _______ values from the inner query to qualify or disqualify the candidate row. Mark for Review
- (1) Points
- CREATE; EXECUTE; USE
- DELETE; UPDATE; INSERT
- GET; EXECUTE; USE (*)
- ROLLUP; GRANT; DROP
- Incorrect Incorrect. Refer to Section 6 Lesson 4.
- 27. Which best describes a single-row subquery? Mark for Review
- (1) Points
- 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
- Incorrect Incorrect. Refer to Section 6 Lesson 2.
- 28. 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 Incorrect. Refer to Section 6 Lesson 2.
- 29. 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 Correct
- 30. 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? Mark for Review
- (1) Points
- 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);
- Incorrect Incorrect. Refer to Section 6 Lesson 1.
- Section 6
- 31. The EMPLOYEES and ORDERS tables contain these columns:
- EMPLOYEES
- EMPLOYEE_ID NUMBER(10) NOT NULL PRIMARY KEY
- FIRST_NAME VARCHAR2(30)
- LAST_NAME VARCHAR2(30)
- ADDRESS VARCHAR2(25)
- CITY VARCHAR2(20)
- STATE VARCHAR2(2)
- ZIP NUMBER(9)
- TELEPHONE NUMBER(10)
- ORDERS
- ORDER_ID NUMBER(10) NOT NULL PRIMARY KEY
- EMPLOYEE_ID NUMBER(10) NOT NULL FOREIGN KEY
- ORDER_DATE DATE
- TOTAL NUMBER(10)
- Which SELECT statement will return all orders generated by a sales representative named Franklin during the year 2001?
- Mark for Review
- (1) Points
- SELECT order_id, total
- FROM ORDERS (SELECT employee_id
- FROM employees
- WHERE last_name = 'Franklin')
- WHERE order_date BETWEEN '01-jan-01' AND '31-dec-01';
- SELECT (SELECT employee_id FROM employees WHERE last_name = 'Franklin') AND order_id, total
- FROM ORDERS
- WHERE order_date BETWEEN '01-jan-01' AND '31-dec-01';
- SELECT order_id, employee_id, total
- FROM ORDERS
- WHERE order_date BETWEEN '01-jan-01' AND '31-dec-01' AND emp_id = 'Franklin';
- SELECT order_id, total
- FROM ORDERS
- WHERE employee_id = (SELECT employee_id FROM employees WHERE last_name = 'Franklin')
- AND order_date BETWEEN '01-jan-01' AND '31-dec-01';
- (*)
- Incorrect Incorrect. Refer to Section 6 Lesson 1.
- 32. Which operator can be used with subqueries that return only one row? Mark for Review
- (1) Points
- LIKE (*)
- ANY
- ALL
- IN
- Incorrect Incorrect. Refer to Section 6 Lesson 1.
- 33. If you use the equality operator (=) with a subquery, how many values can the subquery return? Mark for Review
- (1) Points
- Only 1 (*)
- Up to 2
- Up to 5
- Unlimited
- Incorrect Incorrect. Refer to Section 6 Lesson 1.
- 34. Which operator can be used with a multiple-row subquery? Mark for Review
- (1) Points
- IN (*)
- <>
- =
- LIKE
- Incorrect Incorrect. Refer to Section 6 Lesson 1.
- 35. Which of the following is TRUE regarding the order of subquery execution? Mark for Review
- (1) Points
- The outer query is executed first
- The subquery executes once after the main query
- The subquery executes once before the main query (*)
- The result of the main query is used with the subquery
- Incorrect Incorrect. Refer to Section 6 Lesson 1.
- 36. Using a subquery in which clause will return a syntax error? Mark for Review
- (1) Points
- WHERE
- FROM
- HAVING
- You can use subqueries in all of the above clauses. (*)
- Incorrect Incorrect. Refer to Section 6 Lesson 1.
- Section 7
- 37. 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?
- Mark for Review
- (1) Points
- 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);
- Correct Correct
- 38. 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? Mark for Review
- (1) Points
- An ON clause
- A SET clause
- A subquery (*)
- A function
- Incorrect Incorrect. Refer to Section 7 Lesson 1.
- 39. Using the INSERT statement, and assuming that a column can accept null values, how can you implicitly insert a null value in a column? Mark for Review
- (1) Points
- Use the NULL keyword.
- Use the ON clause
- Omit the column in the column list. (*)
- It is not possible to implicitly insert a null value in a column.
- Incorrect Incorrect. Refer to Section 7 Lesson 1.
- 40. 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?
- Mark for Review
- (1) Points
- 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.
- Correct Correct
- Section 7
- 41. 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? Mark for Review
- (1) Points
- The USING clause
- The ON clause
- The WHERE clause
- The SET clause (*)
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
- 42. 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?
- Mark for Review
- (1) Points
- 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';
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
- 43. One of your employees was recently married. Her employee ID is still 189, however, her last name is now Rockefeller. Which SQL statement will allow you to reflect this change? Mark for Review
- (1) Points
- INSERT INTO my_employees SET last_name = 'Rockefeller' WHERE employee_ID = 189;
- INSERT my_employees SET last_name = 'Rockefeller' WHERE employee_ID = 189;
- UPDATE INTO my_employees SET last_name = 'Rockefeller' WHERE employee_ID = 189;
- UPDATE my_employees SET last_name = 'Rockefeller' WHERE employee_ID = 189; (*)
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
- 44. You need to update the area code of employees that live in Atlanta. Evaluate this partial UPDATE statement:
- UPDATE employee
- SET area_code = 770
- Which of the following should you include in your UPDATE statement to achieve the desired results?
- Mark for Review
- (1) Points
- UPDATE city = Atlanta;
- SET city = 'Atlanta';
- WHERE city = 'Atlanta'; (*)
- LIKE 'At%';
- Correct Correct
- 45. You need to remove a row from the EMPLOYEES table. Which statement would you use? Mark for Review
- (1) Points
- UPDATE with a WHERE clause
- INSERT with a WHERE clause
- DELETE with a WHERE clause (*)
- MERGE with a WHERE clause
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
- 46. What keyword in an UPDATE statement speficies the columns you want to change? Mark for Review
- (1) Points
- SELECT
- WHERE
- SET (*)
- HAVING
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
- 47. What would happen if you issued a DELETE statement without a WHERE clause? Mark for Review
- (1) Points
- 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.
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
- 48. The TEACHERS and CLASS_ASSIGNMENTS tables contain these columns:
- TEACHERS
- TEACHER_ID NUMBER(5)
- NAME VARCHAR2(25)
- SUBJECT_ID NUMBER(5)
- HIRE_DATE DATE
- SALARY NUMBER(9,2)
- CLASS_ASSIGNMENTS
- CLASS_ID NUMBER(5)
- TEACHER_ID NUMBER(5)
- START_DATE DATE
- MAX_CAPACITY NUMBER(3)
- Which scenario would require a subquery to return the desired results?
- Mark for Review
- (1) Points
- You need to display the start date for each class taught by a given teacher.
- You need to create a report to display the teachers who were hired more than five years ago.
- You need to display the names of the teachers who teach classes that start within the next week.
- You need to create a report to display the teachers who teach more classes than the average number of classes taught by each teacher. (*)
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
- 49. 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.
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
- 50. Examine the structures of the PLAYERS, MANAGERS, and TEAMS tables:
- PLAYERS
- PLAYER_ID NUMBER Primary Key
- LAST_NAME VARCHAR2 (30)
- FIRST_NAME VARCHAR2 (25)
- TEAM_ID NUMBER
- MGR_ID NUMBER
- SIGNING_BONUS NUMBER(9,2)
- SALARY NUMBER(9,2)
- MANAGERS
- MANAGER_ID NUMBER Primary Key
- LAST_NAME VARCHAR2 (20)
- FIRST_NAME VARCHAR2 (20)
- TEAM_ID NUMBER
- TEAMS
- TEAM_ID NUMBER Primary Key
- TEAM_NAME VARCHAR2 (20)
- OWNER_LAST_NAME VARCHAR2 (20)
- OWNER_FIRST_NAME VARCHAR2 (20)
- Which situation would require a subquery to return the desired result?
- Mark for Review
- (1) Points
- To display the names each player on the Lions team
- To display the maximum and minimum player salary for each team
- To display the names of the managers for all the teams owned by a given owner (*)
- To display each player, their manager, and their team name for all teams with a id value greater than 5000
- Incorrect Incorrect. Refer to Section 7 Lesson 2.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement