Category: Oracle

  • Comments

    In Oracle, comments can be placed in queries. Comments can be a single line as well as multi-line. Comment on a Single Line Syntax Example comment on a multi line Syntax Example

  • Check Constraints

    In Oracle, Check Constraints have the specific condition for each row of the table. Using a CREATE TABLE statement Syntax: Example 1 Note : During creating the table we have applied a constraint, in which only 1 to 10 rows can be inserted. So, in below query 12 fields are inserted. If will generate an…

  • Change Password

    In Oracle, we can change the password using alter command. Syntax : Parameters user_name: user name to change the password. new_password: new password for the user. Example

  • ORACLE where clause

    In Oracle, where clause is used to filter the result. Where clause can be used in INSERT, UPDATE, DELETE, and SELECT statements. Syntax Parameters Conditions: for getting specified records. Table 1: employee1 Table 2: employee2 Example 1 Select *from employee1 where city = ‘raipur’ Example 2 Select *from employee2 where name like ‘s%’

  • ORACLE TRUNCATE TABLE statement

    In Oracle, the truncate statement is used to remove all the records of a table. It works same as the delete statement but without using where clause. Syntax Example 1 Table before truncate Table truncated Table after truncate

  • ORACLE Subqueries

    In Oracle, subqueries are the queries inside a query. Subqueries can be made using WHERE, FROM or SELECT clause. Table 1: employee1 Table 2: employee2 Example 1 Query: Select name, city from employee1 where id in (select id from employee2 where designation=’Shareholder’) Example 2 Query: Select e.id, e.city, e.name, e1.designation from employee1 e join employee2 e1 on…

  • ORACLE OR

    In Oracle, the OR operator is used to check more than one condition and returns the result when any one of the given condition is true. Syntax Parameters condition1, condition2, condition_n : returns the record if any one condition is true. Example 1 Select *from table1 where name like ‘s%’ or age > 20 Example 2…

  • ORACLE NOT condition

    In Oracle, NOT condition is used with SELECT, INSERT, UPDATE or DELETE statement. It is also called NOT operator. It is used to negate the given condition. Syntax Parameters Condition: condition to be neglected. Table: Example 1 Query: select *from table1 where name not like 26 Example 2 Query: select *from table1 where name not like ‘s%’

  • ORACLE LIKE CONDITION

    In oracle, like condition is used with select, insert, update, and delete in where clause using wildcard. It allows pattern matching. Syntax Parameters expression: name of column. pattern: patter to be matched in expression. Pattern can be in one of the following:- Wildcard Explanation % Used for matching string _ Used for matching single character Table 1:…

  • ORACLE NULL

    In oracle, IS NULL is used to check not null values. It is used with select, insert, update, and delete statements. Syntax Parameters expression: column name or any value to check it is a null value Note: Table: Example 1 Query: select * from table1 where name is null