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/02/27 08:17] – [Syntax of FwSQL] wuywspec [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 69: Line 69:
       - TIMESTAMP       - TIMESTAMP
         - When inserting or updateing, if the value of this eld were not given,it means current time.         - When inserting or updateing, if the value of this eld were not given,it means current time.
-    
-===== Misc ===== 
  
-**Version** 4.1+==== Some Clari cation ====
  
-**Date Created** 2012-2-25 +  It's free for your team to decide which programming language to use, but the test case is totally based on the JDBC interface, so we strongly recommend Java as your programming language.  
- +  - You should code very thing by yourselfHowever, taking advantage of some code-generation tool like JFLEX or JavaCup is allowed and encouraged
-**Authors**  +  - It's NOT required to do arithmetic operation on DECIMAL columnIn addition, you can set arbitrary restrict on CHAR(), DECIMAL() and VARCHAR(), as long as it's reasonableFor example, the length of VARCHAR can't exceed 4000You 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 bigWhat you have to load into bu er are records (in heap le) and B+ trees.
-  * 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 122: 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)
  
  -Insert  -Insert
Line 146: 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 
-  *//col-name//    ::=[tbl-name.] //col-name//+  *//col-name//    ::= [tbl-name.] //col-name//
   *//tbl-ref//     ::=//tbl-name//[AS //alias//]\\                     |(//subquery//) AS //alias//   *//tbl-ref//     ::=//tbl-name//[AS //alias//]\\                     |(//subquery//) AS //alias//
   *//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.1330330651.txt.gz · Last modified: 2012/02/27 08:17 by wuyw

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki