(Tutorial) What is SQL? – DataCamp

[ad_1]

SQL or structured question language is the native language for interacting with databases and is designed for precisely this goal. It is a language of databases. A database fashions actual-life entities like professors and universities by storing them in tables. Each desk accommodates information from a single entity sort. This reduces redundancy by storing entities solely as soon as. For instance, there solely must be one row of information containing a sure firm’s particulars. Lastly, a database can be utilized to mannequin the connection between entities.

If you wish to know learn how to study the fundamentals of SQL or turn out to be an knowledgeable, take a look at these weblog posts:

Querying Databases

While SQL can be utilized to create and modify databases, this tutorial’s focus shall be on querying databases. A question is a request for information from a database desk (or mixture of tables). Querying is an important ability for a data scientist for the reason that information you want on your analyses will usually dwell in databases.

In SQL, you’ll be able to choose information from a desk utilizing a SELECT assertion. For instance, the next question selects the identify column from the folks desk:

SELECT identify
FROM folks;

In this question, SELECT and FROM are known as key phrases. In SQL, key phrases will not be case-delicate, which implies you’ll be able to write the identical question as:

choose identify
from folks;

That stated, it is good observe to make SQL key phrases uppercase to tell apart them from different components of your question, like column and desk names.

It’s additionally good observe to incorporate a semicolon on the finish of your question. This tells SQL the place the tip of your question is!

SQL Order of Execution

Note: Your question will all the time want a SELECT and a FROM assertion (to determine which columns you need returned from which desk)—the others are non-obligatory.

Example of SELECT

In the next instance, you’ll SELECT the title column from the movies desk.

SELECT title
FROM movies;

When we run the above code, it produces the next outcome:

Try it for your self.

This content material is taken from DataCamp’s Introduction to SQL course by Nick Carchedi.

[ad_2]

Source hyperlink

Write a comment