Question

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 = d.department_id AND d.location_id = l.location_id AND e.commission_pct IS NOT NULL;

Group of answer choices

True

False

3.

The PRODUCT table contains these columns:

PRODUCT_ID NUMBER(9)
DESCRIPTION VARCHAR2(20)
COST NUMBER(5,2)
MANUFACTURER_ID VARCHAR2(10)

You want to display product costs with these desired results:

1. The cost displayed for each product is increased by 20 percent.
2. The product manufacturer id must be 25001, 25020, or 25050 but not 25002
3. Twenty percent of the original cost is less than $4.
Note: (select two options)

Which statement should you use?

Group of answer choices

SELECT description, cost * .20
FROM product
WHERE cost * .20 < 4.00 AND manufacturer_id BETWEEN '25001' AND '25050';

SELECT description, cost * 1.20
FROM product
WHERE cost * .20 < 4.00 AND manufacturer_id IN ('25001', '25020', '25050');

SELECT description, cost * 1.20
FROM product
WHERE cost * .20 < 4.00 AND manufacturer_id <> 25002
AND manufacturer_id IN ('25001', '25020', '25050');

SELECT description, cost * .20
FROM product
WHERE cost * .20 < 4.00;

4.

PRODUCT table contains these columns:

ID NUMBER(7) PK
SALE_PRICE NUMBER(7,2)

Evaluate these two SQL statements:

1. SELECT MAX(sale_price), MIN(sale_price), AVG(sale_price)
FROM product;

2. SELECT ROUND(MAX(sale_price),2), ROUND(MIN(sale_price),2), ROUND(AVG(sale_price),2)
FROM product
GROUP BY sale_price;

How will the results differ?

Group of answer choices:

One of the statements will generate an error.

Statement 1 will display a result for each sale price; statement 2 will display a result for each product.

Statement 2 will only display one row of results; statement 1 could display more than one.

Statement 1 will display three values; statement 2 will display three values for each sale price.

Homework Answers

Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Question 1:

Answer :Self join

Explanation :

  • Joining a table to itself is called as self join.
  • In the query given above a table is joined to itself that is emp is joined with emp.

**************************

Question 2:

Answer :True

Explanation :SQL query given in the question will return true because sql query will join three tables employees e, departments d, locations l and will return the result.

**************************

Question 3:

Answer :


SELECT description, cost * 1.20
FROM product
WHERE cost * .20 < 4.00 AND manufacturer_id IN ('25001', '25020', '25050');

SELECT description, cost * 1.20
FROM product
WHERE cost * .20 < 4.00 AND manufacturer_id <> 25002
AND manufacturer_id IN ('25001', '25020', '25050');

Explanation :SQL query given above will list the required result.

**************************

Question 4:

Answer :Statement 1 will display three values; statement 2 will display three values for each sale price.

Explanation :

  • SELECT MAX(sale_price), MIN(sale_price), AVG(sale_price)
    FROM product;
  • Sql statement will display max,min and avg for sale_price.
  • while statement2 will display min,max and avg for each sale price because group by is used.
  • Which will group all the records based on sales price.

**************************

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

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
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...
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;...
With the employee database from practical session 4 loaded, I enter a query on table Emp...
With the employee database from practical session 4 loaded, I enter a query on table Emp that starts with "SELECT workdept, salary, comm FROM Emp" and continues on with a WHERE condition and ends with GROUP BY workdept. Which of the following statements is FALSE for MySQL (as based on the latest version, such as that running on the VDI solution)? The query above will return an error message. If we modify the above query to replace salary by MAX(salary)...
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. 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....
What would be the Mongodb equivalent of the 2 following SQL queries? SELECT A.Lname FROM Assistant...
What would be the Mongodb equivalent of the 2 following SQL queries? SELECT A.Lname FROM Assistant A INNER JOIN Manager Ma ON A.RefNum = Ma.RefNum GROUP BY A.Lname HAVING COUNT(DISTINCT Ma.Manager) > 1; SELECT G.Cname, R.Snum FROM Game G INNER JOIN Role R ON G.Cnum = R.Cnum WHERE G.level>200;
PS8 JULY 1. Log on to your Oracle ApEx account. Navigate to SQL Workshop à SQL...
PS8 JULY 1. Log on to your Oracle ApEx account. Navigate to SQL Workshop à SQL Scripts Create a SQL script called update_demo_orders that contains these update statements: update demo_orders set order_total = 200 where customer_id = 1; update demo_orders set order_total = 15 where customer_id = 2; update demo_orders set order_total = 12 where customer_id = 3; update demo_orders set order_total = 22 where customer_id = 4; update demo_orders set order_total = 32 where customer_id = 5; update demo_orders...
QUESTION 5 The ACCOUNT table contains these columns: ACCOUNT_ID NUMBER(12) NEW_BALANCE NUMBER(7,2) PREV_BALANCE NUMBER(7,2) FINANCE_CHARGE NUMBER(7,2)...
QUESTION 5 The ACCOUNT table contains these columns: ACCOUNT_ID NUMBER(12) NEW_BALANCE NUMBER(7,2) PREV_BALANCE NUMBER(7,2) FINANCE_CHARGE NUMBER(7,2) You must create statements to be mailed to all account holders. Each customer's statement must include the account holder's previous balance and finance charge (0.09 of previous balance) in this format: Previous Balance:   5000 &  Finance Charge: 45 Which SELECT statement will produce these results? A. SELECT Previous Balance: || prev_balance || & Finance Charge: || prev_balance * .009   FROM account; B. SELECT 'Previous Balance:'...
Customers ID Name Street City Zip email 1 Emily 101 Anza St San Francisco 94118 2...
Customers ID Name Street City Zip email 1 Emily 101 Anza St San Francisco 94118 2 Amy 1 Houston Ave New York 12111 3 John 29 Sunset Blvd Los Angeles 45643 4 Pam 800 Market St San Francisco 94080 5 Sue 400 Muir Ave Redwood City 94598 6 Chris 987 A Ave New York 13111 7 Todd 788 Harrison St San Francisco 94117 Products ID Product_name Price Quantity 1 Metal pen 5.99 20 2 Surge protector 25.99 0 3 pencil...
Suppose all the employees got promoted on January 1, 2000. Write an SQL query that will...
Suppose all the employees got promoted on January 1, 2000. Write an SQL query that will output first name, last name, salary, department and date (in a specific format) columns from the Employees table. The first column will be the employee’s first name, the second column will be the employee’s last name, the third column will be the current salary and the fourth column will show the 'Updated salary' of the employees. The updated salary column will be calculated as...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT