Skip to content

About

9 T-SQL query examples covering CRUD, joins, subqueries, views, triggers, and stored procedures for SQL Server.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

🗄️ SQL-Samples

(Transact-SQL Query Examples for SQL Server)

License: MIT TSQL SQL Server Made with Learning

This repository contains a collection of Transact-SQL (T-SQL) queries and database operations created while learning SQL Server. It demonstrates fundamental and intermediate database concepts through practical, runnable examples.

📚 Table of Contents


About the Project

This project was created to understand database management, data manipulation, and complex query structures. It includes DDL and DML commands, functions, and relational database designs suitable for various scenarios.

  • Developer: Haluk Can SARIÖZ
  • Database: Microsoft SQL Server (T-SQL)
  • Purpose: Practice SQL Server query writing and database operations
  • Total Samples: 9 structured T-SQL query files + additional resources

SQL Topics Covered

The main topics you'll find in this repository are:

Category Examples
CRUD Operations SELECT, INSERT, UPDATE, DELETE
Database & Table Operations (DDL) CREATE, ALTER, DROP, TRUNCATE
Filtering & Sorting WHERE, ORDER BY, GROUP BY, HAVING
Joins INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN
Subqueries Nested SELECT statements, correlated subqueries
Advanced Structures Views, Triggers, Stored Procedures, Functions
Aggregate Functions COUNT, SUM, AVG, MIN, MAX

Project Structure

SQL-Samples/
├── SQL-Kaynaklar/           # Additional SQL resource files and references
├── SQLQuery1.sql            # Query example 1
├── SQLQuery2.sql            # Query example 2
├── SQLQuery3.sql            # Query example 3
├── SQLQuery4.sql            # Query example 4
├── SQLQuery5.sql            # Query example 5
├── SQLQuery6.sql            # Query example 6
├── SQLQuery7.sql            # Query example 7
├── SQLQuery8.sql            # Query example 8
├── SQLQuery9.sql            # Query example 9
├── .gitattributes           # Git configuration file
├── LICENSE                  # MIT License
└── README.md                # Project documentation

Getting Started

Prerequisites

Steps

1. Clone the repository:

git clone https://github.com/halukcansarioz/SQL-Samples.git

2. Navigate to the project directory:

cd SQL-Samples

3. Open any .sql file in your preferred SQL client (SSMS, Azure Data Studio, DBeaver, DataGrip, etc.) and execute the queries against your SQL Server instance.


Development Workflow

When adding a new SQL example or updating existing queries, you can follow these steps:

1. Fork the repository

First, fork the repository to your own GitHub account.

2. Create a new branch

Creating a new branch for each feature or fix keeps things organized:

git checkout -b feature/new-sql-query

3. Push your code

After making and committing your changes, push the branch to GitHub:

git push origin feature/new-sql-query

Contributing

Contributions are welcome! Feel free to submit a pull request.

  1. Fork this repository.
  2. Create a branch (git checkout -b feature/join-examples).
  3. Make your changes and commit them.
  4. Push your code (git push origin feature/join-examples).
  5. Open a Pull Request.

Contact

Haluk Can Sarıöz


If you find this project helpful, please ⭐ the repository!


License

This project is licensed under the MIT License. Feel free to use and modify it as you wish.

About

9 T-SQL query examples covering CRUD, joins, subqueries, views, triggers, and stored procedures for SQL Server.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages