Structured Query Language | SQL

Dory
Dory
Jul 27, 2017 · 1 min read

A brief introduction to databases, SQL, and common SQL data types.

The basics:

A database is a systematic collection of information that can be accessed and maintained. Think spreadsheet. SQL is the most common language used to “talk” to databases; it is a standard language used to store and *query* (request, retrieve, and render) data.

It is important to take note of data types, especially when working with relational database structures because data types are pre-defined. Relational Database Management System (RDBMS) are used to manage or interact with information stored in relational databases. There are many RDBMS “vendors,” including: PostgreSQL, Oracle, MySQL, SQL Server, and Sqlite3 — they all “speak” standard SQL however, each also has their own “dialect” or vendor specific syntax to perform data queries.

Defining data types is important because 1) it allows data to be organized in a consistent format, 2) it helps determine what calculations can be performed when querying data, and 3) it affects space, storage, and performance.

Some common data types (regardless of vendor unless otherwise indicated) are illustrated in the diagram below.

References:

https://www.w3schools.com/sql/sql_datatypes.asp

https://www.postgresql.org/docs/9.5/static/datatype.html

http://slides.com/devleague/intro-sql#/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade