Saturday, July 19, 2014

Join in MySQL

Join clause is used to combine rows from two or more tables depending upon common field between them.

There are different kinds of Joins.

The most common and useful Join is Inner Join.

Inner Join:
It will return all rows from multiple tables where the condition is met.

Thursday, July 17, 2014

Aggregate Functions in MySQL

Aggregate Functions are those functions which are used in SQL. They return a single value which is calculated from values in the columns from a particular table.

The aggregate functions are below:

AVG()- It returns a average value
COUNT() - It returns the number of rows in a table
MAX() - It returns the maximum value stored in a table
MIN() - It returns the minimum value stored in a table
SUM() - It returns the sum of all the values of specified column

Wednesday, July 16, 2014

Cursors

What are Cursors?

A cursor is a temporary work area created in the system memory when a SQL statement is executed. A cursor contains information on a select statement and the rows of data accessed by it. This temporary work area is used to store the data retrieved from the database, and manipulate this data. A cursor can hold more than one row, but can process only one row at a time. The set of rows the cursor holds is called the active set.

There are two types of cursors in PL/SQL:

Implicit cursors:

These are created by default when DML statements like, INSERT, UPDATE, and DELETE statements are executed. They are also created when a SELECT statement that returns just one row is executed.

Between and In Operators in SQL

Between Operator

It is used to select values within a range.

Tuesday, July 15, 2014

SubQuery in MySQL

A subquery is a query inside another query or it is a nested query which is embedded within the WHERE clause.

Subqueries can be used with the SELECT, INSERT, UPDATE, and DELETE statements along with the operators like =, <, >, >=, <=, IN, BETWEEN etc.

Monday, July 14, 2014

Primary Key and Foreign Key in MySQL

Primary Key:

Primary Key is something which will uniquely identifies each record in a database table.

Tuesday, July 8, 2014

Array and its types

What is an array?

An array is a data structure that stores one or more similar type of values in a single value.

There are three kinds of array.

Sorting, searching and pagination

Sorting:

While retrieving information from database, you can sort information or data as per your requirement. Like in some case, if you want to show the latest entered value in the table then you can show data in descending order of primary key. Similarly you can also show data displayed according to the name in ascending or decending order. Use "ORDER BY" Keyword.

Monday, July 7, 2014

PL/SQL Constants

As the name implies a constant is a value used in a PL/SQL Block that remains unchanged throughout the program. A constant is a user-defined literal value. You can declare a constant and use it instead of actual value.

For example: If you want to write a program which will increase the salary of the employees by 25%, you can declare a constant and use it throughout the program. Next time when you want to increase the salary again you can change the value of the constant which will be easier than changing the actual value throughout the program.
The General Syntax to declare a constant is:

Validate numeric field using javascript

The user input should always validated so that we can get correct and reliable data.

 For example, if you want user to input their age but if user inputs any letters then the system should not accept is as an input.

Sunday, July 6, 2014

Validate a form using javascript

We should validate a form for null values, otherwise user can click submit button without filling necessary information. In that case, our database will have many null values.

So below is a simple validation using javascript for validating a form.

Saturday, July 5, 2014

Normalization of Relational Database and its types

A database stores data in an organized way so that it can be searched and retrieved later. It should contain one or more tables. A table is much like a spreadsheet, in that it's made up of rows and columns. All rows have the same columns, and each column contains the data itself. If it helps, think of your tables in the same way that you would a table in Excel.

Data can be inserted, retrieved, updated, and deleted from a table. The word, created, is generally used instead of inserted, so, collectively, these four functions are affectionately abbreviated as CRUD.

Conditional Statements in PL/SQL

As the name implies, PL/SQL supports programming language features like conditional statements, iterative statements.

The programming constructs are similar to how you use in programming languages like Java and C++. In this section I will provide you syntax of how to use conditional statements in PL/SQL programming.

Friday, July 4, 2014

Advantages of PL/SQL

These are the advantages of PL/SQL.

    * Block Structures: PL SQL consists of blocks of code, which can be nested within each other. Each block forms a unit of a task or a logical module. PL/SQL Blocks can be stored in the database and reused.

Introduction to PL/SQL

What is PL/SQL?

PL/SQL stands for Procedural Language extension of SQL.

PL/SQL is a combination of SQL along with the procedural features of programming languages. It was developed by Oracle Corporation in the early 90’s to enhance the capabilities of SQL.

Escape Sequence in PHP

Escape sequence in PHP means preventing PHP from ending strings early or making sure you have the correct string information returned.

For example:

<?php

    $string='Rita's new house';
    echo $string;
?>