Home
Search results “Oracle union with sum”
SQL Aggregation queries using Group By, Sum, Count and Having
 
10:01
From SQL Queries Joes 2 Pros (Vol2) ch4.1. Learn up to write aggregated queries.
Views: 155127 Joes2Pros SQL Trainings
SQL Inner Join Multiple Tables with SUM Tutorial - SQL 2008/2012/2016/2017
 
18:03
Use inner joins with multiple tables to create reports. Uses aliases, and the SUM aggregate function to demonstrate the flexibility of the join statement. Get the SQL script to create the database and run the exercies in the video here: https://www.qewbi.com/sql/scripts/qewbijoins.zip
Views: 124700 Edward Kench
PL/SQL Tutorial 6 (Oracle): Sum Command
 
02:38
PL/SQL Tutorial 6 (Oracle): Sum Command In this tutorial I show you how to use the sum command in PL/SQL. It's used to sum numbers in your data tables. Source Code: https://github.com/mitchtabian/SQL-tutorials Subscribe to my Blog and YouTube channel to get notifications when new FREE coding tutorials are posted! Blog: http://www.codingwithmitch.com/
Views: 87 CodingWithMitch
15 of 15 SQL Basics with Oracle - Traditional set operators: UNION, INTERSECT & MINUS
 
09:56
This video gives examples of three set operators: UNION, INTERSECT, MINUS. The union compatible rule is also explained. Set operators are used when output comes from more than one SQL statement. (15 of 15) There is also an "Advanced SQL" series. (Search for "databasemec" for tutorials using SQL Server.)
Views: 12051 Jennifer Kreie
SQL UNION, INTERSECT, EXCEPT
 
08:45
Jamie King of Neumont University demonstrating UNION, INTERSECT, and EXCEPT.
Views: 38386 Jamie King
Union and union all in sql server   Part 17
 
12:41
In this video we will learn about the 1. Purpose of UNION and UNION ALL 2. Difference between UNION and UNION ALL 3. Difference between JOIN and UNION Text version of the video http://csharp-video-tutorials.blogspot.com/2012/08/union-and-union-all-in-sql-server-part.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-17-union-and-union-all.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: 238215 kudvenkat
Grouping Sets in SQL Server
 
09:36
grouping sets examples in sql server sql server grouping sets order by grouping sql server 2008 grouping sets example sql server group by union all Grouping sets is a new feature introduced in SQL Server 2008. Let us understand Grouping sets with an example. We want to calculate Sum of Salary by Country and Gender. We can very easily achieve this using a Group By query as shown below Select Country, Gender, Sum(Salary) as TotalSalary From Employees Group By Country, Gender Within the same result set we also want Sum of Salary just by Country. To achieve the above result we could combine 2 Group By queries using UNION ALL as shown below. Select Country, Gender, Sum(Salary) as TotalSalary From Employees Group By Country, Gender UNION ALL Select Country, NULL, Sum(Salary) as TotalSalary From Employees Group By Country Within the same result set we also want Sum of Salary just by Gender. We can achieve this by combining 3 Group By queries using UNION ALL as shown below Select Country, Gender, Sum(Salary) as TotalSalary From Employees Group By Country, Gender UNION ALL Select Country, NULL, Sum(Salary) as TotalSalary From Employees Group By Country UNION ALL Select NULL, Gender, Sum(Salary) as TotalSalary From Employees Group By Gender Finally we also want the grand total of Salary. In this case we are not grouping on any particular column. So both Country and Gender columns will be NULL in the resultset. To achieve this we will have to combine the fourth query using UNION ALL as shown below. Select Country, Gender, Sum(Salary) as TotalSalary From Employees Group By Country, Gender UNION ALL Select Country, NULL, Sum(Salary) as TotalSalary From Employees Group By Country UNION ALL Select NULL, Gender, Sum(Salary) as TotalSalary From Employees Group By Gender UNION ALL Select NULL, NULL, Sum(Salary) as TotalSalary From Employees There are 2 problems with the above approach. The query is huge as we have combined different Group By queries using UNION ALL operator. This can grow even more if we start to add more groups The Employees table has to be accessed 4 times, once for every query. If we use Grouping Sets feature introduced in SQL Server 2008, the amount of T-SQL code that you have to write will be greatly reduced. The following Grouping Sets query produce the same result as the above UNION ALL query. Select Country, Gender, Sum(Salary) TotalSalary From Employees Group BY GROUPING SETS ( (Country, Gender), -- Sum of Salary by Country and Gender (Country), -- Sum of Salary by Country (Gender) , -- Sum of Salary by Gender () -- Grand Total ) The order of the rows in the result set is not the same as in the case of UNION ALL query. To control the order use order by as shown below. Select Country, Gender, Sum(Salary) TotalSalary From Employees Group BY GROUPING SETS ( (Country, Gender), -- Sum of Salary by Country and Gender (Country), -- Sum of Salary by Country (Gender) , -- Sum of Salary by Gender () -- Grand Total ) Order By Grouping(Country), Grouping(Gender), Gender Text version of the video http://csharp-video-tutorials.blogspot.com/2015/09/grouping-sets-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/09/grouping-sets-in-sql-server_19.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: 43638 kudvenkat
SQL Tutorial : Difference Between Count(1) and Count(*)  in SQL Oracle
 
06:43
SQL Tutorial : Difference Between Count(1) and Count(*) in SQL Oracle SQL Tutorial SQL Tutorial for beginners PLSQL Tutorial PLSQL Tutorial for beginners PL/SQL Tutorial PL SQL Tutorial PL SQL Tutorial for beginners PL/SQL Tutorial for beginners Oracle SQL Tutorial
Views: 1708 TechLake
SQL Intersect, Union, Union All, Minus, and Except
 
01:56
This video explains how the keywords INTERSECT, UNION, UNION ALL, MINUS, and EXCEPT are used in SQL.
Views: 40610 1Keydata
60. Set Union, Union All, Intersect, Minus Operators in PL/SQL Oracle
 
10:25
In this video you will learn about Set Union, Union All, Intersect, Minus Operators in Oracle. For Support =========== Email: [email protected] Contact Form: http://www.learninhindi.com/home/contact Our Social Media ================ Facebook: https://www.facebook.com/LearnInHindi Twitter: https://twitter.com/LearnInHindi For Training & Videos ===================== For more videos and articles visit: http://www.learninhindi.com Free Java Programming In Hindi Course ===================================== https://www.youtube.com/playlist?list=PLOZ3jentlCDAwwhMyoLISrxkXTADGp7PH Free Oracle PL/SQL Programming In Hindi Course ============================================== https://www.youtube.com/playlist?list=PLB5DA82419C2D99B6 Free C Programming In Hindi Course ================================== https://www.youtube.com/playlist?list=PLOZ3jentlCDAxKpBLMWogxSdy6BZcsAJq Trips & Tricks Channel ====================== https://www.youtube.com/channel/UCGmLfkuCo-3lHHJXRJ9HUMw Programming in Hindi Channel ============================ https://www.youtube.com/channel/UCudElIDgwNrybeAvXIy1HZQ
Views: 2739 ITORIAN
SQL Union Operator with Example in Oracle 11g(Hindi, English)
 
07:24
SQL Tutorial for Beginners in Hindi and English SQL Union Operator with Example in Oracle 11g(Hindi, English)
Oracle union and union all
 
11:54
Oracle union and union all explained
Views: 56 CONNECT TO LEARN
SQL Complete Tutorial - Use UNION for combined query results - Chapter 25
 
03:31
In this video, I have explained how to get a result in single query with two table names involved with the same column names. visit my blog : http://www.techyvicky.com
Views: 2692 Vicky's Blog
SQL Server Queries - SELECT SUM() Function (with GROUP BY)
 
08:03
https://www.udemy.com/sql-server-fast-track-intro-to-queries/learn/v4/overview How to use the SUM() aggregate function in TSQL. This tutorial shows a real world example of how to use the SUM() aggregate function in SQL Server along with the COUNT() aggregate function and the GROUP BY clause.
Views: 9304 Dave Merton
SQL Tutorial in Oracle - 5 Column Alias with Order By
 
11:09
SQL aliases are used to give a database table, or a column in a table, a temporary name. Check out our website: http://www.telusko.com Follow Telusko on Twitter: https://twitter.com/navinreddy20 Follow on Facebook: Telusko : https://www.facebook.com/teluskolearnings Navin Reddy : https://www.facebook.com/navintelusko Follow Navin Reddy on Instagram: https://www.instagram.com/navinreddy20 Subscribe to our other channel: Navin Reddy : https://www.youtube.com/channel/UCxmkk8bMSOF-UBF43z-pdGQ?sub_confirmation=1 Telusko Hindi : https://www.youtube.com/channel/UCitzw4ROeTVGRRLnCPws-cw?sub_confirmation=1
Views: 11436 Telusko
Running total in SQL
 
04:21
Using a correlated subquery to produce a running total (or running balance) column.
Views: 9681 Barry Brown
SQL Aggregate Functions - SUM, AVG(n), COUNT, MIN, MAX Functions in Hindi and English
 
08:25
SQL Tutorial for Beginners in Hindi and English SQL Aggregate Functions - SUM, AVG(n), COUNT, MIN, MAX Functions in Hindi and English
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: 126 Database Star
Subqueries in sql   Part 59
 
14:34
In this video we will discuss about subqueries in sql server. Let us understand subqueris with an example. Please create the required tables and insert sample data using the script below. Create Table tblProducts ( [Id] int identity primary key, [Name] nvarchar(50), [Description] nvarchar(250) ) Create Table tblProductSales ( Id int primary key identity, ProductId int foreign key references tblProducts(Id), UnitPrice int, QuantitySold int ) Insert into tblProducts values ('TV', '52 inch black color LCD TV') Insert into tblProducts values ('Laptop', 'Very thin black color acer laptop') Insert into tblProducts values ('Desktop', 'HP high performance desktop') Insert into tblProductSales values(3, 450, 5) Insert into tblProductSales values(2, 250, 7) Insert into tblProductSales values(3, 450, 4) Insert into tblProductSales values(3, 450, 9) Write a query to retrieve products that are not at all sold? This can be very easily achieved using subquery as shown below. Select [Id], [Name], [Description] from tblProducts where Id not in (Select Distinct ProductId from tblProductSales) Most of the times subqueries can be very easily replaced with joins. The above query is rewritten using joins and produces the same results. Select tblProducts.[Id], [Name], [Description] from tblProducts left join tblProductSales on tblProducts.Id = tblProductSales.ProductId where tblProductSales.ProductId IS NULL In this example, we have seen how to use a subquery in the where clause. Let us now discuss about using a sub query in the SELECT clause. Write a query to retrieve the NAME and TOTALQUANTITY sold, using a subquery. Select [Name], (Select SUM(QuantitySold) from tblProductSales where ProductId = tblProducts.Id) as TotalQuantity from tblProducts order by Name Query with an equivalent join that produces the same result. Select [Name], SUM(QuantitySold) as TotalQuantity from tblProducts left join tblProductSales on tblProducts.Id = tblProductSales.ProductId group by [Name] order by Name From these examples, it should be very clear that, a subquery is simply a select statement, that returns a single value and can be nested inside a SELECT, UPDATE, INSERT, or DELETE statement. It is also possible to nest a subquery inside another subquery. According to MSDN, subqueries can be nested upto 32 levels. Subqueries are always encolsed in paranthesis and are also called as inner queries, and the query containing the subquery is called as outer query. The columns from a table that is present only inside a subquery, cannot be used in the SELECT list of the outer query. Next Video: What to choose for performance? Queries that involve a subquery or a join Text version of the video http://csharp-video-tutorials.blogspot.com/2013/01/subqueries-in-sql-part-59.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-59-subqueries-in-sql-server.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: 188081 kudvenkat
SQL Server Calculating Cumulative Sums
 
04:47
7. Calculating Cumulative Sums
Views: 2315 Eagle
What is the difference between UNION and UNION All ( SQl server )?
 
03:52
For more such videos visit http://www.questpond.com See our other Step by Step video series below :- Learn SQL Server Step by Step in 16 hours:- http://tinyurl.com/ja4zmwu Learn Angular tutorial for beginners https://tinyurl.com/ycd9j895 Learn MVC Core step by step :- http://tinyurl.com/y9jt3wkv Learn MVC 5 Step by Step in 16 hours:- https://goo.gl/dmdakg 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 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 What is the difference between UNION and UNION All ( SQl server )?. This is a important SQL server interview lets try to answer the same. We are also distributing a 100 page Ebook "SQL Server Interview Questions". 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.
SQL 09 Min Max Avg Sum
 
03:57
Views: 1191 Berry Pieters
Rollup in SQL Server
 
09:01
sql server group by rollup sql server 2008 group by rollup group by with rollup example sql rollup example sql server rollup example sql server 2008 rollup examples rollup clause in sql server rollup function in sql server ROLLUP in SQL Server is used to do aggregate operation on multiple levels in hierarchy. Let us understand Rollup in SQL Server with examples. We will use the following Employees table for the examples in this video. Retrieve Salary by country along with grand total There are several ways to achieve this. The easiest way is by using Rollup with GroupBy. SELECT Country, SUM(Salary) AS TotalSalary FROM Employees GROUP BY ROLLUP(Country) The above query can also be rewritten as shown below SELECT Country, SUM(Salary) AS TotalSalary FROM Employees GROUP BY Country WITH ROLLUP We can also use UNION ALL operator along with GROUP BY SELECT Country, SUM(Salary) AS TotalSalary FROM Employees GROUP BY Country UNION ALL SELECT NULL, SUM(Salary) AS TotalSalary FROM Employees We can also use Grouping Sets to achieve the same result SELECT Country, SUM(Salary) AS TotalSalary FROM Employees GROUP BY GROUPING SETS ( (Country), () ) Let's look at another example. Group Salary by Country and Gender. Also compute the Subtotal for Country level and Grand Total as shown below. Using ROLLUP with GROUP BY SELECT Country, Gender, SUM(Salary) AS TotalSalary FROM Employees GROUP BY ROLLUP(Country, Gender) OR SELECT Country, Gender, SUM(Salary) AS TotalSalary FROM Employees GROUP BY Country, Gender WITH ROLLUP Using UNION ALL with GROUP BY SELECT Country, Gender, SUM(Salary) AS TotalSalary FROM Employees GROUP BY Country, Gender UNION ALL SELECT Country, NULL, SUM(Salary) AS TotalSalary FROM Employees GROUP BY Country UNION ALL SELECT NULL, NULL, SUM(Salary) AS TotalSalary FROM Employees Using GROUPING SETS SELECT Country, Gender, SUM(Salary) AS TotalSalary FROM Employees GROUP BY GROUPING SETS ( (Country, Gender), (Country), () ) Text version of the video http://csharp-video-tutorials.blogspot.com/2015/09/rollup-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/09/rollup-in-sql-server_20.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: 49512 kudvenkat
How to Join 3 tables in 1 SQL query
 
04:59
Get your first month on the Joes 2 Pros Academy for just $1 with code YOUTUBE1. Visit http://www.joes2pros.com Offer expires July 1, 2015 From the newly released 2 Disc DVD set (SQL Queries Joes 2 Pros Vol2) this video shows how to join 3 tables in 1 query.
Views: 237304 Joes2Pros SQL Trainings
Learn Oracle SQL : The Hierarchical Query Clause
 
11:19
http://bit.ly/oracle-sql-course | Get the complete course today. Learn Oracle SQL : The Hierarchical Query Clause: In this video, I show you how to use the Hierarchical Query Clause in Oracle SQL to build a basic hierarchical query. This is an excerpt of the course "The Ultimate Oracle SQL Course" which you can get at a heavily discounted price here: http://bit.ly/oracle-sql-course ================ You can find additional Oracle SQL related articles and educational content in my blog here: http://standout-dev.com/
Views: 4024 Oracle SQL
SQL Server Interview Question: How to find sum of Positive numbers and Negative numbers in a column
 
04:11
SQL Server Interview Question: How to find sum of Positive numbers and Negative numbers in a column
SQL SERVER UNION QUERY EXAMPLE
 
08:10
https://www.udemy.com/sql-server-fast-track-intro-to-queries/learn/v4/overview This tutorial illustrates how to use a UNION QUERY when you need to merge two data sets into one complete data set. It covers some details that may not occur to the beginner.
Views: 5424 Dave Merton
Lesson 5 - WHERE Clause (Oracle SQL Certification)
 
19:36
Take the Complete Course at: www.jobreadyprogrammer.com You'll learn about how to use the WHERE clause in a SQL Query
Views: 2917 Imtiaz Ahmad
Difference between rows and range
 
05:52
range vs rows in sql server difference between rows clause and range clause in sql server range clause vs rows clause in sql server sql server running total query running total example in sql server In this video we will discuss the difference between rows and range in SQL Server. This is continuation to Part 116. Please watch Part 116 from SQL Server tutorial before proceeding. Let us understand the difference with an example. We will use the following Employees table in this demo. SQL Script to create the Employees table Create Table Employees ( Id int primary key, Name nvarchar(50), Salary int ) Go Insert Into Employees Values (1, 'Mark', 1000) Insert Into Employees Values (2, 'John', 2000) Insert Into Employees Values (3, 'Pam', 3000) Insert Into Employees Values (4, 'Sara', 4000) Insert Into Employees Values (5, 'Todd', 5000) Go Calculate the running total of Salary and display it against every employee row The following query calculates the running total. We have not specified an explicit value for ROWS or RANGE clause. SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary) AS RunningTotal FROM Employees So the above query is using the default value which is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW This means the above query can be re-written using an explicit value for ROWS or RANGE clause as shown below. SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Employees We can also achieve the same result, by replacing RANGE with ROWS SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Employees What is the difference between ROWS and RANGE To understand the difference we need some duplicate values for the Salary column in the Employees table. Execute the following UPDATE script to introduce duplicate values in the Salary column Update Employees set Salary = 1000 where Id = 2 Update Employees set Salary = 3000 where Id = 4 Go Now execute the following query. Notice that we get the running total as expected. SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Employees The following query uses RANGE instead of ROWS SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Employees Notice we don't get the running total as expected. So, the main difference between ROWS and RANGE is in the way duplicate rows are treated. ROWS treat duplicates as distinct values, where as RANGE treats them as a single entity. All together side by side. The following query shows how running total changes 1. When no value is specified for ROWS or RANGE clause 2. When RANGE clause is used explicitly with it's default value 3. When ROWS clause is used instead of RANGE clause SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary) AS [Default], SUM(Salary) OVER(ORDER BY Salary RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS [Range], SUM(Salary) OVER(ORDER BY Salary ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS [Rows] FROM Employees Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/difference-between-rows-and-range.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/difference-between-rows-and-range_8.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: 30761 kudvenkat
Part 1   How to find nth highest salary in sql
 
11:45
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/05/part-1-how-to-find-nth-highest-salary_17.html This is a very common SQL Server Interview Question. There are several ways of finding the nth highest salary. By the end of this video, we will be able to answer all the following questions as well. How to find nth highest salary in SQL Server using a Sub-Query How to find nth highest salary in SQL Server using a CTE How to find the 2nd, 3rd or 15th highest salary Let's use the following Employees table for this demo Use the following script to create Employees table Create table Employees ( ID int primary key identity, FirstName nvarchar(50), LastName nvarchar(50), Gender nvarchar(50), Salary int ) GO Insert into Employees values ('Ben', 'Hoskins', 'Male', 70000) Insert into Employees values ('Mark', 'Hastings', 'Male', 60000) Insert into Employees values ('Steve', 'Pound', 'Male', 45000) Insert into Employees values ('Ben', 'Hoskins', 'Male', 70000) Insert into Employees values ('Philip', 'Hastings', 'Male', 45000) Insert into Employees values ('Mary', 'Lambeth', 'Female', 30000) Insert into Employees values ('Valarie', 'Vikings', 'Female', 35000) Insert into Employees values ('John', 'Stanmore', 'Male', 80000) GO To find the highest salary it is straight forward. We can simply use the Max() function as shown below. Select Max(Salary) from Employees To get the second highest salary use a sub query along with Max() function as shown below. Select Max(Salary) from Employees where Salary [ (Select Max(Salary) from Employees) To find nth highest salary using Sub-Query SELECT TOP 1 SALARY FROM ( SELECT DISTINCT TOP N SALARY FROM EMPLOYEES ORDER BY SALARY DESC ) RESULT ORDER BY SALARY To find nth highest salary using CTE WITH RESULT AS ( SELECT SALARY, DENSE_RANK() OVER (ORDER BY SALARY DESC) AS DENSERANK FROM EMPLOYEES ) SELECT TOP 1 SALARY FROM RESULT WHERE DENSERANK = N To find 2nd highest salary we can use any of the above queries. Simple replace N with 2. Similarly, to find 3rd highest salary, simple replace N with 3. Please Note: On many of the websites, you may have seen that, the following query can be used to get the nth highest salary. The below query will only work if there are no duplicates. WITH RESULT AS ( SELECT SALARY, ROW_NUMBER() OVER (ORDER BY SALARY DESC) AS ROWNUMBER FROM EMPLOYEES ) SELECT SALARY FROM RESULT WHERE ROWNUMBER = 3
Views: 780646 kudvenkat
Creating Calculated Items Using Oracle BI EE
 
02:26
This video teaches you how to create a calculated item for a specific set of data values. A calculated item is a computation between members. To find out more about Oracle BI EE, see the documentation at https://docs.oracle.com/en/middleware Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
JOINs and UNIONs - How Do I Know When to Use a JOIN or UNION
 
06:59
Visit LearnItFirst, our new channel with over 100 videos! --------------------------------------------------------------------------------- So many newbies to Transact-SQL have difficulties determing when to use a UNION or a JOIN to satisy their query. This video teaches you some guidelines to help you quickly and easily identify whether your query will likely need to become a JOIN or UNION. Disclaimer: these are just guidelines and they will not work in every situation but they are applicable for most SQL developers most of the time. Author: Scott Whigham Versions: SQL Server 2008, SQL Server 2005, SQL Server 2000/7.0
Views: 48841 LearnSqlServerDotCom
Difference between cube and rollup in SQL Server
 
05:38
difference between cube and rollup in sql server 2008 sql server rollup vs cube difference between cube and rollup in sql server 2005 rollup and cube in sql server 2005 In this video we will discuss the difference between cube and rollup in SQL Server. CUBE generates a result set that shows aggregates for all combinations of values in the selected columns, where as ROLLUP generates a result set that shows aggregates for a hierarchy of values in the selected columns. Let us understand this difference with an example. ROLLUP(Continent, Country, City) produces Sum of Salary for the following hierarchy Continent, Country, City Continent, Country, Continent () CUBE(Continent, Country, City) produces Sum of Salary for all the following column combinations Continent, Country, City Continent, Country, Continent, City Continent Country, City Country, City () SELECT Continent, Country, City, SUM(SaleAmount) AS TotalSales FROM Sales GROUP BY ROLLUP(Continent, Country, City) SELECT Continent, Country, City, SUM(SaleAmount) AS TotalSales FROM Sales GROUP BY CUBE(Continent, Country, City) You won't see any difference when you use ROLLUP and CUBE on a single column. Both the following queries produces the same output. SELECT Continent, Sum(SaleAmount) AS TotalSales FROM Sales GROUP BY ROLLUP(Continent) -- OR SELECT Continent, SUM(SaleAmount) AS TotalSales FROM Sales GROUP BY CUBE(Continent) Text version of the video http://csharp-video-tutorials.blogspot.com/2015/09/difference-between-cube-and-rollup-in.html Slides http://csharp-video-tutorials.blogspot.com/2015/09/difference-between-cube-and-rollup-in_24.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: 39207 kudvenkat
Understanding Correlated Queries in SQL
 
08:13
Join Discussion: http://www.techtud.com/video-lecture/understanding-correlated-queries-sql IMPORTANT LINKS: 1) Official Website: http://www.techtud.com/ 2) Virtual GATE: http://virtualgate.in/login/index.php Both of the above mentioned platforms are COMPLETELY FREE, so feel free to Explore, Learn, Practice & Share! Our Social Media Links: Facebook Page: https://www.facebook.com/techtuduniversity Facebook Group: https://www.facebook.com/groups/virtualgate Google+ Page: https://plus.google.com/+techtud/posts Last but not the least, SUBSCRIBE our YouTube channel to stay updated about the regularly uploaded new videos.
Views: 39391 Techtud
SQLite Queries: UNION, INTERSECT and EXCEPT
 
08:25
This video shows how to use the SQL set operations of UNION, INTERSECT, and EXCEPT to manipulate your database in database queries. For more details, go to http://www.squidoo.com/sqlitedatabasedesign.
Views: 5406 Jay Godse
SQL implicit joins and compound queries with UNION and MINUS(EXCEPT)
 
23:49
This video demonstrates compound queries using UNION and MINUS(Oracle, EXCEPT for ANSI), and implicit join statement construction using some pre-load table information.
Views: 1110 C.S. Taylor, Jr.
SQL Intersect Operator with Example in Hindi, English on Oracle 11g Database
 
05:06
SQL Tutorial for Beginners in Hindi and English SQL Intersect Operator with Example in Hindi, English on Oracle 11g Database
SQL UNION clause Telugu | SQL - Union Statement-vlr training
 
03:08
For all sql videos in Telugu :http://www.vlrtraining.in/sql-training-videos-telugu/ In Telugu: SQL UNION clause Telugu SQL - Union Statement SQL: UNION Operator The SQL UNION clause/operator is used to combine the results of two or more SELECT statements without returning any duplicate rows. In English: download sql study material Website: http://www.vlrtrain.in/2016/09/download-sql-files.html Learn SQL sql tutorial for beginners sql commands oracle sql tutorial sql tutorial advanced mysql tutorial sql tutorial video SQL Tutorial, Tutorials SQL
Views: 702 VLR Training
SQL AND/OR Operator with Example in Oracle 11g Database
 
09:56
SQL Tutorial for Beginners in Hindi and English SQL AND/OR Operator with Example in Oracle 11g Database
Oracle SQL Join Tutorials
 
19:48
Oracle SQL Join Tutorials. Different types of joins and examples. For Full Course Experience Please Go To http://mentorsnet.org/course_preview?course_id=4 Full Course Experience Includes 1. Access to course videos and exercises 2. View & manage your progress/pace 3. In-class projects and code reviews 4. Personal guidance from your Mentors
Views: 101031 Oresoft LWC
50. Subquery or Inner Query or Nested Query in PL/SQL Oracle
 
03:40
In this video you will learn about Subquery or Inner Query or Nested Query in PL/SQL Oracle. For Support =========== Email: [email protected] Contact Form: http://www.learninhindi.com/home/contact Our Social Media ================ Facebook: https://www.facebook.com/LearnInHindi Twitter: https://twitter.com/LearnInHindi For Training & Videos ===================== For more videos and articles visit: http://www.learninhindi.com Free Java Programming In Hindi Course ===================================== https://www.youtube.com/playlist?list=PLOZ3jentlCDAwwhMyoLISrxkXTADGp7PH Free Oracle PL/SQL Programming In Hindi Course ============================================== https://www.youtube.com/playlist?list=PLB5DA82419C2D99B6 Free C Programming In Hindi Course ================================== https://www.youtube.com/playlist?list=PLOZ3jentlCDAxKpBLMWogxSdy6BZcsAJq Trips & Tricks Channel ====================== https://www.youtube.com/channel/UCGmLfkuCo-3lHHJXRJ9HUMw Programming in Hindi Channel ============================ https://www.youtube.com/channel/UCudElIDgwNrybeAvXIy1HZQ
Views: 5966 ITORIAN
SQL Server interview questions :- What are Sub Query and Co-related Queries ?
 
09:39
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 In this video we will try to understand what are SQL server sub queries , co-related queries and how they differ from each other. We are also distributing a 100 page Ebook "Sql Server 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: 227138 Questpond
Lesson 8 - SQL BETWEEN, IN and More Filtering (Oracle SQL Certification)
 
19:59
In this lesson we continue on from the last lesson and dive deeper into query filtering using the BETWEEN, IN and NULL keywords
Views: 3205 Imtiaz Ahmad
63 - Oracle Subqueries - Nested Queries تعليم أوراكل
 
33:25
by Mohamed El Desouki - محمد الدسوقى [email protected] Tel :00966 553450836 جامعة سلمان بن عبد العزيز - السعودية - الخرج Database 2 - Subqueries in Arabic Text Book: Fundamentals of Database Systems, 5th Edition, by Elmasri/Navathe, published by Addison-W
The SQL EXISTS clause
 
08:52
How to use the EXISTS clause in SQL. For beginners.
Views: 20047 Database by Doug
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: 160927 Questpond