Data processing refers to the use of SQL's DDL statement, the table of information in the increase and deletion of the check.
Insert operation
INSERT into Table [(column [, Column ... ]]VALUES [, Value ... ]);
Insert a null value into the table
Implicit: Omit this field from the Column name table
INSERT into departments (department_id, department_name )VALUES ( Purchasing ');
Display by: Performs a null value in the VALUES clause
INSERT into Departments VALUES (Finance'nullnull);
Inserts the specified value
--record the current system time and dateINSERT intoemployees (employee_id, first_name, last_name, email, phone_number, Hire_date, job_id, salary, commission_pct, manager_id, department_id)VALUES(113, 'Louis','Popp', 'Lpopp','515.124.4567', Sysdate,'Ac_account',6900, NULL,205, -);
Copy from other tables
--You do not have to write the VALUES clause. --the list of values in the subquery should correspond to the column names in the INSERT clauseINSERT intoEMP2SELECT * fromEmployeesWHEREdepartment_id= -;INSERT intosales_reps (ID, name, salary, commission_pct)SELECTemployee_id, last_name, salary, commission_pct fromEmployeesWHEREjob_id like '%rep%';
Update data
UPDATE Table SET column = [, column = value, ... ][WHERE condition];
Using subqueries in Update
--Update the work and salary of employee No. 114th to make it with employee number NO. 205sameUPDATEEmployeesSETjob_id=(SELECTjob_id fromEmployeesWHEREemployee_id= 205), Salary=(SELECTSalary fromEmployeesWHEREemployee_id= 205) WHEREemployee_id= the;
Delete statement
DELETE from Table [WHERE condition];
Using subqueries in Delete
-- Remove department ID with public character in DEPT1 department name from EMP1 table DELETE from EMP1 WHERE = (SELECT department_id from dept1 WHERElike '%public%');
Database Things
Oracle Learning-7. Data processing