1 2 3 4 5 6 > >>   Sort: Rank

ALTER TABLE - Delete a Column in Oracle
How To Delete a Column in an Existing Table in Oracle? 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 AS SELECT * FROM employees WHERE dep...
2020-02-20, 651👍, 0💬

DROP TABLE Statement in Oracle
How To Drop an Existing Table in Oracle? 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 WHERE department_id=10; Tabl...
2020-02-20, 616👍, 0💬

ALTER INDEX - Rename an Index in Oracle
How To Rename an Index in Oracle? 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 student (id NUMBER(5) PRIMARY KEY, first_name...
2020-02-20, 603👍, 0💬

CREATE INDEX - Create a Table Index in Oracle
How To Create a Table Index in Oracle? 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 the CREATE INDEX statement as shown in th...
2020-02-20, 569👍, 0💬

Drop an Existing Index in Oracle
How To Drop an Existing Index in Oracle? 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 VARCHAR(80) NOT NULL, birth_date DATE N...
2020-02-20, 568👍, 0💬

Understanding SQL DML Statements for Oracle
Where to find answers to frequently asked questions on SQL DML Statements for Oracle. I want insert and delete data in tables. Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on SQL DML Statements for Oracle. Clear answers are provided with tutorial ...
2020-02-07, 672👍, 0💬

What Are DML Statements in Oracle
What Are DML Statements in Oracle? 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 database tables . DELETE - Deleting existing ...
2020-02-07, 622👍, 0💬

Create a New View in Oracle
How To Create a New View in Oracle? 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.email, e.manager_id, d.department_name FROM em...
2020-02-07, 553👍, 0💬

Drop an Existing View in Oracle
How To Drop an Existing View in Oracle? 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.   ⇒Understanding SQL DDL Statements for Oracle ⇒⇒Oracle Database Tut...
2020-02-07, 524👍, 0💬

Create a Test Table for DML Testing in Oracle
How To Create a Testing Table in Oracle? 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, created DATE DEFAULT (sysdate)); Table cr...
2020-02-07, 519👍, 0💬

Omit Columns in INSERT Statements in Oracle
How To Omit Columns with Default Values in INSERT Statement in Oracle? 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 column list in the INSERT statement. If a colum...
2020-01-29, 651👍, 0💬

Set Up SQL*Plus Output Format in Oracle
How To Set Up SQL*Plus Output Format in Oracle? 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; COLUMN url FORMAT A24; COLUMN notes FORMAT A12;...
2020-01-29, 618👍, 0💬

Insert Multiple Rows with 1 INSERT Statement in Oracle
How To Insert Multiple Rows with One INSERT Statement in Oracle? 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 following tutorial exercise gives a good ex...
2020-01-29, 596👍, 0💬

Specify Default Values in INSERT Statements in Oracle
How To Specify Default Values in INSERT Statement in Oracle? 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 good example: INSERT INTO fyi_links VALUES ...
2020-01-29, 570👍, 0💬

Insert a New Row into a Table in Oracle
How To Insert a New Row into a Table in Oracle? 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', NULL, 0, '30-Apr-2006'); 1 row created. S...
2020-01-29, 569👍, 0💬

Use Existing Column Values in SET Clause in Oracle
How To Use Existing Values in UPDATE Statements in Oracle? If a row matches the WHERE clause in a UPDATE statement, existing values in this row can be used in expressions to provide new values in the SET clause. Existing values are represented by columns in the expressions. The tutorial exercise bel...
2020-01-21, 593👍, 0💬

Use Values from Other Tables in UPDATE in Oracle
How To Use Values from Other Tables in UPDATE Statements in Oracle? If you want to update values in one with values from another table, you can use a subquery in the SET clause. The subquery should return only one row for each row in the update table that matches the WHERE clause. The tutorial exerc...
2020-01-21, 577👍, 0💬

Update Values on Multiple Rows in Oracle
How To Update Values on Multiple Rows in Oracle? 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 example: UPDATE fyi_links SET counts = 9, n...
2020-01-21, 564👍, 0💬

Update Values in a Table in Oracle
How To Update Values in a Table in Oracle? If you want to update some values in one row or multiple rows in a table, you can use the UPDATE statement. The script below shows a good example: UPDATE fyi_links SET counts = 999, notes = 'Good site.' WHERE id = 101; 1 row updated. SELECT * FROM fyi_links...
2020-01-21, 538👍, 0💬

Error: Single-Row Subquery Returns More Than One Row in Oracle
What Happens If the UPDATE Subquery Returns Multiple Rows in Oracle? If a subquery is used in a UPDATE statement, it must return exactly one row for each row in the update table that matches the WHERE clause. If it returns multiple rows, Oracle server will give you an error message. To test this out...
2020-01-21, 504👍, 0💬

Understanding SQL SELECT Query Statements in Oracle
Where to find answers to frequently asked questions on SQL SELECT Query Statements in Oracle? I want to query data from tables. Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on SQL SELECT Query Statements in Oracle. Clear answers are provided with ...
2020-01-04, 719👍, 0💬

Delete Multiple Rows from a Table in Oracle
How To Delete Multiple Rows from a Table in Oracle? You can delete multiple rows from a table in the same way as deleting a single row, except that the WHERE clause will match multiple rows. The tutorial exercise below deletes 3 rows from the fyi_links table: SELECT * FROM fyi_links WHERE id &gt...
2020-01-04, 707👍, 0💬

What Is a SELECT Query Statement in Oracle
What Is a SELECT Query Statement in Oracle? The SELECT statement is also called the query statement. It is the most frequently used SQL statement in any database application. A SELECT statement allows you to retrieve data from one or more tables, or views, with different selection criteria, grouping...
2020-01-04, 631👍, 0💬

Delete an Existing Row from a Table in Oracle
How To Delete an Existing Row from a Table in Oracle? If you want to delete an existing row from a table, you can use the DELETE statement with a WHERE clause to identify that row. Here is good sample of DELETE statements: INSERT INTO fyi_links (url, id) VALUES ('http://www.myspace.com', 301); 1 row...
2020-01-04, 588👍, 0💬

1 2 3 4 5 6 > >>   Sort: Rank