Narayana Tutorial

Online Java Tutorial Blog

Tag: SQL Queries

SQL DBA

SQL DBA SQL statement for creating table space Syntax CREATE TABLESPACE <TablespaceName> DATAFILE ‘<Datafile Path>’ SIZE 100M AUTOEXTEND ON MAXSIZE UNLIMITED ; Example CREATE TABLESPACE TUTORIALTBS DATAFILE ‘C:oraclexeoradataXETUTORIALTBS.DBF’ SIZE 100M AUTOEXTEND ON MAXSIZE UNLIMITED ;   SQL statement for alter table space — ADD DATAFILE Syntax ALTER TABLESPACE <TablespaceName> ADD DATAFILE ‘<Datafile Path>’ SIZE 4G […]

SQL RENAME

SQL RENAME By using RENAME command, we can rename a table. The rename operation is done automatically. Which means that no other thread can access any of the tables while the rename processing is running. Syntax RENAME <TableName> TO <NewTAbleName>; Example RENAME EMPLOYEE TO EMPLOYEE_DETAILS;   NarayanaswamyHello! I am Narayanaswamy founder and admin of narayanatutorial.com. […]

SQL UPDATE

SQL UPDATE The UPDATE command is used to change or update data values in a table. UPDATE all rows one column Syntax UPDATE <TableName> SET <ColumnName 1>=<Expression> or <Value> Example UPDATE EMPLOYEE SET COUNTRY=”INDIA”; UPDATE all rows more than one column Syntax UPDATE <TableName> SET <ColumnName 1>=<Expression> or <Value>, <ColumnName 2>=<Expression> or <Value> Example UPDATE […]

SQL INSERT

SQL INSERT DATA INTO A TABLE FROM ANOTHER TABLE We can insert data into table in two different ways. They are 1) Using INSERT INTO without using SELECT statement. Syntax INSERT INTO <TableName>(<ColumnName1>,<ColumnName2>) VALUES (<ColumnValue1>,<ColumnValue2>); Example INSERT INTO EMPLOYEE (FIRSTNAME, LASTNAME) VALUES (‘Narayana’,’Ragi’); 2) Using INSERT INTO with SELECT statement Syntax INSERT INTO <TableName> SELECT […]

SQL CREATE

SQL CREATE TABLE FROM ANOTHER TABLE We can create tables two ways they are 1) Using CREATE TABLE by specifying columns names, columns data types, columns data length. Syntax: CREATE TABLE <TableName> ( <ColumnName1> <DataType>(Length), <ColumnName2> <DataType>(Length)); Example CREATE TABLE EMPLOYEE (NAME Varchar2(20), ID Number(10)); 2) Using CREATE TABLE statement for target table and SELECT […]

SQL ORDER BY

SQL ORDER BY Oracle allow data from a table to be viewed in a sorted order. The rows retrieved from the table will be sorted in either ascending or descending order depending on the condition specified in the SELECT statement. Syntax SELECT * FROM <TableName> ORDER BY <ColumnName1>,<ColumnName2> <[Sort Order]> The ORDER BY clause will […]

Narayana Tutorial © 2016 Frontier Theme
Show Button
Hide Button