< 1 2 3 >   Sort: Rank

How To Concatenate Two Text Values
How To Concatenate Two Text Values? - Oracle DBA FAQ - Understanding SQL Basics There are two ways to concatenate two text values together: CONCAT() function. '||' operation. Here is some examples on how to use them: SELECT 'FYI' || 'Center' || '.com' FROM DUAL; FYICenter.com SELECT CONCAT('FYICente...
2007-04-23, 4778👍, 0💬

How To Calculate Date and Time Differences
How To Calculate Date and Time Differences? - Oracle DBA FAQ - Understanding SQL Basics If you want to know how many years, months, days and seconds are there between two dates or times, you can use the date and time interval expressions: YEAR ... TO MONTH and DAY ... TO SECOND. The tutorial exercis...
2007-04-23, 5076👍, 0💬

How To Use IN Conditions
How To Use IN Conditions? - Oracle DBA FAQ - Understanding SQL Basics An IN condition is single value again a list of values. It returns TRUE, if the specified value is in the list. Otherwise, it returns FALSE. Some examples are given in the script below: SELECT CASE WHEN 3 IN (1,2,3,5) THEN 'TRUE' ...
2007-04-23, 4517👍, 0💬

How To Use LIKE Conditions
How To Use LIKE Conditions? - Oracle DBA FAQ - Understanding SQL Basics LIKE condition is also called pattern patch. There 3 main rules on using LIKE condition: '_' is used in the pattern to match any one character. '%' is used in the pattern to match any zero or more characters. ESCAPE clause is us...
2007-04-23, 4232👍, 0💬

How To Use Regular Expression in Pattern Match Conditions
How To Use Regular Expression in Pattern Match Conditions? - Oracle DBA FAQ - Understanding SQL Basics If you have a pattern that is too complex for LIKE to handle, you can use the regular expression pattern patch function: REGEXP_LIKE(). The following script provides you some good examples: SELECT ...
2007-04-22, 4426👍, 0💬

What Are DDL Statements
What Are DDL Statements? - Oracle DBA FAQ - Understanding SQL DDL Statements DDL (Data Definition Language) statements are statements to create and manage data objects in the database. The are 3 primary DDL statements: CREATE - Creating a new database object. ALTER - Altering the definition of an ex...
2007-04-22, 4528👍, 0💬

How To Create a New Table
How To Create a New Table? - Oracle DBA FAQ - Understanding SQL DDL Statements If you want to create a new table in your own schema, you can log into the server with your account, and use the CREATE TABLE statement. The following script shows you how to create a table: >.\bin\sqlplus /nolog SQL> con...
2007-04-22, 4274👍, 0💬

How To Create a New Table by Selecting Rows from Another Table
How To Create a New Table by Selecting Rows from Another Table? - Oracle DBA FAQ - Understanding SQL DDL Statements Let's say you have a table with many data rows, now you want to create a backup copy of this table of all rows or a subset of them, you can use the CREATE TABLE...AS SELECT statement t...
2007-04-22, 4431👍, 0💬

How To Add a New Column to an Existing Table
How To Add a New Column to an Existing Table? - Oracle DBA FAQ - Understanding SQL DDL Statements If you have an existing table with existing data rows, and want to add a new column to that table, you can use the ALTER TABLE ... ADD statement to do this. Here is an example script: SQL> connect HR/fy...
2007-04-22, 4457👍, 0💬

How To Delete a Column in an Existing Table
How To Delete a Column in an Existing Table? - Oracle DBA FAQ - Understanding SQL DDL Statements If you have an existing column in a table and you need that column any more, you can delete it with ALTER TABLE ... DROP COLUMN statement. Here is an example SQL script: SQL> CREATE TABLE emp_dept_90 2 A...
2007-04-22, 4328👍, 0💬

How To Drop an Existing Table
How To Drop an Existing Table? - Oracle DBA FAQ - Understanding SQL DDL Statements If you want to delete an existing table and its data rows, you can use the DROP TABLE statement as shown in this script: SQL> connect HR/fyicenter Connected. SQL> CREATE TABLE emp_dept_10 2 AS SELECT * FROM employees ...
2007-04-22, 4230👍, 0💬

How To Create a Table Index
How To Create a Table Index? - Oracle DBA FAQ - Understanding SQL DDL Statements If you have a table with a lots of rows, and you know that one of the columns will be used often a search criteria, you can add an index for that column to in improve the search performance. To add an index, you can use...
2007-04-22, 4224👍, 0💬

How To Rename an Index
How To Rename an Index? - Oracle DBA FAQ - Understanding SQL DDL Statements Let's say you have an existing index, and you don't like its name anymore for some reason, you can rename it with the ALTER INDEX ... RENAME TO statement. Here is an example script on how to rename an index: CREATE TABLE stu...
2007-04-22, 4129👍, 0💬

How To Create a New View
How To Create a New View? - Oracle DBA FAQ - Understanding SQL DDL Statements You can create a new view based on one or more existing tables by using the CREATE VIEW statement as shown in the following script: CREATE VIEW employee_department AS SELECT e.employee_id, e.first_name, e.last_name, e.emai...
2007-04-22, 4315👍, 0💬

How To Drop an Index
How To Drop an Index? - Oracle DBA FAQ - Understanding SQL DDL Statements If you don't need an existing index any more, you should delete it with the DROP INDEX statement. Here is an example SQL script: CREATE TABLE student (id NUMBER(5) PRIMARY KEY, first_name VARCHAR(80) NOT NULL, last_name VARCHA...
2007-04-22, 4281👍, 0💬

How To Drop an Existing View
How To Drop an Existing View? - Oracle DBA FAQ - Understanding SQL DDL Statements If you have an existing view, and you don't want it anymore, you can delete it by using the DROP VIEW statement as shown in the following script: DROP VIEW employee_department; View dropped.
2007-04-22, 4169👍, 0💬

What Are DML Statements
What Are DML Statements? - Oracle DBA FAQ - Understanding SQL DML Statements DML (Data Manipulation Language) statements are statements to change data values in database tables. The are 3 primary DML statements: INSERT - Inserting new rows into database tables. UPDATE - Updating existing rows in dat...
2007-04-22, 4525👍, 0💬

How To Set Up SQL*Plus Output Format
How To Set Up SQL*Plus Output Format? - Oracle DBA FAQ - Understanding SQL DML Statements If you want to practice SQL statements with SQL*Plus, you need to set up your SQL*Plus output formatting parameter properly. The following SQL*Plus commands shows you some examples: COLUMN id FORMAT 9999; COLUM...
2007-04-22, 4593👍, 0💬

How To Create a Testing Table
How To Create a Testing Table? - Oracle DBA FAQ - Understanding SQL DML Statements If you want to practice DML statements, you should create a testing table as shown in the script below: CREATE TABLE fyi_links (id NUMBER(4) PRIMARY KEY, url VARCHAR2(80) NOT NULL, notes VARCHAR2(1024), counts NUMBER,...
2007-04-22, 4318👍, 0💬

How To Insert a New Row into a Table
How To Insert a New Row into a Table? - Oracle DBA FAQ - Understanding SQL DML Statements To insert a new row into a table, you should use the INSERT INTO statement with values specified for all columns as shown in the following example: INSERT INTO fyi_links VALUES (101, 'http://dev.fyicenter.com',...
2007-04-21, 4235👍, 0💬

How To Specify Default Values in INSERT Statement
How To Specify Default Values in INSERT Statement? - Oracle DBA FAQ - Understanding SQL DML Statements If a column is defined with a default value in a table, you can use the key word DEFAULT in the INSERT statement to take the default value for that column. The following tutorial exercise gives a g...
2007-04-21, 4439👍, 0💬

How To Omit Columns with Default Values in INSERT Statement
How To Omit Columns with Default Values in INSERT Statement? - Oracle DBA FAQ - Understanding SQL DML Statements If you don't want to specify values for columns that have default values, or you want to specify values to columns in an order different than how they are defined, you can provide a colum...
2007-04-21, 4261👍, 0💬

How To Insert Multiple Rows with One INSERT Statement
How To Insert Multiple Rows with One INSERT Statement? - Oracle DBA FAQ - Understanding SQL DML Statements If you want to insert multiple rows with a single INSERT statement, you can use a subquery instead of the VALUES clause. Rows returned from the subquery will be inserted the target table. The f...
2007-04-21, 5036👍, 0💬

How To Update Values on Multiple Rows
How To Update Values on Multiple Rows? - Oracle DBA FAQ - Understanding SQL DML Statements If the WHERE clause in an UPDATE matches multiple rows, the SET clause will be applied to all matched rows. This rule allows you to update values on multiple rows in a single UPDATE statement. Here is a good e...
2007-04-21, 4893👍, 0💬

< 1 2 3 >   Sort: Rank