Skip to main content
Azure SQL Database – A Complete Guide

Azure SQL Database – A Complete Guide

🌐 What is Azure SQL Database?

Azure SQL Database is Microsoft’s fully managed, cloud‑based relational database service. It runs on the latest stable SQL Server engine and takes care of patching, backups, upgrades, and high availability automatically. It’s part of the Azure SQL family, which also includes Azure SQL Managed Instance and SQL Server on Azure Virtual Machines.

⚡ Key Benefits

  • Fully Managed – No need to maintain servers or install updates.
  • High Availability – 99.99% uptime SLA.
  • Scalable – Adjust compute and storage on demand.
  • Secure – Built‑in encryption, threat detection, and compliance features.
  • Latest Features First – New SQL Server capabilities arrive in Azure SQL before on‑premises releases.

🛠 Deployment Options

  1. Single Database – Ideal for isolated workloads with predictable performance.
  2. Elastic Pool – Share resources across multiple databases to save costs.
  3. Serverless – Auto‑pause and auto‑resume to save money on infrequent workloads.

📊 Purchasing Models

  • vCore‑based – Choose CPU, memory, and storage; use Azure Hybrid Benefit for discounts.
  • DTU‑based – Pre‑bundled compute, memory, and I/O for simpler pricing.

🔍 Common Use Cases

  • Hosting web and mobile app backends.
  • Storing business application data.
  • Running analytics and reporting.
  • Supporting multi‑tenant SaaS applications.

🚀 Getting Started

  1. Sign in to the Azure Portal.
  2. Search for Azure SQL Database and click Create.
  3. Choose your subscription, resource group, and database name.
  4. Select a compute tier (vCore or DTU) and configure storage.
  5. Set authentication (SQL or Azure AD) and networking options.
  6. Review and create — your database will be ready in minutes.
💡 Pro Tip: Start with the free tier to explore features without cost — you get 100,000 vCore‑seconds and 32 GB storage per month.
Azure SQL Database Architecture Diagram

Azure SQL Database – Architecture Overview

🧑‍💻 Hands‑On Examples: Creating, Inserting & Querying Data

Once your Azure SQL Database is created, you can connect to it using:

  • SQL Server Management Studio (SSMS) – for a full desktop experience.
  • Azure Portal Query Editor – for quick, browser‑based queries.

1️⃣ Create a Table

Example SQL script to create a simple Customers table:

CREATE TABLE Customers (
    CustomerID INT PRIMARY KEY IDENTITY(1,1),
    FirstName NVARCHAR(50),
    LastName NVARCHAR(50),
    Email NVARCHAR(100),
    CreatedDate DATETIME DEFAULT GETDATE()
);

2️⃣ Insert Data

Insert sample records into the Customers table:

INSERT INTO Customers (FirstName, LastName, Email)
VALUES 
('John', 'Doe', 'john.doe@example.com'),
('Jane', 'Smith', 'jane.smith@example.com'),
('Ravi', 'Kumar', 'ravi.kumar@example.com');

3️⃣ Query Data

Retrieve all records from the Customers table:

SELECT CustomerID, FirstName, LastName, Email, CreatedDate
FROM Customers;

💡 Running These in SSMS

  1. Open SSMS and connect to your Azure SQL Database using the server name, username, and password from the Azure Portal.
  2. Click New Query and paste the SQL script.
  3. Click Execute (or press F5) to run the commands.
SQL Server Management Studio Query Window

Example: SSMS Query Window connected to Azure SQL Database

💡 Running These in Azure Portal Query Editor

  1. Go to your Azure SQL Database resource in the Azure Portal.
  2. Click Query editor (preview) in the left menu.
  3. Sign in with your SQL or Azure AD credentials.
  4. Paste the SQL script and click Run.
Azure Portal SQL Database Query Editor

Example: Azure Portal Query Editor running a SQL query

🔹 Tip: Always test scripts in a development database before running them in production.

Comments

Popular posts from this blog

Different types of Database Restore option

RESTORE FILELISTONLY retrieves the list of database and log files in the backup. RESTORE HEADERONLY returns header information about all backup sets on the supplied backup device. Although this command returns a wealth of information, typically you will only examine a small portion of it. For instance, it might be beneficial to know a backed up database’s collation, type of backup, first and last Log Sequence Numbers and database compatibility level. RESTORE FILELISTONLY FROM DISK = 'e:\telefullbkp' RESTORE HEADERONLY FROM DISK = 'e:\telefullbkp' RESTORE FILELISTONLY FROM DISK = 'D:\backup\Banking_20120929192001.trn' RESTORE HEADERONLY FROM DISK = 'D:\backup\Banking_20120929192001.trn' ********************************************************************************************* /* restore the full backup first with NO RECOVERY */ RESTORE DATABASE pubs FROM DISK = 'e:\pubs.bak' WITH...

All about View in SQL Server

View :: Any relation which is not part of logical model,but is made visible to a user as a virtual relation, is called a view. --CREATE VIEW [ schema_name . ] view_name [ (column [ ,...n ] ) ] [ WITH <view_attribute> [ ,...n ] ] AS select_statement [ ; ] [ WITH CHECK OPTION ] < view_attribute > ::= { [ ENCRYPTION ] [ SCHEMABINDING ] [ VIEW_METADATA ] } ----------------------------------------------------------------------------------------- ENCRYPTION : The definition of an encrypted view is not visible to anyone, including a member of the sysadmin fixed server role.cannot decrypt the definition. SCHEMABINDING : cannot drop any tables, views, or functions referenced by the view without first dropping the view. VIEW_METADATA : ----------------- Example:CREATE VIEW v_CustomerAddress AS SELECT a . CustomerID , a . CustomerName , c . AddressLine1 , c . AddressLine2 , c . AddressLine3 , c . City , d . StateProvince , c . P...

How to install SQL Server 2005 step by step

How to install SQL Server 2005 step by step