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
Lera25 [3.4K]
4 years ago
3

Write an SQL statement to display from the Products table the CategoryID, CategoryName, and the sum of Units In Stock grouped by

CategoryID, CategoryName and name the sum Total Products OnHand.Only include products that have 100 or lessin stock(Hint: use aWHERE clause). Only show categories having more than 200 total products in stock(Hint: use a GROUP BY and HAVING clause). Display the results in descending order by Total Products OnHand.
Computers and Technology
1 answer:
anzhelika [568]4 years ago
6 0

Answer:

Select CategoryID, CategoryName, sum(Units_in_stock) as "Total Products On hand"

from Products

where Units_in_stock <= 100

group by CategoryID, CategoryName

having count(Units_in_stock) > 200

order by count(Units_in_stock) desc;

Explanation:

First thing to do is to select the required columns from the Products table. We have used an alias for the "Units_in_stock" column.

Next, is to have the where clause, followed by grouping the results by category Id and name.

And after that, only showing grouped results with more than 200 as the sum value. And finishing it off with the descending order command.

You might be interested in
How do I add my bestie on brainy? /??!!! ​
ziro4ka [17]

Answer:

You have to remember their name on here

Explanation:

If u dont you cant talk to them again

3 0
3 years ago
Write a program (using functions) starting from directives to compute and display the transpose of a matrix of dimension m x n.
pentagon [3]

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int m, n;

void transpose(int matrix[]){

  int transp[m][n];

  for (int i = 0; i < n; i++){

     for (int j = 0; j < m; j++){

        transp[j][i] = matrix[i][j];

        cout<< transp[j][i]<< " ";

     }

     cout<< "\n";

  }

}

int main(){

  cout<< "Enter the value for n: ";

  cin>> n;

  cout>> "Enter the value for m: ";

  cin>> m;

  int mymatrix[n][m];

  for (int i = 0; i < n; i++){

     for (int j = 0; j < m; j++){

        mymatrix[i][j] = (rand() % 50);

     }

  }

  transpose(mymatrix);

}

Explanation:

The C source code defined a void transpose function that accepts a matrix or a two-dimensional array and prints the transpose on the screen. The program gets user input for the row (n) and column (m) length of the arrays. The C standard library function rand() is used to assign random numbers to the array items.

3 0
3 years ago
A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one child cl
Troyanec [42]

Answer:

The answer is A)

Explanation:

In programming languages like java you can only use single inhertance meaning a class can only inherit attributes from one class. But in other languanges like C you can have multiple inhertance

6 0
3 years ago
Give two relative advantages of the GUI over the CL
Juliette [100K]

Answer:

GUI (Graphic User Interface) Can be used for images whereas CL Focuses on Text Imports

Info:

Here's One Try To Finish It With The Other

3 0
3 years ago
Characteristics of 1st generation​ computers
jasenka [17]

Answer:

use of vacume tubes to make circuit

use of punch cards as I/O devices

use of high electricity

use of magnetic drums

use of machine language and symbols in instuctons

4 0
3 years ago
Other questions:
  • Part 3a. Largest power of two less than (10 pts) Implement the method public static int largestPow2LessThan(int n) which calcula
    5·1 answer
  • A ___ is the basic collective unit of data in a computer.
    12·1 answer
  • A/an ___________ is a scheduling tool that sets the standard and nonworking time for the project and is used to assess how tasks
    6·1 answer
  • Help please brainliest
    8·1 answer
  • Why is the cost of a software project not directly related to the cost of development?
    13·1 answer
  • The process of capturing moving images on film or a digital storage device is called?
    6·1 answer
  • Information is data converted into useful, meaningful context. What are data characteristics that change or vary over time?
    8·1 answer
  • What is the CPU's role?
    15·2 answers
  • dash is a set of communication standard using for transferring file information between computers in a network​
    5·1 answer
  • Write a program that uses a while loop to calculate and print the multiples of 3 from 3 to 21. Your program should print each nu
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!