User Tools

Site Tools


spec

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
spec [2012/03/01 01:28] – [Advance] sunrhspec [2012/03/10 15:08] (current) – old revision restored wuyw
Line 55: Line 55:
     - Support transaction     - Support transaction
     - Logger and roll back      - Logger and roll back 
-  - Supplementary Speci cation+  - Supplementary Specifi cation
     - Syntax     - Syntax
       - STRING & DATE       - STRING & DATE
         - Any CHAR, VARCHAR, DATETIME or TIMESTAMP starts and ends with a '.         - Any CHAR, VARCHAR, DATETIME or TIMESTAMP starts and ends with a '.
-      - AUTO INCREMENT +      - AUTO_INCREMENT 
-        - One table can have one column to be AUTO INCREMENT, and this column MUST BE the PRIMARY KEY.+        - One table can have one column to be AUTO_INCREMENT, and this column MUST BE the PRIMARY KEY.
         - AUTO INCREMENT column MUST BE INT.         - AUTO INCREMENT column MUST BE INT.
-        - When inserting a row, value in AUTO INCREMENT  eld CAN be a value given. If no value were given, the value should be (MAX(this column)+1).If the value were not given and no row               were in table, the value should be 1. +        - When inserting a row, value in AUTO_INCREMENT  eld CAN be a value given. If no value were given, the value should be (MAX(this column)+1).If the value were not given and no row               were in table, the value should be 1. 
-        - Of couse, AUTO INCREMENT column CAN BE updated.+        - Of couse, AUTO_INCREMENT column CAN BE updated.
       - INSERT       - INSERT
         - If user used INSERT INTO table name VALUES (...), ALL elds should be speci ed.         - If user used INSERT INTO table name VALUES (...), ALL elds should be speci ed.
Line 76: Line 76:
   - It's NOT required to do arithmetic operation on DECIMAL column. In addition, you can set arbitrary restrict on CHAR(), DECIMAL() and VARCHAR(), as long as it's reasonable. For example, the length of VARCHAR can't exceed 4000. You should also write these restrict in document.   - It's NOT required to do arithmetic operation on DECIMAL column. In addition, you can set arbitrary restrict on CHAR(), DECIMAL() and VARCHAR(), as long as it's reasonable. For example, the length of VARCHAR can't exceed 4000. You should also write these restrict in document.
   - You are allowed to keep metadata of table / database (or something like that) in memory (outside bu er), since they are not very big. What you have to load into bu er are records (in heap le) and B+ trees.   - You are allowed to keep metadata of table / database (or something like that) in memory (outside bu er), since they are not very big. What you have to load into bu er are records (in heap le) and B+ trees.
-===== Misc ===== 
- 
-**Version** 4.1 
- 
-**Date Created** 2012-2-25 
- 
-**Authors**  
- 
-  * 02-ACMer  
-    * Li Lei <lilei@cs.cmu.edu> 
-    * Yang Linji <dragonylj@sjtu.edu.cn> 
-    * Zhang Yaodong <zhydong@sjtu.edu.cn> 
-  * 03-ACMer 
-    * Ma Rong <marong1204@gmail.com> 
-    * Zhou Muxin <muxin.zhou@gmail.com> 
-    * Qian Feng <fengqian@umich.edu> 
-    * Qu Wentao <thomas.qu@gmail.com> 
-  * 04-ACMer 
-    * Li Mu <limu.cn@gmail.com> 
-    * Lian Xiaochen <lianxiaochen@gmail.com> 
-    * Sun Xiaorui <sunsirius@hotmail.com> 
-  * 05-ACMer  
-    * Han Wei <blue066@gmail.com> 
-    * Tian Yuan <feldfar@gmail.com> 
-    * Zhang Kang <jobo.zh@gmail.com> 
-  * 06-ACMer  
-    * Chen Xiangru <cxreinstein@gmail.com> 
-    * Chen Tianqi <workcrow@gmail.com> 
-    * Zhu Yihe <sjtu.pigoneand@gmail.com> 
-  * 07-ACMer  
-    * Sheng Meilun <sjmind2@gmail.com> 
-    * Wu Chenyang <shivaw@gmail.com> 
-  * 08-ACMer 
-    * Wu Yangwei <wyw.wyw.good@gmail.com> 
-    * Sun Ruihua <sun.ruih@gmail.com> 
-    * Pan Ye <panye.sjtu@gmail.com> 
  
 ===== Syntax of FwSQL ===== ===== Syntax of FwSQL =====
Line 128: Line 92:
    *DROP TABLE //tbl-name// [,//tbl-name//]    *DROP TABLE //tbl-name// [,//tbl-name//]
    *//create-definition// ::= //column-definition// | PRIMARY KEY (//col-name//)    *//create-definition// ::= //column-definition// | PRIMARY KEY (//col-name//)
-   *//column-definition// ::= //col-name// //data-type// [[Not]NULL] [DEFAULT //const-value//][AUTO_INCREMENT]+   *//column-definition// ::= //col-name// //data-type// [[NOT]NULL] [DEFAULT //const-value//][AUTO_INCREMENT]
    *//data-type// ::= INT | FLOAT | CHAR(M) | DATETIME | BOOLEAN | DECIMAL(M[,D]) | TIMESTAMP | VARCHAR(M)    *//data-type// ::= INT | FLOAT | CHAR(M) | DATETIME | BOOLEAN | DECIMAL(M[,D]) | TIMESTAMP | VARCHAR(M)
  
Line 152: Line 116:
  - Select  - Select
    
-  *SELECT [DISTINCT] //select-expr//,...\\ [FROM //tbl-ref//[,//tbl-ref//]...]\\ [WHERE //where-condition//]\\       [GROUP BY //col-name//]\\   [HAVING //having-condition//]\\ [ORDERE BY col-name[ ASC | DESC ],...]+  *SELECT [DISTINCT] //select-expr//,...\\ [FROM //tbl-ref//[,//tbl-ref//]...]\\ [WHERE //where-condition//]\\       [GROUP BY //col-name//]\\   [HAVING //having-condition//]\\ [ORDER BY col-name[ ASC | DESC ],...]
   *//select-expr// ::=//value// [AS //alias//]|*   *//select-expr// ::=//value// [AS //alias//]|*
   *//func//        ::= AVG | COUNT | MIN | MAX | SUM   *//func//        ::= AVG | COUNT | MIN | MAX | SUM
Line 159: Line 123:
   *//where-condition//::=//bool-expr//   *//where-condition//::=//bool-expr//
   *//bool-expr//      ::=//value cop value//      \\                         | //bool-expr// AND //bool-expr//    \\                      | //bool-expr// OR //bool-expr//         \\                 | [NOT] EXISTS (//subquery//)\\                         | //value cop// ANY (//subquery//) \\                         | //value// IN (//subquery//) \\                         | //value cop// ALL (//subquery//) \\                         | (//bool-expr//)     *//bool-expr//      ::=//value cop value//      \\                         | //bool-expr// AND //bool-expr//    \\                      | //bool-expr// OR //bool-expr//         \\                 | [NOT] EXISTS (//subquery//)\\                         | //value cop// ANY (//subquery//) \\                         | //value// IN (//subquery//) \\                         | //value cop// ALL (//subquery//) \\                         | (//bool-expr//)  
-  *//cop//                ::= < | > | = | >= | >= | <>+  *//cop//                ::= < | > | = | ''''<''='' | >= | <>
   *//value//              ::= (//value//)|//col-name//|//const-value//|//value aop value//       \\                         | (subquery with only one elements(or NULL)in the result table)\\ | //func//(//col-name//)   *//value//              ::= (//value//)|//col-name//|//const-value//|//value aop value//       \\                         | (subquery with only one elements(or NULL)in the result table)\\ | //func//(//col-name//)
   *//aop//                ::= + | - | * | / | %    *//aop//                ::= + | - | * | / | % 
   *//const-value//        ::= //integer// | //'string'// | //float// | 'YYYY-MM-DD HH:MM:SS' | TRUE | FALSE | NULL | DEFAULT   *//const-value//        ::= //integer// | //'string'// | //float// | 'YYYY-MM-DD HH:MM:SS' | TRUE | FALSE | NULL | DEFAULT
   *//having-condition//   ::= //bool-expr//   *//having-condition//   ::= //bool-expr//
 +
 +===== Misc =====
 +
 +**Version** 4.1
 +
 +**Date Created** 2012-2-25
 +
 +**Authors** 
 +
 +  * 02-ACMer 
 +    * Li Lei <lilei@cs.cmu.edu>
 +    * Yang Linji <dragonylj@sjtu.edu.cn>
 +    * Zhang Yaodong <zhydong@sjtu.edu.cn>
 +  * 03-ACMer
 +    * Ma Rong <marong1204@gmail.com>
 +    * Zhou Muxin <muxin.zhou@gmail.com>
 +    * Qian Feng <fengqian@umich.edu>
 +    * Qu Wentao <thomas.qu@gmail.com>
 +  * 04-ACMer
 +    * Li Mu <limu.cn@gmail.com>
 +    * Lian Xiaochen <lianxiaochen@gmail.com>
 +    * Sun Xiaorui <sunsirius@hotmail.com>
 +  * 05-ACMer 
 +    * Han Wei <blue066@gmail.com>
 +    * Tian Yuan <feldfar@gmail.com>
 +    * Zhang Kang <jobo.zh@gmail.com>
 +  * 06-ACMer 
 +    * Chen Xiangru <cxreinstein@gmail.com>
 +    * Chen Tianqi <workcrow@gmail.com>
 +    * Zhu Yihe <sjtu.pigoneand@gmail.com>
 +  * 07-ACMer 
 +    * Sheng Meilun <sjmind2@gmail.com>
 +    * Wu Chenyang <shivaw@gmail.com>
 +  * 08-ACMer
 +    * Wu Yangwei <wyw.wyw.good@gmail.com>
 +    * Sun Ruihua <sun.ruih@gmail.com>
 +    * Pan Ye <panye.sjtu@gmail.com>
 +
spec.1330565336.txt.gz · Last modified: 2012/03/01 01:28 by sunrh

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki