Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

100+ SQL Scripts - PostgreSQL, MySQL, Oracle, Google BigQuery, MariaDB, AWS Athena. DBA, Analytics, DevOps, performance engineering. Google BigQuery ML machine learning classification.

License

NotificationsYou must be signed in to change notification settings

HariSekhon/SQL-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub starsGitHub forksLineCountCocomoLicenseMy LinkedInGitHub Last Commit

PostgreSQLMySQLMariaDBOracleAWS AthenaAWS AuroraGoogle BigQuery

CodacyCodeFactorQuality Gate StatusMaintainability RatingReliability RatingSecurity RatingVulnerabilities

CI Builds OverviewShellCheckYAMLMarkdownValidationGrypeKicsSemgrepSemgrep CloudTrivy

LinuxMacRepo on GitHubRepo on GitLabRepo on Azure DevOpsRepo on BitBucket

git.io/SQL

Useful SQL scripts, split fromDevOps Bash tools, for which this is now a submodule.

Hari Sekhon

Cloud & Big Data Contractor, United Kingdom

My LinkedIn
(you're welcome to connect with me on LinkedIn)

Inventory

DevOps / DBA

  • aws_athena_cloudtrail_ddl.sql -AWS Athena DDL to setup up integration to queryCloudTrail logs from Athena
  • bigquery_*.sql -Google BigQuery scripts:
    • bigquery_billing_*.sql - billing queries forGCP usage eg. highest cost services, most used GCP products, recent charges etc.
    • bigquery_info_*.sql - information schema queries for datasets, tables, columns, partitioning, clustering etc.
  • mysql_*.sql:
    • MySQL /MariaDB queries for DBA investigating + performance tuning
    • mysql_info.sql - summary overview, useful to debug yourmysql.user table auth effects
      • (shows intendedUSER() vs actualCURRENT_USER())
    • tested on MySQL 5.5, 5.6, 5.7, 8.0 and MariaDB 5.5, 10.x
  • postgres_*.sql:
    • PostgreSQL queries for DBA investigating + performance tuning
    • postgres_info.sql - big summary overview, recommend you start here
    • tested on PostgreSQL 8.4, 9.x, 10.x, 11.x, 12.x, 13.x
  • oracle_*.sql:
    • Oracle queries for DBA investigating
    • tested on Oracle 9i, 10g, 11g, 19c

Analytics

  • bigquery_*.sql -Google BigQuery scripts:
    • bigquery_billing_*.sql - billing queries forGCP usage eg. highest cost services, most used GCP products, recent charges etc.
    • bigquery_info_*.sql - information schema queries for datasets, tables, columns, partitioning, clustering etc.
    • analytics/bigquery_*.sql - ecommerce queries andBigQuery ML machine learning classification logistic regression models and purchasing predictions
    • for moreBigQuery examples, seeData Engineering demos

Database Knowledge Base

See the pages for:

in theHariSekhon/Knowledge-Base repo:

Readme Card

DevOps SQL tooling

Readme Card

You can quickly test the PostgreSQL / MySQL scripts usingpostgres.sh /mysqld.sh /mariadb.sh in theDevOps Bash tools repo, which boots a docker container and drops straight in to amysql /psql shell with this directory mounted at/sql and used as$PWD for fast easy sourcing eg.

postgres:

\i /sql/postgres_query_times.sql
\i postgres_query_times.sql

mysql:

source /sql/mysql_sessions.sql
\. mysql_sessions.sql

Related scripts

Star History

Star History Chart

git.io/SQL

More Core Repos

Knowledge

Readme CardReadme Card

DevOps Code

Readme CardReadme CardReadme CardReadme Card

Containerization

Readme CardReadme Card

CI/CD

Readme CardReadme Card

DBA - SQL

Readme Card

DevOps Reloaded

Readme CardReadme CardReadme CardReadme CardReadme Card

Templates

Readme CardReadme Card

Misc

Readme CardReadme Card

The rest of my original source repos arehere.

Pre-built Docker images are available on myDockerHub.

About

100+ SQL Scripts - PostgreSQL, MySQL, Oracle, Google BigQuery, MariaDB, AWS Athena. DBA, Analytics, DevOps, performance engineering. Google BigQuery ML machine learning classification.

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp