Skip to main content

Posts

Cursor and Types of Cursor in Oracle with Examples #Diksha Oracle Training Centre

Cursor and Types of Cursor in Oracle with Examples.   Hello Everyone, Today I will discuss about Cursor in Oracle and it’s uses in PL/SQL anonymous block. Cursor is very important part in PL/SQL .Cursor act as a pointer to this context area. PL/SQL controls the context area through a cursor. A cursor holds the rows (one or more) returned by a SQL statement. The set of rows the cursor holds is referred to as the active set. For example: The number of rows processed through multiple table and that cursor can be used in that block. For our convenient we name a cursor so that it could be referred to in a program to fetch and process the rows returned by the SQL statement, one at a time. There are three types of cursors   in Oracle ·         Implicit cursors : Maintained By Oracle Server Itself ·          Explicit cursors : Controlled by programmer so in Explicit Cursor Programmer need to follow the below step to use a cursor in PL/SQL Block.             Declare the Cursor  

SQL SUBQUERY AND CO-RELATED SUBQUERY IN ORACLE #Diksha Oracle Training Centre

  SQL SUBQUERY AND CO-RELATED SUBQUERY IN ORACLE. Hello Everyone, Today I will give you the overview of Sub query and CO-RELATED Sub Query. Before starting this topic I suggest you to please go through my previous blogs related with SQL joins and types of Join, Classification of SQL and various commands in SQL. Before knowing SUBQUERY and CO-RELATED SUBQUERY first need to understand query. Query :   A query is basically used to request data or information from database tables or combination of tables to display the result .   In another word Data will be generated as a result used by SQL (Structure Query Language). In SQL statement we use select clause to fetch the data, from clause to pull data from the table and where clause to filter the result/output. For Example : If I need student_name from student table who lives in Delhi we need to query the data from student table.   To get the result we use the below query : Select student_name from student where location=’Delhi

Aggregate Functions and Group By Clause in Oracle with Examples #Diksha Oracle Training Centre

  Aggregate Functions and Group By Clause Oracle with Examples.   Hello Everyone, Today I will   discuss about   Aggregate function in SQL by using Group By Clause and different clauses with some examples . Please go tjrough my previous blogs in Archive folder for classification of SQL, Commands and   SQL joins for your understanding.   Aggregate Functions Allows us to perform a calculation on a set of values to return a single value . We can use Group by Clause to group the result-set by one or more columns. Also we can use Having clause to restrict or filter the data as per our requirement. Note: Whenever we use Aggregate function in SQL we can’t able to use where condition. To restrict or filter the record we need to use having clause instead of Where. Below is the most commonly used Aggregate function in SQL.   MAX : Max function   used to get the maximum values in a set of values. COUNT : This function used to count rows in specified tables. AVG    : This funct

Dual Table in Oracle and its uses in Database #Diksha Oracle Training Centre

  Dual Table in Oracle and its uses in Database. Hello Everyone, Today we will discuss about Dual table in Oracle and it’s benefit in Database.Dual table in Oracle which is a special and dynamic table used for evaluating expressions or calling functions. Once you Install Oracle Database in your System Dual table is available in all schema’s . The DUAL table contains one column named DUMMY whose data type is VARCHAR2() and contains one row with a value X. The DUAL table is most simple one because it was designed for fast access and can be used for any calculation checking date and printing any value as the output for our  requirement. To  Access Dual table we can use Select statement. To see the output from Dual table we can use below select statement and can see output as column DUMMY with one Row value X. Select *  from dual; By using the DUAL table, we can execute queries that contain functions that do not involve any table like the UPPER() function as below: SELECT   U

SQL Joins and its importance in Oracle Database #Diksha Oracle Training Centre

  SQL Joins and its importance in Oracle Database.     Hello Everyone, Today I will discuss why SQL Joins is important in any database , Before starting Join please go through my below blogs so it’s easy for you to write different types of Joins . https://dikshaoracletraining.blogspot.com/2020/09/sql-and-classification-of-sql-in-oracle.html https://dikshaoracletraining.blogspot.com/2020/09/basic-sql-commands-in-oracle-database.html Why Join is important: The SQL Joins clause is used to combine records from two or more tables in a database. A JOIN is a means for combining fields from two tables by using values common to each. Join used to match rows between tables. In most cases we're matching a column value from one table with another. So In Simple word we can say Joins is basically used to get the data from one or more tables to get the required data and Joins can be of different types which can be used for trend analysis in any organization. Let’s Understand different