📘 SERIES · CHAPTER 36

Working with Databases India 2026

MySQL, PostgreSQL, and BigQuery — how to set them up, design schemas, write production-quality queries, and connect them to Power BI and Python as a data analyst in India.

⏱ 16 min read📅 September 2026📍 India · Noida · Delhi NCR
← Ch 35: Data Ethics & PrivacyCh 37: Senior Analyst & Career Growth →

MySQL vs PostgreSQL vs BigQuery — which to use when

Most data analyst jobs in India involve at least one of these three databases. Understanding the differences helps you know what to learn first and what questions to ask in interviews.

MySQLPostgreSQLBigQuery
TypeRelational (RDBMS)Relational (RDBMS)Cloud data warehouse
Where it runsYour own server / laptopYour own server / laptopGoogle Cloud (no local install)
CostFree (Community Edition)Free (open source)Free tier: 1 TB queries/month
Best forTransactional data, web apps, small-medium datasetsComplex queries, JSONB, large datasetsVery large datasets, petabyte scale
SQL dialectMySQL SQLANSI SQL (most standard)BigQuery SQL (standard SQL)
Window functionsBasic supportExcellent — full ANSI supportExcellent — full support
Common atIndian startups, IT companies, e-commerceLarger tech companies, SaaSCompanies using Google Cloud / GCP
GUI toolMySQL Workbench (free)pgAdmin (free), DBeaver (free)BigQuery Console (web browser)
Learn first?✅ Yes — most common in IndiaSecond — after MySQLThird — when ready for cloud

MySQL — install, connect, and build your first database

Step 1 — Install MySQL on Windows (free)

  1. Go to dev.mysql.com/downloads/installer — download MySQL Installer for Windows
  2. Run the installer → choose "Developer Default" (includes MySQL Server + Workbench)
  3. Set a root password — write it down, you need it every time
  4. Accept defaults for port (3306) and service name
  5. Open MySQL Workbench → click the localhost connection → enter root password
Mac users: Install via Homebrew — brew install mysql then brew services start mysql. Use DBeaver or TablePlus as a GUI (both free).

Step 2 — Create a practice database and tables

SQL — CREATE DATABASE AND TABLES
-- Create the database
CREATE DATABASE evika_practice;
USE evika_practice;

-- Customers table
CREATE TABLE customers (
  customer_id   INT AUTO_INCREMENT PRIMARY KEY,
  name          VARCHAR(100)        NOT NULL,
  city          VARCHAR(50),
  signup_date   DATE                NOT NULL,
  email         VARCHAR(150)        UNIQUE
);

-- Orders table
CREATE TABLE orders (
  order_id      INT AUTO_INCREMENT PRIMARY KEY,
  customer_id   INT                 NOT NULL,
  order_date    DATE                NOT NULL,
  amount        DECIMAL(10,2)       NOT NULL,
  status        ENUM('completed','returned','pending') DEFAULT 'pending',
  FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);

-- Products table
CREATE TABLE products (
  product_id    INT AUTO_INCREMENT PRIMARY KEY,
  name          VARCHAR(200)        NOT NULL,
  category      VARCHAR(100),
  price         DECIMAL(10,2)       NOT NULL,
  stock_qty     INT                 DEFAULT 0
);

Step 3 — Insert sample data and run analytical queries

SQL — INSERT AND ANALYSE
-- Insert sample customers
INSERT INTO customers (name, city, signup_date, email) VALUES
  ('Priya Sharma',   'Noida',   '2025-01-15', 'priya@example.com'),
  ('Rahul Gupta',    'Delhi',   '2025-02-01', 'rahul@example.com'),
  ('Anita Verma',    'Gurugram','2025-02-20', 'anita@example.com'),
  ('Saurav Mehta',   'Noida',   '2025-03-10', 'saurav@example.com');

-- Insert sample orders
INSERT INTO orders (customer_id, order_date, amount, status) VALUES
  (1, '2025-03-01', 1250.00, 'completed'),
  (1, '2025-04-15', 850.00,  'completed'),
  (2, '2025-03-20', 3200.00, 'returned'),
  (3, '2025-04-01', 580.00,  'completed'),
  (4, '2025-04-20', 2100.00, 'pending');

-- Analytical query: revenue by city, last 6 months
SELECT
  c.city,
  COUNT(DISTINCT o.order_id)    AS total_orders,
  SUM(o.amount)                 AS total_revenue,
  ROUND(AVG(o.amount), 2)       AS avg_order_value
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
WHERE o.status = 'completed'
  AND o.order_date >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH)
GROUP BY c.city
ORDER BY total_revenue DESC;

Step 4 — Connect MySQL to Power BI

  1. Download MySQL ODBC Connector from dev.mysql.com/downloads/connector/odbc (free)
  2. Open Power BI Desktop → Get Data → MySQL Database
  3. Server: localhost | Database: evika_practice | Data Connectivity mode: Import
  4. Enter root as username and your password → OK
  5. Select your tables from the Navigator → Load
  6. Build your reports normally — data now comes from MySQL

PostgreSQL — what makes it more powerful than MySQL

PostgreSQL has stronger support for advanced SQL features that data analysts use heavily — especially window functions and handling semi-structured data.

Window functions
PostgreSQL: ✅ Full ANSI support — ROWS/RANGE, FILTER, all frames
MySQL: ⚠️ Basic — some advanced frames not supported
JSONB columns
PostgreSQL: ✅ Native JSON storage with indexing and fast queries
MySQL: ⚠️ JSON support exists but slower, less featured
CTEs (WITH clause)
PostgreSQL: ✅ Materialised and non-materialised, recursive
MySQL: ✅ Supported (v8.0+) — recursive CTEs available
Full-text search
PostgreSQL: ✅ Built-in, powerful, no extra tools needed
MySQL: ⚠️ Available but more limited
DISTINCT ON
PostgreSQL: ✅ Very useful for getting latest row per group
MySQL: ❌ Not available — need subquery workaround
Data types
PostgreSQL: ✅ Arrays, ranges, UUID, geometric types built in
MySQL: Standard types only
POSTGRESQL — DISTINCT ON (GET LATEST ORDER PER CUSTOMER)
-- PostgreSQL's DISTINCT ON — no subquery needed
-- Gets the most recent order for each customer
SELECT DISTINCT ON (customer_id)
  customer_id,
  order_id,
  order_date,
  amount,
  status
FROM orders
ORDER BY customer_id, order_date DESC;

-- Equivalent in MySQL requires a subquery:
SELECT o.*
FROM orders o
INNER JOIN (
  SELECT customer_id, MAX(order_date) AS last_date
  FROM orders
  GROUP BY customer_id
) latest ON o.customer_id = latest.customer_id
         AND o.order_date = latest.last_date;

Google BigQuery — free setup and first queries

Setting up BigQuery (free)

  1. Go to console.cloud.google.com — sign in with your Google account
  2. Create a new project (e.g. "evika-analytics-practice")
  3. In the left menu, click BigQuery
  4. In the Explorer panel, click + ADD → Public datasets to browse free datasets
  5. Try: bigquery-public-data.usa_names for US name data, or bigquery-public-data.covid19_india for Indian COVID data
  6. Write a query in the query editor — first 1 TB per month is free
BIGQUERY — QUERY PUBLIC DATASET
-- Query a public BigQuery dataset
-- COVID-19 cases in India by state (public data)
SELECT
  state_name,
  SUM(cumulative_confirmed)     AS total_confirmed,
  SUM(cumulative_deceased)      AS total_deceased,
  ROUND(
    100.0 * SUM(cumulative_deceased) /
    NULLIF(SUM(cumulative_confirmed), 0), 2
  )                             AS case_fatality_rate_pct
FROM `bigquery-public-data.covid19_india.case_details`
WHERE date = (
  SELECT MAX(date)
  FROM `bigquery-public-data.covid19_india.case_details`
)
GROUP BY state_name
ORDER BY total_confirmed DESC
LIMIT 15;

Connect Python to BigQuery

PYTHON — READ BIGQUERY INTO PANDAS
# Install: pip install pandas-gbq google-cloud-bigquery db-dtypes

import pandas as pd
from google.cloud import bigquery

# Authenticate (run once in terminal):
# gcloud auth application-default login

client = bigquery.Client(project='your-project-id')

query = """
    SELECT state_name, SUM(cumulative_confirmed) AS total
    FROM `bigquery-public-data.covid19_india.case_details`
    GROUP BY state_name
    ORDER BY total DESC
    LIMIT 10
"""

df = client.query(query).to_dataframe()
print(df.head(10))

Schema design basics — what analysts need to know

You do not need to be a DBA to understand schema design. These principles help you write better queries and communicate with your engineering team.

Primary Keys

Every table needs a unique identifier column (PRIMARY KEY). Use AUTO_INCREMENT (MySQL) or SERIAL (PostgreSQL) for integer IDs, or UUID for globally unique IDs.

Why it matters: JOINs rely on primary keys. Duplicate or missing PKs cause data quality issues that are extremely hard to debug later.

Foreign Keys

A column in one table that references the primary key of another. Enforces referential integrity — you cannot have an order without a matching customer.

Why it matters: Understanding FK relationships is essential for knowing which tables to JOIN. Ask for an entity-relationship (ER) diagram when joining a new company.

Normalisation (1NF-3NF)

Keep one piece of data in one place. Do not store "Noida, Delhi, Gurugram" in a single column. Do not repeat customer details in every order row.

Why it matters: Poorly normalised tables produce inconsistent data — the same customer's city spelled three different ways. Most analytical problems start with bad schema design.

Indexes

An index speeds up queries on a column. Add indexes on columns you frequently filter or JOIN on (customer_id, order_date, status). Too many indexes slow down writes.

Why it matters: A query on 10 million rows without an index on the WHERE column can take minutes. With an index, milliseconds. Always check if frequently-queried columns are indexed.

Star Schema (for analytics)

A central fact table (orders, transactions, events) surrounded by dimension tables (customers, products, dates, locations). Optimised for analytical queries, not transactional systems.

Why it matters: Power BI and Tableau work best with a star schema. If your company uses a flat, denormalised table for reporting, it was probably designed this way for analytics performance.

Connect Python to MySQL and PostgreSQL

PYTHON — CONNECT TO MYSQL AND POSTGRESQL
# Install dependencies
# pip install sqlalchemy mysql-connector-python psycopg2-binary pandas

import pandas as pd
from sqlalchemy import create_engine

# ── MySQL connection ──────────────────────────────────────
mysql_engine = create_engine(
    "mysql+mysqlconnector://root:YOUR_PASSWORD@localhost/evika_practice"
)

# Read a table directly into a DataFrame
df_orders = pd.read_sql("SELECT * FROM orders", mysql_engine)

# Run an analytical query
df_city = pd.read_sql("""
    SELECT c.city, SUM(o.amount) AS revenue
    FROM orders o
    JOIN customers c USING (customer_id)
    WHERE o.status = 'completed'
    GROUP BY c.city
    ORDER BY revenue DESC
""", mysql_engine)

# ── PostgreSQL connection ─────────────────────────────────
pg_engine = create_engine(
    "postgresql+psycopg2://postgres:YOUR_PASSWORD@localhost/your_db"
)

df_pg = pd.read_sql("SELECT * FROM your_table LIMIT 1000", pg_engine)

# Write a DataFrame back to a database table
df_orders.to_sql("orders_cleaned", mysql_engine, if_exists="replace", index=False)
Best practice: Never hard-code passwords in your script. Use environment variables: os.environ.get('DB_PASSWORD') or a .env file with python-dotenv.

Databases at companies in Noida and Delhi NCR — what to expect

Different types of companies in Delhi NCR use different databases. Knowing what to expect helps you prepare for technical interviews and ask the right questions.

Company TypeCommon DatabasesAnalyst Access Level
D2C / E-commerce startups (Noida Expressway)MySQL + BigQuery or RedshiftDirect SQL access to staging/analytics DB; raw tables
IT services companies (Noida Sec 62)Oracle, MySQL, SQL Server (client databases)Read-only views; often via Excel ODBC connection
BFSI / fintech (Noida Expressway, Gurugram)Oracle, SQL Server, SnowflakeTightly controlled; access via approved tools only
SaaS / product companies (Gurugram)PostgreSQL, BigQuery, SnowflakeDirect query access; dbt models; Metabase or Looker
Manufacturing / logistics (Greater Noida)SAP, MySQL, Excel as pseudo-DBOften Excel-based; may need to build DB from scratch
Government / PSU (Delhi)Oracle, SQL ServerVery restricted; reports via approved systems only

Frequently asked questions

Which database should a data analyst learn first in India — MySQL or PostgreSQL?

Start with MySQL. It is the most commonly used relational database at Indian companies — especially startups, e-commerce businesses, and IT services firms. MySQL is free, easy to install on Windows and Mac, has extensive documentation in Hindi and English, and most entry-level data analyst job descriptions in Noida and Delhi NCR mention MySQL specifically. Learn PostgreSQL second — it is more powerful (better window functions, JSONB support, more advanced indexing) and used at larger tech companies. BigQuery is third — learn it when you are working with datasets too large for a local database or when your company uses Google Cloud.

How do I install MySQL on Windows for free?

To install MySQL on Windows: (1) Go to dev.mysql.com/downloads/installer and download MySQL Community Server (free, open source); (2) Run the installer — choose "Developer Default" setup type; (3) Set a root password you will remember; (4) Install MySQL Workbench (included in Developer Default) as your GUI; (5) Open MySQL Workbench and connect using localhost, port 3306, and your root password. Total install time: 10-15 minutes. MySQL Community Server is completely free for individual and educational use.

What is Google BigQuery and is it free for data analysts in India?

Google BigQuery is a cloud-based data warehouse that can query terabytes of data in seconds using SQL. It is used by large Indian companies and startups that have data too big for a local database. BigQuery has a permanent free tier: 10 GB of free storage per month and 1 TB of free query processing per month — more than enough for learning and personal projects. To start: create a Google Cloud account (free, requires a credit card for verification but the free tier does not charge), go to console.cloud.google.com, create a project, and open the BigQuery console. Google provides free public datasets (including Indian census data) to practice on.

How do I connect MySQL to Power BI?

To connect MySQL to Power BI Desktop: (1) Install the MySQL ODBC Connector from dev.mysql.com/downloads/connector/odbc (free); (2) In Power BI Desktop, go to Get Data → MySQL Database; (3) Enter Server: localhost (or your server IP) and Database name; (4) Enter your MySQL username and password; (5) Select the tables you want to import. Power BI will load the data and you can build reports. For scheduled refresh in Power BI Service (cloud), your MySQL server must be accessible from the internet or you need an on-premises data gateway.

How do I connect to a database using Python pandas?

To connect Python to MySQL: install the connector with pip install mysql-connector-python sqlalchemy pandas. Then: import pandas as pd; from sqlalchemy import create_engine; engine = create_engine("mysql+mysqlconnector://username:password@localhost/database_name"); df = pd.read_sql("SELECT * FROM orders LIMIT 1000", engine). For PostgreSQL, use pip install psycopg2-binary sqlalchemy and change the connection string to "postgresql+psycopg2://username:password@localhost/database_name". For BigQuery, use pip install pandas-gbq google-cloud-bigquery and authenticate with a Google service account JSON key.

What is the difference between MySQL, PostgreSQL, and BigQuery for data analysts?

MySQL: best for transactional data (orders, users, products), runs on your own server, free, used widely at Indian startups and IT companies, good for datasets up to a few hundred million rows. PostgreSQL: more feature-rich than MySQL (better window functions, JSONB for semi-structured data, full-text search, more advanced indexing), also free and self-hosted, preferred at companies with complex data models. BigQuery: cloud-based, no server to manage, scales to petabytes, billed by query (but free tier covers most learning use cases), uses a SQL dialect close to standard SQL, best for very large datasets and when your company already uses Google Cloud. For most data analyst beginners in India, start with MySQL locally, then explore BigQuery using Google's free tier and public datasets.

Is database knowledge taught at data analytics courses in Noida?

EVIKA ACADEMY at Noida Sector 51 teaches SQL on a live MySQL database as part of the core curriculum — not just theoretical queries but connecting to real databases, writing multi-table queries, and exporting results to Power BI and Python. Students also get exposure to cloud data concepts. WhatsApp 8081035456 or visit near Sector 51 Metro Station (Aqua Line) to book a free demo class.

Learn SQL on a live MySQL database — not just slides

EVIKA ACADEMY teaches SQL using a live MySQL database with real datasets — queries, JOINs, aggregations, and connecting to Power BI. Free demo class at Noida Sector 51 (Aqua Line Metro).

📱 WhatsApp 8081035456 — Book Free Demo
← Ch 35: Data Ethics & PrivacyCh 37: Senior Analyst & Career Growth →
🎓 Free Demo Class — Online & Offline · Noida Sector 51