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 (database)

2025-01-30 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 manipulating databases.

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

:::::::::::::::::::::::::

SQL Introduction

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

。。。。。。

What is SQL?

SQL stands for Structured Query Language.

SQL allows you to access and manipulate databases.

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

。。。。。。

What can SQL do?

SQL executes queries against databases

http:/ /www.iis7.com/b/plc/

SQL retrieves data from database

SQL inserts new records into the database

SQL can update data in a database

SQL deletes records from a database

SQL creates new databases

SQL creates new tables in the database

SQL creates stored procedures in a database

SQL creates views in a database

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

。。。。。。

SQL is a standard-but...

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

However, to be compatible with ANSI standards, they must collectively support some of the major commands (such as SELECT, UPDATE, Delete, INSERT, WHERE, etc.) in a similar manner.

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

。。。。。。

Use SQL in your website

To create a website that displays data from a database, you need:

(Relational database management system)RDBMS database programs (such as MS Access, SQL Server, MySQL)

Use server-side scripting languages such as PHP or ASP

Use SQL to get the data you want

Use HTML / CSS

。。。。。。

RDBMS

RDBMS stands for Relational Database Management System.

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

Data in an RDBMS is stored in database objects called tables.

A table is a collection of related data items consisting of columns and rows.

:::::::::::::::::::::::::::::::::::

SQL syntax

database table

A database usually contains one or more tables. Each table is identified by a name (e.g.:"Websites") and contains records (rows) with data for storing website records.

。。。。。。

SQL statement

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

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

。。。。。。

Semicolons after SQL statements?

Some database systems require a semicolon at the end of each SQL statement.

Semicolons are the standard way to separate each SQL statement in a 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 database

UPDATE -Update data in the database

Delete -deletes data from the database

INSERT INTO -Insert new data into the database

CREATE DATABASE -Create a new database

ALTER DATABASE -Modify a database

CREATE TABLE -Create a new table

ALTER TABLE -Alter (change) database tables

DROP TABLE -Delete a table

CREATE INDEX -Create index (search key)

DROP INDEX -drop index

::::::::::::::::::::::::::::::::::::::

SQL SELECT statement, 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;

with

SELECT * FROM table_name;

。。。。。。

Navigation in the result set

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

:::::::::::::::::::::::::::::::::::::

SQL SELECT DISTINCT statement, SELECT DISTINCT statement is used to return unique values.

In tables, a column may contain multiple duplicate values, and sometimes you may want to list only distinct values.

The DISTINCT keyword is used to return unique values.

Grammar:

SELECT DISTINCT column_name,column_name

FROM table_name;

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