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
-- Logical operators are used in SQL to filter records based on multiple conditions in the WHERE clause
-- AND → Returns records where both conditions are TRUE
-- OR → Returns records where at least one condition is TRUE
-- NOT → Negates a condition (returns the opposite result)
CREATE DATABASE company_db;
USE company_db;
CREATE TABLE employees (
@thevipulvats
thevipulvats / where.sql
Created January 28, 2025 16:13
Filtering results (WHERE)
CREATE DATABASE bookstore;
USE bookstore;
CREATE TABLE books (
book_id INT PRIMARY KEY,
title VARCHAR(100),
author VARCHAR(50),
price DECIMAL(10,2),
publication_date DATE,
@thevipulvats
thevipulvats / select.sql
Created January 28, 2025 13:31
Retrieving data (SELECT)
select first_name,email from employees;
CREATE DATABASE company;
USE company;
CREATE TABLE employees (
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
department VARCHAR(50),