Sport Informatics and Analytics/Pattern Recognition/SQL

Introduction
This page introduces Structured Query Language (SQL). There is a wikipedia page on the topic of SQL

An increasing number of job descriptions in sport analytics are requiring experience of SQL and related command and programming skills.

SQL enables the user to communicate with databases. A database is "a tool for collecting and organizing information". Rahul Batra (2018) points out that the most prevalent database model is the relational database. Steve Suehring (2002) pointed out that such databases are speedy, accurate and thorough. They make for the flexible reporting of information.

Chad Brooks (2014) reports: The SQL programming language was first developed in the 1970s by IBM researchers Raymond Boyce and Donald Chamberlin. The programming language, was known then as SEQUEL.

Relational Databases
In 1970, Edgar Codd published his seminal paper on a relational model of data for large shared data banks. Edgar's paper "is concerned with the application of elementary relation theory to systems which provide shared access to large banks of formatted data". Edgar's use of the term relation in the paper is used in its mathematical sense.

Edgar adds: The adoption of a relational model of data, as described, permits the development of a universal data sub-language based on an applied predicate calculus.

In section 1.3 of his paper, Edgar observes: it is proposed that most users should interact with a relational model of the data consisting of a collection of time-varying relationships (rather than relations). Each user need not know more about any relationship than itsname together with the names of its domains (role qualified whenever necessary).

SQL
There is a wikipedia page on the topic of SQL

In 1979, Relational Software released its own version of the SQL language, Oracle V2. Since that time the American National Standards Institute and the International Standards Organization have regarded the SQL language the standard language in relational database communication.

Edgar Codd (1979) published his account of extending the database relational model to capture more meaning. In it, he confirmed: A database system is fully relational if it supports: (1) the structural aspects of the relational model; (2) the insert-update-delete rules; (3) a data sublanguage at least as powerful as the relational algebra, even if all facilities the language may have for iterative loops and recursion were deleted from that language.

The 1981 ACM Turing Award was presented to Edgar Codd. At the Award lecture, Edgar presented a paper titled Relational Database: A Practical Foundation for Productivity.

In his paper, Edgar looked back at database systems and observed: Looking back at the database management systems of the late sixties, we may readily observe that there was no sharp distinction between the programmer's (logical) view of the data and the (physical) representation of data in storage.

He added: installation of these systems was otten agonizingly slow, due to the large amount of time spent in 1earning about the systems and in planning the organization of the data at both logical and physical levels, prior to database activation.

Edgar described the research motivatiuon for relational data models. He the objective was to provide "a sharp and clear boundary between the logical and physical aspects of database management". Edgar defined three objectives of the research:
 * data independence
 * communicability
 * set-processing

He also asked why call the database relational, why not call it tabular? His answer was: There are two reasons: (1) At the time the relational model was introduced, many people in data processing felt that a relation (or relationship) among two or more objects must be represented by a linked data structure (so the name was selected to counter this misconception); (2) Tables are at a lower level of abstraction than relations, since they give the impression that positional (array-type) addressing is applicable (which is not true of n-ary relations), and they fail to show that the information content of a table is independent of row order. Nevertheless, even with these minor flaws, tables are the most important conceptual representation of relations, because they are universally understood.

Edgar concluded his paper with this observation: We have presented a series of arguments to support the claim that relational database technology offers dramatic improvements in productivity both for end users and for application programmers. The arguments center on the data independence, structural simplicity, and relational processing defined in the relational model and implemented in relational database management systems.

Roman Orac (2019) discussed five common mistakes when writing SQL queries.

Bryan Feng (2019) discussed how to learn SQL by using Excel as a bridge.

MySQL
There is a wikipedia page on the topic of MySQL.

MySQL is an open source, relational database management system. It is shared under the terms of the GNU General Public License.It is mostly written in C and C++. MySQL was developed in 1994 by David Axmark and Michael Widenius. In an intereview, Michael was quoted: I have some talents in writing working C code and know a little bit about databases. Some years ago (1994) I put these talents to some use and wrote the MySQL database on top of my old database project that I started in 1982. David Axmark (the second founder of MySQL) and I released it 'open source like' (this was before open source) in 1995 because we wanted do some good and we thought that 'at least we wouldn't get less business by doing this'. The end result did way exceed our expectations.

The first version of MySQL appeared on 23 May 1995.In 2018-2019, 143 developers contributed new code to MySQL.

MySQL is available for different operating systems on a variety of computer architectures.

Chad Brooks (2014) noted: Rather than trying to write an SQL for their own databases, many companies use a database management system that has SQL already built in to it. Developed and distributed by Oracle, MySQL is one of the most popular SQL database management systems currently available. The software is an open source version, which means it can be downloaded and used for free.

Steve Suehring (2002) suggested that what MySQL did best with:
 * Web applications
 * Enterprise-level applications
 * Open-source support
 * Low overhead
 * Large table size
 * Stability

Motion data
Janez Pers and his colleagues (2005) sought to develop an "inexpensive and flexible  way to analyze large amounts of sport motion data, which are generated by automated motion tracking methods and complemented with manual annotations". Their paper uses a database of 100 squash plays to "detect certain kinds of  play,  activities,  certain  predefined  scenarios  and to generate various statistics about these activities – without hard-coding them in the executable code". Their paper provides examples of SQL queries for sport  analysis and they provide a tutorial on aspects of SQL language.