Question

A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a....

A(n) _____ is a query that is embedded (or nested) inside another query.

Select one:

a. operator

b. subquery

c. alias

d. view

If a subquery returns list of values, which operator can be used in the outer query predicate?

Select one:

a. >

b. <

c. IN

d. =

Which query returns a list of all products with a price greater than or equal to the average product price?

Select one:

a.
SELECT P_CODE,MAX(AVG(P_PRICE))
FROM PRODUCT
GROUP BY P_CODE;

b.
SELECT P_CODE, P_PRICE
FROM PRODUCT
WHERE P_PRICE >= (SELECT AVG(P_PRICE) FROM PRODUCT)
GROUP BY P_CODE;

c.
SELECT P_CODE, P_PRICE
FROM PRODUCT
WHERE P_PRICE >= AVG(P_PRICE);

d.
SELECT P_CODE, P_PRICE
FROM PRODUCT
WHERE P_PRICE >= (SELECT AVG(P_PRICE) FROM PRODUCT);

Rows can be grouped into smaller collections quickly and easily using the _____ clause within the SELECT statement.

Select one:

a. WHERE

b. FROM

c. GROUP BY

d. JOIN

SELECT statement may use subqueries within ____ clauses

Select one or more:

a. WHERE

b. HAVING

c. FROM

d. IN

IN SQL language

Homework Answers

Answer #1

Question 1:

Correct Answer: b

Explanation:

The subquery is a query which is nested in the other query by using IN operator.

So, only the option 'b' is correct option.

Question 2:

Correct Answer: c

Explanation:

The subquery is a query which is nested in the other query by using IN operator.

So, only the option 'c' is correct option.

Question 3:

Correct Answer: b

Explanation:

The option 'b' select the desired query result because the subquery find the average price and then the main query find the P_CODE which are above or equal to the average price.

So, only the option 'b' is correct.

Question 4:

Correct Answer: c

Explanation:

The 'Group By' clause is used to group the row.

So, option 'c' is correct.

Question 5:

Correct Answer: d

Explanation:

The subquery is a query which is nested in the other query by using IN operator.

So, only the option 'd' is correct option.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1) In which clause of a query can a subquery not be used? (Choose two.) 2)...
1) In which clause of a query can a subquery not be used? (Choose two.) 2) The ORDER BY clause is allowed in an inline view true or false 3) the order by clause is not allowed in subqueries true or false 4) The operators IN and EXISTS are somewhat equivalent true or false 5) this Oracle error message? ORA-01427: single- row subquery returns more than one row >= = IN <= 6) SELECT 'TRUE' FROM dual WHERE 6 =...
Which query lists all products with a total quantity sold less than the average quantity sold?...
Which query lists all products with a total quantity sold less than the average quantity sold? Select one: a. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) < AVG(LINE_UNITS); b. SELECT P_CODE, AVG(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING AVG(LINE_UNITS) < (SELECT AVG(LINE_UNITS) FROM LINE); c. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) < (SELECT AVG(LINE_UNITS) FROM LINE); d. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE...
1, The following query is called_________ SQL>select e.empno,e.ename, m.ename, m.empno from emp e, emp m where...
1, The following query is called_________ SQL>select e.empno,e.ename, m.ename, m.empno from emp e, emp m where e.mgr = m.empno; cross join outer join Self join Full join Natural Joins 2. Steve wants to write a query to display the employee last name, department name, location id, and city of all employees who earn a commission. He wrote the following query. is it true or false. SELECT e.last_name, d.department_name, d.location_id, l.city FROM employees e, departments d, locations l WHERE e.department_id =...
You query data from emp2 table with below SQL statement: SQL> SELECT *     FROM  emp2; NAME SSN...
You query data from emp2 table with below SQL statement: SQL> SELECT *     FROM  emp2; NAME SSN ------------- ------------------------ Joe 452852452 Mary 444525962 Fred 445212525 Tom 492525252 Lucy   172826152   Now, you query data from emp2 table with below SQL statement again: SQL> SELECT AVG(LENGTH(name)) AS column1, SUM(INSTR(ssn, '%@',2,2)) AS column2 FROM  emp2 WHERE name = INICAP(name); What will be displayed for the output of column1 and column2? A. The value in column1 will be 3.5 and the value in column2 will be...
EMPLOYEE Field Name EMP_ID EMP_LNAME EMP_MI EMP_FNAME EMP_SEX EMP_AGE EMP_SALARY EMP_HIREDATE DEPT_CODE Table: DEPARTMENT DEPT_CODE BIOL...
EMPLOYEE Field Name EMP_ID EMP_LNAME EMP_MI EMP_FNAME EMP_SEX EMP_AGE EMP_SALARY EMP_HIREDATE DEPT_CODE Table: DEPARTMENT DEPT_CODE BIOL CPTR HIST MATH RELB Data Type Text Text Text Text Text Number Currency Date/Time Text DEPT_TITLE Biology Computer Science History Mathematics Religion    Field Name DEPT_CODE DEPT_TITLE Data Type Text Text INSTRUCTIONS Use SQL commands to create the tables and enter the data shown above using MS Access. Write the following SQL statement given below: 1. 2. 3. 4. 5. 6. 7. 8. 9....
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table....
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table. SQL provides two different techniques for querying data from multiple tables: • The SQL subquery • The SQL join As you will learn, although both work with multiple tables, they are used for slightly different purposes. We used WMCRM database which is what we created in Lab 4. Here is the summary of the database schema (where schema is used in its meaning of...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). A research field...
1. Write a SELECT statement to count SKUs for each department, i.e., a table of two...
1. Write a SELECT statement to count SKUs for each department, i.e., a table of two columns, departments and their SKU counts. use cape_codd; select department, count(*) from sku_data group by department ; 2. List buyers who is responsible for at least two SKUs, in three columns, department, buyer, sku count. Sort buyers by their department names in ascending order. select department, buyer, count(sku) from sku_data group by buyer ; 3. Write a SQL statement which returns all the orders....
Saul wants to buy a new writer's desk, but he doesn't want to spend more than...
Saul wants to buy a new writer's desk, but he doesn't want to spend more than $350. Write a select statement to find products matching these requirements For each customer, list the customer name and city and state in this format: City, State (one column) Display only those orders where more than one different product has been ordered Find the average price of bookcases A. List all the customers and list the number of different shipping addresses for each. Customers...
1. Long run average costs rise as output (q) increases Select one: a. Economy of Scale...
1. Long run average costs rise as output (q) increases Select one: a. Economy of Scale b. Decreasing Returns to Scale c. Increasing Returns to Scale d. Constant Returns to Scale e. Diseconomy of Scale 2. A production function where the MRTS is constant at all points. Isoquants are straight lines. Select one: a. Production Function b. Isoquant c. Perfect Substitutes Production Function d. Isocost Line e. Technology Function f. Fixed-Proportions Production Function 3. A production function with L-shaped isoquants...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT