Posts

Interview in Virtusa

 difference between package/function/procedure what is mutation error can we create index on views/mviews Types of exception/pragma Types of trigger If i have null values. what inner join returns/outer join returns

Top 10 tips to create indexes on database

 1:- On which column we need to create index 2 :- Index depends on workload then on column 3:- For example if DEPTNO and DEPTNAME  is available then index need to be created on deptno and deptname 4:- Index to avoid sorting (group by and order by), to improve sorting ,which can improve performance 5 :- Create index for uniqueness 6 :- Create index for foreign key 7:- Be aware of modification on applications

Migration

DAtabase Design Fact Tables

Image
  Draw.io  is a free online diagram software for making flowcharts, process diagrams, etc. Allows different types of charts like flowcharts, org charts, UML, ER and network diagrams. Allows saving your diagrams to cloud storage services like GDrive, Dropbox and OneDrive, or to your own computer Visual interfaces not as nice as lucidchart.

LIST_AGG function

  SELECT deptno, SUBSTR (LISTAGG(longname, ';' ON OVERFLOW TRUNCATE ) WITHIN GROUP ( ORDER BY EMPNO), 1 , 50 ) AS "Starts..." , '........' , SUBSTR (LISTAGG(longname, ';' ON OVERFLOW TRUNCATE ) WITHIN GROUP ( ORDER BY EMPNO), - 50 ) AS "...Ends" FROM empln WHERE deptno = 20 GROUP BY deptno; However, we can now also trap the error using the new  ON OVERFLOW TRUNCATE  syntax Note:  In the code below I have chopped-up the string returned by LISTAGG so that you don't have to scroll across 32,000 characters to see the effect on the new keywords Removing the count of missing values The final set of new keywords control whether the count of truncated values is shown or not shown. By default, the count is shown and this can be explicitly stated using the  WITH COUNT  syntax. Similarly, it is possible to remove the count by using the  WITHOUT COUNT  keywords after the on overflow... keywords. SELECT deptno, SUBSTR (LISTAGG...

MATCH_RECOGNIZE - Fraud demo for OracleCODE events

  This is a simple demo showing how to use SQL pattern matching for fraud analysis. It is part of a presentation for the Oracle CODE events program for developers. In Database 12c there is a new SQL construct MATCH_RECOGNIZE for finding rows matching a pattern across a sequence of rows, using a regular expressions. Pattern matching using SQL is based around four logical concepts: Logically partition and order the data/li> Define pattern using regular expression and pattern variables/li> Regular expression is matched against a sequence of rows/li> Each pattern variable is defined using conditions on rows and aggregates irst step is to create the JSON table that will hold our transaction log. The log will provide the details of the time, account/user id, type of event (deposit or transfer) and the transaction amount. Oracle Database 12c supports storing JSON documents inside the database. Use following code to create a table to store the transaction log which is in JSON form...

Materialized Views

A materialized view is  a view that contains the result of a query. The From clause of the query can have a name from a table, view and a materialized view. It needs privileges before executing create command, you must have system privilege. To create table ,query rewrite enabled must have privilege, you must have SELECT privilege with GRANT OPTION  on the container table.