Skip to main content

Posts

Showing posts from November, 2018

Unix shell scripts

1 Shell Program to Swap Two Numbers  2 Shell Program to Add Two Numbers 3 Shell Program to Find the Biggest of Two Numbers 4 Shell program to Find the Biggest of Three Numbers 5 Shell Program to Find the Area and Circumference of a Circle 6 Shell Program to Find the whether the given Number is Positive, Negative and Zero 7 Shell Program to Find the whether the given Number is Even or Odd 8 Shell Program to Find the whether the given Year is Leap Year or Not 9 Shell Program to Convert Fahrenheit to Celsius and Celsius to Fahrenheit 10 Shell Program to Find the Quotient and Remainder of two Numbers 11 Shell Program to check whether a number is divisible by 5 12 Shell Program to find the sum and average of four integers 13 Shell Program to compute simple interest and compound interest 14 Shell Program to calculate the sum of digits(without using loop) 15 Shell Program to Print the first “N” Odd  Number 16 Shell Program to Print the first “N” Even  Numbe

FOREIGN KEY

Pre-requisits : General understanding of integrity constraints. Constrains are used to prevent invalid data into the table. Integrity constrains are business rules enforced on the data in a table. The enforced rules trigger whenever a row is inserted, updated, or deleted from that table and prevent data that does not meet the set rules. FOREIGN KEY :  Establishes and enforces a relationship between two tables or to the same table itself. The foreign key or referential integrity constraint, designates a column or combination of columns as a foreign key and establishes a relationship between a primary key or a unique key in the same table or a different table.  In the example below   Emp_child  table's deptno   has been defined as the foreign key ; it references the deptno column of the Dept_parent table. Implementation: Step 1 Create parent table DEPT_PARENT as follows: Create table DEPT_PARENT ( Deptno number(2) primary key,   Dname varchar2

Oracle Merge Statement Delta Detection

The MERGE Syntax by Ajay Nerumati Delta Detection in Oracle SQL Posted on  8. October 2016 Delta detection is a common task in every Data Warehouse. It compares new data from a source system with the last versions in the Data Warehouse to find out whether a new version has to be created. There are several ways to implement this in Oracle. Your source system delivers a full extraction every night, and you have to load only the changed rows into your Core Data Warehouse? You receive incremental loads from another source system every few minutes, but only a few columns are loaded into the Data Warehouse. In all these situations, you need a delta detection mechanism to identify the rows that have to be inserted or updated in your Data Warehouse tables. In this blog post, I want to show different methods in Oracle SQL that provide the subset of rows of a source table that were changed since the last load. All these methods are set-based, i.e. they can be executed in one SQL statement.