Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Groupings of queries

I would like to understand what might be the highest-level groupings of how query languages can be broken up into, and why one grouping might be fundamentally different than another. For example, the groupings that I have come up with now (for general-purpose usage) are:

  1. Relational
    Example: SQL
  2. Document
    Example: XQuery, JSONPath, MQL (mongoDB)
  3. Graph
    Example: Cypher (Neo4j)
  4. Other possibilities (?)
    Dataframe/pandas? multidimensional (MDX)?

What might be the best high-level grouping to describe various query languages?

like image 596
David542 Avatar asked Oct 27 '20 22:10

David542


People also ask

What is a grouping query?

A GROUP BY statement in SQL specifies that a SQL SELECT statement partitions result rows into groups, based on their values in one or several columns. Typically, grouping is used to apply some sort of aggregate function for each group. The result of a query using a GROUP BY statement contains one row for each group.

What are the 4 types of queries?

They are: Select queries • Action queries • Parameter queries • Crosstab queries • SQL queries.

What is a grouping query in Access?

In Microsoft Access, GROUP BY is a clause you can use to combine records with identical values in a specific field in one record. If you include an SQL aggregate function in the SELECT statement, such as AVG, COUNT, or SUM, Access creates a summary value for each record.


1 Answers

One variant is to group the query language depending on the database categories.

  • relational (Microsoft SQL Server, Oracle, MySQL, MariaDB)
  • object-relational (PostgreSQL)
  • NoSQL
    • Key-value (Riak, Redis, Couchbase Server, MemcacheDB)
    • Columnar (HBase)
    • Document (MongoDV, CouchDB)
    • Graph (Neo4j)

So far, so good, but in reality the border line between the categories become thinner and thinner.

For example, we have graph support in Microsoft SQL Server and T-SQL we have syntax like the following:

-- Find Restaurants that John's friends like
SELECT Restaurant.name 
FROM Person person1, Person person2, likes, friendOf, Restaurant
WHERE MATCH(person1-(friendOf)->person2-(likes)->Restaurant)
AND person1.name='John';

In MongoDB, we have graph,too using graph lookup:

{
   $graphLookup: {
      from: <collection>,
      startWith: <expression>,
      connectFromField: <string>,
      connectToField: <string>,
      as: <string>,
      maxDepth: <number>,
      depthField: <string>,
      restrictSearchWithMatch: <document>
   }
}

So, maybe the the highest-level grouping is just a group of database management system following the American National Standards Institute (ANSI) standards (relational and object-relational) and the others.

like image 183
gotqn Avatar answered Sep 17 '22 08:09

gotqn