Oracle ----- familiar with basic usage

Source: Internet
Author: User

Oracle ----- familiar with the basic use of oracle databases, do not come! 1. create a table employee with the following fields: Id number (4), First_Name varchar2 (20), last_Name varchar2 (20), mgrid NUMBER (4), Job varchar2 (20 ), salary number (7,2) [SQL] create table employee (Id number (4), First_Name varchar2 (20), last_Name varchar2 (20), mgrid NUMBER (4 ), job varchar2 (20), Salary number (7,2); 2. insert the following data into the table, submit, and query the data; ID FIRST_NAME LAST_NAME mgrid salary 1 Rose Taylor 4 1500 2 Matha Jones 4 2200 3 Donna Noble 4 1300 4 Doctor Who 3500 5 Jack Harkness 1 3000 [SQL] insert into employee values (1, 'Rose ', 'Count', 4, null, 1500); insert into employee values (2, 'matha', 'Jones', 4, null, 2200 ); insert into employee values (3, 'dona', 'noble ', 4, null, 1300); insert into employee values (4, 'Doctor', 'who', null, null, 3500); insert into employee values (5, 'jack', 'hark', 1, null, 3000); 3. change last_name of employee 3 to "Tate", submit and query the data. [SQL] update employee set last_name = 'tate' where id = 3; commit; select * from employee; 4. change the salary of all employees whose salaries are less than 5000 to 5000 (do not submit), set the storage point, and query data. [SQL] update employee set salary = 5000 where salary <5000; savepoint a; select * from employee; 5. delete all data in the employee table (do not submit) and query data; // delete from + Table name = delete + Table name [SQL] delete employee where 2 = 2; select * from employee; 6. roll back to the storage point set in question 4 to query data. [SQL] rollback to a; select * from employee; 7. delete all data in the table employee, submit the data, and query the data. [SQL] truncate table employee;

Related Article

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.