0% found this document useful (0 votes)
4 views3 pages

Ex-2 Data Manipulation Language (DML) PL SQL Lab

The document outlines the procedure for creating and managing a table named 'employee' using Data Manipulation Language (DML) commands in an Oracle database. It includes steps for connecting to the database, creating the table, inserting records, updating records, deleting records, and displaying the table contents. The execution of these DML commands was successful, as indicated by the final results.

Uploaded by

Dr. S.K. Sajan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Ex-2 Data Manipulation Language (DML) PL SQL Lab

The document outlines the procedure for creating and managing a table named 'employee' using Data Manipulation Language (DML) commands in an Oracle database. It includes steps for connecting to the database, creating the table, inserting records, updating records, deleting records, and displaying the table contents. The execution of these DML commands was successful, as indicated by the final results.

Uploaded by

Dr. S.K. Sajan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

EX:2 Data Manipulation Language (DML)

Aim: To create and manage tables using DML commands like insert, update, delete,

and select.

Procedure:

1. Open Command Prompt and connect to the Oracle database using the
command: sqlplus / as sysdba;
2. Create a table named employee with attributes empid, empname, designation
and salary.
3. Insert records into the table employee.

4. Use update command to make changes to the table employee

Eg: UPDATE employee SET salary = 55000 WHERE empid = 101;

5. Use delete command to remove the records or rows from the table.
6. Display the table using the SELECT command to view the changes in the table.
7. Exit
OUTPUT:
SQL> CREATE TABLE employee (empid NUMBER(5), empname VARCHAR2(50),
designation VARCHAR2(30), salary NUMBER(10,2));
Table Created

SQL> INSERT INTO employee VALUES (101, 'Rahul', 'Manager', 50000);


1 row inserted

SQL> INSERT INTO employee VALUES (102, 'Anita', 'Developer', 35000);


1 row inserted

SQL> INSERT INTO employee VALUES (103, 'Karthik', 'Analyst', 40000);


1 row inserted

SQL> UPDATE employee SET salary = 55000 WHERE empid = 101;


SQL> UPDATE employee SET designation = 'Senior Developer WHERE empid = 102;
SQL> DELETE FROM employee WHERE empid = 103;
SQL> COMMIT;
Commit complete.

SQL> SELECT * FROM employee;

Result:
Thus the DML commands were executed successfully.

You might also like