Home Database Mysql Tutorial 3. SQL语言基础

3. SQL语言基础

Jun 07, 2016 pm 02:50 PM
ddl defi sql definition data language

SQL语言: 数据定义语言(DDL,defination,CREAT、ALTER、DROP)、数据查询语言(DQL)、数据操纵语言(DML,INSERT、DELETE、UPDATE)、数据控制语言(DCL) 数据定义: CREATE创建表、视图,索引 创建表: 创建视图: Oracle数据库的视图可以修改,标准SQ

SQL语言: 数据定义语言(DDL,defination,CREAT、ALTER、DROP)、数据查询语言(DQL)、数据操纵语言(DML,INSERT、DELETE、UPDATE)、数据控制语言(DCL)
数据定义: CREATE创建表、视图,索引 创建表:      创建视图:      Oracle数据库的视图可以修改,标准SQL不可以。WITH CHECK OPTION:对视图进行UPDATE、DELETE、INSERT操作时,保证更新、删除或插入的行满足视图中定义的谓词条件,机子查询中的条件表达式。 创建索引:      UNIQUE:表示索引的值不能重复,对应唯一数据记录 CLUSTER:表示建立的是聚簇索引,聚簇索引指索引项的顺序与表中记录存储的物理顺序一致的索引组织。 次序:表示索引值的排列顺序,默认ASC(DESC降序)
DROP删除表、视图、索引 删除表:DROP TABLE 删除视图:DROP VIEW 删除索引:DROP INDEX
ALTER增加列、修改列、删除约束,不可以删除列     
数据查询: 简单查询     distinct:去重复     Oracle判断一个条件的值时,会有TRUE、FALSE、UNKNOWN(遇到NULL时)
    GROUP BY:ROLLUP、CUBE、     HAVING:对分组结果进行筛选

多表连接查询:     简单连接、inner join、left join、right join、natural join、自连接

集合操作:不能在BLOB、LONG的大数据类型上进行集合操作     UNION:并运算
    UNION ALL:并运算
    INTERSECT:交运算    
    MINUS:差运算

子查询:     IN:列的值与子查询返回结果中的值进行比较
    EXISTS:子查询中是否存在查询结果

数据操纵:     一般INSERT
    批量INSERT:INSERT INTO TABLE_NAME[col1,col2..] SubQuery 

    UPDATE:也可以通过子查询赋值

    DELETE:删除后可以用ROLLBACK恢复数据
    TRUNCATE:删除数据,速度快,不产生回滚信息,不可恢复数据。可结合关键字REUSE STORAGE、DROP STORAGE(默认,删除就立即释放存储空间)使用

数据控制:     GRANT:授予权限
        GRANT [,]...         [ON]
        TO[,]...
        [WITH GRANT OPTION]
    权限:
对象 对象类型 操作权限
TABLE COLUMN SELECT、INSERT、UPDATE、DELETE、ALL PRIVILEGES
视图 TABLE VIEW SELECT、INSERT、UPDATE、DELETE、ALL PRIVILEGES
基表 TABLE SELECT、INSERT、UPDATE、DELETE、ALTER、INDEX、ALL PRIVILEGES
数据库 DATABASE CREATETAB
WITH GRANT OPTION:用户是否可以传播权限 PUBLIC:全体用户
    REVOKE:收回权限,收回权限可以级联
        REVOKE [,]...
        [ON ]
        FROM [,...]

ORACLE常用函数:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Lulo, a Solana-based Yield Aggregator, Saw Its TVL Double to $38.7M Since August Lulo, a Solana-based Yield Aggregator, Saw Its TVL Double to $38.7M Since August Aug 27, 2024 pm 09:10 PM

The yield aggregator launched at the beginning of the year and has continued to grow even during DeFi market downturns.

What is the difference between DeFi and blockchain? What is the difference between DeFi and blockchain? Jul 12, 2024 am 02:06 AM

DeFi, decentralized finance, is a financial system based on blockchain technology that aims to create financial services without intermediaries (such as banks and brokerage companies). Blockchain is a decentralized distributed ledger technology (DLT) used to record transactions and data. When many beginners enter the currency market, it is difficult to understand what is the difference between DeFi and blockchain? According to the analysis of existing data, the differences between DeFi and blockchain are in terms of nature, function and purpose, scope and application, and technical implementation. Next, the editor will tell you in detail. What is the difference between DeFi and blockchain? There are differences between DeFi and blockchain in terms of nature, function and purpose, scope and application, and technical implementation. Blockchain is a decentralized data storage.

70B model generates 1,000 tokens in seconds, code rewriting surpasses GPT-4o, from the Cursor team, a code artifact invested by OpenAI 70B model generates 1,000 tokens in seconds, code rewriting surpasses GPT-4o, from the Cursor team, a code artifact invested by OpenAI Jun 13, 2024 pm 03:47 PM

70B model, 1000 tokens can be generated in seconds, which translates into nearly 4000 characters! The researchers fine-tuned Llama3 and introduced an acceleration algorithm. Compared with the native version, the speed is 13 times faster! Not only is it fast, its performance on code rewriting tasks even surpasses GPT-4o. This achievement comes from anysphere, the team behind the popular AI programming artifact Cursor, and OpenAI also participated in the investment. You must know that on Groq, a well-known fast inference acceleration framework, the inference speed of 70BLlama3 is only more than 300 tokens per second. With the speed of Cursor, it can be said that it achieves near-instant complete code file editing. Some people call it a good guy, if you put Curs

China Mobile: Humanity is entering the fourth industrial revolution and officially announced 'three plans” China Mobile: Humanity is entering the fourth industrial revolution and officially announced 'three plans” Jun 27, 2024 am 10:29 AM

According to news on June 26, at the opening ceremony of the 2024 World Mobile Communications Conference Shanghai (MWC Shanghai), China Mobile Chairman Yang Jie delivered a speech. He said that currently, human society is entering the fourth industrial revolution, which is dominated by information and deeply integrated with information and energy, that is, the "digital intelligence revolution", and the formation of new productive forces is accelerating. Yang Jie believes that from the "mechanization revolution" driven by steam engines, to the "electrification revolution" driven by electricity, internal combustion engines, etc., to the "information revolution" driven by computers and the Internet, each round of industrial revolution is based on "information and "Energy" is the main line, bringing productivity development

Being intercepted by OpenAI again, Google launched an open source visual language model: PaliGemma Being intercepted by OpenAI again, Google launched an open source visual language model: PaliGemma Jun 09, 2024 am 09:17 AM

Foreword This model combines the SigLIP visual model and the Gemma language model. Both models are open components, making PaliGemma excellent at processing tasks that combine vision and language. The usage scenarios of PaliGemma include image subtitles, image tags and visual question answering. These application scenarios take advantage of PaliGemma's ability to understand image content and extract key features, and then convert this information into language output to enable interaction with users or automated content generation. This flexibility makes PaliGemma suitable not only for research and development environments, but also for commercial applications such as customer service, content recommendation systems, etc. Pictures What can PaliGemma do? Pictures can be used when prompted.

The inside story of Google's search algorithm was revealed, and 2,500 pages of documents were leaked with real names! Search Ranking Lies Exposed The inside story of Google's search algorithm was revealed, and 2,500 pages of documents were leaked with real names! Search Ranking Lies Exposed Jun 11, 2024 am 09:14 AM

Recently, 2,500 pages of internal Google documents were leaked, revealing how search, "the Internet's most powerful arbiter," operates. SparkToro's co-founder and CEO is an anonymous person. He published a blog post on his personal website, claiming that "an anonymous person shared with me thousands of pages of leaked Google Search API documentation that everyone in SEO should read." Go to them! "For many years, RandFishkin has been the top spokesperson in the field of SEO (Search Engine Optimization, search engine optimization), and he proposed the concept of "website authority" (DomainRating). Since he is highly respected in this field, RandFishkin

Discover the potential of affordable DeFi coins that could see massive growth in the coming year Discover the potential of affordable DeFi coins that could see massive growth in the coming year Jul 28, 2024 am 09:39 AM

This article delves into digital assets priced under a dollar, with the promise to soar a hundredfold in 2024. Uncover which tokens are on the radar

What is DeFi (decentralized finance)? How to invest in DeFi? The 3 most common DeFi application platforms What is DeFi (decentralized finance)? How to invest in DeFi? The 3 most common DeFi application platforms Mar 05, 2025 pm 05:39 PM

Interpretation of DeFi: The Future of Decentralized Finance This article will explain DeFi (decentralized Finance) in an easy-to-understand manner and explore its operating principles, advantages and investment methods. DeFi uses blockchain technology and smart contracts to bypass traditional financial institutions and achieve more transparent, efficient and low-cost financial services. What is DeFi? DeFi, namely decentralized finance, is a new financial model based on blockchain and smart contracts. It eliminates dependence on banks, governments or other centralized institutions, making financial services more open and convenient. Anyone can participate through the Internet without being restricted by geographical and identity, and enjoying greater efficiency. The difference between DeFi and traditional finance: Characteristics Degree of traditional finance centralization

See all articles