Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SQL- gives a little bit of foundation to friends who want to learn database.

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

SQL is a standard computer language for accessing and processing databases.

How to use SQL to access and process data in a data system, such databases include: MySQL, SQL Server, Access, Oracle, Sybase, DB2, and so on.

:

Introduction to SQL

SQL is a standard computer language for accessing and processing databases.

Http:/ / www.iis7.com/b/ssyqdq/

.

What is SQL?

SQL refers to the structured query language, the full name is Structured Query Language.

SQL allows you to access and work with databases.

SQL is an ANSI (American National Standards Institute American National Organization for Standardization) standard computer language.

.

What can SQL do?

SQL executes queries against the database

SQL can retrieve data from the database

SQL can insert new records in the database

SQL can update the data in the database

SQL can delete records from the database

SQL can create a new database

SQL can create a new table in the database

SQL can create stored procedures in the database

SQL can create views in the database

SQL can set permissions for tables, stored procedures, and views

.

SQL is a standard.-but.

Although SQL is an ANSI (American National Standards Institute American National Organization for Standardization) standard computer language, there are still many different versions of SQL.

However, in order to be compatible with the ANSI standard, they must support some major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE, and so on) in a similar manner.

Note: in addition to the SQL standard, most SQL database programs have their own proprietary extensions!

.

Use SQL in your website

To create a Web site that displays data in the database, you need to:

(relational database management system) RDBMS database programs (e.g. MS Access, SQL Server, MySQL)

Use a server-side scripting language, such as PHP or ASP

Use SQL to get the data you want

Use HTML / CSS

.

RDBMS

RDBMS refers to the relational database management system, the full name Relational Database Management System.

RDBMS is the foundation of SQL, as well as all modern database systems, such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.

The data in RDBMS is stored in database objects called tables.

A table is a collection of related data items, which consists of columns and rows.

::

SQL syntax

Database table

A database usually contains one or more tables. Each table is identified by a name (for example, "Websites"), and the table contains records (rows) with data that are used to store Web site records.

.

SQL statement

Most of the work you need to do on the database is done by SQL statements.

Remember... SQL is case-insensitive: SELECT is the same as select.

.

The semicolon after the SQL statement?

Some database systems require the use of semicolons at the end of each SQL statement.

The semicolon is the standard way to separate each SQL statement in the database system so that more than one SQL statement can be executed in the same request to the server.

.

Some of the most important SQL commands

SELECT-extract data from the database

UPDATE-updates the data in the database

DELETE-removes data from the database

INSERT INTO-insert new data into the database

CREATE DATABASE-create a new database

ALTER DATABASE-modify the database

CREATE TABLE-create a new table

ALTER TABLE-change (change) database table

DROP TABLE-Delete the table

CREATE INDEX-create index (search key)

DROP INDEX-Delete the index

::

SQL SELECT statement, and the SELECT statement is used to select data from the database. The results are stored in a result table called the result set.

SQL SELECT syntax:

SELECT column_name,column_name

FROM table_name

Vs.

SELECT * FROM table_name

.

Navigation in the result set

Most database software systems allow you to navigate through the result set using programming functions, such as Move-To-First-Record, Get-Record-Content, Move-To-Next-Record, and so on.

::

SQL SELECT DISTINCT statement, which is used by the SELECT DISTINCT statement to return a unique different value.

In a table, a column may contain multiple duplicate values, and sometimes you may want to list only different (distinct) values.

The DISTINCT keyword is used to return a unique different value.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report