Basic grammar operation database

Basic grammar operation database

文献种类:专题技术文献;
开发工具与关键技术:SQL
作者:卢媛媛;
撰写时间:2019/05/15

Among what basis do you have a database? Basic operation: query [Select], add [Insert], modify [Update], delete [Delete] Although a few simple phrases but the application is very wide; First New: insert PW_Title (TitleTypeID, DofdID, SubjectID, PointID , UnitID, Stem, rightKey, Remarks , ToVoidN) values (2,1,1,1,1, ' subject', 'B', null, 'True')
(. 1) primary key is set to an "identifier", key will not be displayed based interpolation value;
(2) the column data type is "numeric", may not add any marks
(3) into a value, all instructions are in English symbols state
number (4) into the values the number of columns and data types and data type definition table structure must be consistent.
(5) the new foreign key value must exist in the primary key table, such as: the "item table", the value of new "title type ID" must be present in the "item table" in the value =
(6 ) a new instruction can only operate one table.
Second, the modification (Update) Update PW_Title (TitleTypeID, DofdID, SubjectID, PointID, UnitID, Stem, RightKey, Remarks, ToVoid) Set (2,1,1,1,1, ' subject', 'B', null, ' true ')
where TitleID = 123 Summary: an instruction table can only operate one
must pay attention to whether where enabled; recommends enabling "key ID" accurate positioning data.
Remove Deletedelete from PW_Titlewhere TitleID = 123 an instruction can only operate a table
two, the query select simplest single table query
(1) to query all columns (SELECT *) * on behalf of all also refers to the wildcard
SELECT student ID, class ID, Student ID, name FROM A04 Student Table
(2) the query part of columns in the SELECT number, name FROM A04 student Table
2, multi-table query (1) two-table query
SELECT A01 College table. faculties name, A02 professional table. professional name, A02 professional table. national professional coding, A02 professional table. schooling, A02 professional table training level,
A02 professional table. Year FROM A01 College JOIN table the INNER
A02 ON A01 professional table School table. faculties ID = A02 professional table. faculties ID
three tables connected
SELECT A01 College table. faculties name, A02 professional table. professional name, A02 professional table. State professional coding,
A02 professional table. schooling, A02 professional table training level,
A02 professional table-grade, A03 class table class name the FROM
A01 College JOIN table the INNER
A02 ON A01 professional table School table. faculties ID = A02 professional tables. the INNER JOIN department ID
A03 ON A02 professional class table table table class professional ID = A03. professional ID
the WHERE and or () multi-table
SELECT A01 College table. faculties name, A02 professional table. professional name,
A02 professional table. State professional coding, A02 professional table. schooling, A02 professional table training level,
A02 Industry Table grades, A03 class table class name, A04 student table Student ID, A04 student table. Name
FROM A01 College JOIN table the INNER
A02 ON A01 professional table School table. Faculties ID = A02 professional table. The INNER JOIN department ID
A03 ON A02 professional class table table table class professional ID = A03. The INNER JOIN professional ID
A04 student table ON table A03 class. class ID = A04 student table. class ID
the WHERE A01 College table. faculties ID = 3 and (A02 professional table. Year = 2007 or A02 professional table. Year = 2006)
each has a different role in basic grammar , can be carried out depending on the desired use

Guess you like

Origin blog.csdn.net/qq_42577408/article/details/90246418