Results for "IF"
37 / 184 posts
What is the difference between DELETE and TRUNCATE statements in SQL?
--What is the difference between DELETE and TRUNCATE statements in SQL? --DELETE and TRUNCATE are both SQL commands that can be used to remove data from a …
What difference between the DATEPART() and DATENAME() functions?
The difference between the DATEPART() and DATENAME() functions lies in their definitions. DATEPART() returns an integer that represents the specified datep…
Added columns in a table by dynamic ways
IF OBJECT_ID('AddedDynamicColumn','P') IS NOT NULL BEGIN DROP PROC AddedDynamicColumn END GO CREATE PROCEDURE AddedDynamicColumn AS BEGIN SELECT ED.empid,E…
How to get first date of given date or month.
Get First date of month: SELECT DATEFROMPARTS(YEAR(GETDATE()), MONTH(GETDATE()), 1) AS FirstDayOfCurrentMonth Create function for that IF NOT EXISTS (SELEC…
How to one series with comma separate(any Delimiter) value split into in rows
If we have one series with comma separate(any Delimiter) value and we want split into in rows, I have create function for that: IF OBJECT_ID('TF_SplitSerie…
How to Two series with comma separate(any Delimiter) value split into in rows respectively
If we have two series with comma separate(any Delimiter) value and we want split into in rows, I have create function for that: IF OBJECT_ID('TF_SplitTwoSe…
Use of Apply(Cross and Outer) operator in SQL server
APPLY operator joins two table expressions. Also, I'll show how it differs from regular JOINs. Operator: CROSS APPLY Similar: INNER JOIN When to Use: Use a…
Find column in the whole database in sql server
To find a specific column in the whole database in SQL Server, you can query the information schema views. Here's a query you can use: SELECT table_name, c…
How to use GOTO statement in SQL server
If you want to jump to a specific point in your SQL code, you can use the GOTO statement. The GOTO statement is used to exit a loop or a nested block of co…
How to use Magic (virtual) table INSERTED and DELETED in SQL server
Magic Tables are virtual tables that are automatically created and maintained by SQL Server for each data modification operation performed on a table. They…
What is an Index? Explain its different types in SQL
✅ Index in SQL Server (इंडेक्स इन SQL सर्वर): Index SQL Server में एक database object (डेटाबेस ऑब्जेक्ट) है जो टेबल के डेटा को जल्दी से प्राप्त करने के लिए…
What is View in SQL server
A view is a virtual table based on the result-set of an SQL statement. A view contains rows and columns, just like a real table. IF OBJECT_ID('ViewTable','…
SQL Server Data type
SQL Server provides a variety of data types to store different kinds of data efficiently. Here are some commonly used SQL Server data types: CHAR(size): A …
ANY and ALL operators used in SQL
The ANY operator: returns a boolean value as a result returns TRUE if any of the sub-query values meet the condition Any means that the condition will be t…
How to get first date From month and Finyear
If we have Finyear and month then we create a date for examples: DECLARE @finyear CHAR(5) = '202425'; DECLARE @month smallint = 5; --Get Year DECLARE @year…
Basic of DAX query
// How to check null ISBLANK(EmployeeDetails[DateofLeaving]) //if condition IF(ISBLANK(EmployeeDetails[DateofLeaving]),TODAY(),EmployeeDetails�…
Databricks widgets
Input widgets allow you to add parameters to your notebooks and dashboards. You can add a widget from the Databricks UI or using the widget API. If y…
Spark SQL useful command
Spark SQL provides a variety of commands for managing databases, tables, and performing SQL operations. CREATE DATABASE IF NOT EXISTS demo; SHOW DATABASES;…
What is Managed and External table in Spark
In Apache Spark, both Managed and External tables are used to store the data. However, there are significant differences in how Spark manages the data for …
What is Resilient Distributed Datasets (RDDs)
Resilient Distributed Datasets (RDDs) are a data structure of Apache Spark. They represent an immutable, distributed collection of objects that can be proc…
Spark session vs Spark context
In Apache Spark, SparkSession and SparkContext are both essential components, but they serve different purposes and have different scopes. Here's a detaile…
How to Create table in Power BI using Dax
ROW: The ROW function in DAX creates a single row table with the specified columns and values. ROW(columnName1, value1, [columnName2, value2], ...) Si…
Calculate and Calculatetable Function in Power BI
CALCULATE : It's used to modify or filter the context in which a calculation is being performed CALCULATE(<expression>, <filter1>, <filter2&…
Split full name into first name and last name in SQL
Split full name into first name and last name : SELECT EmployeeName, CASE WHEN CHARINDEX(' ', EmployeeName) > 0 -- Check if there is a space (indicating…
What is Functions and Difference between Functions and Stored Procedures in SQL Server
What is a Function in sql : A function is a set of SQL Statements that perform a specific task. Basically, it is a set of SQL statements that accept only i…
Vectors
Definition A vector is a quantity that has both magnitude and direction . Vectors can be represented in different ways, such as geometrically (with arrows)…
What difference between between MySQL and MSSQL
Feature MySQL MSSQL Ownership Oracle Corporation Microsoft Licensing Open-source (GPL) and commercial versions Commercial with free Express Edition Operati…
Functions in MySQL
In MySQL, a Function is similar to a Stored Procedure but with some key differences. Functions are used to perform calculations or operations and return a …
Making API Calls in Python
APIs (Application Programming Interfaces) are the bridges that allow different software systems to communicate with each other. pip install requests import…
Database Permissions in SQL Server
In SQL Server, database permissions control what actions users can perform on specific database objects (like tables, views, and stored procedures). Permis…
Understanding SQL Query for Identifying and Analyzing Default Values and Constraint in a Database
Default constraints in SQL are used to assign a default value to a column when no value is provided during data insertion. However, managing and auditing t…
SQL Logical Operators with Examples
SQL logical operators are used to filter data by combining multiple conditions in SQL queries. These operators help in refining queries to fetch specific r…
where() & filter() in PySpark
The filter() function in PySpark is used to create a new DataFrame by selecting rows that meet a specified condition or SQL expression. Alternatively, the …
PySpark Built-in Functions
These functions are commonly used with groupBy() , agg() , or select() to compute things like sum, average, max, min, count, etc. PySpark functions come fr…
The ALTER TABLE statement in Microsoft SQL Server (MSSQL) and PostgreSQL
The ALTER TABLE statement in Microsoft SQL Server (MSSQL) and PostgreSQL is used to modify the structure of an existing table. It allows you to: Add, drop,…
Table Types Comparison: SQL Server vs PostgreSQL
Table Type SQL Server PostgreSQL Scope / Lifetime Usage Notes Permanent Table CREATE TABLE Employee (...) CREATE TABLE Employee (...) Permanent in DB until…
SQL Server Agent Alerts, Operators, Database Mail & Job Activity Monitor
Production environment me sirf jobs schedule karna hi kaafi nahi hota. Hume monitoring aur notification system bhi chahiye hota hai taaki agar koi job fail…