Special operators in SQL

There are several special operators that serve specific purposes beyond basic comparison and arithmetic operations. Some of these special operators include: LIKE Operator: The LIKE operator is used to search for a specified pattern in a column. It’s commonly used with wildcard characters such as % (matches any sequence of characters) and _ (matches any single character). SELECT \* FROM Employees WHERE FirstName LIKE 'J%'; IN Operator: The IN operator is used to specify multiple values in a WHERE clause....

April 11, 2024 · 2 min · Ashwini Shalke

For Beginners to Understand Constraints in Database

Think of constraints in a database as rules that ensure data behaves properly, just like rules in a game. For instance, if you’re playing basketball, you can’t use your hands to touch the ball unless you’re dribbling or shooting. Similarly, constraints in a database ensure that data follows certain rules, like not allowing duplicate values in a column or making sure each student has a unique student ID. Let’s say we have a table called “Students” with columns for StudentID, Name, and Age....

April 13, 2024 · 3 min · Ashwini Shalke

Beginners Guide — Inner,Outer,left and right JOINS in SQL

What are Joins? Imagine you have two lists of friends — one list with their names and another list with their hobbies. Now, you want to find out which friend has which hobby. This is where joins come in handy! In databases, tables are like lists, and joins help us combine information from different tables based on a common piece of information, like a friend’s name or an ID. Let’s consider two tables: friends and hobbies....

April 13, 2024 · 2 min · Ashwini Shalke

For Beginners to Understand Triggers in SQL

Lets assume !! you have a magic toy box that automatically does something whenever you put a specific type of toy inside it. Triggers in SQL are like these magical rules that automatically perform actions in the database when certain events happen. Example: Let’s say you have a database table called “Orders” that stores information about orders placed by customers: Trigger Example: Now, imagine you want to keep track of any large orders (orders with a total amount over $100) automatically....

April 13, 2024 · 2 min · Ashwini Shalke

SQL — Temporary Tables

Temporary tables are like a temporary workspace or desk that you set up when you need some extra space to work on a project. You can use this space to organize and manipulate data without affecting your main workspace (or database) permanently. Once you’re done with your task, you can clean up and remove the temporary workspace, and everything goes back to how it was before. Example: Suppose you’re working on a school project where you need to analyze data about students’ grades and attendance....

April 13, 2024 · 2 min · Ashwini Shalke

Views in SQL

Imagine you have a favourite playlist on your music app. Instead of going through all your songs every time you want to listen to your favorite tracks, you create a playlist that contains only the songs you love. A view in a database is like that playlist — it’s a saved query that contains only the data you’re interested in, making it easier and faster to access. Suppose we have a database with a table called “Students” that contains information about students, including their names and ages....

April 15, 2024 · 2 min · Ashwini Shalke

What is a Cursor in SQL ?

Think of a cursor in SQL like a pointer that allows you to navigate through a set of rows returned by a query, one row at a time. It’s like a virtual hand that can grab one row of data from a table, process it, and then move on to the next row. Types of Cursors: There are mainly two types of cursors in SQL: Implicit Cursors: These cursors are created by default when you execute a SQL query....

April 15, 2024 · 3 min · Ashwini Shalke

Understanding REF_CURSOR in SQL

Ever heard of something called REF_CURSOR Don’t worry if it sounds like gibberish right now. I’m here to break it down for you in the simplest way possible, so grab a snack and let’s dive in! Imagine you’re at a library, and you ask the librarian to recommend some good books. Instead of giving you a list of book titles right away, the librarian hands you a special kind of card called a REF_CURSOR....

April 16, 2024 · 3 min · Ashwini Shalke

Difference between REF CURSOR and CURSOR

To know the difference between ref cursor and cursor , first you should know what is cursor and ref_cursor. REF_CURSOR: Dynamic Result Sets: REF_CURSOR, or reference cursor, is a data type that represents a cursor variable. It allows for dynamic result sets to be returned from stored procedures or functions in Oracle. Data Pointing: REF_CURSOR does not hold actual data but acts as a reference to the result set generated by a query....

April 16, 2024 · 2 min · Ashwini Shalke

PRAGMA in PL/SQL

Imagine you’re writing a story in your notebook, and sometimes you want to add special notes to yourself or your friend about how to read the story. You might write something like “Don’t worry about the spelling mistakes” or “Read this part very carefully.” In programming, a pragma is a bit like those special notes. It’s a way for the computer to understand special instructions or hints about how to handle your code....

April 16, 2024 · 4 min · Ashwini Shalke