|
Site Search |
||
|
| Most popular Generic SQL commands used in Oracle. |
| Oracle |
| Submitted by Administrator |
|
While working with Oracle database, in day to day life,we use many types of SQL commands. In fact SQL commands are really universal in nature. Today, let us learn some of the most commonly used SQL commands in Oracle. Creating a table in Oracle For creating a table in Oracle you can use the below given command: CREATETABLE tablename (columnname datatype(size), columnname datatype(size),) For Creating a table from a table you can use the below give SQL command Syntax: CREATETABLE tablename,
Note: If the source table from which the Target is being created, has records in it then the target table is populated with these records as well. For inserting data or information to your ORACLE tables you can use: Syntax
Note : The character expressions must be in single quotes. For inserting data from another table to your ORACLE table of your database you can use the below give syntax: Syntax INSERT INTO tablename
Inserting Selected data from another Table In many cases you need to insert selected data from another table to your table. For this you can use : Syntax
Updating the Contents of a table For updating the contents of your Oracle database table you can use the below given syntax. Syntax
Deleting all rows from Oracle database tables For deleting all the rows from the Oracle database tables you can use: Syntax
Deleting a specific number of rows For deleting a specific number of rows from your ORACLE database you can use; Syntax
THE SELECT COMMAND IN ORACLE
Global data extract: For extracting the data from the tables you can use: Syntax
Retrieving specific columns from a table : For retrieving a particular column from a table use: Syntax
Elimination of Duplicate from the Select Statement: For eliminating all duplicate data from the selected columns of the database tables use: Syntax
Sorting of data in table in Oracle If you want to sort the data in a table you can use : Syntax
Selecting a data set from table data: If you want to select a data set from table data then you can use the following command: Syntax
Note : In the search condition all standard operators such as logic, arithmetic, predicates etc can be used. For modifying the structure of tables in Oracle you can take the advantage of the ALTER command:- Syntax
Restrictions : Using the alter table clause you cannot perform the following tasks:
Note : Oracle will not allow constraints defined using the alter table, if the date in the table, violets such constraints. Example : The Primary Key constraints on the column that has duplicate values will not be allowed.
Removing/Deleting/Dropping Tables in Oracle: For removing or in other words you can say dropping tables in Oracle you can use the below given syntax: Syntax
|

