Skip to content

jackiecheng2008/Ultimate-SQL-Commands

Repository files navigation

Ultimate-SQL-Commands Project

Ultimate-SQL-Commands is a repository that organizes SQL commands, scripts, and examples for a variety of SQL dialects and query frameworks. It is designed to serve as a reference library for developers, DBAs, and data engineers who work across different database technologies and SQL-based tools.

Table of Contents

Project Structure Supported SQL Dialects & Frameworks Folder Descriptions Usage Database Schemas & Sample Dumps Contributing License Project Structure

The repository uses a standardized folder layout for each SQL dialect or query language. Each top-level folder (e.g., ANSI-SQL, IBM-DB2-SQL, Oracle-SQL, etc.) contains subfolders for different categories of commands:

Ultimate-SQL-Commands/ ├── ANSI-SQL/ │ ├── DML/ │ ├── Common-DDLs/ │ ├── Common-Data-Sets/ │ ├── Bulk-Load-SQL/ │ ├── Complicated-SQL/ │ ├── Stored-Procedures/ │ ├── Materialized-Views/ │ ├── Special-Functions/ │ ├── schema.sql │ └── sample_dump.sql ├── IBM-DB2-SQL/ │ ├── ... │ ├── schema.sql │ └── sample_dump.sql ├── Oracle-SQL/ │ ├── ... │ ├── schema.sql │ └── sample_dump.sql ├── MySQL-SQL/ │ ├── ... │ ├── schema.sql │ └── sample_dump.sql ├── Hibernate-SQL/ │ ├── ... │ ├── schema.sql │ └── sample_dump.sql ├── JPA-SQL/ │ ├── ... │ ├── schema.sql │ └── sample_dump.sql ├── Snowflake-SQL/ │ ├── ... │ ├── schema.sql │ └── sample_dump.sql ├── Hive-QL/ │ ├── ... │ ├── schema.sql │ └── sample_dump.sql └── Databricks-SQL/ ├── ... ├── schema.sql └── sample_dump.sql

Within each subfolder (e.g., DML, Common-DDLs, etc.), you’ll find .sql or .sp files containing code snippets for that category. For example:

DML: basic_select.sql, insert_data.sql, update_data.sql, delete_data.sql, merge_upsert.sql Common-DDLs: create_tables.sql, alter_tables.sql, drop_tables.sql Bulk-Load-SQL: example scripts for loading large data sets Complicated-SQL: advanced queries, window functions, complex joins, subqueries, etc. Stored-Procedures: .sp files containing procedure definitions. Materialized-Views: sample scripts for creating or simulating materialized views. Special-Functions: date/time, string manipulation, or other dialect-specific functions. Supported SQL Dialects & Frameworks ANSI-SQL IBM DB2 SQL Oracle SQL MySQL SQL Hibernate SQL (HQL examples) JPA SQL (JPQL examples) Snowflake SQL Hive QL Databricks SQL Folder Descriptions Each top-level folder (e.g., ANSI-SQL) contains:

DML: Basic CRUD operations (SELECT, INSERT, UPDATE, DELETE, merges/upserts).

Common-DDLs: CREATE TABLE, ALTER TABLE, DROP TABLE, or any typical schema manipulation statements. Common-Data-Sets: Example data insertion scripts or sample data generation queries. Bulk-Load-SQL: Methods for loading data in bulk (e.g., COPY, LOAD, external tables). Complicated-SQL: Advanced queries demonstrating window functions, complex joins, CTEs, etc. Stored-Procedures: Files containing stored procedure definitions. Materialized-Views: Scripts for creating or simulating materialized views. Special-Functions: Examples of built-in or custom functions, date/time manipulation, string operations, etc. schema.sql: A typical database schema for that SQL dialect. sample_dump.sql: A sample data dump that can be imported to replicate a small environment. Usage Browse by Dialect: Navigate to the relevant folder (e.g., MySQL-SQL) for MySQL-specific commands. Pick a Category: Inside that folder, open the subfolder for the type of script you need (DML, Complicated-SQL, etc.). Copy/Paste or Adapt: Copy the .sql (or .sp) snippets into your environment. Adjust table names, columns, or parameters as needed. Import Schemas & Data: To quickly create a test environment, run schema.sql and then sample_dump.sql. This will generate a minimal schema with example data you can experiment with.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published