Skip to main content

Posts

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: