General Oracle Database deletion statement DELETE usage

Source: Internet
Author: User
The syntax is the same as that for other SQL database tutorials, as shown in the following DELETEFROMCOURSESWHERECOURSE_DESIGNATERJava110 Method for performing complex operations by condition (2006-02-1500: 00: 00, YYYY-MM-

The syntax is the same as that of other SQL database tutorials, the following delete from courses where COURSE_DESIGNATER = 'java110 'is a complex operation method: delete from classconvenings where CLASSES_NUM_FK 4 AND CLASS_CONVENE_DATE = TO_DATE ('2017-02-15 00:00:00 ', 'yyyy-MM-

The syntax is the same as that of other SQL database tutorials.
DELETE FROM COURSES
WHERE COURSE_DESIGNATER = 'java110'

Complex operations by conditions

DELETE FROM CLASSCONVENINGS
WHERE CLASSES_NUM_FK> 4
AND CLASS_CONVENE_DATE = TO_DATE ('2017-02-15 00:00:00 ',
'Yyyy-MM-DD HH24: MI: ss ')
AND CLASS_LOCATION_FK = 'seattle-Training Room 1'

Next, let's look at a detailed instance.

SQL> -- create demo table
SQL> create table Employee (
2 ID VARCHAR2 (4 BYTE) not null,
3 First_Name VARCHAR2 (10 BYTE ),
4 Last_Name VARCHAR2 (10 BYTE ),
5 Start_Date DATE,
6 End_Date DATE,
7 Salary Number (8, 2 ),
8 City VARCHAR2 (10 BYTE ),
9 Description VARCHAR2 (15 bytes)
10)
11/

Table created.

SQL>
SQL> -- prepare data
SQL> insert into Employee (ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
2 values ('01 ', 'jason', 'martin ', to_date ('20170101', 'yyyymmdd'), to_date ('20170101', 'yyyymmdd'), 19960725, 'toronto ', 'programmer ')
3/

1 row created.

SQL> insert into Employee (ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
2 values ('02 ', 'alison', 'mathews ', to_date ('20170101', 'yyyymmdd'), to_date ('20170101', 'yyyymmdd'), 19760321, 'vancouver ', 'tester ')
3/

1 row created.

SQL> insert into Employee (ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
2 values ('03', 'James ', 'Smith', to_date ('20170101', 'yyyymmdd'), to_date ('20170101', 'yyyymmdd'), 19781212, 'vancouver ', 'tester ')
3/

1 row created.

SQL> insert into Employee (ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
2 values ('04 ', 'cela', 'Rice', to_date ('20170101', 'yyyymmdd'), to_date ('20170101', 'yyyymmdd'), 19821024, 'vancouver ', 'manager ')
3/

1 row created.

SQL> insert into Employee (ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.