Oracle BASIC Statement

Source: Internet
Author: User

Dept Department table

Classification of SQL statements

1 Data Manipulation Language DML

Insert (record inserted)

INSERT INTO Dept (DEPTNO,DEPTNAME,LOC) VALUES (28, ' teaching department ', ' Zhuhai ')

Update (Modify record)

Update Dept Set deptno=38 where deptno=28


Delete (deleting records)

Delete from dept where deptno=38


Query statements

Select Depno,deptname,loc from dept where deptno<50;


Data Definition Language DDL

CREATE DATABASE structure

Alter to modify the database structure

Drop DELETE Database structure

Rename Renaming a table

Truncate deleting data from a table


CREATE TABLE Testtab (

ID int,

C1 VARCHAR2 (50),

C2 Date

)


ALTER TABLE Testtab add C3 decimal (15,2)



drop table Testtab

Rename EMP to Employess

(table name) (table name)


TRUNCATE TABLE EMP


Things Control (TC)

Commit (permanent save changes made to the row)

INSERT INTO Dept VALUES (88, ' Operations department ', ' HK ')

Rollback

Undo, Roll back

Commit commit (no meaning in rollback after commit)

SavePoint


Data Control Language (DCL)

Grant grants other users permission to access the database structure

Revoke primarily prevents other users from accessing the database structure



Variable declaration

Condition control

Cycle

Definition of procedures and functions




















This article is from the "Code of Things" blog, be sure to keep this source http://hw168.blog.51cto.com/10425348/1673217

Oracle BASIC Statement

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.