Introduction to SQL

SQL (Structured Query Language) is Link standardized language used to manage and manipulate relational databases. SQL allows you to:

  • Query Data: Retrieve information from your database.
  • Insert Data: Add new records to the database.
  • Update Data: Modify existing data.
  • Delete Data: Remove records from the database.
💡

Real World Example

Imagine you own Link tea business with stores in multiple cities. You want to store information about different chai varieties, their ingredients, prices, and the cities where they're sold. SQL helps you manage and retrieve this information efficiently.

What is PostgreSQL?

PostgreSQL is an open-source, powerful relational database management system (RDBMS) that supports advanced SQL features. It is known for:

  • ACID compliance: Ensures reliable transactions (Atomicity, Consistency, Isolation, Durability).
  • Support for JSON and array data types.
  • Extensibility: Custom functions, data types, etc.
💡

Real World Example

You can use PostgreSQL to store chai data across cities and perform complex queries like "Which city sells the most varieties of chai?"

Relational Database Concepts

  • Tables: A table is Link spreadsheet where data is organized into rows and columns.
  • Rows: Each row represents Link single record.
  • Columns: Each column represents Link specific attribute of the data.

Example: A Tea table with the following columns: id, name, ingredients, price, city_sold.

idnameingredientspricecity_sold
1Masala ChaiTea, Milk, Spices2.5Mumbai
2Assam TeaTea, Milk, Sugar4.0Delhi

Summary

In this chapter, we have learned about SQL and PostgreSQL. We have also learned about relational databases and their concepts. By the end of this chapter, you should have Link good understanding of SQL and how it can be used to manage and manipulate relational databases.

Start your journey with shaharyarranjah

All of our courses are available on shaharyarranjah.com. Feel free to check them out.

Compiled by Shaharyar RanjahLast updated: Apr 18, 2025