1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
klemol [59]
3 years ago
11

Harry Potter and his friends are at Ollivander's with Ron, finally replacing Charlie's old broken wand. Hermione decides the bes

t way to choose is by determining the minimum number of gold galleons needed to buy each non-evil wand of high power and age. Write a query to print the id, age, coins_needed, and power of the wands that Ron's interested in, sorted in order of descending power. If more than one wand has same power.
Computers and Technology
1 answer:
Step2247 [10]3 years ago
4 0

Answer:

SELECT a.id, ab.age, b.min_coins_needed, b.power

FROM(SELECT code, power, min(coins_needed) AS min_coins_needed

 from Wands

 group by power, code) AS b

JOIN Wands wa

 ON a.coins_needed = b.min_coins_needed AND a.code = b.code AND a.power = b.power

JOIN Wands_property AS ab  

 ON a.code = ab.code  

WHERE ab.is_evil = 0          

ORDER BY b.power desc, ab.age DESC;              

Explanation:  

SELECT statement is used to select the columns id, age, coins_needed and power of the wands that Ron's interested in.

It is required to get the minimum coins_needed so, min() aggregate function is used to return the minimum value of coins_needed. So this is how minimum coins needed for wands with same age and power are attained and the resultant set is given the name of min_coins_needed  using alias. This is then grouped by code and power using GROUP BY because code and age has one to one mapping.

Next the JOIN is used to combine columns from two or more relations. Here Wands and Wands_property are joined to obtain id and age.

WHERE clause is used to filter the wands that are not evil.

ORDERED BY is used to sort in order of power and age, the result obtained. DESC is used to sort the result in descending order of power and age.

You might be interested in
What is one difference between a web page and a web application? Web pages provide information, while web applications allow the
Assoli18 [71]

Webpage is a page of a site, such as https://example.com/test, where the bolded text is the page.

On the other hand, web applications, or simply web apps, are found in many websites, such as here and also in Connexus. They end in either aspx or jsp, which stand for asp.net appx and javascript page, respectively.


So, your answer would be A: Web pages provide information, while web applications allow the user to do something.

Hope this was answer you were looking for. Have a nice day!

7 0
3 years ago
Please describe the role of games in modern society!
ohaa [14]
It is to Entertainment.
5 0
2 years ago
Read 2 more answers
The term "resolution" refers to ______.
Usimov [2.4K]

Options A and C can get you confused. We can choose option A if our argument is based entirely on digital images. The correct answer, however, is  C: Number of pixels you see on your computer monitor.

Resolution describes the clarity and sharpness of a picture that can be measured by the number of pixels contained on a display monitor. It can be expressed by the number of horizontal (width) and vertical pixels (height) represented by a screen. The clarity and sharpness are always dependent on the resolution and size of the monitor.

4 0
3 years ago
Read 2 more answers
Using a tag, set the color to green for all tags.
nordsb [41]

Answer:

<style>

p {

background-color: rgb(255, 0, 0);

}

h1 {

background-color: rgb(0, 255, 0);

}

ol {

background-color: rgb(97,51,47);

}

</style>

Explanation:

Put this at the top of your code. It should target the paragraph tag, the header h1 tag, and the Ordered List (OL) tag individually and set their background colors respectively.

It's been a while since I've done CSS so you might have to tweak the syntax a bit, but it should look something like that.

5 0
3 years ago
Use the drop-down menu to complete the sentences about the benefits of flowcharts.
mojhsa [17]

Answer:

c,a,c using the drop down menus edge 2021

GOODLUCK

Explanation:

4 0
3 years ago
Other questions:
  • Gloria needs to show in spreadsheet form the number of students in her class who speak different languages. Which type of graph
    7·1 answer
  • Your phone's battery dies -- no Internet for you! When you get home hours later, you plug in the charger and turn your phone bac
    6·1 answer
  • A specially formatted encrypted message that validates the information the CA requires to issue a digital certificate is known a
    6·1 answer
  • To communicate with an expansion card, one part of the ____ bus runs between RAM and the processor; the other part runs between
    13·1 answer
  • What is the purpose of the Occupational Safety and Health Act?
    7·2 answers
  • How do you change the name on your brainly account?
    12·1 answer
  • NBA bank uses centralized client server database that is accessed by all its nationwide branches. All customers' records are sto
    14·1 answer
  • Identify the correct characteristics of Python tuples. Check all that apply.
    9·1 answer
  • Calculate the resistance of an unknown resistor in a circuit with 30 volts and 6 amps. The formula is R = V/I.
    6·1 answer
  • when demonstrating 2022 altima’s parking assistance, what steering feature should you mention when pointing out how easy the veh
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!