Category: Oracle

  • Oracle UNION Operator

    In Oracle, UNION operator is used to combine the result sets of two or more Oracle SELECT statements. It combines the both SELECT statement and removes duplicate rows between them./p> Each SELECT statement within the UNION operator must have the same number of fields in the result sets with similar data types. Syntax Parameters 1)…

  • Oracle HAVING Clause

    In Oracle, HAVING Clause is used with GROUP BY Clause to restrict the groups of returned rows where condition is TRUE. Syntax: Parameters: expression1, expression2, … expression_n: It specifies the expressions that are not encapsulated within aggregate function. These expressions must be included in GROUP BY clause. aggregate_function: It specifies the aggregate functions i.e. SUM, COUNT, MIN,…

  • Oracle GROUP BY Clause

    In Oracle GROUP BY clause is used with SELECT statement to collect data from multiple records and group the results by one or more columns. Syntax: Parameters: expression1, expression2, … expression_n: It specifies the expressions that are not encapsulated within aggregate function. These expressions must be included in GROUP BY clause. aggregate_function: It specifies the aggregate functions…

  • Oracle ORDER BY Clause

    In Oracle, ORDER BY Clause is used to sort or re-arrange the records in the result set. The ORDER BY clause is only used with SELECT statement. Syntax: Parameters: expressions: It specifies columns that you want to retrieve. tables: It specifies the table name from where you want to retrieve records. conditions: It specifies the conditions that must…

  • Oracle FROM Clause

    FROM clause is a mandatory clause in SELECT expression. It specifies the tables from which data is to be retrieved. Syntax: Oracle FROM Clause Example: (with one table) Let’s take an example to explain how to use FROM clause to retrieve data from one table. Consider a table “customers”. Customer table: Execute this query: Output:…

  • Oracle DISTINCT Clause

    Oracle DISTINCT clause is used to remove the duplicate records from the result set. It is only used with SELECT statement. Syntax: Parameters: expressions:It specifies the columns that you want to retrieve. tables: It specifies the table from where you want to retrieve records. conditions: It specifies the conditions that must be fulfilled. Oracle DISTINCT Example: (with…

  • Oracle DELETE Statement

    In Oracle, DELETE statement is used to remove or delete a single record or multiple records from a table. Syntax Parameters 1) table_name: It specifies the table which you want to delete. 2) conditions: It specifies the conditions that must met for the records to be deleted. Oracle Delete Example: On one condition This statement will delete…

  • Oracle UPDATE Statement

    In Oracle, UPDATE statement is used to update the existing records in a table. You can update a table in 2 ways. Traditional Update table method Syntax: Update Table by selecting rocords from another table Syntax: Parameters: 1) column1, column2, … column_n: It specifies the columns that you want to update. 2) expression1, expression2, …expression_n:…

  • Oracle INSERT ALL statement

    The Oracle INSERT ALL statement is used to insert multiple rows with a single INSERT statement. You can insert the rows into one table or multiple tables by using only one SQL command. Syntax Parameters 1) table_name: it specifies the table in which you want to insert your records. 2) column1, column2, column_n: this specifies the columns…

  • Oracle Insert Statement

    In Oracle, INSERT statement is used to add a single record or multiple records into the table. Syntax: (Inserting a single record using the Values keyword): Syntax: (Inserting multiple records using a SELECT statement): Parameters: 1) table: The table to insert the records into. 2) column1, column2, … column_n: The columns in the table to insert…