Skip to content

Instantly share code, notes, and snippets.

View thevipulvats's full-sized avatar
💭
I may be slow to respond.

Vipul thevipulvats

💭
I may be slow to respond.
View GitHub Profile
-- SQL DELETE Tutorial
-- Demonstrates how to remove records from a database table
-- DELETE FROM table_name WHERE condition;
-- Create a database for our examples
CREATE DATABASE delete_tutorial;
-- Use the database
USE delete_tutorial;
-- REPLACE INTO SQL Demonstration
-- This script demonstrates how REPLACE INTO combines INSERT and DELETE operations
-- to simplify the process of updating or inserting records based on primary or unique key values.
-- Create and use database
CREATE DATABASE replace_demo;
USE replace_demo;
-- Create products table
CREATE TABLE products (
-- Self JOIN in SQL Demonstration
-- This script demonstrates how to use Self JOINs to query hierarchical and relational data
-- within the same table, using an employee management system example.
-- Create and use database
CREATE DATABASE self_join_tutorial;
USE self_join_tutorial;
-- Create employees table with manager_id referencing the same table
CREATE TABLE employees (
-- StoreDB Complete SQL Script
-- This script creates a sample database with products and orders tables
-- and demonstrates various SQL query examples
-- Create the database
CREATE DATABASE StoreDB;
USE StoreDB;
-- Create products table
CREATE TABLE products (