Structured Query Language (SQL) is the most commonly used language when working with relational databases. The language can be used for much more than simple queries, despite its name. It can also be used to perform all operations necessary to create and maintain databases.
Advantages of the Structured Query Language
The structured query language provides many functions to read, modify or delete data. In addition, it is preferred by many analysts over other languages for the following reasons:
- It is semantically very easy to read and understand. The commands can be interpreted to a large extent even by beginners.
- The language can be used directly within the database environment. For basic work with information, the data does not have to be transferred from the database to another tool first. Simple calculations and queries are possible directly in the database.
- Compared to other spreadsheet tools, such as Excel, data analysis with Structured Query Language can be easily replicated and copied because everyone has access to the same data in the database. Thus, the same query always leads to the same result.
SQL provides an alternative to the kind of summaries and calculations that most perform in Excel spreadsheets, such as totals, averaging, or finding the maximum within a column. These calculations can also be performed over multiple data sets simultaneously.
Categories of SQL commands
The Structured Query Language can be used for all kinds of work-related to relational databases. Therefore, we distinguish a total of three categories of commands.
|Data Manipulation Language||– Inserting data into an existing table|
– Updating data
– Deleting table rows
– Selecting data from tables under certain conditions.
|Data Definition Language||– Creation, modification, and deletion of tables|
|Data Control Language||– Administrative tasks|
– Creating new users
– Granting access to parts of the database
Data types in the Structured Query Language
If we want to create a table in a relational database, we always have to specify a data type that is to apply to the individual columns. All data, which are added over time, must then also correspond to this schema.
The most popular data types are the following:
- Integer: For integers without decimal places. These can be both positive and negative.
- Numeric or Decimal: These are used for the so-called fixed-point numbers, i.e. there is a fixed number of digits before and after the decimal place. If we want to define booleans, i.e. columns that accept only one of two values, we also use numeric.
- Float, Real or Double: We use these types for floating-point numbers. These are numbers that do not have a fixed number before and after the decimal place.
- Character and Text: For all types of strings.
- Date and Time: These data types can be used for all columns where we want to store date or time information.
In addition, there are of course significantly more data types that we can use in the Structured Query Language. Depending on the use case, the data types and their advantages and disadvantages must be evaluated.
How do you pronounce SQL?
If you have read this article so far and wondered from the beginning how to pronounce the abbreviation SQL, we are sorry to disappoint you. This will probably remain a mystery forever. In general, there are two camps: S-Q-L and “Sequel”. You can find a detailed article on this topic here. The author actually asks one of the inventors of SQL, Don Chamberlin, this very question.
This is what you should take with you
- The Structured Query Language can be used for all work around a relational database.
- This includes, for example, the creation of new tables, the definition of user permissions, and of course the query of data.
- When we create new tables we have to define the data types in the schema. For this, there are some classic data types, like integer, float, or date.
- Unfortunately, it is still not finally clarified whether the abbreviation of Structured Query Language is pronounced S-Q-L or “Sequel”.
Explanation of the Apache Hadoop Distributed File System with examples and benefits.
Other Articles on the Topic of SQL
- You can find a detailed tutorial for the query language here.