Logo

dev-resources.site

for different kinds of informations.

SQL Operators Made Easy for Beginners

Published at
7/9/2024
Categories
operators
beginners
server
Author
shikha_gupta_080e904b317e
Categories
3 categories in total
operators
open
beginners
open
server
open
Author
25 person written this
shikha_gupta_080e904b317e
open
SQL Operators Made Easy for Beginners

SQL Operators Made Easy for Beginners

SQL (Structured Query Language) uses operators to perform operations on data. Here’s a simple guide to understand the basics:

  1. Arithmetic Operators These are used for mathematical operations.
  • + (Addition): Adds two numbers.
  SELECT 3 + 2; -- Result is 5
Enter fullscreen mode Exit fullscreen mode
  • - (Subtraction): Subtracts one number from another.
  SELECT 5 - 3; -- Result is 2
Enter fullscreen mode Exit fullscreen mode
  • (Multiplication): Multiplies two numbers. sql SELECT 4 2; -- Result is 8 ``
  • / (Division): Divides one number by another. `sql SELECT 10 / 2; -- Result is 5 `
  • % (Modulus): Returns the remainder of a division. `sql SELECT 10 % 3; -- Result is 1 `
  1. Comparison Operators These are used to compare two values.
  • = (Equal): Checks if two values are equal. `sql SELECT FROM employees WHERE salary = 50000; `
  • != or <> (Not Equal): Checks if two values are not equal. `sql SELECT FROM employees WHERE department != 'HR'; `
  • > (Greater Than): Checks if the left value is greater than the right value. `sql SELECT FROM employees WHERE age > 30; `
  • < (Less Than): Checks if the left value is less than the right value. `sql SELECT FROM employees WHERE age < 25; `
  • >= (Greater Than or Equal To): Checks if the left value is greater than or equal to the right value. `sql SELECT FROM employees WHERE experience >= 5; `
  • <= (Less Than or Equal To): Checks if the left value is less than or equal to the right value. `sql SELECT FROM employees WHERE experience <= 2; `
  1. Logical Operators These are used to combine multiple conditions.
  • AND: Combines two or more conditions. All conditions must be true. `sql SELECT FROM employees WHERE age > 25 AND department = 'Finance'; `
  • OR: Combines two or more conditions. At least one condition must be true. `sql SELECT FROM employees WHERE age < 30 OR department = 'HR'; `
  • NOT: Reverses the result of a condition. `sql SELECT FROM employees WHERE NOT (age < 30); `
  1. Between and In Operators
  • BETWEEN: Selects values within a given range (inclusive). `sql SELECT FROM employees WHERE salary BETWEEN 30000 AND 50000; `
  • IN: Checks if a value is within a set of values. `sql SELECT FROM employees WHERE department IN ('HR', 'Finance', 'IT'); `
  1. LIKE and IS NULL Operators
  • LIKE: Used for pattern matching. % represents zero or more characters, _ represents a single character. `sql SELECT FROM employees WHERE name LIKE 'J%'; -- Names starting with 'J' SELECT FROM employees WHERE name LIKE '_

https://www.youtube.com/watch?v=3tCym9ZkEdk&t=3s

server Article's
30 articles in total
Favicon
Singularity: Streamlining Game Development with a Universal Framework
Favicon
VPS Servers for Linux - Everything You Need to Know
Favicon
SLOT THAILAND™ LINK SITUS SLOT GACOR TERBAIK GAMPANG MAXWIN 2024
Favicon
Why adventuresinminecraft.com is the Best Minecraft Server for Customization and Survival
Favicon
Free VPS Hosting and Windows VPS to Understand How They Work on Websites
Favicon
How to Send Emails in Python Using Gmail’s Free SMTP Mail Server API
Favicon
How to write GraphQL resolvers effectively
Favicon
Path-Based Reverse Proxying with Caddy
Favicon
How I Set Up My Own Server (and Why You Should Too)
Favicon
Unlocking the Power of AWS Route 53: Your Complete Guide to DNS Management
Favicon
Unlock Efficient Data Exchange: Import & Export Excel in ASP.NET Core
Favicon
Copy file between server and local machine ( from windows to linux server )
Favicon
Client Boundaries
Favicon
Server actions in Next.js
Favicon
Self-host - Part 3 - MySQL and PostgreSQL Database Backup to Local Drive
Favicon
need suggestions
Favicon
SQL Operators Made Easy for Beginners
Favicon
What is Localhost in Development Mode?
Favicon
How to Customize the Fastify Logger
Favicon
Websocket starter in Rust with client and server example
Favicon
Unraid: Das ultimative Tool für deine Heimserver 🚀
Favicon
Drawbacks to Using Rack Server Unit as Desktop Computer?
Favicon
How to View Your index.php File in a Browser
Favicon
NextJs Server Actions: Why and How
Favicon
Self-host - Part 2 - Zero-Downtime Deployment using Docker Swarm
Favicon
Decoding Web Hosting: Understanding the landlords of the digital Realm Landscape
Favicon
Kaptan ve Tayfa - Kaptan Sunucu Kurulumu
Favicon
argc, argv의 차이
Favicon
Server side (vulnerability scanning)
Favicon
Running npm install on a Server with 1GB Memory using Swap

Featured ones: