Thursday, 4 April 2019

Python Programming Language


1.                   What is Python
2.                   Why the name Python?
3.                   Why Python has become so popular
4.                   Features of Python
5.                   What type of applications can be built using Python
6.                   Where is Python used mostly?
7.                   Python for Data Analytics and Machine Learning
8.                   Python for Big Data
9.                   Python for Robotics

What is Python

Python is a general-purpose interpreted, interactive, object-oriented, and very high-level programming language. It was created by Guido van Rossum during 1985- 1990. So first version appeared in 1990.

Guido van Rossum

Why the name Python?

No. It wasn't named after a dangerous snake. Rossum was fan of a comedy series from late seventies. The name "Python" was adopted from the same series "Monty Python's Flying Circus".

Why Python has become so popular

As compared to other languages, Python has soared in popularity, thanks to its ease of use and less time required.E.g.  when compared to other languages such as Java or C/C++, one has to write fewer lines of code in Python

If we look at the philosophy of the Python language, you can say that this language was built for its readability and less complexity. You can easily understand it and make someone understand very fast.

Did you know it’s now the most popular introductory teaching language in U.S. universities?

Features of Python

1.                   A simple language which is easier to learn
Python has a very simple and elegant syntax. It's much easier to read and write Python programs compared to other languages like: C++, Java, C#. Python makes programming fun and allows you to focus on the solution rather than syntax.
If you are a newbie, it's a great choice to start your journey with Python.

2.                   Free and open-source
You can freely use and distribute Python, even for commercial use. Not only can you use and distribute software written in it, you can even make changes to the Python's source code.
Python has a large community constantly improving it.

3.                   Platform Independent
When a python program is compiled using a Python compiler, it generates bytecode (like Java bytecode). Python’s bytecode can run on all Operating Systems and Hardware via PVM (Python Virtual Machine) like JVM for Java.

4.                   Portability
You can move Python programs source code from one platform to another, and run it without any changes.
It runs seamlessly on almost all platforms including Windows, Mac OS X, Solaris and Linux.

5.                   Extensible
Ex1: Jython is useful to integrate Java code into Python programs and run on JVM (Java Virtual Machine). Jython takes the Python programming language syntax and enables it to run on the Java platform.
Ex2: Iron Python is useful to integrate .NET programs into Python programs and run on CLR (Common Language Runtime)

6.                   Embeddable
Enrich your C/C++ application by embedding Python in it. Embedding provides your application with the ability to implement some of the functionality of your application in Python rather than C or C++. This can be used for many purposes; one example would be to allow users to tailor the application to their needs by writing some scripts in Python. You can also use it yourself if some of the functionality can be written in Python more easily.

7.                   A Very high-level, interpreted language
Unlike C/C++, you don't have to worry about daunting tasks like memory management.
Likewise, when you run Python code, it automatically converts your code to the language your computer understands. You don't need to worry about any lower-level operations.

8.                   Large standard libraries to solve common tasks
Python has a number of standard libraries which makes life of a programmer much easier since you don't have to write all the code yourself. Standard libraries in Python are well tested and used by hundreds of people. So you can be sure that it won't break your application.

9.                   Huge Libraries for various domains
Python has a rich set of modules for different programming domains – like PyMySQL  to access MySQL DB, pymongo to access MongoDB, Tkinter for GUI Programming, numpy for numerical processing, pandas for Data Analysis/querying, seaborn for Data Visualizations, scikit-learn for machine learning etc

10.               Object-oriented
Everything in Python is an object. Object oriented programming (OOP) helps you solve a complex problem intuitively.
With OOP, you are able to divide these complex problems into smaller sets by creating objects.

11.               Dynamically typed
In Python, we need not declare anything. An assignment statement binds a name to an object. Recollect that languages like C,C++ and Java are statically typed.

What type of applications can be built using Python

·         Data Analysis and Data Visualizations
·         Machine Learning
·         Big Data (pydoop, pyspark)
·         Robotics
·         Web Apps (YouTube, Quora, Instagram,NetFlix)
·         Desktop GUI Apps
·         Computer Graphics / Game Development
·         etc

Where is Python used mostly?

·         Data Analytics(Data Analysis, Data Visualizations)&Machine Learning
·         Robotics

Early on at Google, there was an engineering decision to use “Python where we can, C++ where we must.” Python was used for parts that required rapid delivery and maintenance. Then, they used C++ for the parts of the software stack where it was important to have very low latency and/or tight control of memory. 

Python for Data Analytics and Machine Learning

Packages, Packages everywhere !

Yes you guessed it right. It’s the collection and code stack of various open source repositories which is developed by people (still in process ) to continuously improve upon the existing methods.

·         Want to work with images — numpy, opencv, scikit
·         Want to work in text — nltk, numpy, scikit
·         Want to work in audio — librosa
·         Want to solve machine learning problem — pandas, scikit
·         Want to see the data clearly — matplotlib, seaborn, scikit
·         Want to use deep learning — tensorflow, pytorch
·         Want to do scientific computing — scipy
·         Want to integrate web applications — Django

Python for Big Data

Python provides a huge number of libraries to work on Big Data. You can also work – in terms of developing code – using Python for Big Data much faster than any other programming language. These two aspects are enabling developers worldwide to embrace Python as the language of choice for Big Data projects.

Hadoop is the most popular open-source big data platform and the inherent compatibility of Python is yet another reason to prefer it over other languages.

Python can be used to write Hadoop MapReduce programs and applications to access HDFS API for Hadoop using the Pydoop package

One of the biggest advantage of Pydoop is the HDFS API. This allows you to connect to an HDFS installation, read and write files, and get information on files, directories and global file system properties seamlessly.

The MapReduce API of Pydoop allows you to solve many complex problems with minimal programming efforts. Advance MapReduce concepts such as ‘Counters’ and ‘Record Readers’ can be implemented in Python using Pydoop.

Python for Robotics

There has been a huge resurgence of Python in recent years especially in robotics. One of the reasons for this is probably that Python (and C++) are the two main programming languages found in ROS.

Like Java, it is an interpretive language. Unlike Java, the prime focus of the language is ease of use. Many people agree that it achieves this very well. Python dispenses with a lot of the usual things which take up time in programming, such as defining and casting variable types.

There are a huge number of free libraries for it, which means you don't have to "reinvent the wheel" when you need to implement some basic functionality. And since it allows simple bindings with C/C++ code, this means that performance heavy parts of the code can be implemented in these languages to avoid performance loss. As more electronics start to support Python "out-of-the-box" (as with Raspberry Pi), we are likely to see a lot more Python in robotics.

Wednesday, 27 February 2019

Oracle contents

Writing Basic SQL SELECT Statements

  •  Basic SELECT Statement
  •  Selecting All Columns
  •  Selecting Specific Columns
  • Writing SQL Statements
  • Column Heading Defaults
  • Arithmetic Expressions
  • Using Arithmetic Operators
  • Operator Precedence
  • Using Parentheses
  • Defining a Null Value
  • Null Values in Arithmetic Expressions
  • Defining a Column Alias
  • Using Column Aliases
  • Concatenation Operator
  • Using the Concatenation Operator
  • Literal Character Strings
  • Using Literal Character Strings
  • Duplicate Rows
  • Eliminating Duplicate Rows 

Restricting and Sorting Data

  • Limiting Rows Using a Selection
  • Limiting the Rows Selected
  • Using the WHERE Clause
  • Character Strings and Dates
  • Comparison Conditions
  • Using Comparison Conditions
  • Other Comparison Conditions
  • Using the BETWEEN Condition
  • Using the IN Condition
  • Using the LIKE Condition
  • Using the NULL Conditions
  • Logical Conditions
  • Using the AND Operator
  • Using the OR Operator
  • Using the NOT Operator
  • Rules of Precedence
  • ORDER BY Clause
  • Sorting in Descending Order
  • Sorting by Column Alias
  • Sorting by Multiple Columns 

Single-Row Functions

  • SQL Function
  • Two Types of SQL Functions
  • Single-Row Functions
  • Single-Row Functions
  • Character Functions
  • Character Functions
  • Case Manipulation Functions
  • Using Case Manipulation Functions
  • Character-Manipulation Functions
  • Using the Character-Manipulation Functions
  • Number Functions
  • Using the ROUND Function
  • Using the TRUNC Function
  • Using the MOD Function
  • Working with Dates
  • Arithmetic with Dates
  • Using Arithmetic Operators with Dates
  • Date Functions
  • Using Date Functions
  • Practice 3, Part One:
  • Conversion Functions
  • Implicit Data Type Conversion
  • Explicit Data Type Conversion
  • Using the TO_CHAR Function with Dates
  • Elements of the Date Format Model
  • Using the TO_CHAR Function with Dates
  • Using the TO_CHAR Function with Numbers
  • Using the TO_NUMBER and TO_DATE Functions
  • RR Date Format
  • Example of RR Date Format
  • Nesting Functions
  • General Functions
  • NVL Function
  • Using the NVL Function
  • Using the NVL2 Function
  • Using the NULLIF Function
  • Using the COALESCE Function
  • Conditional Expressions
  • The CASE Expression
  • Using the CASE Expression
  • The DECODE Function
  • Using the DECODE Function 

Displaying Data from Multiple Tables

  • Obtaining Data from Multiple Tables
  • Cartesian Products
  • Generating a Cartesian Product
  • Types of Joins
  • Joining Tables Using Oracle Syntax
  • What is an Equijoin?
  • Retrieving Records with Equijoins
  • Additional Search Conditions Using the AND Operator
  • Qualifying Ambiguous Column Names
  • Using Table Aliases
  • Joining More than Two Tables
  • Non-Equijoins
  • Retrieving Records with Non-Equijoins
  • Outer Joins Outer Joins Syntax
  • Using Outer Joins
  • Self Joins
  • Joining a Table to Itself
  • Joining Tables Using SQL: 1999 Syntax
  • Creating Cross Joins
  • Creating Natural Joins
  • Retrieving Records with Natural Joins
  • Creating Joins with the USING Clause
  • Retrieving Records with the USING Clause
  • Creating Joins with the ON Clause
  • Retrieving Records with the ON Clause
  • Creating Three-Way Joins with the ON Clause
  • INNER Versus OUTER Joins
  • Additional Conditions 

Aggregating Data Using Group Functions

  • What Are Group Functions?
  • Types of Group Functions
  • Group Functions Syntax
  • Using the AVG and SUM Functions
  • Using the MIN and MAX Functions
  • Using the COUNT Function
  • Using the DISTINCT Keyword
  • Group Functions and Null Values
  • Using the NVL Function with Group Functions
  • Creating Groups of Data
  • Creating Groups of Data: The GROUP BY Clause Syntax
  • Using the GROUP BY Clause
  • Grouping by More Than One Column
  • Using the GROUP BY Clause on Multiple Columns
  • Illegal Queries Using Group Functions
  • Excluding Group Results
  • Excluding Group Results: The HAVING Clause
  • Using the HAVING Clause
  • Nesting Group Functions 


  • Objectives
  • Using a Subquery to Solve a Problem
  • Subquery Syntax
  • Using a Subquery
  • Guidelines for Using Subqueries
  • Types of Subqueries
  • Single-Row Subqueries
  • Executing Single-Row Subqueries
  • Using Group Functions in a Subquery
  • The HAVING Clause with Subqueries
  • What is Wrong with this Statement?
  • Will this Statement Return Rows?
  • Multiple-Row Subqueries
  • Using the ANY Operator in Multiple-Row Subqueries
  • Using the ALL Operator in Multiple-Row Subqueries
  • Null Values in a Subquery 

Manipulating Data

  • Data Manipulation Language
  • Adding a New Row to a Table
  • The INSERT Statement Syntax 8-5
  • Inserting New Rows
  • Inserting Rows with Null Values
  • Inserting Special Values
  • Inserting Specific Date Values
  • Creating a Script
  • Copying Rows from Another Table
  • Changing Data in a Table
  • The UPDATE Statement Syntax
  • Updating Rows in a Table
  • Updating Two Columns with a Subquery
  • Updating Rows Based on Another Table
  • Updating Rows: Integrity Constraint Error
  • Removing a Row from a Table
  • The DELETE Statement
  • Deleting Rows from a Table
  • Deleting Rows Based on Another Table
  • Deleting Rows: Integrity Constraint Error
  • Using a Subquery in an INSERT Statement
  • Using the WITH CHECK OPTION Keyword on DML Statements
  • Overview of the Explicit Default Feature
  • Using Explicit Default Values
  • The MERGE Statement
  • The MERGE Statement Syntax
  • Merging Rows
  • Database Transactions
  • Advantages of COMMIT and ROLLBACK Statements
  • Controlling Transactions
  • Rolling Back Changes to a Marker
  • Implicit Transaction Processing
  • State of the Data Before COMMIT or ROLLBACK
  • State of the Data after COMMIT
  • Committing Data
  • State of the Data After ROLLBACK
  • Statement-Level Rollback
  • Read Consistency
  • Implementation of Read Consistency
  • Locking
  • Implicit Locking
  • Read Consistency Example 

Creating and Managing Tables

  • Database Objects
  • Naming Rules
  • The CREATE TABLE Statement
  • Referencing Another User?s Tables
  • The DEFAULT Option
  • Creating Tables
  • Tables in the Oracle Database
  • Querying the Data Dictionary 9-10
  • Data Types
  • DateTime Data Types
  • Creating a Table by Using a Subquery Syntax
  • Creating a Table by Using a Subquery
  • The ALTER TABLE Statement
  • Adding a Column
  • Modifying a Column
  • Dropping a Column
  • The SET UNUSED Option
  • Dropping a Table
  • Changing the Name of an Object
  • Truncating a Table
  • Adding Comments to a Table 

Including Constraints

  • What are Constraints?
  • Constraint Guidelines
  • Defining Constraints
  • The NOT NULL Constraint
  • The UNIQUE Constraint
  • The PRIMARY KEY Constraint
  • The FOREIGN KEY Constraint
  • FOREIGN KEY Constraint Keywords
  • The CHECK Constraint
  • Adding a Constraint Syntax
  • Adding a Constraint
  • Dropping a Constraint
  • Disabling Constraints
  • Enabling Constraints
  • Cascading Constraints
  • Viewing Constraints
  • Viewing the Columns Associated with Constraints 

Creating Views

  • Database Objects
  • What is a View?
  • Why use Views?
  • Simple Views and Complex Views
  • Creating a View
  • Retrieving Data from a View
  • Querying a View
  • Modifying a View
  • Creating a Complex View
  • Rules for Performing DML Operations on a View
  • Using the WITH CHECK OPTION Clause
  • Denying DML Operations
  • Removing a View
  • Inline Views
  • Top-N Analysis
  • Performing Top-N Analysis
  • Example of Top-N Analysis 

Other Database Objects

  • Database Objects
  • What is a Sequence?
  • The CREATE SEQUENCE Statement Syntax
  • Creating a Sequence
  • Confirming Sequences
  • NEXTVAL and CURRVAL Pseudocolumns
  • Using a Sequence
  • Modifying a Sequence
  • Guidelines for Modifying a Sequence
  • Removing a Sequence
  • What is an Index?
  • How Are Indexes Created?
  • Creating an Index
  • When to Create an Index
  • When Not to Create an Index
  • Confirming Indexes
  • Function-Based Indexes
  • Removing an Index
  • Creating and Removing Synonyms 

Controlling User Access

  • Objectives
  • Controlling User Access
  • Privileges
  • System Privileges
  • Creating Users
  • User System Privileges
  • Granting System Privileges
  • What is a Role?
  • Creating and Granting Privileges to a Role
  • Changing Your Password
  • Object Privileges
  • Granting Object Privileges
  • Using the WITH GRANT OPTION and PUBLIC Keywords
  • Confirming Privileges Granted
  • How to Revoke Object Privileges
  • Revoking Object Privileges
  • Database Links 

SQL Workshop

  • Workshop Overview 

Using SET Operators

  • The SET Operators
  • Tables Used in This Lesson
  • The UNION Operator
  • Using the UNION Operator
  • The UNION ALL Operator
  • Using the UNION ALL Operator
  • The INTERSECT Operator
  • Using the INTERSECT Operator
  • The MINUS Operator
  • SET Operator Guidelines
  • The Oracle Server and SET Operators
  • Matching the SELECT Statements
  • Controlling the Order of Rows 

Enhancements to the GROUP BY Clause

  • Review of Group Functions
  • Review of the GROUP BY Clause
  • Review of the HAVING Clause
  • GROUP BY with ROLLUP and CUBE Operators
  • ROLLUP Operator
  • ROLLUP Operator Example
  • CUBE Operator
  • CUBE Operator: Example
  • GROUPING Function
  • GROUPING Function: Example
  • GROUPING SETS: Example
  • Composite Columns
  • Composite Columns: Example
  • Concatenated Groupings
  • Concatenated Groupings Example 

Advanced Subqueries

  • What Is a Subquery?
  • Subqueries
  • Using a Subquery
  • Multiple-Column Subqueries
  • Column Comparisons
  • Pairwise Comparison Subquery
  • Nonpairwise Comparison Subquery
  • Using a Subquery in the FROM Clause
  • Scalar Subquery Expressions
  • Scalar Subqueries: Examples
  • Correlated Subqueries
  • Using Correlated Subqueries
  • Using the EXISTS Operator
  • Using the NOT EXISTS Operator
  • Correlated UPDATE
  • Correlated DELETE
  • The WITH Clause
  • WITH Clause: Example 

Hierarchical Retrieval

  • Sample Data from the EMPLOYEES Table
  • Natural Tree Structure
  • Hierarchical Queries
  • Walking the Tree
  • Walking the Tree: From the Bottom Up
  • Walking the Tree: From the Top Down
  • Ranking Rows with the LEVEL Pseudocolumn
  • Formatting Hierarchical Reports Using LEVEL and LPAD
  • Pruning Branches 

Extensions to DML and DDL Statements

  • Review of the INSERT Statement
  • Review of the UPDATE Statement
  • Overview of Multitable INSERT Statements
  • Overview of Multitable INSERT Statements
  • Types of Multitable INSERT Statements
  • Multitable INSERT Statements
  • Unconditional INSERT ALL
  • Conditional INSERT ALL
  • Conditional FIRST INSERT
  • Pivoting INSERT
  • External Tables
  • Creating an External Table
  • Example of Creating an External Table
  • Querying External Tables

Plsql syllabus

Part I: Programming in PLSQL

  • Introduction to PLSQL
  • What Is PLSQL?
  • The Origins of PLSQL
  • About PLSQL Versions
  • Resources for PLSQL Developers 

Creating and Running the PLSQL Code

  • SQL*Plus
  • Performing Essential PLSQL Tasks
  • Calling PLSQL from Other Languages
  • Language Fundamentals
  • PLSQL Block Structure
  • The PLSQL Character Set
  • Identifiers
  • Literals
  • The Semicolon Delimiter
  • Comments
  • The PRAGMA Keyword
  • Labels 

Part II: PLSQL Program Structure

  • Conditional and Sequential Control
  • IF Statements
  • CASE Statements and Expressions
  • The GOTO Statement
  • The NULL Statement
  • Iterative Processing with Loops 

Loop Basics

  • The Simple Loop
  • The WHILE Loop
  • The Numeric FOR Loop
  • The Cursor FOR Loop
  • Loop Labels
  • Tips for Iterative Processing 

Exception Handlers

  • Exception-Handling Concepts and Terminology
  • Defining Exceptions
  • Raising Exceptions
  • Handling Exceptions
  • Building an Effective Error Management Architecture
  • Making the Most of PLSQL Error Management 

Part III: PLSQL Program Data

  • Working with Program Data
  • Naming Your Program Data
  • Overview of PLSQL Datatypes
  • Declaring Program Data
  • Programmer-Defined Subtypes
  • Conversion Between Datatypes 


  • String Datatypes
  • Working with Strings
  • String Function Quick Reference 


  • Numeric Datatypes
  • Number Conversions
  • Numeric Functions 


  • Records in PLSQL 


  • Collections Overview
  • Collection Methods (Built-Ins)
  • Working with Collections
  • Nested Table Multiset Operations
  • Maintaining Schema-Level Collections 

Miscellaneous Datatypes

  • The BOOLEAN Datatype
  • The RAW Datatype
  • The UROWID and ROWID Datatypes
  • The LOB Datatypes
  • Working with LOBs
  • Predefined Object Types 


  • DML and Transaction Management
  • DML in PLSQL
  • Bulk DML with the FORALL Statement
  • Transaction Management
  • Autonomous Transactions 

Data Retrieval

  • Cursor Basics
  • Working with Implicit Cursors
  • Working with Explicit Cursors
  • Cursor Variables and REF CURSORs
  • Cursor Expressions 

Procedures, Functions, and Parameters

  • Procedures
  • Functions
  • Parameters
  • Local Modules
  • Module Overloading
  • Forward Declarations
  • Advanced Topics
  • Go Forth and Modularize! 


  • Why Packages?
  • Rules for Building Packages
  • Rules for Calling Packaged Elements
  • Working with Package Data
  • When to Use Packages
  • Packages and Object Types 


  • DML Triggers
  • DDL Triggers
  • Database Event Triggers
  • INSTEAD OF Triggers
  • AFTER SUSPEND Triggers
  • Maintaining Triggers 

Managing the PLSQL Code

  • Managing Code in the Database
  • Using Native Compilation
  • Using the Optimizing Compiler and Compile-Time Warnings
  • Conditional Compilation
  • Testing PLSQL Programs
  • Debugging PLSQL Programs
  • Tuning PLSQL Programs
  • Protecting Stored Code 

Python Programming Language

Contents 1.                    What is Python 2.                    Why the name Python? 3.                    Why Py...