Wednesday, January 9, 2019

Objective of Dataware House



Data Warehouse is designed to meet some business needs, which is transaction system cannot do (and vice versa). Data Warehouse is designed to meet some business needs, which is transaction system cannot do (and vice versa). he big question is on why we have to create a Data-Warehouse?. The reasons are as follows.
As a starter, let’s say you want to know the monthly variations in 3 months running average on your customer balances over last twelve months grouped by products+ channels+ customer segments. Let’s see why do you need a data-warehouse for this purpose.

1.2.1 Keeping Analysis/Reporting and Production Separate.
If you run the above-said query on your production systems, you will find that it will lock all your tables and will eat-up most of your resources, as it will be accessing a lot of data doing a lot of calculations. This results in the production work to come to a virtual halt. Imagine hundreds of such above-said queries running at the same time on your production systems.
Reporting and analysis work typically access data across the database tables, whereas production work typically accesses specific customer OR product OR channel record at a point of time. That’s why it is important to have the Information generation work to be done from an offline platform (aka. Data Warehouse). Purpose of Data Warehouse is to keep analysis/reporting (non-production use data) separate from production data.

1.2.2 Information Integration from multiple systems- Single point source for information
As an example- Let’s say you have different systems for say a loan product vs. credit card product. The above-said query, if run on production will need to pick the data on real time basis from these systems.
This will make the query extremely slow, and will need to do connects in the intermediate tables OR in run-time memory. Moreover it will not be a reliable result as at a particular point of time, the databases may not be in synch as many of such synching happen in the end of day batch runs.

1.2.3 DW purpose for Data Consistency and Quality
Organizations are riddled with tens of important systems from which their information comes. Each of these systems may carry the information in different formats and also may be having out of synch information. (Different customer ID formats, mismatch in the supplier statuses). By bringing the data from these disparate sources at a common place, one can effectively undertake to bring the uniformity and consistency in data (Refer to cleansing and Data Transformation).

1.2.4 High Response Time- Production Databases are tuned to expected transaction load
Even if you run the above-said query on an offline database, it will take a lot of time on the database design, which is same as that of production. This is because the production databases are created to cater to production work. In production systems, there is some level of expected intensity for different kind of actions. Therefore, the indexing and normalization and other design considerations are for given transaction loads. However, the Data-warehouse has to be ready for fairly unexpected loads and type of queries, which demands a high degree of flexibility and quick response time.

1.2.5 Data Warehouse objective of providing an adaptive and flexible source of information.
Its easier for users to define the production work and functionalities they want, but difficult to define the analysis they need. The analysis needs keep on changing and Data-Warehouse has the capabilities to adapt quickly to the changing requirements. Please refer to 'Dimension Modeling'

1.2.6 Establish the foundation for Decision Support
Decision process of an organization will involve analysis, data mining, forecasting, decision modeling etc. By having a common point, which can provide consistent, quality data with high response time provides the core enabler for making fast and informed decisions.

Definition of Data ware house


1.1  Definition of Data ware house

“A data ware is a subject –oriented, integrated, time varying, non-volatile collection of data in support of the management’s decision making process”
By W H Inmon(1993)
 1.1.1    Subject-Oriented:
A data warehouse is organized around major subject such a customer, products, sale etc. Data are organized according to subject instead of application. The data organized by subject obtains only information necessary for the decision support system.
1.1.2    Non-Volatile:
The data are not updated and changed in any way once they enter the data warehouse but data is only loaded, refreshed and accessed for query. Data warehouse is a always physically separate store of data which is transformed from the application from the appropriate environment, therefore DWH don’t need transaction, processing, recovery, concurrency control etc.
1.1.3    Time Varying:
Data are stored in a DWH to provide a historical perspective. Every key structure in DWH contain implicitly or explicitly, an element of time. The DWH contains a place for sorting data that are 5 to 10 years old or older to be used for comparisons, trends, forecasting.
1.1.4    Integrated
A DWH is usually constructed by integrating multiple, heterogeneous source such as relation databases, flat files and OLTP.


Monday, November 12, 2018

Database Connectivity ( NetBean Configuration)


Step-1:Configure Database in NetBeans 8.1


Step-2: Right click on database following  window will popup

Step-3:



Step-4:



Step-5:Give your username, password, service ID.

Step-6: Click Test Button to Check The Connectivity: It Connection is successful then message will be displayed in the screen.

Step-7:Select Schema (User Name)
Step-8:Connection String will be generated by NetBean

Step-9: 





Sunday, November 4, 2018

Inheritance Programs in C++


Ref: Kamthane.


/*C++ program to demonstrate example of private simple inheritance.*/

#include
using namespace std;
class A
{   private:
        int a;
    protected:
        int x;  //can access by the derived class
    public:
        void setVal(int v)
        {  x=v;   }
};
class B:private A
{
    public:
        void printVal(void)
        {
            setVal(10);  //accessing public member function here //protected data member direct access here
            cout << "value of x: " << x << endl;
        }
};
int main()
{
        B objB; //derived class creation
        objB.printVal();
        return 0;
}


/* C++ program to demonstrate example of multilevel inheritance.*/

#include
using namespace std;

//Base Class : class A
class A
{
    private:
        int a;
    public:
        void get_a(int val_a)
        {  a=val_a;  }
       
        void disp_a(void)
        {  cout << "Value of a: " << a << endl;   }
};
class B: public A
{
    private:
        int b;
    public:
        void get_b(int val_a, int val_b)
        {
            get_a(val_a);      //assign value of a by calling function of class A
            b=val_b;
        }
        void disp_b(void)
        {
            //display value of a
            disp_a();
            cout << "Value of b: " << b << endl;
        }
};

//Here class C is derived class and B is Base class

class C: public B
{
    private:
        int c;
    public:
        //assign value of a from here
        void get_c(int val_a, int val_b,int val_c)
        {
            /*** Multilevel Inheritance ***/
            //assign value of a, bby calling function of class B and Class A
            //here Class A is inherited on Class B, and Class B in inherited on Class B
            get_b(val_a,val_b);
            c=val_c;
        }
       
        void disp_c(void)
        {
            disp_b(); //display value of a and b using disp_b()
            cout << "Value of c: " << c << endl;
        }
};

int main()
{
    //create object of final class, which is Class C
    C objC;
    objC.get_c(10,20,30);
    objC.disp_c();
    return 0;
}
---------------------

/* C++ program to demonstrate example of Multiple inheritance.*/
class A
  {
    protected:
        int a;
  }
class B
  {
    protected:
        int b;
  }
class C
  {
    protected:
        int c;
  }
class D
  {
    protected:
        int d;
  }

class E:public A,B,C,D
  {
      int e;
     public:
      void getdata()
        {
          cout<<"\n Enter the values of a,b,c,d,e";
          cin>>a>>b>>c>>d>>e;
        }
      void showdata()
        {
          cout<<"\n Values of a"<

Saturday, November 3, 2018

Proejct Table Structures - Setting General Tables

Master  Tables


State_Master
id Auto Generated
code Auto Generated
Name User Input
ShortName User Input
createby Logged in User
createdate System Date
updateby Logged in User
updatedate System Date
STATUS User Input



Country_Master
id Auto Generated
code Auto Generated
Name User Input
ShortName User Input
createby Logged in User
createdate System Date
updateby Logged in User
updatedate System Date
STATUS User Input

Type_Master
id Auto Generated
code Auto Generated
Name User Input
createby Logged in User
createdate System Date
updateby Logged in User
updatedate System Date
STATUS User Input


SubType_Master
id Auto Generated
code Auto Generated
Name User Input
typeid Ref - Type_Master
createby Logged in User
createdate System Date
updateby Logged in User
updatedate System Date
STATUS User Input


User_Master
id Auto Generated
code Auto Generated
F_NAME      User Input
M_NAME      User Input
L_NAME      User Input
USER_NAME  
PASSWORD User Input
TYPEID      Ref - Type_Master
FIRST_LOGIN Auto Generated
EXPIRYDATE  Auto Generated
PASSUPDATE  Auto Generated
createby System Date
createdate Logged in User
updateby System Date
updatedate User Input
STATUS      User Input


First_Load (Back End table)
COMPANY_CODE    
COMPANY_NAME    
SOFTWARE_VERSION
SOFTWARE_NAME   
MAINSCREEN_PATH 
MOBILE_NO1      
MOBILE_NO2      
WEBSITE         
ADDRESS         
TAG_LINE        
PHONE_NO        
createby
createdate
updateby
updatedate
STATUS      User Input


SETTING_MASTER
 ID             Auto Generated
 CODE           Auto Generated
 FORM_NAME      User Input
 FORM_NAME_MENU User Input
 FORM_PATH      User Input
createby Logged in User
createdate System Date
updateby Logged in User
updatedate System Date
 STATUS         User Input

Financial Year Oracle PLSQL Program

 CREATE OR REPLACE function FINANCIAL_YEAR(p_date DATE) return varchar2 IS    v_first     varchar2(4);    v_second    varchar2(4);    v_year...