Skip to main content

Posts

Showing posts from 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.

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

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.

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.

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.

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:

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.

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.