code-301-reading-notes

View project on GitHub

Introduction to SQL

  • SQL is standard for Structured Query Language.
  • It is a language designed to allow both technical and non-technical users query, manipulate, and transform data from a relational database.
  • SQL databases provide safe and scalable storage for millions of websites and mobile applications.
  • SQLite, MySQL, Postgres, Oracle and Microsoft SQL Server are popular SQL databases.
  • A relational database represents a collection of related (two-dimensional) tables.
  • To retrieve data from a SQL database, we need to write SELECT statements, which are often colloquially refered to as queries.
  • A query is a statement which declares what data we are looking for, where to find it in the database, and optionally, how to transform it before it is returned.
  • Think about database as a table that has columns as properties and rows as instances.
  • Select is used to select properties from a table.
  • The clause is applied to each row of data by checking specific column values to determine whether it should be included in the results or not.
  • You can add a condition using WHERE.
  • DISTINCT keyword will blindly remove duplicate rows