Skip to content

This repository contains various SQL scripts and examples, demonstrating key database operations such as creating tables, inserting data, querying, updating records, and managing database schemas.

SeongLee7/SQL-Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Examples

SQL-Examples Overview Welcome to the SQL-Examples repository! This repository showcases a variety of SQL scripts designed to demonstrate my knowledge of SQL in areas like data retrieval, data manipulation, creating views, stored procedures, functions, and more. The examples cover real-world scenarios such as managing invoices, vendors, boats, and trips.

Repository Structure This repository is organized by different use cases and SQL features:

Data Analysis Queries: Includes queries for summarizing, grouping, and analyzing data, such as invoice totals, payment dates, and vendor statistics. Stored Procedures & Functions: Demonstrates the creation of reusable stored procedures and functions for tasks like calculating balances and updating records. Views: Examples of using SQL views for easier access and querying of data across multiple tables. Error Handling: Includes examples of how to handle errors and ensure data integrity using triggers and constraints. Branching and Version Control: Demonstrates my use of Git and GitHub for version control with feature-specific branches.

Key Examples

  1. Invoice and Vendor Analysis File: invoice_analysis.sql Description: Contains SQL queries that retrieve, aggregate, and analyze invoice and vendor data, including calculating total invoice amounts, identifying unpaid invoices, and grouping by payment dates.

  2. Stored Procedure for Employee Updates File: employee_update_procedure.sql Description: Demonstrates the use of stored procedures with input parameters to update employee salaries, including error handling for negative values.

  3. Views for Simplifying Data Access File: views.sql Description: Contains several SQL views that join related tables, providing a simple and efficient way to query data, such as open invoices and available trips.

  4. Calculating Balance Due File: balance_due_function.sql Description: A SQL function to calculate the balance due on an invoice by subtracting payments and credits from the total invoice amount.

About

This repository contains various SQL scripts and examples, demonstrating key database operations such as creating tables, inserting data, querying, updating records, and managing database schemas.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published