Hello and welcome back to another post!
In this post, I would like to go back to basics. I personally think that having a good foundation of something, helps us to understand more complicated things. In this case, I’m going to talk about what is SQL, what is used for and how it can help you.
For this, I’m going to create a series of posts of what I consider basic stuff related to SQL, I hope you like them. Let’s get going.
WHAT IS SQL?
So, SQL is an acronym for Structured Query Language, which is a standard language designed to query and manage data in a relational database management system (or RDBMS). Now, an RDBMS is a database management system based on the relational model, which in turn is based on set theory and predicate theory.
The name SQL comes from a language developed by IBM in the early 1970’s called SEQUEL that was short for Structured English Query Language, but then the name was changed later to SQL because there was a company with that name and had a problem since the name was trademark.
By 1986 it became ANSI and ISO standard, and they have been releasing revisions every few years. So far they have released: SQL-86 (1986), SQL-89(1989), SQL-92 (1992), SQL:1999 (1999), SQL:2003 (2003), SQL:2006 (2006), SQL:2008 (2008), and SQL:2011 (2011), and the most recent is 2016.
SQL is a lot like the English language, and is also very logical. SQL is a declarative language. It requires that you specify what you want to get, not how to get it leaving the RDBMS to figure out how to process your request.
CATEGORIES OF STATEMENTS
SQL has several categories of statements:
- Data Definition Language (DML): Deals with object definition, for example CREATE, ALTER, DROP
- Data Manipulation Language (DML): Used to query and modify data, like SELECT, INSERT, UPDATE, DELETE, TRUNCATE, MERGE
- Data Control Language (DCL): Used for database permissions and includes statements like GRANT and REVOKE
[highlight background=”” color=””]This is highlighted[/highlight]
THE FLAVORS OF SQL
There are a bunch of several RDBMS out there using SQL, or at least a dialect of SQL. For example, this blog is about T – SQL which is Microsoft’s implementation of SQL, which include several non-standard statements. To mention some others we have: MySQL which was accquired by Oracle, which in turn has PL/SQL, we also have PostgreSQL and it also can be extended with its procedural language PL/pgSQL, we have also IBM DB2, SQLite, etc.
PostgreSQL and MySQL became popular because they are open source, which SQL Server and Oracle are not. I’m not sure about others but these are the ones I know and I’ve worked with.
In my opinion, the two that I like the most are SQL Sever and PostgreSQL, not sure why. I guess I feel more comfortable with them, and for example. If you’re like me that I’ve worked more with T – SQL, is not that difficult to pick up another dialect, and now that I think about, PostgreSQL is using the ANSI standard.
Of course there are several things different from T – SQL and PostgreSQL, but they are minimal and should be pretty easy to work with both.
As I already mentioned, this blog is mostly for T – SQL and other Microsoft tools, but I think that it would be a great idea to start posting about the differences about ANSI SQL and T – SQL.
Anyways, I hope you like these series of basics. It might help you reinforce something you learned and for some reason forgot, or maybe learn something you didn’t know. In both cases, please let me know in the comments or you can send me a message through my social networks.
Thanks for reading.
Discover more from Ben Rodríguez
Subscribe to get the latest posts sent to your email.