SQL guide-SQL entry

Source: Internet
Author: User
Tags sybase how to use sql

Translation from w3schools (the level is limited and may be inaccurate in multiple scenarios, mainly for self-learning purposes)

SQL is a standard computer language used to access and operate databases.
In this guide, you will learn how to use SQL to access and operate data in Oracle, Sybase, SQL Server, DB2, access, and other database systems.

--------------------------------------------------------------------------------

SQL entry

SQL is a standard computer language used to access and operate databases.

--------------------------------------------------------------------------------

What is SQL?

  • SQL stands for Structured Query Language
  • SQL allows you to access the database
  • SQL allows you to access the database
  • SQL is an ANSI standard computer language
  • SQL queries can be executed by Databases
  • SQL can obtain data from the database again
  • SQL can insert records in the database
  • SQL can delete records from the database
  • SQL can update records in the database
  • Easy to learn SQL

SQL is a standard,...

SQL is a standard computer language for ANSI (American National Standards Institute) access and operating database systems. SQL is used to re-obtaining and updating data in the database. SQL and MS Access, DB2, Informix, ms SQL Server, Oracle, Sybase, etc. Run collaboratively.

Unfortunately, there are many different versions of SQL languages, but they follow the ANSI standard and must support the same keywords (such as select, update, delete, insert, where, and others)

Note:Most SQL database programs also have their own extended attributes beyond the SQL standard.

--------------------------------------------------------------------------------

SQL data table

A database usually contains one or more tables. Each table is defined with a name (e.g. "MERs" or "orders ").. Table contains data records (rows)

The following is an example of a table called "persons:

Lastname Firstname Address City
Hansen OLA Timoteivn 10 Sandnes
Svendson Tove Borgvn 23 Sandnes
Pettersen Kari Storgt 20 Stavanger

The preceding table contains three records (one for each person) and four columns (lastname, firstname, address, and city ).

--------------------------------------------------------------------------------

SQL query

With SQL, We can query the database and return results.

A query is like this:

Lastname
Hansen
Svendson
Pettersen

Note:Some database systems require a semicolon at the end of the SQL statement. Do not use semicolons in our guide.

--------------------------------------------------------------------------------

SQL data operation language (DML)

SQL (Structured Query Language) is used to execute the query syntax. However, the SQL language also contains the update, insert, and delete syntaxes.
These query and update commands are part of the data operation language (DML.

  • Select-filter data from a data table
  • Update-update data in a data table
  • Delete-delete data from a data table
  • Insert into-Insert new data into the data table

--------------------------------------------------------------------------------

SQL data definition language (DDL)

The SQL data definition language (DDL) allows you to create and delete data tables. You can also define indexes (KEYS), specify table links, and apply constraints between data tables.

Most important DDL statements of SQL are:

  • Create Table-create a new data table
  • Alter table-change data table
  • Drop table-delete a data table
  • Create index-search key)
  • Drop index-delete an index

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.