# SQL & PL/SQL

SQL and PL/SQL Articles

## NAIVE BAYES ALGORITHM IN SQL. PL/SQL, SPARK SQL

articles:

##############################################
#cd /c/temp/;spark-submit.cmd pysparknaivebayes.py

"""

NAIVE BAYES ALGORITHM IN SQL. PL/SQL, SPARK SQL
Written: JP Vijaykumar
Date: Mar 8th 2022
********************************************************************************
This script is provided for educational purpose ONLY.

## Apriori Algorithm in sql,pl/sql and spark sql

articles:

"""
Apriori Algorithm in sql,pl/sql and spark sql
Written JP Vijaykumar
Date Sep 14 2021

********************************************************************************
This script is provided for educational purpose only.

The sql scripts were tested in 11g & 19c databases.
While testing the sql scripts, pls test it in a dev/test db only and exercise precaution.

## Time Series Analysis in Spark SQL

articles:

"""
Time Series Analysis in Spark SQL
Written JP Vijaykumar
Date Mar 8 2021

This script is provided for educational purpose only.
Pls modify/change the script as may be required to suit your environment.

I presented a script to process data using Time Series Analysis algorithm in sql and pl/sql earlier.
In this article, I am using the same code(90%) from my previous article and 10% pyspark code.

If you know sql, coding in pyspark is not that difficult.

## oracle queries needed

articles:

I want SQL queries for these two scenarios

Q. 1) Anagrams of a string i.e. let a name is RAMESH. So all combinations of letters of word RAMESH.
Probably a procedure needs to be written for this eg RAMESH, RHSEMA. There will be 6*5*4*3*2*1 combinations

Q.2 ) There is one table PERSON as follows:

## Decision Tree Algorithm in Spark SQL

articles:

"""
Decision Tree Algorithm in Spark SQL
Written JP Vijaykumar
Date Sep 14 2020

This script is provided for educational purpose only.
Pls modify/change the script as may be required to suit your environment.

I presented a script to process decision tree algorithm using pl/sql earlier.
I like spark sql for the following reasons:
01) It is open source.
02) It combines the rich functionality of python and sql
03) It has the datamining libraries.
04) can be installed on my desktop and play around.

## Controlling distributed queries with hints

articles:

Recently I've been working on tuning some distributed queries. This is not always straightforward.

## TIME SERIES ANALYSIS IN SQL AND PL/SQL

articles:

TIME SERIES ANALYSIS IN SQL AND PL/SQL
Written JP Vijaykumar
Date Mar 8th 2020

## Audit table field value change

articles:

From the below table example, I'm trying to identify only the records where VAL_IN changed. So I need to see only 4 records in the below example.

## Return TYpe (tablet) as output parameters.

articles:

Good afternoon people!

I have a procedure in Oracle with various functions of calculations, type simulator. So, I want to assemble a type with output parameters reading this data and bring the results of these functions in real time, because I want to display them as output lines on a front (web screen). I already created the types objects and table. However, I am having difficulty assembling, because I do not know well Type. Can someone help me? Thanks

## Decision Tree Algorithm in pl/sql

articles:

Decision Tree Algorithm in pl/sql
Author JP Vijaykumar
Date Sept 14th 2019