文档详情

结构化查询语言(Structured query language).doc

发布:2017-08-03约1.39万字共19页下载文档
文本预览下载声明
结构化查询语言(Structured query language) The third chapter is structured query language --SQL SQL (Structured Query Language) - Structured Query Language 3.1 definition of the basic table and insert data The system structure of 3.1.1 SQL database 1. basic table (Base Table): the independent existence of the table itself, which is actually stored in the database table rather than from the other table out of the guide. 2. Views: (View) derived from one or several basic table or view a few tables. The view itself is not independent of stored data, save only the view definition system. Database architecture -- storage mode supported by SQL (internal model), model, model. From the users perspective, the basic tables and views are, like the SQL to access them. The basic table corresponds to model, view corresponding mode. 3.1.2 defines the basic table The definition of the basic form is to create a basic table, table name (name) and it includes all the attribute name and data type specific provisions. Command format: CREATE TABLE (table name field name 1 types (width, decimal), 2 types of field name (width, decimal), all of all) Command function: for the establishment of a basic table. For example: CARTE TABLE books (the total number of C (6), C (8), the classification of the title C (16), C (6), at N (10,2)) 3.1.3 modify and delete the basic table ALTER TABLE ADD (author of C book publishing unit (8), C (20)) In the book database structure to add author and publishing unit two fields. The basic DROP TABLE table name delete the basic table. 3.1.4 insert data Command format: INSERT INTO (field name table name [1, 2] of all field names) of all VALUES (expression 1, expression of the 2 MVP MVP) Command function: according to the given field value added a new record in the database at the end. For example: INSERT INTO VALUES (446943 books, TP31/138, database, Yang Hua, 17.8) INSTER INTO book (title, author, unit) VALUES (FoxPro encyclopedia, Zhou Hong, 28.6) 3.2 SQL --SQL-SELECT
显示全部
相似文档