https://github.com/natballa/sql-toolkit
Ready-to-use SQL queries for PostgreSQL, Oracle & T-SQL
https://github.com/natballa/sql-toolkit
analytics database dba monitoring oracle postgresql sql tsql
Last synced: 2 months ago
JSON representation
Ready-to-use SQL queries for PostgreSQL, Oracle & T-SQL
- Host: GitHub
- URL: https://github.com/natballa/sql-toolkit
- Owner: natballa
- Created: 2025-11-04T00:13:29.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-11-04T00:33:19.000Z (2 months ago)
- Last Synced: 2025-11-04T02:23:38.868Z (2 months ago)
- Topics: analytics, database, dba, monitoring, oracle, postgresql, sql, tsql
- Homepage: https://ballanata.gumroad.com
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🧩 SQL Toolkit: PostgreSQL, Oracle & T-SQL
A collection of ready-to-use SQL scripts for **analytics**, **monitoring**, and **database administration**.
Includes examples for **PostgreSQL**, **Oracle**, and **T-SQL (MS SQL Server)**.
Each pack contains 10+ practical queries with clean structure and comments — built from real-world tasks.
## 👉 [Full Packs on Gumroad](https://ballanata.gumroad.com)
---
## 📘 Sample Scripts
Each section below includes 2 free demo queries.
Full versions with 10+ optimized queries and explanations are available on Gumroad.
## 🐘 PostgreSQL
```sql
SELECT query, total_exec_time, calls
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;
```
## 🔴 Oracle
```sql
SELECT tablespace_name,
ROUND((used_space/tablespace_size)*100, 2) AS used_percent
FROM dba_tablespace_usage_metrics;
```
## 🟣 T-SQL
```sql
SELECT TOP 10 session_id, login_name, total_cpu_time
FROM sys.dm_exec_sessions
WHERE is_user_process = 1
ORDER BY total_cpu_time DESC;
```
## 📂 Repository Structure
```plsql
PostgreSQL/
├── examples.sql
├── README.md
Oracle/
├── examples.sql
├── README.md
TSQL/
├── examples.sql
├── README.md
```
---
## 🌐 About
This repository is part of my project of structured SQL toolkits
for everyday analytics, monitoring, and database maintenance tasks.
Feel free to:
- ⭐ **Star the repo** if you find it useful
- 📝 **Share suggestions or ideas** for new queries
- 📦 **Explore full SQL packs here:** [ballanata.gumroad.com](https://ballanata.gumroad.com)
---
### 📬 Connect
If you want to discuss SQL scripts, automation, or database tools —
you can reach me on **[LinkedIn](https://linkedin.com)** or comment in the repo.