`

An introduction to the SQL statements

 
阅读更多

The SQL statements can be divided into two categories: the data manipulation language(DML) that let you work with the data in the database and the data definition language(DDL) that lets you work with the objects in the database.

SQL programmers typically work with the DML statements, while database adminstrators(DBAs) use the DDL statements.

 

The statements that work with the data in a database are called the data manipulation language(DML). 

SQL statements used to work with data(DML)

 

Statements           Description
SELECT Retrieve data from one or more tables.          
INSERT Adds new rows to a table.
UPDATE Changes existing rows in a table.
DELETE Deletes existing rows from a table.

 

The statements that work with the objects in a database are called the data definition language(DDL). On large systems, these statements are used exclusively by database adminstrators, or DBAs. It's the DBA's job to maintain existing databases, tune them for faster performance, and create new databases. On smaller systems, though, the SQL programmer may fill the role of the DBA.

SQL statements used to work with database objects(DDL)

 

Statement                     Description
CREATE USER Creates a new user for a database.
CREATE TABLE Creates a new table in a database.
CREATE SEQUENCE Creates a new sequence that automatically generates numbers.          
CREATE INDEX Creates a new index for a table.
   
ALTER USER Changes the definition of an existing user.
ALTER TABLE Changes the definition of an existing table.
ALTER SEQUENCE Changes the definition of an existing sequence.
ALTER INDEX Changes the structure of an existing index.
   
DROP USER Deletes an existing user.
DROP TABLE Deletes an existing table.
DROP SEQUENCE Deletes an existing sequence.
DROP INDEX Deletes an existing index.
   
GRANT Grants privileges to a user.
REVOKE Revokes privileges from a user.
分享到:
评论

相关推荐

    Beginning T-SQL with Microsoft SQL Server 2005 and 2008

    We start with an introduction to the T-SQL language and data management systems, and then continue with the SQL Server product fundamentals. This first section teaches the essentials of the SQL Server...

    Microsoft SQL Server 2016: A Beginner’s Guide, 6th Edition

    From there, you will learn how to write Transact-SQL statements, execute simple and complex database queries, handle system administration and security, and use the powerful analysis and BI tools....

    Programming.Microsoft.SQL.Server.2000.with.XML

    In fact, I’m counting on your already being familiar with the basic Transact-SQL statements, such as SELECT, INSERT, UPDATE, and DELETE, and knowing something of the basic architectural and security...

    Oracle Database 10g PL-SQL Programming

    - **Subprograms**: Introduction to procedures and functions, which can be called from other PL/SQL blocks or SQL statements. #### 2. Using SQL*Plus and JDeveloper This chapter focuses on the tools ...

    SAS.9.2.SQL.Procedure.Users.Guide

    #### Chapter 1: Introduction to the SQL Procedure **What Is SQL?** Structured Query Language (SQL) is a standard language used for managing and manipulating relational databases. It allows users to ...

    cli guide and Reference

    Embedded Dynamic SQL**: While embedded dynamic SQL is directly embedded within the application code and uses SQL statements to communicate with the database, DB2 CLI offers a more structured approach...

    Oracle官方SQL参考手册.zip

    Structured Query Language (SQL) is the set of statements with which all programs and users access data in an Oracle database. Application programs and Oracle tools often allow users access to the ...

    Apress - Oracle SQL Recipes A Problem Solution Approach (November 2009) (ATTiCA).pdf

    8. **Troubleshooting and Debugging**: The final part of the book focuses on troubleshooting and debugging SQL statements. Readers learn how to identify and fix common errors, optimize performance, and...

    Database Processing Fundamentals, Design, and Implementation (12th Edition).rar

    Submitting SQL Statements to the DBMS Using SQL in Microsoft Access 2007 Using SQL in Microsoft SQL Server 2008 Using SQL in Oracle Database 11g Using SQL in Sun Microsystems MySQL 5.1 SQL ...

    Sql for mysql

    3.5 Downloading SQL Statements from the Web Site . . . . . . . . . . 38 3.6 Ready? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 CHAPTER 4 SQL in a Nutshell ...

    计算机英语第二版清华第5单元.pdf

    The chapter introduces programming as a set of instructions, or statements, written in a specific programming language that a computer follows to convert raw data into meaningful information....

    MySql存储过程编程.chm

    Stored Programs as an Alternative to Expensive SQL Section 22.5. Optimizing Loops Section 22.6. IF and CASE Statements Section 22.7. Recursion Section 22.8. Cursors Section 22.9. Trigger ...

    Java for Programmers

    Start with an introduction to Java using an early classes and objects approach, then rapidly move on to more advanced topics, including GUI, graphics, exception handling, generics, collections, JDBC, ...

    Orchard CMS Up and Running

    This abstraction layer makes it easier to manage data persistence without the need to write complex SQL statements. 3. **Autofac**: A powerful inversion of control (IoC) container that manages ...

    Pro PHP Security(Pro)

    The book aims to provide both defensive and proactive security strategies, making it an essential resource for developers looking to protect their applications from potential attacks. #### ...

    java7帮助文档

    RowSet 1.1: The introduction of the RowSetFactory interface and the RowSetProvider class, which enable you to create all types of row sets supported by your JDBC driver; see Using the RowSetFactory ...

    A LabVIEW courseware customized for

    The development aligns with the outcomes proposed in the new curriculum statements for South Africa but remains applicable to other countries in general. #### Key Features and Components - **...

    Java2核心技术卷I+卷2:基础知识(第8版) 代码

    Executing SQL Statements 232 Query Execution 242 Scrollable and Updatable Result Sets 254 Row Sets 260 Metadata 263 Transactions 273 Connection Management in Web and Enterprise Applications 278 ...

Global site tag (gtag.js) - Google Analytics