Home
Search results “Coalesce group by oracle”
COALESCE IN ORACLE SQL
 
06:50
This video is the 4th video in the series of 'working with null', this video explains the working of the coalesce function in oracle sql. Also the video explains the use of coalesce function in oracle sql queries by perfect simple and easy to understand examples.
Views: 828 Kishan Mashru
SQL tutorial 74: SQL COALESCE Function In oracle Database Manish Sharma
 
04:44
Third tutorial in SQL Null Series. Coalesce Null function with example in oracle Database. ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog : http://bit.ly/sql-coalesce Previous Tutorial ► NVL https://youtu.be/aRoTR5Jn6K0 ► NVL2 https://youtu.be/SCwc0HcS1-U ------------------------------------------------------------------------- ►►►Let's Get Free Uber Cab◄◄◄ Use Referral Code UberRebellionRider and get $20 free for your first ride. ------------------------------------------------------------------------- ►►►Help Me In Getting A Job◄◄◄ ►Help Me In Getting A Good Job By Connecting With Me on My LinkedIn and Endorsing My Skills. All My Contact Info is Down Below. You Can Also Refer Me To Your Company Thanks -------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! -------------------------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider https://www.facebook.com/imthebhardwaj http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ http://rebellionrider.tumblr.com/ http://www.pinterest.com/rebellionrider/ You can also Email me at for E-mail address please check About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 24135 Manish Sharma
Counting Data Within Groups with GROUP BY (Introduction to Oracle SQL)
 
05:32
How to use grouping and count to count occurrences of data
Views: 85 Database Star
SQL Concatenate All Rows Into A String
 
06:24
Combine all rows into a single string adventure works example. This method uses coalesce to remove the leading comma. Easier than for xml path in my opinion. For XML path example(next video): https://www.youtube.com/watch?v=QwPjbQosjgw
Views: 1012 Blake B
SQL 12c Tutorial 13  : SQL General Functions NVL , NVL2, NULLIF and COALESCE
 
09:48
SQL 12c General Functions NVL , NVL2, NULLIF and COALESCE SQL 12c Tutorial for beginners Oracle SQL 12c Tutorial NVL NVL2 NULLIF COALESCE
Views: 222 TechLake
Coalesce
 
07:06
PhUSE Technical Coalesce
Views: 163 PhUSE
SQL Server video :- Explain aggregate functions,group by clause and having keyword ?
 
09:25
For more such videos visit http://www.questpond.com See our other Step by Step video series below :- Learn Angular tutorial for beginners https://tinyurl.com/ycd9j895 Learn MVC Core step by step :- http://tinyurl.com/y9jt3wkv Learn MSBI Step by Step in 32 hours:- https://goo.gl/TTpFZN Learn Xamarin Mobile Programming Step by Step :- https://goo.gl/WDVFuy Learn Design Pattern Step by Step in 8 hours:- https://goo.gl/eJdn0m Learn C# Step by Step in 100 hours :- https://goo.gl/FNlqn3 Learn Data structures & algorithm in 8 hours :-https://tinyurl.com/ybx29c5s Learn SQL Server Step by Step in 16 hours:- http://tinyurl.com/ja4zmwu Learn Javascript in 2 hours :- http://tinyurl.com/zkljbdl Learn SharePoint Step by Step in 8 hours:- https://goo.gl/XQKHeP Learn TypeScript in 45 Minutes :- https://goo.gl/oRkawI Learn webpack in 50 minutes:- https://goo.gl/ab7VJi Learn Visual Studio code in 10 steps for beginners:- https://tinyurl.com/lwgv8r8 Learn Tableau step by step :- https://tinyurl.com/kh6ojyo Preparing for C# / .NET interviews start here http://www.youtube.com/watch?v=gaDn-sVLj8Q visit for 600+ videos @ http://www.questpond.com In this video we will try to understand aggregate function,group by clause and having keyword. This is also one of the favorite SQL Server interview questions as well. We are also distributing a 100 page Ebook ".NET Interview Question and Answers". If you want this ebook please share this video in your facebook/twitter/linkedin account and email us on [email protected] with the shared link and we will email you the PDF.
Views: 154669 Questpond
LNNVL FUNCTION IN ORACLE SQL
 
09:11
This video is the 5th video in the series of 'working with null', this video explains the working of the lnnvl function in oracle sql with simple and easy to understand example.
Views: 517 Kishan Mashru
SQL tutorial 72: NVL SQL NULL function By Manish Sharma RebellionRider
 
03:50
Part 1: SQL Null Function NVL learn the concepts of NVL null function in this tutorial with examples and all the Interview concepts covered ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog : http://bit.ly/nvl-sql-null-function Previous Tutorial ► LPAD & RPAD Functions https://youtu.be/nPtbuHPCN6E ------------------------------------------------------------------------- ►►►Let's Get Free Uber Cab◄◄◄ Use Referral Code UberRebellionRider and get $20 free for your first ride. ------------------------------------------------------------------------- ►►►Help Me In Getting A Job◄◄◄ ►Help Me In Getting A Good Job By Connecting With Me on My LinkedIn and Endorsing My Skills. All My Contact Info is Down Below. You Can Also Refer Me To Your Company Thanks ------------------------------------------------------------------------- Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=kb4rc1 -------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! -------------------------------------------------------------------------- Amazon Wishlist: http://bit.ly/wishlist-amazon ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider https://www.facebook.com/imthebhardwaj http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ http://rebellionrider.tumblr.com/ http://www.pinterest.com/rebellionrider/ You can also Email me at for E-mail address please check About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 22226 Manish Sharma
NVL2 FUNCTION IN ORACLE SQL WITH EXAMPLE
 
05:40
This video is the 2nd video in the series of 'working with null in oracle sql' , the video explains and demonstrates the use of nvl2 function in oracle sql with simple and easy to understand example.
Views: 1284 Kishan Mashru
NULLIF FUNCTION IN ORACLE SQL WITH EXAMPLE
 
03:24
This video is the 3rd video in the series of 'working with null in oracle sql', the video demonstrates the use of NULLIF function in oracle sql, and how we can use it in day to day coding time. The video explains the function with perfect easy to understand example.
Views: 1070 Kishan Mashru
Group Function 02 Oracle
 
01:04:18
Having Clause, Group Function, Group By Clause
Oracle SQL Video Tutorial 25 - COALESCE  function
 
04:47
Oracle SQL Video Tutorials 25 - COALESCE function explained.In This Oracle SQL Tutorial for Beginners, I have explained basics of SQL.These examples work on Oracle 10g and Oracle 11g database. These helps youto understand Oracle Joins and helps beginners. Iam going to add more tutorials on Oracle DBA, Oracle RAC and Oracle PL/SQL.All Oracle sql tutorial with examples are executed on Oracle 11g using Oracle SQL Developer.
Views: 3036 Just Channel
SQL, Sum, coalesce function, lesson 21
 
05:28
sum and coalesce function
Views: 4806 hammadshams
Part 6   Transform rows into columns in sql server
 
08:53
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/06/part-6-transform-rows-into-columns-in.html This is another common sql server interview question. We will be using Countries table in this example. SQL to create the table Create Table Countries ( Country nvarchar(50), City nvarchar(50) ) GO Insert into Countries values ('USA','New York') Insert into Countries values ('USA','Houston') Insert into Countries values ('USA','Dallas') Insert into Countries values ('India','Hyderabad') Insert into Countries values ('India','Bangalore') Insert into Countries values ('India','New Delhi') Insert into Countries values ('UK','London') Insert into Countries values ('UK','Birmingham') Insert into Countries values ('UK','Manchester') Here is the interview question. Write a sql query to transpose rows to columns. Using PIVOT operator we can very easily transform rows to columns. Select Country, City1, City2, City3 From ( Select Country, City, 'City'+ cast(row_number() over(partition by Country order by Country) as varchar(10)) ColumnSequence from Countries ) Temp pivot ( max(City) for ColumnSequence in (City1, City2, City3) ) Piv
Views: 163874 kudvenkat
SQL, sum function,  group by clause
 
08:36
continuation of sum function of SQL and use subquery
Views: 7359 hammadshams
Let's Learn SQL! Lesson 58: Order By and Group By With the Teradata Version of CSUM
 
02:58
Explore SQL with Tom Coffing of Coffing Data Warehousing! In this lesson, learn about using the Order By and Group By Statement in your CSUM when you are using Teradata Syntax!
Difference Between Case and Decode
 
06:03
What is the difference between case and decode ? Important links for Oracle Developers For for SQL - PL/SQL Interview Questions Answers Facebook group https://www.facebook.com/groups/146487615764170/ Download Free PLSQL Interview Books , Documents Videos from here https://www.facebook.com/groups/146487615764170/files/ Free SQL / PLSQL Video on YouTube Channel SUBSCRIBE https://www.youtube.com/c/ramguptaoracle?sub_confirmation=1 Visit oracle forms / report / SQL PLSQL blog http://oracletemple.blogspot.in/ Oracle Community Google+ https://plus.google.com/u/0/collection/4mW-jB Join our facebook group https://www.facebook.com/groups/146487615764170/ Follow us on Twitter https://twitter.com/Rameshwar275 Simply Like and Share :) Oracle SQL PLSQL FaceBook group https://www.facebook.com/groups/146487615764170/ ORACLE SQL PLSQL VIDEO LINKS What is Parameterized Cursor in Oracle https://www.youtube.com/watch?v=JMKwHlVi6-A What is autonomous transaction in Oracle. https://www.youtube.com/watch?v=gyvFajpfoWE What are Constraints available in Oracle. https://www.youtube.com/watch?v=WivhdLXQklQ What is Mutation Error and How to avoid mutation. https://www.youtube.com/watch?v=CbWNCyW18Bs 5 Effective way to delete Duplicate rows https://www.youtube.com/watch?v=1wtTtnc87Oc What is Difference between Delete and Truncate https://www.youtube.com/watch?v=7b6wQ3Qumgg What are types of View available in Oracle https://www.youtube.com/edit?o=U&video_id=PN-NsSA2R-E
Views: 2954 Ram Gupta
Coalesce и Case - Замена значений в языке запросов Transact-SQL
 
02:33
В данной заметке мы поработаем с Coalesce и Case, будет рассмотрена замена значений в выборках Transact-SQL Статья на сайте: http://snakeproject.ru/rubric/article.php?art=T_SQL_Coalesce
Views: 416 Mihail Kozlov
IsDate, Day, Month, Year and DateName DateTime functions in SQL Server   Part 26
 
12:51
In this video we will learn about built-in date and time functions in sql server, specifically IsDate, Day, Month, Year and DateName functions. Finally a practical example of using these DateTime functions. Text version of the video http://csharp-video-tutorials.blogspot.com/2012/09/isdate-day-month-year-and-datename.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-26-datetime-functions-continued.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 134390 kudvenkat
Coalesce function in SQL With Example
 
05:29
Coalesce function in SQL With Example
Views: 201 Bangalore Techie
SQL tutorial 73: NVL2 SQL null function By Manish Sharma RebellionRider
 
03:01
Part 2: SQL Null Function NVL2 learn the concepts of NVL null function in this tutorial with examples and all the Interview concepts covered ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog : http://bit.ly/nvl2-null-function Previous Tutorial ► NVL function https://youtu.be/aRoTR5Jn6K0 ------------------------------------------------------------------------- ►►►Let's Get Free Uber Cab◄◄◄ Use Referral Code UberRebellionRider and get $20 free for your first ride. ------------------------------------------------------------------------- ►►►Help Me In Getting A Job◄◄◄ ►Help Me In Getting A Good Job By Connecting With Me on My LinkedIn and Endorsing My Skills. All My Contact Info is Down Below. You Can Also Refer Me To Your Company Thanks ------------------------------------------------------------------------- Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=kb4rc1 -------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! -------------------------------------------------------------------------- Amazon Wishlist: http://bit.ly/wishlist-amazon ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider https://www.facebook.com/imthebhardwaj http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ http://rebellionrider.tumblr.com/ http://www.pinterest.com/rebellionrider/ You can also Email me at for E-mail address please check About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 19500 Manish Sharma
SQL Q & A Part 3 - NULL Functions NVL, NVL2, NULLIF, DECODE, & COALESCE
 
03:59
NULL is a keyword used to represent ‘unknown’ or ‘missing’ data. NULL is not ‘zero’ or ‘blank’. SQL NULL functions are used to validate it. Explained NVL(), NVL2(), NULLIF(), DECODE() & COALESCE() in detail with examples SQL Interview Q & A Playlist: https://www.youtube.com/watch?v=t2qoqI5TjSk&list=PLSo-SnVTqbBLavDdG89zpQZDWkoEc9LP_ LINUX Interview Q & A Playlist: https://www.youtube.com/watch?v=1WEZqImoxzs&list=PLSo-SnVTqbBIBjEhxwRV3hbYmfXOWiYmR Technology You Must Know Playlist: https://www.youtube.com/watch?v=9FPrr1f2yjo&list=PLSo-SnVTqbBK4qk42HRrawr17mBITQmJd
Views: 764 Shivanand V
Oracle DECODE Function
 
04:31
https://www.databasestar.com/oracle-decode-function/ The Oracle DECODE function lets you perform IF-THEN-ELSE functionality in your queries. It’s similar to a CASE statement. The syntax of the DECODE function is: DECODE ( expression, search, result [, search, result]... [,default] ) The parameters of the Oracle DECODE function are: - expression (mandatory): This is the value to compare. - search (mandatory): This is the value to compare against the expression. - result (mandatory): This is the return value if the search value matches the expression value. There can be multiple combinations of search and result values, and the result value is attached to the previous search value. - default (optional): If none of the search values match, then this value is returned. If this is not provided, the DECODE function will return NULL if no matches are found. If you compare this to an IF-THEN-ELSE statement, it would look like this: IF (expression = search) THEN result [ELSE IF (expression = search) THEN result] ELSE default END IF The parameters can be one of many different data types, and the return type is calculated from them. Earlier I mentioned it’s similar to CASE. So why would you use one and not the other? - DECODE is an older function, and CASE was introduced as a replacement for DECODE. - CASE offers more flexibility then DECODE - CASE is also easier to read and debug (in my opinion) The performance of these functions is the same, so if you’re considering using DECODE, I would suggest using CASE instead. For more information about the Oracle DECODE function, including all of the SQL shown in this video and the examples, read the related article here: https://www.databasestar.com/oracle-decode-function/
Views: 141 Database Star
Let's Learn SQL! Lesson 92 : The Coalesce Command
 
03:36
Explore SQL with Tom Coffing of Coffing Data Warehousing! In this lesson, learn what you are able to accomplish using the Coalesce Command with you SQL!
Oracle SQL Video Tutorial 26 - CASE Statements
 
05:59
Oracle SQL Video Tutorials 26 - CASE Statements explained.In This Oracle SQL Tutorial for Beginners, I have explained basics of SQL.These examples work on Oracle 10g and Oracle 11g database. These helps youto understand Oracle Joins and helps beginners. Iam going to add more tutorials on Oracle DBA, Oracle RAC and Oracle PL/SQL.All Oracle sql tutorial with examples are executed on Oracle 11g using Oracle SQL Developer.
Views: 5012 Just Channel
SQL: WITH Clause
 
06:11
In this tutorial, you'll learn will learn how to use with clause PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 7), TimesTen in-memory database (since version 11.2.1), and IBM DB2 (since version 9.7).[1] Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database. PL/SQL includes procedural language elements such as conditions and loops. It allows declaration of constants and variables, procedures and functions, types and variables of those types, and triggers. It can handle exceptions (runtime errors). Arrays are supported involving the use of PL/SQL collections. Implementations from version 8 of Oracle Database onwards have included features associated with object-orientation. One can create PL/SQL units such as procedures, functions, packages, types, and triggers, which are stored in the database for reuse by applications that use any of the Oracle Database programmatic interfaces. PL/SQL works analogously to the embedded procedural languages associated with other relational databases. For example, Sybase ASE and Microsoft SQL Server have Transact-SQL, PostgreSQL has PL/pgSQL (which emulates PL/SQL to an extent), and IBM DB2 includes SQL Procedural Language,[2] which conforms to the ISO SQL’s SQL/PSM standard. The designers of PL/SQL modeled its syntax on that of Ada. Both Ada and PL/SQL have Pascal as a common ancestor, and so PL/SQL also resembles Pascal in several aspects. However, the structure of a PL/SQL package does not resemble the basic Object Pascal program structure as implemented by a Borland Delphi or Free Pascal unit. Programmers can define public and private global data-types, constants and static variables in a PL/SQL package.[3] PL/SQL also allows for the definition of classes and instantiating these as objects in PL/SQL code. This resembles usage in object-oriented programming languages like Object Pascal, C++ and Java. PL/SQL refers to a class as an "Abstract Data Type" (ADT) or "User Defined Type" (UDT), and defines it as an Oracle SQL data-type as opposed to a PL/SQL user-defined type, allowing its use in both the Oracle SQL Engine and the Oracle PL/SQL engine. The constructor and methods of an Abstract Data Type are written in PL/SQL. The resulting Abstract Data Type can operate as an object class in PL/SQL. Such objects can also persist as column values in Oracle database tables. PL/SQL is fundamentally distinct from Transact-SQL, despite superficial similarities. Porting code from one to the other usually involves non-trivial work, not only due to the differences in the feature sets of the two languages,[4] but also due to the very significant differences in the way Oracle and SQL Server deal with concurrency and locking. There are software tools available that claim to facilitate porting including Oracle Translation Scratch Editor,[5] CEITON MSSQL/Oracle Compiler [6] and SwisSQL.[7] The StepSqlite product is a PL/SQL compiler for the popular small database SQLite. PL/SQL Program Unit A PL/SQL program unit is one of the following: PL/SQL anonymous block, procedure, function, package specification, package body, trigger, type specification, type body, library. Program units are the PL/SQL source code that is compiled, developed and ultimately executed on the database. The basic unit of a PL/SQL source program is the block, which groups together related declarations and statements. A PL/SQL block is defined by the keywords DECLARE, BEGIN, EXCEPTION, and END. These keywords divide the block into a declarative part, an executable part, and an exception-handling part. The declaration section is optional and may be used to define and initialize constants and variables. If a variable is not initialized then it defaults to NULL value. The optional exception-handling part is used to handle run time errors. Only the executable part is required. A block can have a label. Package Packages are groups of conceptually linked functions, procedures, variables, PL/SQL table and record TYPE statements, constants, cursors etc. The use of packages promotes re-use of code. Packages are composed of the package specification and an optional package body. The specification is the interface to the application; it declares the types, variables, constants, exceptions, cursors, and subprograms available. The body fully defines cursors and subprograms, and so implements the specification. Two advantages of packages are: Modular approach, encapsulation/hiding of business logic, security, performance improvement, re-usability. They support object-oriented programming features like function overloading and encapsulation. Using package variables one can declare session level (scoped) variables, since variables declared in the package specification have a session scope.
Views: 9528 radhikaravikumar
SQL, count function, lesson 19
 
04:56
SQL count function
Views: 8542 hammadshams
SQL7 - Aggregate functions; aggregate and NULLs; using NVL
 
05:14
Aggregate (also known as group) functions: COUNT, MAX, MIN, AVG, SUM. How NULL values are handled by functions, and using NVL to change how NULLs are treated by functions and calculations.
Views: 357 Charles Boisvert
MS SQL case coalesce
 
05:40
sctips: https://github.com/wonhyukc/mssql/blob/master/case%20%EC%98%88%EC%A0%9C.sql 연세대학교 데분설 강의 녹화 2014 11 23 11 56 48 17
Views: 880 정원혁
NTILE function in SQL Server
 
05:10
In this video we will discuss NTILE function in SQL Server NTILE function 1. Introduced in SQL Server 2005 2. ORDER BY Clause is required 3. PARTITION BY clause is optional 4. Distributes the rows into a specified number of groups 5. If the number of rows is not divisible by number of groups, you may have groups of two different sizes. 6. Larger groups come before smaller groups For example NTILE(2) of 10 rows divides the rows in 2 Groups (5 in each group) NTILE(3) of 10 rows divides the rows in 3 Groups (4 in first group, 3 in 2nd & 3rd group) Syntax : NTILE (Number_of_Groups) OVER (ORDER BY Col1, Col2, ...) SQL Script to create Employees table Create Table Employees ( Id int primary key, Name nvarchar(50), Gender nvarchar(10), Salary int ) Go Insert Into Employees Values (1, 'Mark', 'Male', 5000) Insert Into Employees Values (2, 'John', 'Male', 4500) Insert Into Employees Values (3, 'Pam', 'Female', 5500) Insert Into Employees Values (4, 'Sara', 'Female', 4000) Insert Into Employees Values (5, 'Todd', 'Male', 3500) Insert Into Employees Values (6, 'Mary', 'Female', 5000) Insert Into Employees Values (7, 'Ben', 'Male', 6500) Insert Into Employees Values (8, 'Jodi', 'Female', 7000) Insert Into Employees Values (9, 'Tom', 'Male', 5500) Insert Into Employees Values (10, 'Ron', 'Male', 5000) Go NTILE function without PARTITION BY clause : Divides the 10 rows into 3 groups. 4 rows in first group, 3 rows in the 2nd & 3rd group. SELECT Name, Gender, Salary, NTILE(3) OVER (ORDER BY Salary) AS [Ntile] FROM Employees What if the specified number of groups is GREATER THAN the number of rows NTILE function will try to create as many groups as possible with one row in each group. With 10 rows in the table, NTILE(11) will create 10 groups with 1 row in each group. SELECT Name, Gender, Salary, NTILE(11) OVER (ORDER BY Salary) AS [Ntile] FROM Employees NTILE function with PARTITION BY clause : When the data is partitioned, NTILE function creates the specified number of groups with in each partition. The following query partitions the data into 2 partitions (Male & Female). NTILE(3) creates 3 groups in each of the partitions. SELECT Name, Gender, Salary, NTILE(3) OVER (PARTITION BY GENDER ORDER BY Salary) AS [Ntile] FROM Employees Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/ntile-function-in-sql-server.html
Views: 32872 kudvenkat
Rank and Dense Rank in SQL Server
 
10:08
rank and dense_rank example difference between rank and dense_rank with example rank vs dense_rank in sql server 2008 sql server difference between rank and dense_rank In this video we will discuss Rank and Dense_Rank functions in SQL Server Rank and Dense_Rank functions Introduced in SQL Server 2005 Returns a rank starting at 1 based on the ordering of rows imposed by the ORDER BY clause ORDER BY clause is required PARTITION BY clause is optional When the data is partitioned, rank is reset to 1 when the partition changes Difference between Rank and Dense_Rank functions Rank function skips ranking(s) if there is a tie where as Dense_Rank will not. For example : If you have 2 rows at rank 1 and you have 5 rows in total. RANK() returns - 1, 1, 3, 4, 5 DENSE_RANK returns - 1, 1, 2, 3, 4 Syntax : RANK() OVER (ORDER BY Col1, Col2, ...) DENSE_RANK() OVER (ORDER BY Col1, Col2, ...) RANK() and DENSE_RANK() functions without PARTITION BY clause : In this example, data is not partitioned, so RANK() function provides a consecutive numbering except when there is a tie. Rank 2 is skipped as there are 2 rows at rank 1. The third row gets rank 3. DENSE_RANK() on the other hand will not skip ranks if there is a tie. The first 2 rows get rank 1. Third row gets rank 2. SELECT Name, Salary, Gender, RANK() OVER (ORDER BY Salary DESC) AS [Rank], DENSE_RANK() OVER (ORDER BY Salary DESC) AS DenseRank FROM Employees RANK() and DENSE_RANK() functions with PARTITION BY clause : Notice when the partition changes from Female to Male Rank is reset to 1 SELECT Name, Salary, Gender, RANK() OVER (PARTITION BY Gender ORDER BY Salary DESC) AS [Rank], DENSE_RANK() OVER (PARTITION BY Gender ORDER BY Salary DESC) AS DenseRank FROM Employees Use case for RANK and DENSE_RANK functions : Both these functions can be used to find Nth highest salary. However, which function to use depends on what you want to do when there is a tie. Let me explain with an example. If there are 2 employees with the FIRST highest salary, there are 2 different business cases 1. If your business case is, not to produce any result for the SECOND highest salary, then use RANK function 2. If your business case is to return the next Salary after the tied rows as the SECOND highest Salary, then use DENSE_RANK function Since we have 2 Employees with the FIRST highest salary. Rank() function will not return any rows for the SECOND highest Salary. WITH Result AS ( SELECT Salary, RANK() OVER (ORDER BY Salary DESC) AS Salary_Rank FROM Employees ) SELECT TOP 1 Salary FROM Result WHERE Salary_Rank = 2 Though we have 2 Employees with the FIRST highest salary. Dense_Rank() function returns, the next Salary after the tied rows as the SECOND highest Salary WITH Result AS ( SELECT Salary, DENSE_RANK() OVER (ORDER BY Salary DESC) AS Salary_Rank FROM Employees ) SELECT TOP 1 Salary FROM Result WHERE Salary_Rank = 2 You can also use RANK and DENSE_RANK functions to find the Nth highest Salary among Male or Female employee groups. The following query finds the 3rd highest salary amount paid among the Female employees group WITH Result AS ( SELECT Salary, Gender, DENSE_RANK() OVER (PARTITION BY Gender ORDER BY Salary DESC) AS Salary_Rank FROM Employees ) SELECT TOP 1 Salary FROM Result WHERE Salary_Rank = 3 AND Gender = 'Female' Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/rank-and-denserank-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/rank-and-denserank-in-sql-server_1.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 62973 kudvenkat
Oracle CEIL Function
 
01:56
https://www.databasestar.com/oracle-ceil/ The Oracle CEIL function, short for “ceiling”, will return the smallest integer value greater than the specified number. In other words, it rounds up to the nearest whole number. It’s the opposite of the FLOOR function, which rounds down. The syntax of CEIL is: CEIL(number) The number parameter can be any numeric data type. The CEIL function will return a number in the same data type as the parameter. So, you can use CEIL with decimal numbers, which is actually where CEIL works best. You can use it with whole numbers too. It won’t show an error, it just might display the same value as provided (e.g. CEIL(8) would be 8). You can also use functions inside CEIL. For example, CEIL(SUM(salary)) will SUM all of the salary values, and then round them up to the nearest whole number. Like with all functions, the Oracle CEIL function can also use column aliases. So, instead of having your column labelled “CEIL(8.12)” or “CEIL(salary)”, you can label your column “salary_rounded” or something that makes more sense. The CEIL function is similar to the ROUND function. However, ROUND will round up or down, where CEIL will always round up. The TRUNC function will also do some kind of rounding, but it removes decimals from a number which may cause it to “round” down. For more information, including the code used in the examples, read the related article here: https://www.databasestar.com/oracle-ceil/
Views: 430 Database Star
Oracle SQL Video Tutorial 29 - COUNT function
 
03:33
Oracle SQL Video Tutorials 29 - COUNT function explained.In This Oracle SQL Tutorial for Beginners, I have explained basics of SQL.These examples work on Oracle 10g and Oracle 11g database. These helps youto understand Oracle Joins and helps beginners. Iam going to add more tutorials on Oracle DBA, Oracle RAC and Oracle PL/SQL.All Oracle sql tutorial with examples are executed on Oracle 11g using Oracle SQL Developer.
Views: 2785 Just Channel
Decode function in oracle plsql.
 
16:28
This oracle tutorial explain how to use decode function in oracle pl sql. Decode function is a powerful function which let you create a set of branched if else like statement within a single sql statement. I have also provided an example which swap values of 2 columns with a single sql statement using decode.
Views: 1675 Subhroneel Ganguly
SQL, Min, max and avg functions, lesson 23
 
04:43
SQL on oracle platform.
Views: 4550 hammadshams
Select statement in sql server - Part 10
 
21:54
In this video we will learn 1. Select specific or all columns 2. Distinct rows 3. Filtering with where clause. 4. Wild Cards in SQL Server 5. Joining multiple conditions using AND and OR operators 6. Sorting rows using order by 7. Selecting top n or top n percentage of rows Text version of the video http://csharp-video-tutorials.blogspot.com/2012/08/select-statement-part-10.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-10-all-about-select.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 308053 kudvenkat
SQL Lesson 32, How to calculate percentage on a particular column
 
03:36
calculating percentages in SQL
Views: 9272 hammadshams
SQL Function
 
24:33
Oracle
Views: 819 Oresoft LWC
SQL 12c Tutorial 8 : SQL Substitution variables
 
05:51
SQL 12c Tutorial 8 : SQL Substitution variables SQL 12c Tutorial Oracle SQL Tutorial for beginners
Views: 130 TechLake
DECODE FUNCTION IN ORACLE SQL
 
09:36
This video tutorial explains with proper example on how to write a decode statement, this video also demonstrates how the decode statement behaves on null values and implicit datatype conversion that happens in a decode statement.
Views: 1403 Kishan Mashru