What is SQL and Why learn SQL?

emilyscone·2021년 1월 13일
0

SQL

목록 보기
1/1
post-thumbnail

SQL

SQL is a standard learning for storing, manipulating and retrieving data in databases.

Use SQL to do math like sum average etc. utilize it for grouping one to many relational values like getting categories of product. Leverage SQL for string manipulation like CONCAT_WS for concating first name and last name. Exploit SQL to sort by a custom priority formula.

Why learn SQL?

Nader Dabit recently pointed out the most web apps are basically** lists and forms **( and you can build a pretty solid career around making those lists and forms)

Nader Dabit is a web and mobile developer, who specializes in building cross-platform and cloud-enabled applications. @Amazon

But what Happens to the data submitted in those forms, and where does the content that populates thoses lists come from? Nader hinted at the answer: Usually it's an API that talks to a database.

SQL is the language of databases. If you want to understand what you are hooking those lists and forms into, what they represent to the application, SQL is the best tool for exploration and understanding.

These days direct knowledge of SQL isn’t strictly necessary for writing software backed by a database. We can build web apps with Rails learning on an ORM so that we never even see SQL, but that is a surefire way to build inefficient applications.

**Object-relational Map **

Object-relational mapping (ORM, O/RM, and O/R mapping tool)
in computer science is a programming technique for converting data between incompatible type systems using object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language.

If you are not a web developer learning SQL might seem less interesting, but SQL databases aren’t used exclusively in web apps. SQL is used all over your operating system, it is used to build mobile apps, and if you have any interest in data science or business analysis, SQL is a necessary tool.

More data? SQL is everywhere, it shows up every single year on StackOverFlow’s Developer Survey.

Most popular programming languages according to StackOverFlow:

2020

2019

If SQL is running all over the place, most developers should have a grasp on the basics. It is a marketable skill and a super useful one, so a better question might be “why not learn SQL?”


What is SQL?

Structured Query Language is a programming language that dates back to the 70s, but it is still in wide use today. Even DEV is running SQL queries to show the content you are browsing as well.

Developers use SQL to interact with databases. If you ‘ve built websites using Rails or Django, you are probably familiar with using Ruby or Python to interact with a database, but in reality your application is generating SQL based on the code you wrote in Ruby or python.

When we write SQL we are usually trying to accomplish one of four CRUD actions or we are directly administering a database. We will talk more about CRUD later, but you should know that CRUD actions are all about manipulating data. For example, we might store sales records in our database and need to change a record to reflect a refund or discount. We might want to figure out how many of our customers bought christmas trees in august. Those are tasks we can tackle with SQL.

SQL is largely unique from the modern programming languages we used to build websites, mobile apps, and video games.

We can describe one of the biggest distinctions between SQL and a language like Ruby in one word: declarative. SQL is a “declarative” programming language. In layman’s terms, this means that** when we write SQL we don’t typically need to scribe how our code runs, rather we just declare what we want to happen.**

Here is some SQL-like pseudo-code that might clarify the idea:

# We want a list of Twitter usernames
#for all the user accounts on DEV

Show me every DEV user's Twitter username
From the database's user table
Where the user has linked a twitter account

If You’ve seen SQL before, you might notice some similarities between this pseudo-code and a real-world query that would return a similar dataset:

SELECT twitter_username
FROM users
WHERE twitter_username IS NOT NULL

This SQL doesn’t look much like the code we write in JavaScript.
that ‘s probably because in those languages we’d have to tell the programming language a lot more about retrieving information from the computer’s memory. In SQL, we just tell the computer what information we want, not how to retrieve that information.

There is a lot of information online about the history and development of SQL, but I think this is enough information for the conversion rolling.

profile
Hello world

0개의 댓글