Data Manipulation Language: Module of Instruction
Data Manipulation Language: Module of Instruction
Data Manipulation Language: Module of Instruction
INSERT statement
Insert a new row containing values for each column.
List values in the default order of the columns in the
table.
Optionally, list the columns in the INSERT clause.
Enclose character and date values within single
quotation marks.
Add new rows to a table by using the INSERT
statement:
Syntax:
INSERT INTO tbl_name values (column_list);
In the syntax:
o TBL_NAME - Is the name of the table
o COLUMN_LIST - Is the name of the column
in the table to populate
o VALUES - Is the corresponding value for the
column
_____________________________________________________________________________________
2
MODULE OF INSTRUCTION
Output:
_____________________________________________________________________________________
4
MODULE OF INSTRUCTION
those values with no inputs this is set to NULL in the
INSERT INTO statement. By using this method
automatically column with values set to NULL will
automatically have NULL values.
_____________________________________________________________________________________
6
MODULE OF INSTRUCTION
Output: Old table
DELETE Statement
You can remove existing rows from a table by using
the DELETE statement:
Syntax:
DELETE FROM TBL_NAME
WHERE CONDITION;
In the syntax:
Tbl_name - Is the name of the table
Where condition - Identifies the rows to be deleted,
and is composed of column names, expressions,
constants, subqueries, and comparison operators.
_____________________________________________________________________________________
8
MODULE OF INSTRUCTION
As in the output all rows are deleted if WHERE
clause is omitted.
Lesson Summary:
In this lesson, you should have learned how to use the
following statements:
Terms to Remember!
DELETE – a statement use to remove existing rows
in a table.
DML – stand for Data Manipulation Language.
Explicit method - an Insert statement that Specifies
the NULL keyword in the VALUES clause.
Implicit method - an Insert statement that Omits the
column from the column list.
INSERT - a statement used to add new rows in a
table.
Transaction - consists of a collection of DML
statements that form a logical unit of work.
UPDATE - a statement used to update existing rows
in a table.
References Textbook:
Oracle Press (2010). Applied Oracle Security
References:
Pratt, Philip J. (2010). Database management systems
Supplementary Video
https://www.youtube.com/watch?v=S54W4oSqp7s
https://www.youtube.com/watch?v=vnFu6sBfcSs
https://www.youtube.com/watch?v=0EmMIUvjPbA
Suggested Reading
SQL Tutorial. In ws3schools, Retrieved from
http://www.w3schools.com/sql/default.asp
Database management system. In Encyclopedia
Britannica, Retrieved from
http://www.britannica.com/EBchecked/topic/152201/
database-management-system-DBMS.
SQL. In Encyclopedia Britannica, Retrieved from
http://www.britannica.com/EBchecked/topic/569684/
SQL
Database Administration. In Encyclopedia.com,
Retrieved from
http://www.encyclopedia.com/topic/Database_admini
_____________________________________________________________________________________
10
MODULE OF INSTRUCTION
stration.aspx
SQL. In Encyclopedia.com, Retrieved from
http://www.encyclopedia.com/topic/SQL.aspx
Tutorialspoint.com
oracle.com
apex.oracle.com