Database management system Updated +Created
A software that implements some database system, e.g. PostgreSQL or MySQL are two (widely extended) SQL implementations.
Gordon Linoff Updated +Created
Infinitely many SQL answers.
As mentioned at Ciro Santilli's Stack Overflow contributions, he just answers every semi-duplicate immediatly as it is asked, and is therefore able to overcome the Stack Overflow maximum 200 daily reputation limit by far. E.g. in 2018, Gordon reached 135k (archive), thus almost double the 73k yearly limit due to the 200 daily limit, all of that with accepts.
This is in contrast to Ciro Santilli's contribution style which is to only answer questions as he needs the subject, or generally important questions that aroused his interest.
2014 Blog post describing his activity: blog.data-miners.com/2014/08/an-achievement-on-stack-overflow.html, key quote:
For a few months, I sporadically answered questions. Then, in the first week of May, my Mom's younger brother passed away. That meant lots of time hanging around family, planning the funeral, and the like. Answering questions on Stack Overflow turned out to be a good way to get away from things. So, I became more intent.
so that suggests his contributions also take a meditative value.
www.data-miners.com/linoff.htm mentions he's an SQL consultant that consulted for several big companies.
LinkedIn profile: www.linkedin.com/in/gordonlinoff/ says he now works at the New York Times.
2021 Reddit thread about him: www.reddit.com/r/programming/comments/puok1h/a_single_person_answered_76k_questions_about_sql/ mentions that by then he had:
answered 76k questions about SQL on StackOverflow. Averaging 22.8 answers per day, every day, for the past 8.6 years.
How to decide if an ORM is good? Updated +Created
How to decide if an ORM is decent? Just try to replicate every SQL query from nodejs/sequelize/raw/many_to_many.js on PostgreSQL and SQLite.
There is only a very finite number of possible reasonable queries on a two table many to many relationship with a join table. A decent ORM has to be able to do them all.
If it can do all those queries, then the ORM can actually do a good subset of SQL and is decent. If not, it can't, and this will make you suffer. E.g. Sequelize v5 is such an ORM that makes you suffer.
The next thing to check are transactions.
Basically, all of those come up if you try to implement a blog hello world world such as gothinkster/realworld correctly, i.e. without unnecessary inefficiencies due to your ORM on top of underlying SQL, and dealing with concurrency.
IBM Updated +Created
As of the 2020's, a slumbering giant.
But the pre-Internet impact of IBM was insane! Including notably:
Isolation (database systems) Updated +Created
Determines what can or cannot happen when multiple queries are running in parallel.
See Section "SQL transaction isolation level" for the most common context under which this is discussed: SQL.
Nested set model Updated +Created
This is particularly important in SQL: Nested set model in SQL, as it is an efficient way to transverse trees there, since querying parents every time would require multiple disk accesses.
As a tree:
  • Root 1
    • Child 1.1
      • Child 1.1.1
      • Child 1.1.2
    • Child 1.2
      • Child 1.2.1
      • Child 1.2.2
As the sets:
 __________________________________________________________________________
|  Root 1                                                                  |
|   ________________________________    ________________________________   |
|  |  Child 1.1                     |  |  Child 1.2                     |  |
|  |   ___________    ___________   |  |   ___________    ___________   |  |
|  |  |  C 1.1.1  |  |  C 1.1.2  |  |  |  |  C 1.2.1  |  |  C 1.2.2  |  |  |
1  2  3___________4  5___________6  7  8  9___________10 11__________12 13 14
|  |________________________________|  |________________________________|  |
|__________________________________________________________________________|
Consider the following nested set:
0, 8, root
  1, 7, mathematics
    2, 3, geometry
      3, 6, calculus
        4, 5, derivative
        5, 6, integral
      6, 7, algebra
  7, 8, physics
When we want to insert one element, e.g. limit, normally under calculus, we have to specify:
  • parent
  • index within parent
so we have a method:
insert(parent, previousSibling)
Nested set model in SQL Updated +Created
How to implement Nested set model in SQL:
Oracle Corporation Updated +Created
Evil company that desecrated the beauty created by Sun Microsystems, and was trying to bury Java once and or all in the 2010's.
Their database is already matched by open source e.g. PostgreSQL, and ERP and CRM specific systems are boring.
Oracle basically grew out of selling one of the first SQL implementations in the late 70's, and notably to the United States Government and particularly the CIA. They did deliver a lot of value in those early pre-internet days, but now open source is and will supplant them entirely.
Sequelize raw query Updated +Created
Exampes under nodejs/sequelize/raw:
List topics on home page Updated +Created
The new default homepage for a logged out user how shows a list of the topics with the most articles.
This is a reasonable choice for default homepage, and it immediately exposes users to this central feature of the website: the topic system.
Doing this required in particular calculating the best title for a topic, since it is possible to have different titles with the same ID, the most common way being with capitalization changes, e.g.:
JavaScript
Javascript
would both have topic ID javascript.
With this in place we also added the preferred topic title to the top topic page.
The algorithm chosen is to pick the top 10 most upvoted topics, and select the most common title from amongst them. This should make topic title vandalism quite hard. This was made in a single SQL query, and became the most complext SQL query Ciro Santilli has ever written so far: twitter.com/cirosantilli2/status/1549721815832043522
Figure 1.
Screenshot showing the list of topics
. The page is: ourbigbook.com for the logged out user, ourbigbook.com/go/topics for the logged in user.
Figure 2.
Screenshot showing a topic page
. The page is: ourbigbook.com/go/topic/vector-space. Before this sprint, we didn't have the "Vector Space" at the top, as it wasn't necessarily trivial to determine what the preferred title would be.
SQL example Updated +Created
We have some runnable SQL examples with assertion under the sequelize/raw directory.
These examples are written in the Sequelize library using raw queries.
Sequelize is used minimally, just to feed raw queries in transparently to any underlying database, and get minimally parsed results out for us, which we then assert with standard JavaScript. The queries themselves are all written by hand.
By default the examples run on SQLite. Just like the examples from sequelize example, you can set the database at runtime as:
  • ./index.js or ./index.js l: SQLite
  • ./index.js p: PostgreSQL. You must manually create a database called tmp and ensure that peer authentication works for it
Here we list only examples which we believe are standard SQL, and should therefore work across different SQL implementations:
SQL TRIGGER Updated +Created
SQL's implementation of database triggers.
This feature is really cool, as it allows you to keep caches up to date!
In particular, everything that happens in a trigger happens as if it were in a transaction. This way, you can do less explicit transactions when you use triggers. It is a bit like the advantages of SQL CASCADE.
Stack Exchange Data Explorer Updated +Created
Allows you to use SQL (T-SQL because the site is coded in Microsoft) to query the public database. It is quite cool.