SQL (Structured Query Language) is the standard declarative language for working with relational databases. You describe what data you want, and the database decides how to fetch it.
Why it matters
SQL is the common language across PostgreSQL, MySQL, MariaDB, SQLite, and many commercial systems, so skills transfer between them. Statements fall into groups: querying (SELECT), changing data (INSERT, UPDATE, DELETE), defining structure (CREATE, ALTER, DROP), and controlling access or transactions (GRANT, COMMIT). Each vendor adds its own extensions, so portable code needs care.
Example
SELECT name, email
FROM customers
WHERE country = 'IN'
ORDER BY name
LIMIT 10;
This returns the first ten customers from India sorted by name. Nothing in the statement says which index or scan to use; the optimizer chooses.
Common mistakes
- Building queries by concatenating user input into strings, which opens the door to SQL injection. Use parameterized queries.
- Using
SELECT *in application code, which pulls unneeded columns and breaks when the table changes. - Assuming SQL behaves identically everywhere. Date functions, quoting, and
LIMITsyntax differ between systems.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.