Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Multiple choice. Select the correct letter only. 1. How many rows does the following query produce in the report? select * from sq.employee_donations, sq.employees; employee_donations

Multiple choice. Select the correct letter only.

1. How many rows does the following query produce in the report?

select * from sq.employee_donations, sq.employees;

employee_donations

Employee_ID Qtr1 Qtr2 Qtr3 Qtr4
120265 . . . 25
120267 15 15 15 15
120269 20 20 20 20
120270 20 10 5 .

employees

Employee_ID Name
120265 Panagiotis
120267 Emma
120269 Fatima
120270 Sofia
120272 Owen

a. 4
b. 5
c. 9
d. 20

2. Which code produces a report of only the matches from the employee_donations and employees tables? The results should include each column once.

employee_donations

Employee_ID Qtr1 Qtr2 Qtr3 Qtr4
120265 . . . 25
120267 15 15 15 15
120269 20 20 20 20
120270 20 10 5 .
120280 20 10 10 30

employees

Employee_ID Name
120265 Panagiotis
120267 Emma
120269 Fatima
120270 Sofia
120272 Owen

a.
select Employee_ID, Qtr1, Qtr2, Qtr3, Qtr4, Name from employee_donations as d inner join employees as e on Employee_ID=Employee_ID;
b.
select e.Employee_ID, Qtr1, Qtr2, Qtr3, Qtr4, Name from employee_donations as d inner join employees as e

3.Which result set does the following inner join produce?

select p.Prod_ID, Color, Price from products as p inner join saleitems as s on p.Prod_ID=s.Prod_ID;

products

Prod_ID Color
1 Blue
2 Red
3 Red
. Green
. Blue

saleitems

Prod_ID Price
1 12.99
4 45.99
. .99
. 1.99

a. Result Set 1
Prod_ID Color Price
1 Blue 12.99
. Green .99
. Green 1.99
. Blue .99
. Blue 1.99
b. Result Set 2
Prod_ID Color Price
1 Blue 12.99
. Green .99
. Blue 1.99
c. Result Set 3
Prod_ID Color Price
1 Blue 12.99

4.

Using the products and producttiers tables, complete the following program to produce the desired results of a product and its tier.

select p.Prod_ID, Price, Tiers from products as p inner join productTiers as t on _________________ order by p.Prod_ID;

products

Prod_ID Price
1 125.99
2 90.99
3 1.99
4 11.99
5 1099.99
6 10.99

producttiers

Tiers Low High
Tier 1 0 9.99
Tier 2 10 99.99
Tier 3 100 9999.99

Desired Results

Prod_ID Price Tiers
1 125.99 Tier 3
2 90.99 Tier 2
3 1.99 Tier 1
4 11.99 Tier 2
5 1099.99 Tier 3
6 10.99 Tier 2

a. p.Price <= t.High
b. p.Price >= t.Low
c. p.Price >= t.Low or p.Price <= t.High
d. p.Price >= t.Low and p.Price <= t.High

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is meant by organisational theory ?

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago