SQL Introduction

SQL FundamentalsGetting StartedFree Lesson

Advertisement

What is SQL?

SQL (Structured Query Language) is the standard language for working with relational databases.

SQL lets you:

  • Query data — ask questions about your data
  • Insert data — add new records
  • Update data — modify existing records
  • Delete data — remove records
  • Create database objects — tables, views, indexes

💡 SQL is the universal language of data. Every major company uses SQL to manage, analyze, and understand their data.

A Simple SQL Query

-- Find all customers from New York
SELECT first_name, last_name, email
FROM customers
WHERE city = 'New York'
ORDER BY last_name;

Result:

first_namelast_nameemail
AliceJohnsonalice@email.com
BobSmithbob@email.com

What Can SQL Do?

OperationSQL CommandDescription
Query dataSELECTRetrieve data from one or more tables
Insert dataINSERT INTOAdd new rows to a table
Update dataUPDATEModify existing rows
Delete dataDELETERemove rows from a table
Create tablesCREATE TABLEDefine new database tables
Modify tablesALTER TABLEChange table structure
Remove tablesDROP TABLEDelete entire tables

Types of SQL Statements

CategoryFull NameCommands
DDLData Definition LanguageCREATE, ALTER, DROP, TRUNCATE
DMLData Manipulation LanguageSELECT, INSERT, UPDATE, DELETE
DCLData Control LanguageGRANT, REVOKE
TCLTransaction Control LanguageCOMMIT, ROLLBACK, SAVEPOINT

Who Uses SQL?

  • Data Analysts — query data for insights and reports
  • Data Scientists — extract data for analysis and modeling
  • Software Engineers — build data-driven applications
  • Database Administrators — manage and optimize databases
  • Business Analysts — generate business intelligence reports

⚠️ Different databases use slightly different SQL dialects. The fundamentals are the same, but specific functions and syntax may vary between MySQL, PostgreSQL, SQL Server, and SQLite.

✏️ Exercise: Write a SQL query to select the 'name' and 'price' columns from a table called 'products'.

See Solution

SELECT name, price FROM products;

✅ Key Takeaways

  1. SQL is the standard language for relational database management
  2. SQL can query, insert, update, delete, and define data
  3. SQL is used by data professionals across all industries
  4. SQL is declarative — you describe what you want, not how to get it
  5. Practice is the best way to learn SQL

Advertisement

Need Expert SQL Help?

Get personalized SQL training or database consulting.

Advertisement