in Technology by
What are Aggregate and Scalar functions?

1 Answer

0 votes
by

An aggregate function performs operations on a collection of values to return a single scalar value. Aggregate functions are often used with the GROUP BY and HAVING clauses of the SELECT statement. Following are the widely used SQL aggregate functions:

    • AVG() - Calculates the mean of a collection of values.
    • COUNT() - Counts the total number of records in a specific table or view.
    • MIN() - Calculates the minimum of a collection of values.
    • MAX() - Calculates the maximum of a collection of values.
    • SUM() - Calculates the sum of a collection of values.
    • FIRST() - Fetches the first element in a collection of values.
    • LAST() - Fetches the last element in a collection of values.
  • Note: All aggregate functions described above ignore NULL values except for the COUNT function.

    scalar function returns a single value based on the input value. Following are the widely used SQL scalar functions:

    • LEN() - Calculates the total length of the given field (column).
    • UCASE() - Converts a collection of string values to uppercase characters.
    • LCASE() - Converts a collection of string values to lowercase characters.
    • MID() - Extracts substrings from a collection of string values in a table.
    • CONCAT() - Concatenates two or more strings.
    • RAND() - Generates a random collection of numbers of given length.
    • ROUND() - Calculates the round off integer value for a numeric field (or decimal point values).
    • NOW() - Returns the current data & time.
    • FORMAT() - Sets the format to display a collection of values.

Related questions

0 votes
    I use the function apply whenever I want to do something map py in R I want to know about the ... to replace these entirely? Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    I use the function apply whenever I want to do something map py in R I want to know about the ... questions and answers pdf, Verbal Reasoning interview questions for beginners...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    The scalar factor of Cartesian system is unity. State True/False. (a) True (b) False I ... proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    Cylindrical systems have the following scalar values respectively (a) 1, ρ ,1 (b) 1, 1, ... proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    The scalar factor of spherical coordinates is (a) 1, r, r sin θ (b) 1, r, r ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    The divergence of a vector is a scalar. State True/False. (a) True (b) False This ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    The magnetic vector potential is a scalar quantity. (a) True (b) False I had been asked ... proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    My data looks as follows: ID my_val db_val a X X a X X a Y X b X Y b Y Y b ... JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Is there any possibility to get expected result in simplest way (without intermediate steps, as I did in my code)? I was ... B,D) %>% summarise(across(value_1:value_3, sum)) result...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    My camel route tries to pick up some files from sftp, transfer them to network, and delete them from ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    My initial dataframe looks: library(tidyverse) df...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    My initial dataframe looks: library(tidyverse) df...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    Here is my data: { { "_id" : ObjectId("623a92139e19f99295167786"), "headline" : "headline1", " ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have a domain model with an aggregate root: public interface IAggregateRoot { public string Id { get; } ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
...