4) SQL and Data Management
TOPIC OF THE CLASS:
Introduction to SQL
SQL Components
Tables and Schemas
Basic SQL Queries
Joins
Subqueries
Aggregation & Grouping
… Oct 2024
Introduction to SQL
Standard language for querying and manipulating data
Structured Query Language
SQL is a domain-specific language used in programming and designed for managing data held in a relational database management system
(RDBMS), or for stream processing in a relational data stream management system (RDSMS).
A query is a request to retrieve specific information from one or more database tables.
Characteristics
Data stored in columns and tables
Relationships represented by data
Data Manipulation Language
Data Definition Language
Abstraction from physical layer
Transactions
Big Fail or Big Win?
SQL – Big Fail? SQL – Big Win?
Users must specify how to retrieve data
(procedural) rather than just what
Declarative: users only specify
what they want
Declarativity
Declarativity: "What, not How"
No need to write the whole code because the system is automatically choosing the best option available.
Versions
SQL 1999 - Turing Complete
SQL is not a programming language, it is a declarative language (not procedural). In SQL you just declare your needs, you do not write
the procedure to find it. It describes what, not how, which will be solved by the database. The program finds the query optimization.