Everyone should speak SQL!

Do you know that you use databases everyday? Actually databases are everywhere. When you log  in, your credentials are validated against a database. When you are querying google or bing, a large amount of data get filtered to provide you adequate results. Even your phone contact list is a database too. Etc.

More interestingly, we have entered in the era of data. For example, “Wal-Mart, a retail giant, handles more than 1m customer transactions every hour, feeding databases estimated at more than 2.5 petabytes—the equivalent of 167 times the books in America’s Library of Congress”.

Data

big-data_conew1 by luckey_sun (some rights reserved)

This accumulation of diverse data makes it possible to do many interesting things: spot behavioral or business trends, prevent diseases, extract unknown knowledge, detect fraud and prevent crime and so on.

Such advanced data analytics and data science is out of the scope of this article. First, I will present you what is SQL and what it looks like. Secondly, I will assess the advantages of learning SQL and tell you what is the expected level you should reach.

What is SQL?

SQL (pronounce it “sequel”) stands for Structured Query Language and it is the primary language to interact with Relational Database Management Systems (RDBMS) which are based on the relational model as invented by E. F. Codd.

RDBMS are widely used in the world of databases management systems. There are several alternatives like hierarchical model, object-oriented databases or graph databases. So there are several query languages like SPARQL for RDF graphs or MDX for multi-dimensional analytical databases. Each fits for a specific purpose.

In a relational model, all data are represented in terms of tuples, grouped into relations. More explicitly, data are stored in tables with related tables.

Relational data

Let’s talk of SQL. SQL is a language with a high level of abstraction, similar to natural language, then accessible to everyone.

4 sub-languages

SQL is divided in several sub-languages:

  • Data Definition Language (DDL) statements that are used to define the database structure or schema.
  • Data Manipulation Language (DML) statements that are used for managing data within schema objects.
  • Data Control Language (DCL) statements
  • Transaction Control (TCL) statements that are used to manage the changes made by DML statements.

Not all are necessary for everyone. While some are mainly used by well-defined professional (DDL by database architects, DCL by database administrators and TCL by programmers), DML should be known by everyone who uses databases.

The most known DML statements are the SELECT, INSERT, UPDATE and DELETE (a few people know the other useful statements like the MERGE which is an upsert operation, e.g. INSERT or UPDATE).

As you may see the commands are quite intuitive (SELECT for section for example).

Required level at performing DML queries

SQL queries are quite intuitives. Here is an example:

SQL statement anatomy

Sql statement anatomy by SqlPac. CC-BY-SA-3.0-MIGRATED

As you can imagine, the language allows complex queries with aggregate and analytic functions, recursion, even pattern matching in the Oracle dialect. Since it is a high level language, you have to be very careful with such advanced functionalities to get reliable results.

To understand the power of this language, take a look at the following image. It is the standard way to join data from several table into adequate sets.

SQL join

The different types of SQL join and their outputs as determined by sets, by arbek

Basic level

For basics purpose, you have to know the basics of a relational databases, being able to perform simple SELECT, INSERT and DELETE statements with the restricting WHERE clause and the ordering ORDER BY clause. You should also learn how to deal with dates and nulls, how to use the GROUP BY statement and built-in single row functions.

Intermediate level

For intermediate level, you should know every concepts which are taught in the Querying Microsoft SQL Server 2012 Databases Jump Start (and how to implement it the dialect of the RDMBS you use).

Advanced level

At an advanced level, you should be able to became Oracle certified expert and pass the Oracle Database SQL Expert 1Z0-047 exam.

The advantages of speaking SQL

No more Excel crashing

The RDBMS are designed to be extensively used and do not crash so easily.

Answer advanced questions by yourself

Once the DBAs allowed you to connect to the appropriate databases, you can answer business questions in an advanced manner (far more powerful than Excel spreadsheets). No more need to rely on pre-built reports!

Reproducibility

SQL queries can be saved and then be checked and re-used.

And last, but not least:

Being well-paid

Since employers seek for this skill, you may earn more money. Actually most of people use SQL in a bad way and being certified is a great advantage.




Arecibo Observatory

KIC 8462852 is kind of Wow!

Today I will talk about astrophysics, exobiology and, somehow, metaphysics. I will also submit a personal (counterintuitive) hypothesis that needs confirmation: the Wow! signal, the best clue on extraterrestrial existence ever recorded, may be topologically linked to the star what is hypothesized to be surrounded by a swarm of megastructures!

You have certainly heard of KIC 8462852 recently. It is a star located in the constellation Cygnus which exhibits some strange behavior. More explicitly, unusual light fluctuations were observed by the Kepler telescope (e.g. small non-periodic dips in brightness of inconsistent intensity occurs frequently, up to 22% down).

NGC 6866

Map of NGC 6866, Roberto Mura (KIC 8462852 is nearby)

Amongst the proposed scenarios, these fluctuations could notably be explained by a Dyson swarm which is a hypothetical structure that an advanced civilization might build around a star to intercept some of the star’s light for its energy needs (Type II civilization on the Kardashev scale).

That is why KIC 8462852 raises some hopes in finding an extraterrestrial civilization.

Is it serious to talk of extraterrestrial civilization?

As you may know, water and organic compounds are abundant in the universe. It is realistic to think that the life emerges where conditions for the emergence of life are found. Lee Smolin, a physicist and quantum gravity scholar even proposed a Cosmological natural selection theory (CNS), also known as fecund universes which I personally find interesting.

The hypothesis is cosmological natural selection, and its power, beauty and logic provide what may be the best scientific explanation for the existence of complexity and life in the universe.

 

CNS with intelligence (CNS-I) are models which attempt to bring intelligence and information theory into the CNS framework. They propose that accumulated end-of-universe, or more precisely, end-of-black-hole evolutionary intelligence may somehow aid in universe/black hole replication and selection within the multiverse. These models assume that any universe where emergent intelligence was able to play a less-than-random role in replication or selection might become replicatively favored, more resilient, or perhaps dominant in some multiversal environment, over lineages where emergent intrauniversal intelligence does not increasingly factor into replication, as in Smolin’s original CNS model. – Cosmological Natural Selection, evodevouniverse.com

Some people go further and defend the idea of an intrinsic support for intelligence emergence through a strong anthropic principle. Giulio Tononi of the University of Wisconsin–Madison proposed the Integrated information theory (IIT) which is a framework intended to understand and explain the nature of consciousness. According to this theory, even subatomic particles possesses subjective experience. I admit it is a strong hypothesis that can sounds weird to you.

Arecibo Observatory

More interestingly, several scientists think that the dominant life form in the Cosmos is probably superintelligent robots which is not a stupid idea. Actually the most recent advances in NBIC tend to suggest that we are near the singularity, the moment where artificial intelligence overtakes human thinking (e.g. System that replaces human intuition with algorithms outperforms human teams and Kurzweil predicts that by 2045 computers will be a billion times more powerful than all of the human brains on Earth). I personally believe in the powerful combination of AI, information theory and semantic Web.

Considering all I have mentioned, and the tendency to break down barriers between scientific disciplines and even between metaphysics and science, I think that we will see both the singularity and the discovery of simple forms of life on potential candidates in our solar system (Enceladus and Mars for the best candidates… Titan or even Pluto for a radically different biology, maybe based on methane and tholins). Since we may soon reach the technological singularity, and considering both the number of potential habitable worlds in the universe and the age of some solar systems, the eventuality of advanced alien lifeforms should not be discarded so easily.

But, (yes, there is still a but), the so-called Fermi paradox that is the apparent contradiction between high estimates of the probability of the existence of extraterrestrial civilizations and the lack of evidence for such civilizations. Amongst all the hypothetical explanations, several allow the eventuality of abundance of alien life which would be really difficult to identify.

Detection of advanced civilization and the Wow! signal

One of the well-known techniques to identify an “advanced” civilization is to monitor electromagnetic radiation for signs of transmissions from civilizations on other worlds. It is hypothesized that we are able to discover a civilization through their radio signals.

Wow! signal

To my opinion, such a civilization would emit in a detectable manner on rare occasions. That is precisely the point. The Wow! signal “was a strong narrowband radio signal detected by Jerry R. Ehman on August 15, 1977, while he was working on a SETI project at the Big Ear radio telescope of The Ohio State University”. The best candidate of extraterrestrial radio emission that hasn’t been detected again.

A link between the Wow! signal and KIC 8462852?

Disclaimer: The following hypothesis needs further investigations but is still interesting to be shared with you.

The Wow! signal appears to have come from the northwest of the globular cluster of M55 in the constellation Sagittarius, near the Chi Sagittarii star group.

How the Wow! signal and KIC 8462852 could possibly be related? Let me explain it.

Almost everyone think that the universe is infinite and flat. In the Poincaré Dodecahedral Space (PDS) model, the universe is a dodecahedron (a spherical 3-manifold). Such a topology can be detected.

An international team of cosmologists, led by a researcher from Paris Observatory, has improved the theoretical pertinence of the Poincaré Dodecahedral Space (PDS) topology to explain some observations of the Cosmic Microwave Background (CMB). In parallel, another international team has analyzed with new techniques the last data obtained by the WMAP satellite and found a topological signal characteristic of the PDS geometry.

– The Poincaré Dodecahedral Space model gains support to explain the shape of space, Observatoire de Paris

The correlated circles of universe from WMap data suggests that the universe is a dodecahedron. It means that several directions in the space would actually be the same.

PDS

Visualization of the matched circles solution reported in Roukema et al. 2004

In an ideal world, KIC 8462852 and the Wow! signal would be located in the same area. Which could be the case in a universe with a PDS topology.

Guess what?

If you superimpose the WMap correlated circles (“they would represent the same physical points but observed from different directions due to topological lensing”) onto a sky map then you will see that the Wow! signal and KIC 8462852 are possibly in the same direction in a PDS topology !

As far as I know, both maps were made according to the galactic coordinate system that make the superimposition a valid one. Correct me if I’m wrong.

Superimposition

Tadaa! The maps superimposition.

As you may see, the Wow! signal & KIC 8462852 are located in different directions… but in a PDS topology these directions are actually the same. Indeed, the Sagittarius area where the Wow! signal has originated and the Cygnus area where KIC 8462852 is located are in two correlated areas (i.e. the same physical point in a dodecahedral universe).

I must confess, there is uncertainty in the exact location (still large area considered) and the PDS theory is still not fully proven but this raises new hopes for finding extraterrestrial life!

PS:

The aim of science is to seek the simplest explanation of complex facts. We are apt to fall into the error of thinking that the facts are simple because simplicity is the goal of our quest. The guiding motto in the life of every natural philosopher should be “Seek simplicity and distrust it.” – Alfred North Whitehead