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
Alex73 [517]
1 year ago
10

Write an SQL statement to display for every restaurant the name of the restaurant (where the name of the restaurant consists of

more than 10 characters) and for every category of menu item its description (catdesc). Furthermore, display the average; cheapest or lowest; and highest or most expensive price of all menu items in that category at that restaurant. Use single row functions to format all the prices. The average price must be padded; the cheapest price must be rounded; but the highest price must not be rounded. Display only those menu items of which the average item price is more than R40. Sort your results according to the restaurant names and for every restaurant from the most expensive average menu item to the cheapest average menu item. Display your results exactly as listed below.
Computers and Technology
1 answer:
Rainbow [258]1 year ago
4 0

Using the knowledge in computational language in SQL it is possible to write the code that display for every restaurant the name of the restaurant  and for every category of menu item its description.

<h3>Writting the code:</h3>

<em>INSERT INTO Dish </em><em>Values</em><em>(13, 'Spring Rolls', 'ap');</em>

<em>INSERT INTO Dish Values(15, 'Pad Thai', 'en'); </em>

<em>INSERT INTO Dish Values(16, 'Pot Stickers', 'ap');    </em>

<em>INSERT INTO Dish Values(22, 'Masaman Curry', 'en');   </em>

<em>INSERT INTO Dish Values(10, 'Custard', 'ds');   </em>

<em>INSERT INTO Dish Values(12, 'Garlic Bread', 'ap');    </em>

<em>INSERT INTO Dish Values(44, 'Salad', 'ap');    </em>

<em>INSERT INTO Dish Values(07, 'Cheese Pizza', 'en');   </em>

<em>INSERT INTO Dish Values(19, 'Pepperoni Pizza', 'en');    </em>

<em>INSERT INTO Dish Values(77, 'Veggie Supreme Pizza', 'en');</em>

<em />

<em>INSERT </em><em>INTO MenuItem Values(0, 0, 13, 8.00);</em>

<em>INSERT INTO </em><em>MenuItem </em><em>Values(1, 0, 16, 9.00);</em>

<em>INSERT INTO MenuItem Values(2, 0, 44, 10.00);</em>

<em>INSERT INTO MenuItem Values(3, 0, 15, 19.00);</em>

<em>INSERT INTO MenuItem Values(4, 0, 22, 19.00);</em>

<em>INSERT INTO MenuItem Values(5, 3, 44, 6.25);</em>

<em>INSERT INTO MenuItem Values(6, 3, 12, 5.50);</em>

<em>INSERT INTO MenuItem Values(7, 3, 07, 12.50);</em>

<em>INSERT INTO MenuItem Values(8, 3, 19, 13.50);</em>

<em>INSERT INTO MenuItem Values(9, 5, 13, 6.00);</em>

<em>INSERT INTO MenuItem Values(10, 5, 15, 15.00);</em>

<em>INSERT INTO MenuItem Values(11, 5, 22, 14.00);</em>

See more about SQL atbrainly.com/question/13068613

#SPJ1

You might be interested in
On the classic gameshow The Price Is Right, contestants must guess the price of an object (guesses are distinct). The winner is
Kruka [31]

Answer:

The program code is in explaination

Explanation:

Program code below.

def judge(auction,price):

"""

Function: Returns Name who auctioned very near to give price

Input :

auction : list of tuples

price : auction price

output: returns name of best auction amount holder

"""

diff = [] #storing differences between auctionist amount and price

count = 0

for each_pair in auction:

if each_pair[1]<=price:

diff.append(price-each_pair[1])

else:

count+=1

diff.append(each_pair[1])

if count == len(auction): #check for if no one have auctioned good amount

return None

else:

more_possibility_index = diff.index(min(diff)) #finding index of best amount from diff list

return auction[more_possibility_index][0]

auction = [('Alice',430),('Bob',538),('Carol',487),('David',550)]

price = 520

print(judge(auction,price))

I kept the output at the attachment.

3 0
2 years ago
When you use the tilde operator (~ in a url for the attribute of a server control, it represents the _____ directory of the webs
Verizon [17]
The tilde operator represents the root directory of the website.
4 0
3 years ago
Write a statement that defines a double variable named result, initialized with the value 6.759.
In-s [12.5K]

Answer:

"double result=6.759;" is the correct answer for the above question.

Explanation:

  • In c-programming language, the double is a data type which stores the decimal value up to 6 decimal point.
  • This data type takes 8 bytes space in memory when it is used in the c-programming language.
  • When the user wants to declare the double data type, then he should need to declare by the help of the following syntax-- double variable_name_or _identifier_name;
  • When the user wants to declare the double data type and initialize the value on its then he can do this with the help of the following syntax--double variable_name_or _identifier_name= value_which_needs_to_store;
  • The above question asked the one-line statement which declares the result variable of double data type and initializes the "6.759" value on its then he can do this by the help of "double result=6.759;" statement which is described above. Hence the answer is "double result=6.759;".

3 0
3 years ago
Respond to the following in three to five sentences. Select one netiquette guideline. Explain how this helps you draft more effe
slamgirl [31]

Answer:

Keeping as few emoji's as possible. This helps because lots of emoji's can make things confusing and/or annoying. This just means being kind to the person you're messaging and not making things confusing.

8 0
3 years ago
A sample member of the list data is a1 = ['male', True] where the second item is True if the person is on the phone.
Ira Lisetskai [31]
Answer:

0

Explanation:
In the lists, indexation starts from 0, because of that in if statement we compare item[0] which is 'male' and 'male', and then males is itterated within for loop.
8 0
2 years ago
Read 2 more answers
Other questions:
  • Which diagrams represent how roles can affect careers and lifestyles
    11·1 answer
  • How do you add a PDF assignment to google docs and be able to edit it?
    13·1 answer
  • Consider the following recurrence, defined for n a power of 4 (for the time of some algorithm): T(n) = 3 if n = 1 2T(n/4) + 4n +
    10·1 answer
  • ____________ is demonstrated by the processes and procedures that an organization uses to meet the law.A. An auditB. SecurityC.
    15·2 answers
  • What would be a reason for using a workstation rather than a personal computer?
    7·1 answer
  • Which of these is not the correct method for moving text in a document in Word 2016?
    14·2 answers
  • (10 points) A stopwatch has three states named Zero, Running, and Stopped. There are two buttons, named B1 and B2. For each butt
    13·1 answer
  • ___ design uses the same webpage content, but applies styling depending on the viewport size of the device
    11·1 answer
  • In this exercise, you will get some practice with the __add__ method by implementing it for a class called ContactBook. This cla
    12·1 answer
  • One way to protect against a security threat to a computer system is to __________. Avoid external links with inconsistent URLs
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!