Home
Search results “Merge rownum oracle”
Merge Statement in Oracle SQL with Example (UPDATE/DELETE or INSERT)
 
15:04
This video demonstrates how to write a Merge Statement in oracle sql, how it is useful in doing a conditional update or delete or both of them when the condition between the target table and source table is evaluated to true, and how we can insert the record into the target table when condition is evaluated to false. The video also shows the use of UPDATE, DELETE and INSERT with Merge, and also the various possible ways to use a Merge statement!!!
Views: 6266 Kishan Mashru
ROWID & ROWNUM in Oracle/ عربي
 
08:15
ROWID & ROWNUM in Oracle
Views: 846 khaled alkhudari
how to use "ROWNUM" in oracle
 
09:05
this video shows how we can display a range of records in ORACLE DATABASE using SQL
Views: 1698 P-Square Technologies
Part 69   Merge in SQL Server
 
07:14
Text version of the video http://csharp-video-tutorials.blogspot.com/2014/09/part-69-merge-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2014/09/part-69-merge-in-sql-server_30.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 What is the use of MERGE statement in SQL Server Merge statement introduced in SQL Server 2008 allows us to perform Inserts, Updates and Deletes in one statement. This means we no longer have to use multiple statements for performing Insert, Update and Delete. With merge statement we require 2 tables 1. Source Table - Contains the changes that needs to be applied to the target table 2. Target Table - The table that require changes (Inserts, Updates and Deletes) The merge statement joins the target table to the source table by using a common column in both the tables. Based on how the rows match up as a result of the join, we can then perform insert, update, and delete on the target table. Merge statement syntax MERGE [TARGET] AS T USING [SOURCE] AS S ON [JOIN_CONDITIONS] WHEN MATCHED THEN [UPDATE STATEMENT] WHEN NOT MATCHED BY TARGET THEN [INSERT STATEMENT] WHEN NOT MATCHED BY SOURCE THEN [DELETE STATEMENT] Example 1 : In the example below, INSERT, UPDATE and DELETE are all performed in one statement 1. When matching rows are found, StudentTarget table is UPDATED (i.e WHEN MATCHED) 2. When the rows are present in StudentSource table but not in StudentTarget table those rows are INSERTED into StudentTarget table (i.e WHEN NOT MATCHED BY TARGET) 3. When the rows are present in StudentTarget table but not in StudentSource table those rows are DELETED from StudentTarget table (i.e WHEN NOT MATCHED BY SOURCE) Create table StudentSource ( ID int primary key, Name nvarchar(20) ) GO Insert into StudentSource values (1, 'Mike') Insert into StudentSource values (2, 'Sara') GO Create table StudentTarget ( ID int primary key, Name nvarchar(20) ) GO Insert into StudentTarget values (1, 'Mike M') Insert into StudentTarget values (3, 'John') GO MERGE INTO StudentTarget AS T USING StudentSource AS S ON T.ID = S.ID WHEN MATCHED THEN UPDATE SET T.NAME = S.NAME WHEN NOT MATCHED BY TARGET THEN INSERT (ID, NAME) VALUES(S.ID, S.NAME) WHEN NOT MATCHED BY SOURCE THEN DELETE; Please Note : Merge statement should end with a semicolon, otherwise you would get an error stating - A MERGE statement must be terminated by a semi-colon (;) In real time we mostly perform INSERTS and UPDATES. The rows that are present in target table but not in source table are usually not deleted from the target table. Example 2 : In the example below, only INSERT and UPDATE is performed. We are not deleting the rows that are present in the target table but not in the source table. Truncate table StudentSource Truncate table StudentTarget GO Insert into StudentSource values (1, 'Mike') Insert into StudentSource values (2, 'Sara') GO Insert into StudentTarget values (1, 'Mike M') Insert into StudentTarget values (3, 'John') GO MERGE INTO StudentTarget AS T USING StudentSource AS S ON T.ID = S.ID WHEN MATCHED THEN UPDATE SET T.NAME = S.NAME WHEN NOT MATCHED BY TARGET THEN INSERT (ID, NAME) VALUES(S.ID, S.NAME);
Views: 89602 kudvenkat
PL/SQL Tutorial 2 (Oracle): Concatenate Command
 
01:48
PL/SQL Tutorial 2 (Oracle): Concatenate Command In this tutorial I show you how to use the concatenate command in PL/SQL. 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: 295 CodingWithMitch
ORACLE SQL AND PL/SQL INTERVIEW QUESTION : DELETE DUPLICATE RECORDS FROM  A TABLE(3 ways)
 
13:15
This video tutorial demonstrates about how we can delete duplicate records from a table, the video shows 3 different ways to delete duplicate record from a table, one using Group by, second one by using correlated joins and third on by using rownum analytical function You can get the code from our website http://oracleplsqlblog.com/FullBlog/FullBlog/21
Views: 2999 Kishan Mashru
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: 164790 kudvenkat
Hands-On SQL - Combine Column Data
 
03:33
This query challenge is part of our free course, "HANDS-ON SQL For Beginners: SELECT, FROM, and WHERE". You can get access to the course at this link:
Views: 223 Learn To SQL
Hierarchical Queries in Oracle (CONNECT BY)
 
03:05
This video demonstrates one of the ways to query hierarchical data from Oracle. For more information see: https://oracle-base.com/articles/misc/hierarchical-queries Website: https://oracle-base.com Blog: https://oracle-base.com/blog Twitter: https://twitter.com/oraclebase Cameo by Arjen Visser Blog: http://blog.dbvisit.com/ Twitter: https://twitter.com/dbvisit Website: http://www.dbvisit.com/ Cameo appearances are for fun, not an endorsement of the content of this video.
Views: 24099 ORACLE-BASE.com
5 of 6  SQL Advanced with Oracle - A query with nested aggregate functions
 
03:16
This video gives an example of nested aggregate functions. A subquery with aggregate functions is placed in the WHERE clause of the outer query, which also contains aggregate functions. (5 of 6) There is also an "SQL Fundamentals" series. (Search for "databasemec" for tutorials using SQL Server.)
Views: 8802 Jennifer Kreie
DUAL Table In Oracle | Oracle Tutorials for Beginners
 
02:51
DUAL Table In Oracle Oracle Tutorials for Beginners Purpose of Dual Table In Oracle Oracle Tutorials for Beginners Oracle pl/sql Tutorials for Beginners Oracle plsql Tutorials for Beginners Dual Table Dual Table in Oracle What is Dual Table In Oracle What is the Purpose of Dual table in oracle? What is meat by Dual table in Oracle Oracle Tutorials for Beginners Oracle pl/sql Tutorials for Beginners Oracle Tutorials for Beginners Oracle pl/sql Tutorials for Beginners Oracle Tutorials for Beginners Oracle pl/sql Tutorials for Beginners Oracle Tutorials for Beginners Oracle pl/sql Tutorials for Beginners
Views: 240 Oracle PL/SQL World
Merge Statements in T-SQL
 
09:51
Merge statements provide a flexible approach to manipulate data in a "target" table based on a join to a "source" table. The enable users to perform a large # of updates and/or inserts in a target table using a single T-SQL statement. The code to follow along with this tutorial can be found at www.analyticsinaction.com/merge/ I also have a comprehensive 60 minute T-SQL course available at Udemy : https://www.udemy.com/t-sql-for-data-analysts/?couponCode=ANALYTICS50%25OFF
Views: 9668 Steve Fox
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: 1045 Blake B
SQL TUTORIALS : How to join 2 column in sql
 
04:20
how to use Concatenation operator in sql plus. How to join 2 columns with the help of concatenation operator
Views: 8752 learnoracle9i
SQL QUERY 5 ||Combining two table data into a single table using Rownumber|| Explained by KJ VINOD||
 
03:30
CREATE TABLE A (ID INT) INSERT INTO A Values(1),(2),(3),(4) CREATE TABLE B (ID1 INT) INSERT INTO B Values(5),(6),(7),(8) SELECT * FROM A SELECT * from B
Views: 372 KJVinod SQL Queries
What to choose for performance   SubQuery or Joins   Part 62
 
12:26
Text version of the video http://csharp-video-tutorials.blogspot.com/2013/01/what-to-choose-for-performance.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-62-what-to-choose-for-performance.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 What to choose for performance - SubQuery or Joins According to MSDN, in sql server, in most cases, there is usually no performance difference between queries that uses sub-queries and equivalent queries using joins. For example, on my machine I have 400,000 records in tblProducts table 600,000 records in tblProductSales tables The following query, returns, the list of products that we have sold atleast once. This query is formed using sub-queries. When I execute this query I get 306,199 rows in 6 seconds Select Id, Name, Description from tblProducts where ID IN ( Select ProductId from tblProductSales ) At this stage please clean the query and execution plan cache using the following T-SQL command. CHECKPOINT; GO DBCC DROPCLEANBUFFERS; Go DBCC FREEPROCCACHE; GO Now, run the query that is formed using joins. Notice that I get the exact same 306,199 rows in 6 seconds. Select distinct tblProducts.Id, Name, Description from tblProducts inner join tblProductSales on tblProducts.Id = tblProductSales.ProductId Please Note: I have used automated sql script to insert huge amounts of this random data. Please watch Part 61 of SQL Server tutorial, in which we have discussed about this automated script. According to MSDN, in some cases where existence must be checked, a join produces better performance. Otherwise, the nested query must be processed for each result of the outer query. In such cases, a join approach would yield better results. The following query returns the products that we have not sold atleast once. This query is formed using sub-queries. When I execute this query I get 93,801 rows in 3 seconds Select Id, Name, [Description] from tblProducts where Not Exists(Select * from tblProductSales where ProductId = tblProducts.Id) When I execute the below equivalent query, that uses joins, I get the exact same 93,801 rows in 3 seconds. Select tblProducts.Id, Name, [Description] from tblProducts left join tblProductSales on tblProducts.Id = tblProductSales.ProductId where tblProductSales.ProductId IS NULL In general joins work faster than sub-queries, but in reality it all depends on the execution plan that is generated by SQL Server. It does not matter how we have written the query, SQL Server will always transform it on an execution plan. If sql server generates the same plan from both queries, we will get the same result. I would say, rather than going by theory, turn on client statistics and execution plan to see the performance of each option, and then make a decision. In a later video session we will discuss about client statistics and execution plans in detail.
Views: 78657 kudvenkat
Oracle - SQL - Advanced Subqueries
 
11:29
Oracle - SQL - Advanced Subqueries Watch more Videos at https://www.tutorialspoint.com/videotutorials/index.htm Lecture By: Mr. Anadi Sharma, Tutorials Point India Private Limited.
Fun@SQL: Sql Tips - Video- 01: Merging Leave Dates
 
10:11
Merging multiple continuous broken dates into single record
Records in Oracle PLSQL
 
13:13
Complete Oracle PLSQL Tutorial Playlist here https://www.youtube.com/playlist?list=PLI5t0u6ye3FE_9SZcS0cQZDU2qn0uB1Oi ************************************************** This Video Covers the following in Oracle PLSQL 1. Composite Data Types - Records 2. DECLARE a Implicit Record and Explicit Record 3. %TYPE 4. %ROWTYPE 5. Assigning Values to a Records 6. Fetch Values from a record 7. Difference Between Record and Collections
Views: 4256 yrrhelp
SQL: Savepoint (TCL Command)
 
03:55
In this tutorial, you'll learn one of the TCL command i.e Savepoint..
Views: 9333 radhikaravikumar
Part 12   Can we join two tables without primary foreign key relation
 
10:38
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/09/part-12-can-we-join-two-tables-without.html Can we join two tables without primary foreign key relation Yes, we can join two tables without primary foreign key relation as long as the column values involved in the join can be converted to one type. ID column in Departments table is not the primary Key and DepartmentId column in Employees table is not the foreign key. But we can still join these tables using ID column from Departments table and DepartmentId column from Employees table, as both the columns involved in the join have same data type i.e int. Select Employees.Name as EmployeeName, Departments.Name as DepartmentName from Employees join Departments on Departments.ID = Employees.DepartmentId The obious next question is, if primary foreign key relation is not mandatory for 2 tables to be joined then what is the use of these keys? Primary key enforces uniqueness of values over one or more columns. Since ID is not a primary key in Departments table, 2 or more departments may end up having same ID value, which makes it impossible to distinguish between them based on the ID column value. Foreign key enforces referential integrity. Without foreign key constraint on DepartmentId column in Employees table, it is possible to insert a row into Employees table with a value for DepartmentId column that does not exist in Departments table. The following insert statement, successfully inserts a new Employee into Employees table whose DepartmentId is 100. But we don't have a department with ID = 100 in Departments table. This means this employee row is an orphan row, and the referential integrity is lost as result Insert into Employees values (8, 'Mary', 'Female', 80000, 100) If we have had a foreign key constraint on DepartmentId column in Employees table, the following insert statement would have failed with the following error. Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with the FOREIGN KEY constraint. The conflict occurred in database "Sample", table "dbo.Departments", column 'ID'.
Views: 101169 kudvenkat
21/125 Oracle PLSQL: Nested Loops & Labels
 
09:01
تعلم اوراكل دورات اوراكل learn Oracle
Views: 779 khaled alkhudari
SQL * Loader Tutorial 3: SQL Loader  Conventional and Direct Paths
 
04:43
SQL * Loader Tutorial 3: SQL Loader Conventional and Direct Paths Difference Between Conventional and Direct path loading in SQL * Loader 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: 730 TechLake
Single Row Subqueries (Introduction to Oracle SQL)
 
03:01
Explains what a single row subquery is and how it's used. This is a subquery that returns one row. The full Introduction to Oracle SQL course is available here: https://www.databasestar.com/introduction-to-oracle-sql-course/
Views: 152 Database Star
SQL Server join :- Inner join,Left join,Right join and full outer join
 
08:11
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 four important concepts Inner joins,Left join,Right join and full outer joins. 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: 754111 Questpond
PIVOT and UNPIVOT Operators in Oracle Database 11g
 
03:03
A quick example of using the PIVOT and UNPIVOT operators introduced in Oracle Database 11g. For more information see: https://oracle-base.com/articles/11g/pivot-and-unpivot-operators-11gr1 Website: https://oracle-base.com Blog: https://oracle-base.com/blog Twitter: https://twitter.com/oraclebase Cameo by Moans Norgaard Blog: http://wedonotuse.blogspot.co.uk/ Twitter: https://twitter.com/mnorgaard Cameo appearances are for fun, not an endorsement of the content of this video.
Views: 8282 ORACLE-BASE.com
3 2 intro to oracle datatypes
 
08:35
Video from our Oracle SQL course. Check out the full course at.. http://learn.hackpress.co/courses/oracle-sql-learning-by-example
Views: 2543 etldeveloper
Oracle tutorial : With Clause In Oracle
 
12:51
This oracle video will show you how to use With Clause In Oracle PL SQL. with in pl sql oracle tutorial for beginners With clause is used to simplify the complex sql queries. By using the with clause you can get faster query performance. You can simplify the complex subquery logic. WITH clause is called subquery factoring. For more tutorial please visit #techquerypond https://techquerypond.com https://techquerypond.wordpress.com https://twitter.com/techquerypond
Views: 7858 Tech Query Pond
How to Delete Duplicate records(rows) in SQL Server
 
10:21
This video shows to find duplicate records and how to delete Duplicate records in a table.This video explains , best 5 methods to delete duplicate records in table.In this way we can maintain Accuracy and consistence of data data in Database .
Views: 30393 Tech Jago
Oracle Analytic Functions In-Depth / NEW UDEMY COURSE
 
03:02
To all my students that enrolled in my Oracle SQL & PL/SQL course: It is time now for advanced SQL, the Best Course Ever and the only course in udemy which talk about this topic in details You will learn many things: • Use SQL with aggregation operators. • SQL for Analysis and Reporting functions • Group and aggregate data using the ROLLUP and CUBE operators • The GROUPING function • Composite Columns and the concatenated Groupings • RANK & DENSE_RANK • PERCENT_RANK • CUME_DIST (cumulative distribution) • The LAG/LEAD Functions • LISTAGG function • Aggregate functions VS Analytic Part • Aggregate functions & windowing clause In-Depth • Moving Average and running totals • ROWNUM & ROW_NUMBER • And much more Take it now 10.99$ https://www.udemy.com/oracle-analytic-functions-in-depth/?couponCode=KHKH10
Views: 247 khaled alkhudari
PL/SQL: Materialized Views Part-1
 
04:40
In this tutorial, you'll know what are materialized views
Views: 38333 radhikaravikumar
Oracle - Sub-Queries
 
07:03
Oracle - Sub-Queries
Views: 9673 Chris Ostrowski
06 05  Merge Clause
 
02:38
Views: 494 solubletech
Tune Query without Changing Code using DBMS_ADVANCED_REWRITE
 
14:10
Tune Query without modifying SQL using DBMS ADVANCED REWRITE
Views: 9178 Anindya Das
12c SQL Performance Features Adaptive Execution Plans
 
09:12
See Oracle Database change a SQL execution plan - during execution!! See more free 12c features lessons at http://www.skillbuilders.com/free-12c-performance-features-training-2.
Views: 239 SkillBuilders
T-SQL: ROW_NUMBER(), RANK(), DENSE_RANK() & NTILE()
 
07:39
T-SQL: ROW_NUMBER(), RANK(), DENSE_RANK() & NTILE() Please check my blog azizsharif.blogspot.com for more videos!
SQL Server Ranking Functions
 
10:12
Microsoft SQL Server- Ranking functions - Row_Number(),Rank(),Dense_Rank(),NTile()
Views: 271 Hima Bindu
Learn Oracle | Using Case Function, Decode Function in SQL
 
03:31
Pebbles present, Learn Oracle 10g with Step By Step Video Tutorials. Learn Oracle 10g Tutorial series contains the following videos : Learn Oracle - History of Oracle Learn Oracle - What is Oracle - Why do we need Oracle Learn Oracle - What is a Database Learn Oracle - What is Grid Computing Learn Oracle - What is Normalization Learn Oracle - What is ORDBMS Learn Oracle - What is RDBMS Learn Oracle - Alias Names, Concatenation, Distinct Keyword Learn Oracle - Controlling and Managing User Access (Data Control Language) Learn Oracle - Introduction to SQL Learn Oracle - Oracle 10g New Data Types Learn Oracle - How to Alter a Table using SQL Learn Oracle - How to Create a Package in PL SQL Learn Oracle - How to Create a Report in SQL Plus Learn Oracle - How to Create a Table using SQL - Not Null, Unique Key, Primary Key Learn Oracle - How to Create a Table using SQL Learn Oracle - How to Create a Trigger in PL SQL Learn Oracle - How to Delete Data from a Table using SQL Learn Oracle - How to Drop and Truncate a Table using SQL Learn Oracle - How to Insert Data in a Table using SQL Learn Oracle - How to open ISQL Plus for the first time Learn Oracle - How to Open SQL Plus for the First Time Learn Oracle - How to Update a Table using SQL Learn Oracle - How to use Aggregate Functions in SQL Learn Oracle - How to use Functions in PL SQL Learn Oracle - How to use Group By, Having Clause in SQL Learn Oracle - How to Use Joins, Cross Join, Cartesian Product in SQL Learn Oracle - How to use Outer Joins (Left, Right, Full) in SQL Learn Oracle - How to use the Character Functions, Date Functions in SQL Learn Oracle - How to use the Merge Statement in SQL Learn Oracle - How to use the ORDER BY Clause with the Select Statement Learn Oracle - How to use the SELECT Statement Learn Oracle - How to use the Transactional Control Statements in SQL Learn Oracle - How to use PL SQL Learn Oracle - Data Types in PL SQL Learn Oracle - Exception Handling in PL SQL Learn Oracle - PL SQL Conditional Logics Learn Oracle - PL SQL Cursor Types - Explicit Cursor, Implicit Cursor Learn Oracle - PL SQL Loops Learn Oracle - Procedure Creation in PL SQL Learn Oracle - Select Statement with WHERE Cause Learn Oracle - SQL Operators and their Precedence Learn Oracle - Using Case Function, Decode Function in SQL Learn Oracle - Using Logical Operators in the WHERE Clause of the Select Statement Learn Oracle - Using Rollup Function, Cube Function Learn Oracle - Using Set Operators in SQL Learn Oracle - What are the Different SQL Data Types Learn Oracle - What are the different types of Databases Visit Pebbles Official Website - http://www.pebbles.in Subscribe to our Channel – https://www.youtube.com/channel/UCNNjWVsQqaMYccY044vtHJw?sub_confirmation=1 Engage with us on Facebook at https://www.facebook.com/PebblesChennai Please Like, Share, Comment & Subscribe
Views: 354 Pebbles Tutorials
SQL UPDATE Telugu - Learn How to Update Data Rows using Update Statement in SQL-vlr training
 
06:37
For all sql videos in Telugu :http://www.vlrtraining.in/sql-training-videos-telugu/ In Telugu: SQL update statement How to Update Query in SQL SQL: using JOIN in UPDATE Query How to UPDATE from SELECT in SQL Server 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: 1339 VLR Training
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: 29882 kudvenkat
Rows Unbounded Preceding, Following in SQL Server
 
11:35
Click here to Subscribe to IT PORT Channel : https://www.youtube.com/channel/UCMjmoppveJ3mwspLKXYbVlg From SQL Server 2012, This feature enabled to OVER BY Windowing Functions The ROWS limits the rows within a partition by specifying a fixed number of rows preceding or following the current row. Preceding and following rows are defined based on the ordering in the ORDER BY clause ROWS BETWEEN 1 PRECEDING AND CURRENT ROW – Aggregates 2 Between Last Row and Current Row ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING – Aggregates 2 Current Row and Next Row ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW – Aggregates all Rows before Current Row with Current Row ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING – Aggregates all the Rows After Current Row With Current Row ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING – Aggregates all Rows
Views: 957 IT Port
Generating random numbers in Oracle
 
03:30
For more tutorial please visit #techquerypond https://techquerypond.com https://techquerypond.wordpress.com https://twitter.com/techquerypond
Views: 484 Tech Query Pond
Subqueries in oracle
 
16:18
Views: 124 Adam Tech
oracle flashback technologies 640x480
 
17:38
Sometimes it is a rouge query, sometimes a simple data clean up effort by the users, whatever may the cause be, inadvertent data-loss is a very common phenomenon. Backup and recovery capabilities are provided by the database management systems which ensure the safety and protection of valuable enterprise data in case of data loss however, not all data-loss situations call for a complete and tedious recovery exercise from the backup. Oracle introduced flashback features in Oracle 9i and 10g to address simple data recovery needs. Flashback query allows a user to view the data quickly and easily the way it was at a particular time in the past, even when it is modified and committed, be it a single row or the whole table. This article is an introduction to the flashback feature of Oracle and discusses how to use this feature in Oracle 9i and 10g. Its main focus is the usage of flashback queries, not the mechanism that governs it.
What is Autonomous transaction in Oracle
 
05:05
What is Autonomous transaction in Oracle. This is very frequently asking question in Interview. Hello Friend, in this Video You can learn how we can give the answer of Autonomous Transactions. An autonomous transaction is available from Oracle 8i. It is a very cool, useful, unique and powerful feature in oracle. An autonomous transaction is an independent transaction that is initiated by another transaction. It must contain at least one Structured Query Language (SQL) statement. When an autonomous transaction is called, the original transaction (calling transaction) is temporarily suspended. The autonomous transaction must commit or roll back before it returns control to the calling transaction. Once changes have been made by an autonomous transaction, those changes are visible to other transactions in the database. Autonomous transactions can be nested. For use Autonomous Transactions feature in program we have to use PRAGMA AUTONOMOUS_TRANSACTION Key word in Program When to use Autonomous Transactions? • Logging mechanism you need to log an error to your database log table. On the other hand, you need to roll back your core transaction because of the error. And you don't want to roll back over other log entries. • Commits and rollbacks in your database triggers If you define a trigger as an autonomous transaction, then you can commit and/or roll back in that code. • Software usage meter You want to keep track of how often a program is called during an application session. This information is not dependent on, and cannot affect, the transaction being processed in the application. Mutation Error Using autonomous transaction we can avoid mutation error. IF you want to share with your friend this video you can copy below block of text with link and past your friend group. ----------------------------------------------------------------------------- What is autonomous transaction in Oracle This is a very frequently ask Question in Interview Please Share this video with your friends and Oracle groups and communities. https://www.youtube.com/watch?v=gyvFajpfoWE ----------------------------------------------------------------------------- For More video's you can use blow link. https://www.youtube.com/user/rameshwargupta1/videos Join With us our Facebook Group for PLSQL Interview Q/A https://www.facebook.com/groups/146487615764170/ Join our Blogs http://oracletemple.blogspot.in/ Watch More... 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
Views: 13013 Ram Gupta
Find Duplicate Rows in SQL - Select Statement Tutorial
 
02:06
Find duplicate row values in a field or multiple fields in SQL Server table with this tutorial. Do this for one column, or multiple columns. Uses SQL Server Management Studio for the demonstration.
Views: 37488 Edward Kench
Identify and Delete Duplicate records (rows) - SQL Server
 
10:08
Identify and Delete Duplicate records/rows. Check and get the script here in my blog: http://sqlwithmanoj.com/2011/10/14/identify-delete-duplicate-records-from-a-table/ For more updates like my page in FB: https://www.facebook.com/sqlwithmanoj
Views: 18357 SQL with Manoj
LAST VALUE function in SQL Server
 
05:35
last_value function in sql server 2008 sql server last_value function returns incorrect data sql server last_value function example sql server last_value function with partition example LAST_VALUE function in SQL Server In this video we will discuss LAST_VALUE function in SQL Server. LAST_VALUE function Introduced in SQL Server 2012 Retrieves the last value from the specified column ORDER BY clause is required PARTITION BY clause is optional ROWS or RANGE clause is optional, but for it to work correctly you may have to explicitly specify a value Syntax : LAST_VALUE(Column_Name) OVER (ORDER BY Col1, Col2, ...) LAST_VALUE function not working as expected : In the following example, LAST_VALUE function does not return the name of the highest paid employee. This is because we have not specified an explicit value for ROWS or RANGE clause. As a result it is using it's default value RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. SELECT Name, Gender, Salary, LAST_VALUE(Name) OVER (ORDER BY Salary) AS LastValue FROM Employees LAST_VALUE function working as expected : In the following example, LAST_VALUE function returns the name of the highest paid employee as expected. Notice we have set an explicit value for ROWS or RANGE clause to ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING This tells the LAST_VALUE function that it's window starts at the first row and ends at the last row in the result set. SELECT Name, Gender, Salary, LAST_VALUE(Name) OVER (ORDER BY Salary ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS LastValue FROM Employees LAST_VALUE function example with partitions : In the following example, LAST_VALUE function returns the name of the highest paid employee from the respective partition. SELECT Name, Gender, Salary, LAST_VALUE(Name) OVER (PARTITION BY Gender ORDER BY Salary ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS LastValue FROM Employees Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/lastvalue-function-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/lastvalue-function-in-sql-server_9.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 Full SQL Server Course https://www.youtube.com/playlist?list=PL4cyC4G0M1RQ_Rm52cQ4CcOJ_T_HXeMB4 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: 29039 kudvenkat