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
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...
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....
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...
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...
12. The primary elements forming biomolecules include Select one: a. Carbon, Hydrogen and Oxygen b. Nitrogen,...
12. The primary elements forming biomolecules include Select one: a. Carbon, Hydrogen and Oxygen b. Nitrogen, Potassium and Lithium c. Hydrogen, Nitrogen, and Silicon d. Calcium, Chlorine and Boron Where are nonpolar amino acids of a protein more likely to be found? Check all that apply. Answer options: Select one or more: a. on the surface of soluble proteins b. in the interior of soluble proteins c. on the surface of cell membrane d. embedded in cell membrane Which cellular...
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...
20. Which of the following statements about hypothesis testing is FALSE? Select one: a. A valid...
20. Which of the following statements about hypothesis testing is FALSE? Select one: a. A valid hypothesis should be testable and falsifiable. b. Experiments should be designed to test whether an hypothesis can be rejected. c. Experiments rely on variables and controls to test hypotheses. d. Each variable being tested should have at least one control. e. A control group should have as many distinct features as possible compared to the test group. f. If an hypothesis is inconsistent with...
A negative value for a given slack variable implies: Select one: a. no excess capacity. b....
A negative value for a given slack variable implies: Select one: a. no excess capacity. b. use of more resources than are available. c. none of the above. d. excess capacity. For costs to be a linear function of output: Select one: a. returns to each factor input must be constant. b. input prices must change at a constant rate. c. product prices must be constant. d. returns to scale must be constant. For managerial decision problems analyzed using the...
A cost-output relation for a specific plant and operating environment is the: Select one: a. short-run...
A cost-output relation for a specific plant and operating environment is the: Select one: a. short-run cost curve. b. long-run total cost curve. c. long-run marginal cost curve. d. long-run average cost curve. A firm's capacity is the output: Select one: a. maximum that can be produced in the long-run. b. level where short-run average costs are minimized. c. level where long-run average costs are minimized. d. maximum that can be produced in the short-run. Average cost declines as output...
Question text Which of the following best describes constrained optimization problem? Select one: a. A constrained...
Question text Which of the following best describes constrained optimization problem? Select one: a. A constrained optimization problem is an optimization problem that maintains a priority queue of variables, where the weight of a variable is the number of conflicts in which it participates. b. A constrained optimization problem is an optimization problem that also has hard constraints specifying which variable assignments are possible. The aim is to find an optimal assignment that satisfies the hard constraints. c. A constrained...