11th Day SQL

Source: Internet
Author: User
Tags sqlplus

SQL Structured Query statement:

$ sqlplus/as sysdba into SQL as administrator under Oracle User

sql> alter user HR account unlock identified by HR; Unlock HR Users

Sql> Show user shows current administrator status

Sql> DESC Employees Show all columns of employees

Full screen editing function with Sqlplus:;

Sql> Ed

Go to full screen edit equivalent VI editor

Enter SQL command, save after exiting


SQL Base query:

Query statements each query is the intersection of rows and columns

Filter criteria for Select Columns * represents all Columns

from which table

Row of the where row's filter condition Plus condition example id=90

Base SELECT statement:

Sql> SELECT * FROM Employees;

Sql> DESC Employees

Sql> Select Last_Name, SALARY, commission_pct from employees;

Sql> DESC Departments

Sql> Select department_id, department_name from departments;

spaces are aliased after the columns of the query :
Select salary,12*salary* (1+commission_pct) total wage from employees; The total salary is the alias of salary,12*salary* (1+commission_pct).

To construct a statement using hyphens:

Output the following employee information:

EmployeeID is ... at department. Total salary are ...

Select ' Employee name is ' | | last_name| | ' The department is ' department_id '

From Employees


11th Day SQL

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.