mirror of
https://github.com/doctrine/sql-formatter.git
synced 2026-03-23 22:42:14 +01:00
Merge pull request #93 from rinu/force-uppercase
Force uppercase SQL keywords
This commit is contained in:
@@ -909,7 +909,7 @@ final class Tokenizer
|
||||
) {
|
||||
return new Token(
|
||||
Token::TOKEN_TYPE_RESERVED_TOPLEVEL,
|
||||
substr($string, 0, strlen($matches[1]))
|
||||
substr($upper, 0, strlen($matches[1]))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -923,7 +923,7 @@ final class Tokenizer
|
||||
) {
|
||||
return new Token(
|
||||
Token::TOKEN_TYPE_RESERVED_NEWLINE,
|
||||
substr($string, 0, strlen($matches[1]))
|
||||
substr($upper, 0, strlen($matches[1]))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -937,7 +937,7 @@ final class Tokenizer
|
||||
) {
|
||||
return new Token(
|
||||
Token::TOKEN_TYPE_RESERVED,
|
||||
substr($string, 0, strlen($matches[1]))
|
||||
substr($upper, 0, strlen($matches[1]))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -949,7 +949,7 @@ final class Tokenizer
|
||||
if (preg_match('/^(' . $this->regexFunction . '[(]|\s|[)])/', $upper, $matches)) {
|
||||
return new Token(
|
||||
Token::TOKEN_TYPE_RESERVED,
|
||||
substr($string, 0, strlen($matches[1]) - 1)
|
||||
substr($upper, 0, strlen($matches[1]) - 1)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[37mSELECT[0m
|
||||
customer_id[0m,[0m
|
||||
customer_name[0m,[0m
|
||||
[37mCOUNT[0m(order_id[0m) [37mas[0m total[0m
|
||||
[37mCOUNT[0m(order_id[0m) [37mAS[0m total[0m
|
||||
[37mFROM[0m
|
||||
customers[0m
|
||||
[37mINNER JOIN[0m orders[0m [37mON[0m customers[0m.[0mcustomer_id[0m =[0m orders[0m.[0mcustomer_id[0m
|
||||
@@ -21,12 +21,12 @@
|
||||
(
|
||||
[37mSELECT[0m
|
||||
customer_id[0m,[0m
|
||||
[37mcount[0m(order_id[0m) [37mAs[0m total[0m
|
||||
[37mCOUNT[0m(order_id[0m) [37mAS[0m total[0m
|
||||
[37mFROM[0m
|
||||
orders[0m
|
||||
[37mGROUP BY[0m
|
||||
customer_id[0m
|
||||
) [37mAs[0m ordersummary[0m
|
||||
) [37mAS[0m ordersummary[0m
|
||||
[37mWHERE[0m
|
||||
customers[0m.[0mcustomer_id[0m =[0m ordersummary[0m.[0mcustomer_id[0m
|
||||
---
|
||||
@@ -44,30 +44,30 @@
|
||||
[37mNAMES[0m [34;1m'utf8'[0m;[0m
|
||||
---
|
||||
[37mCREATE[0m [37mTABLE[0m [35;1m`PREFIX_address`[0m (
|
||||
[35;1m`id_address`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mauto_increment[0m,[0m
|
||||
[35;1m`id_country`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_state`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mdefault[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_customer`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mdefault[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`id_manufacturer`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mdefault[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`id_supplier`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mdefault[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`id_warehouse`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mdefault[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`id_address`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mAUTO_INCREMENT[0m,[0m
|
||||
[35;1m`id_country`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_state`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_customer`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`id_manufacturer`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`id_supplier`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`id_warehouse`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`alias`[0m varchar[0m([32;1m32[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`company`[0m varchar[0m([32;1m64[0m) [37mdefault[0m [37mNULL[0m,[0m
|
||||
[35;1m`company`[0m varchar[0m([32;1m64[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`lastname`[0m varchar[0m([32;1m32[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`firstname`[0m varchar[0m([32;1m32[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`address1`[0m varchar[0m([32;1m128[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`address2`[0m varchar[0m([32;1m128[0m) [37mdefault[0m [37mNULL[0m,[0m
|
||||
[35;1m`postcode`[0m varchar[0m([32;1m12[0m) [37mdefault[0m [37mNULL[0m,[0m
|
||||
[35;1m`address2`[0m varchar[0m([32;1m128[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`postcode`[0m varchar[0m([32;1m12[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`city`[0m varchar[0m([32;1m64[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`other`[0m text[0m,[0m
|
||||
[35;1m`phone`[0m varchar[0m([32;1m16[0m) [37mdefault[0m [37mNULL[0m,[0m
|
||||
[35;1m`phone_mobile`[0m varchar[0m([32;1m16[0m) [37mdefault[0m [37mNULL[0m,[0m
|
||||
[35;1m`vat_number`[0m varchar[0m([32;1m32[0m) [37mdefault[0m [37mNULL[0m,[0m
|
||||
[35;1m`phone`[0m varchar[0m([32;1m16[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`phone_mobile`[0m varchar[0m([32;1m16[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`vat_number`[0m varchar[0m([32;1m32[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`dni`[0m varchar[0m([32;1m16[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`date_add`[0m datetime[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`date_upd`[0m datetime[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`active`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mdefault[0m [34;1m'1'[0m,[0m
|
||||
[35;1m`deleted`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mdefault[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`active`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'1'[0m,[0m
|
||||
[35;1m`deleted`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[37mPRIMARY[0m [37mKEY[0m ([35;1m`id_address`[0m),[0m
|
||||
[37mKEY[0m [35;1m`address_customer`[0m ([35;1m`id_customer`[0m),[0m
|
||||
[37mKEY[0m [35;1m`id_country`[0m ([35;1m`id_country`[0m),[0m
|
||||
@@ -78,31 +78,31 @@
|
||||
) [37mENGINE[0m =[0m [37mENGINE_TYPE[0m [37mDEFAULT[0m [37mCHARSET[0m =[0m utf8[0m
|
||||
---
|
||||
[37mCREATE[0m [37mTABLE[0m [35;1m`PREFIX_alias`[0m (
|
||||
[35;1m`id_alias`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mauto_increment[0m,[0m
|
||||
[35;1m`id_alias`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mAUTO_INCREMENT[0m,[0m
|
||||
[35;1m`alias`[0m varchar[0m([32;1m255[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`search`[0m varchar[0m([32;1m255[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`active`[0m tinyint[0m([32;1m1[0m) [37mNOT[0m [37mNULL[0m [37mdefault[0m [34;1m'1'[0m,[0m
|
||||
[35;1m`active`[0m tinyint[0m([32;1m1[0m) [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'1'[0m,[0m
|
||||
[37mPRIMARY[0m [37mKEY[0m ([35;1m`id_alias`[0m),[0m
|
||||
[37mUNIQUE[0m [37mKEY[0m [35;1m`alias`[0m ([35;1m`alias`[0m)
|
||||
) [37mENGINE[0m =[0m [37mENGINE_TYPE[0m [37mDEFAULT[0m [37mCHARSET[0m =[0m utf8[0m
|
||||
---
|
||||
[37mCREATE[0m [37mTABLE[0m [35;1m`PREFIX_carrier`[0m (
|
||||
[35;1m`id_carrier`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mAUTO_INCREMENT[0m,[0m
|
||||
[35;1m`id_reference`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_tax_rules_group`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`id_carrier`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mAUTO_INCREMENT[0m,[0m
|
||||
[35;1m`id_reference`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_tax_rules_group`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`name`[0m varchar[0m([32;1m64[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`url`[0m varchar[0m([32;1m255[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`active`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`deleted`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`shipping_handling`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'1'[0m,[0m
|
||||
[35;1m`range_behavior`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`is_module`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`is_free`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`shipping_external`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`need_range`[0m tinyint[0m([32;1m1[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`active`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`deleted`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`shipping_handling`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'1'[0m,[0m
|
||||
[35;1m`range_behavior`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`is_module`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`is_free`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`shipping_external`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`need_range`[0m tinyint[0m([32;1m1[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`external_module_name`[0m varchar[0m([32;1m64[0m) [37mDEFAULT[0m [37mNULL[0m,[0m
|
||||
[35;1m`shipping_method`[0m int[0m([32;1m2[0m) [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`position`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mdefault[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`position`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'0'[0m,[0m
|
||||
[35;1m`max_width`[0m int[0m([32;1m10[0m) [37mDEFAULT[0m [32;1m0[0m,[0m
|
||||
[35;1m`max_height`[0m int[0m([32;1m10[0m) [37mDEFAULT[0m [32;1m0[0m,[0m
|
||||
[35;1m`max_depth`[0m int[0m([32;1m10[0m) [37mDEFAULT[0m [32;1m0[0m,[0m
|
||||
@@ -114,13 +114,13 @@
|
||||
) [37mENGINE[0m =[0m [37mENGINE_TYPE[0m [37mDEFAULT[0m [37mCHARSET[0m =[0m utf8[0m
|
||||
---
|
||||
[37mCREATE[0m [37mTABLE[0m [37mIF[0m [37mNOT[0m [37mEXISTS[0m [35;1m`PREFIX_specific_price_rule`[0m (
|
||||
[35;1m`id_specific_price_rule`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mAUTO_INCREMENT[0m,[0m
|
||||
[35;1m`id_specific_price_rule`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mAUTO_INCREMENT[0m,[0m
|
||||
[35;1m`name`[0m VARCHAR[0m([32;1m255[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_shop`[0m int[0m([32;1m11[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'1'[0m,[0m
|
||||
[35;1m`id_currency`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_country`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_group`[0m int[0m([32;1m10[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`from_quantity`[0m mediumint[0m([32;1m8[0m) [37munsigned[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_shop`[0m int[0m([32;1m11[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [34;1m'1'[0m,[0m
|
||||
[35;1m`id_currency`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_country`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`id_group`[0m int[0m([32;1m10[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`from_quantity`[0m mediumint[0m([32;1m8[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`price`[0m DECIMAL[0m([32;1m20[0m,[0m [32;1m6[0m),[0m
|
||||
[35;1m`reduction`[0m decimal[0m([32;1m20[0m,[0m [32;1m6[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
[35;1m`reduction_type`[0m enum[0m([34;1m'amount'[0m,[0m [34;1m'percentage'[0m) [37mNOT[0m [37mNULL[0m,[0m
|
||||
@@ -454,7 +454,7 @@
|
||||
[37mALTER TABLE[0m
|
||||
[35;1m`PREFIX_employee`[0m
|
||||
[37mADD[0m
|
||||
[35;1m`bo_color`[0m varchar[0m([32;1m32[0m) [37mdefault[0m [37mNULL[0m [37mAFTER[0m [35;1m`stats_date_to`[0m
|
||||
[35;1m`bo_color`[0m varchar[0m([32;1m32[0m) [37mDEFAULT[0m [37mNULL[0m [37mAFTER[0m [35;1m`stats_date_to`[0m
|
||||
---
|
||||
[37mINSERT[0m [37mINTO[0m [35;1m`PREFIX_cms_category_lang`[0m
|
||||
[37mVALUES[0m
|
||||
@@ -779,16 +779,16 @@
|
||||
[32;1m2[0m,[0m
|
||||
[32;1m3[0m
|
||||
[37mWHERE[0m
|
||||
a[0m [37min[0m ([32;1m1[0m,[0m [32;1m2[0m,[0m [32;1m3[0m,[0m [32;1m4[0m,[0m [32;1m5[0m)
|
||||
[37mand[0m b[0m =[0m [32;1m5[0m;[0m
|
||||
a[0m [37mIN[0m ([32;1m1[0m,[0m [32;1m2[0m,[0m [32;1m3[0m,[0m [32;1m4[0m,[0m [32;1m5[0m)
|
||||
[37mAND[0m b[0m =[0m [32;1m5[0m;[0m
|
||||
---
|
||||
[37mSELECT[0m
|
||||
count[0m -[0m [32;1m50[0m
|
||||
[35;1m`count`[0m -[0m [32;1m50[0m
|
||||
[37mWHERE[0m
|
||||
a[0m -[0m [32;1m50[0m =[0m b[0m
|
||||
[37mWHERE[0m
|
||||
[32;1m1[0m
|
||||
[37mand[0m -[0m[32;1m50[0m
|
||||
[37mAND[0m -[0m[32;1m50[0m
|
||||
[37mWHERE[0m
|
||||
-[0m[32;1m50[0m =[0m a[0m
|
||||
[37mWHERE[0m
|
||||
@@ -799,11 +799,11 @@
|
||||
-[0m[32;1m50[0m
|
||||
[37mWHERE[0m
|
||||
[32;1m1[0m
|
||||
[37mand[0m -[0m[32;1m50[0m;[0m
|
||||
[37mAND[0m -[0m[32;1m50[0m;[0m
|
||||
---
|
||||
[37mSELECT[0m
|
||||
@[0m
|
||||
[37mand[0m b[0m;[0m
|
||||
[37mAND[0m b[0m;[0m
|
||||
---
|
||||
[37mSELECT[0m
|
||||
[36;1m@"weird variable name"[0m;[0m
|
||||
@@ -823,7 +823,7 @@
|
||||
a[0m
|
||||
[37mFROM[0m
|
||||
b[0m
|
||||
[37mLEFT OUTER JOIN[0m c[0m [37mon[0m (d[0m =[0m f[0m);[0m
|
||||
[37mLEFT OUTER JOIN[0m c[0m [37mON[0m (d[0m =[0m f[0m);[0m
|
||||
---
|
||||
[37mWITH[0m
|
||||
cte[0m [37mAS[0m (
|
||||
@@ -831,7 +831,7 @@
|
||||
a[0m,[0m
|
||||
b[0m
|
||||
[37mFROM[0m
|
||||
[37mtable[0m
|
||||
[35;1m`table`[0m
|
||||
),[0m
|
||||
[37mRECURSIVE[0m fibonacci[0m (n[0m,[0m fib_n[0m,[0m next_fib_n[0m) [37mAS[0m (
|
||||
[37mSELECT[0m
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
SELECT customer_id, customer_name, COUNT(order_id) as total FROM customers INNER JOIN orders ON customers.customer_id = orders.customer_id GROUP BY customer_id, customer_name HAVING COUNT(order_id) > 5 ORDER BY COUNT(order_id) DESC;
|
||||
SELECT customer_id, customer_name, COUNT(order_id) AS total FROM customers INNER JOIN orders ON customers.customer_id = orders.customer_id GROUP BY customer_id, customer_name HAVING COUNT(order_id) > 5 ORDER BY COUNT(order_id) DESC;
|
||||
---
|
||||
UPDATE customers SET totalorders = ordersummary.total FROM (SELECT customer_id, count(order_id) As total FROM orders GROUP BY customer_id) As ordersummary WHERE customers.customer_id = ordersummary.customer_id
|
||||
UPDATE customers SET totalorders = ordersummary.total FROM (SELECT customer_id, COUNT(order_id) AS total FROM orders GROUP BY customer_id) AS ordersummary WHERE customers.customer_id = ordersummary.customer_id
|
||||
---
|
||||
SELECT * FROM sometable UNION ALL SELECT * FROM someothertable;
|
||||
---
|
||||
SET NAMES 'utf8';
|
||||
---
|
||||
CREATE TABLE `PREFIX_address` ( `id_address` int(10) unsigned NOT NULL auto_increment, `id_country` int(10) unsigned NOT NULL, `id_state` int(10) unsigned default NULL, `id_customer` int(10) unsigned NOT NULL default '0', `id_manufacturer` int(10) unsigned NOT NULL default '0', `id_supplier` int(10) unsigned NOT NULL default '0', `id_warehouse` int(10) unsigned NOT NULL default '0', `alias` varchar(32) NOT NULL, `company` varchar(64) default NULL, `lastname` varchar(32) NOT NULL, `firstname` varchar(32) NOT NULL, `address1` varchar(128) NOT NULL, `address2` varchar(128) default NULL, `postcode` varchar(12) default NULL, `city` varchar(64) NOT NULL, `other` text, `phone` varchar(16) default NULL, `phone_mobile` varchar(16) default NULL, `vat_number` varchar(32) default NULL, `dni` varchar(16) DEFAULT NULL, `date_add` datetime NOT NULL, `date_upd` datetime NOT NULL, `active` tinyint(1) unsigned NOT NULL default '1', `deleted` tinyint(1) unsigned NOT NULL default '0', PRIMARY KEY (`id_address`), KEY `address_customer` (`id_customer`), KEY `id_country` (`id_country`), KEY `id_state` (`id_state`), KEY `id_manufacturer` (`id_manufacturer`), KEY `id_supplier` (`id_supplier`), KEY `id_warehouse` (`id_warehouse`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8
|
||||
CREATE TABLE `PREFIX_address` ( `id_address` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `id_country` int(10) UNSIGNED NOT NULL, `id_state` int(10) UNSIGNED DEFAULT NULL, `id_customer` int(10) UNSIGNED NOT NULL DEFAULT '0', `id_manufacturer` int(10) UNSIGNED NOT NULL DEFAULT '0', `id_supplier` int(10) UNSIGNED NOT NULL DEFAULT '0', `id_warehouse` int(10) UNSIGNED NOT NULL DEFAULT '0', `alias` varchar(32) NOT NULL, `company` varchar(64) DEFAULT NULL, `lastname` varchar(32) NOT NULL, `firstname` varchar(32) NOT NULL, `address1` varchar(128) NOT NULL, `address2` varchar(128) DEFAULT NULL, `postcode` varchar(12) DEFAULT NULL, `city` varchar(64) NOT NULL, `other` text, `phone` varchar(16) DEFAULT NULL, `phone_mobile` varchar(16) DEFAULT NULL, `vat_number` varchar(32) DEFAULT NULL, `dni` varchar(16) DEFAULT NULL, `date_add` datetime NOT NULL, `date_upd` datetime NOT NULL, `active` tinyint(1) UNSIGNED NOT NULL DEFAULT '1', `deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`id_address`), KEY `address_customer` (`id_customer`), KEY `id_country` (`id_country`), KEY `id_state` (`id_state`), KEY `id_manufacturer` (`id_manufacturer`), KEY `id_supplier` (`id_supplier`), KEY `id_warehouse` (`id_warehouse`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8
|
||||
---
|
||||
CREATE TABLE `PREFIX_alias` ( `id_alias` int(10) unsigned NOT NULL auto_increment, `alias` varchar(255) NOT NULL, `search` varchar(255) NOT NULL, `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (`id_alias`), UNIQUE KEY `alias` (`alias`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8
|
||||
CREATE TABLE `PREFIX_alias` ( `id_alias` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `alias` varchar(255) NOT NULL, `search` varchar(255) NOT NULL, `active` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id_alias`), UNIQUE KEY `alias` (`alias`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8
|
||||
---
|
||||
CREATE TABLE `PREFIX_carrier` ( `id_carrier` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_reference` int(10) unsigned NOT NULL, `id_tax_rules_group` int(10) unsigned DEFAULT '0', `name` varchar(64) NOT NULL, `url` varchar(255) DEFAULT NULL, `active` tinyint(1) unsigned NOT NULL DEFAULT '0', `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0', `shipping_handling` tinyint(1) unsigned NOT NULL DEFAULT '1', `range_behavior` tinyint(1) unsigned NOT NULL DEFAULT '0', `is_module` tinyint(1) unsigned NOT NULL DEFAULT '0', `is_free` tinyint(1) unsigned NOT NULL DEFAULT '0', `shipping_external` tinyint(1) unsigned NOT NULL DEFAULT '0', `need_range` tinyint(1) unsigned NOT NULL DEFAULT '0', `external_module_name` varchar(64) DEFAULT NULL, `shipping_method` int(2) NOT NULL DEFAULT '0', `position` int(10) unsigned NOT NULL default '0', `max_width` int(10) DEFAULT 0, `max_height` int(10) DEFAULT 0, `max_depth` int(10) DEFAULT 0, `max_weight` int(10) DEFAULT 0, `grade` int(10) DEFAULT 0, PRIMARY KEY (`id_carrier`), KEY `deleted` (`deleted`,`active`), KEY `id_tax_rules_group` (`id_tax_rules_group`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8
|
||||
CREATE TABLE `PREFIX_carrier` ( `id_carrier` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `id_reference` int(10) UNSIGNED NOT NULL, `id_tax_rules_group` int(10) UNSIGNED DEFAULT '0', `name` varchar(64) NOT NULL, `url` varchar(255) DEFAULT NULL, `active` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', `deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', `shipping_handling` tinyint(1) UNSIGNED NOT NULL DEFAULT '1', `range_behavior` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', `is_module` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', `is_free` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', `shipping_external` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', `need_range` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', `external_module_name` varchar(64) DEFAULT NULL, `shipping_method` int(2) NOT NULL DEFAULT '0', `position` int(10) UNSIGNED NOT NULL DEFAULT '0', `max_width` int(10) DEFAULT 0, `max_height` int(10) DEFAULT 0, `max_depth` int(10) DEFAULT 0, `max_weight` int(10) DEFAULT 0, `grade` int(10) DEFAULT 0, PRIMARY KEY (`id_carrier`), KEY `deleted` (`deleted`,`active`), KEY `id_tax_rules_group` (`id_tax_rules_group`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8
|
||||
---
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_specific_price_rule` ( `id_specific_price_rule` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `id_shop` int(11) unsigned NOT NULL DEFAULT '1', `id_currency` int(10) unsigned NOT NULL, `id_country` int(10) unsigned NOT NULL, `id_group` int(10) unsigned NOT NULL, `from_quantity` mediumint(8) unsigned NOT NULL, `price` DECIMAL(20,6), `reduction` decimal(20,6) NOT NULL, `reduction_type` enum('amount','percentage') NOT NULL, `from` datetime NOT NULL, `to` datetime NOT NULL, PRIMARY KEY (`id_specific_price_rule`), KEY `id_product` (`id_shop`,`id_currency`,`id_country`,`id_group`,`from_quantity`,`from`,`to`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_specific_price_rule` ( `id_specific_price_rule` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `id_shop` int(11) UNSIGNED NOT NULL DEFAULT '1', `id_currency` int(10) UNSIGNED NOT NULL, `id_country` int(10) UNSIGNED NOT NULL, `id_group` int(10) UNSIGNED NOT NULL, `from_quantity` mediumint(8) UNSIGNED NOT NULL, `price` DECIMAL(20,6), `reduction` decimal(20,6) NOT NULL, `reduction_type` enum('amount','percentage') NOT NULL, `from` datetime NOT NULL, `to` datetime NOT NULL, PRIMARY KEY (`id_specific_price_rule`), KEY `id_product` (`id_shop`,`id_currency`,`id_country`,`id_group`,`from_quantity`,`from`,`to`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8
|
||||
---
|
||||
UPDATE `PREFIX_configuration` SET value = '6' WHERE name = 'PS_SEARCH_WEIGHT_PNAME'
|
||||
---
|
||||
UPDATE `PREFIX_hook_module` SET position = 1 WHERE id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayPayment') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'cheque') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayPaymentReturn') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'cheque') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayHome') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'homeslider') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'actionAuthentication') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'statsdata') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'actionShopDataDuplication') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'homeslider') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayTop') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blocklanguages') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'actionCustomerAccountAdd') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'statsdata') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayCustomerAccount') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'favoriteproducts') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayAdminStatsModules') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'statsvisits') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayAdminStatsGraphEngine') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'graphvisifire') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayAdminStatsGridEngine') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'gridhtml') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayLeftColumnProduct') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blocksharefb') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'actionSearch') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'statssearch') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'actionCategoryAdd') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockcategories') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'actionCategoryUpdate') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockcategories') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'actionCategoryDelete') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockcategories') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'actionAdminMetaSave') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockcategories') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayMyAccountBlock') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'favoriteproducts') OR id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayFooter') AND id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockreinsurance')
|
||||
---
|
||||
ALTER TABLE `PREFIX_employee` ADD `bo_color` varchar(32) default NULL AFTER `stats_date_to`
|
||||
|
||||
ALTER TABLE `PREFIX_employee` ADD `bo_color` varchar(32) DEFAULT NULL AFTER `stats_date_to`
|
||||
---
|
||||
INSERT INTO `PREFIX_cms_category_lang` VALUES(1, 3, 'Inicio', '', 'home', NULL, NULL, NULL)
|
||||
---
|
||||
@@ -70,11 +71,11 @@ ALTER TABLE `test_modify` MODIFY `id` INT(11) UNSIGNED NOT NULL;
|
||||
---
|
||||
ALTER TABLE `test_change` CHANGE `id` `_id` BIGINT(20) UNSIGNED NULL;
|
||||
---
|
||||
SELECT * LIMIT 1; SELECT a,b,c,d FROM e LIMIT 1, 2; SELECT 1,2,3 WHERE a in (1,2,3,4,5) and b=5;
|
||||
SELECT * LIMIT 1; SELECT a,b,c,d FROM e LIMIT 1, 2; SELECT 1,2,3 WHERE a IN (1,2,3,4,5) AND b=5;
|
||||
---
|
||||
SELECT count - 50 WHERE a-50 = b WHERE 1 and - 50 WHERE -50 = a WHERE a = -50 WHERE 1 - 50 WHERE 1 and -50;
|
||||
SELECT `count` - 50 WHERE a-50 = b WHERE 1 AND - 50 WHERE -50 = a WHERE a = -50 WHERE 1 - 50 WHERE 1 AND -50;
|
||||
---
|
||||
SELECT @ and b;
|
||||
SELECT @ AND b;
|
||||
---
|
||||
SELECT @"weird variable name";
|
||||
---
|
||||
@@ -84,9 +85,9 @@ SELECT "no closing quote
|
||||
---
|
||||
SELECT [sqlserver] FROM [escap[e]]d style];
|
||||
---
|
||||
SELECT a FROM b LEFT OUTER JOIN c on (d=f);
|
||||
SELECT a FROM b LEFT OUTER JOIN c ON (d=f);
|
||||
---
|
||||
WITH cte AS (SELECT a, b FROM table), RECURSIVE fibonacci (n, fib_n, next_fib_n) AS ( SELECT 1, 0, 1 UNION ALL SELECT n + 1, next_fib_n, fib_n + next_fib_n FROM fibonacci WHERE n < 10 ) SELECT * FROM fibonacci;
|
||||
WITH cte AS (SELECT a, b FROM `table`), RECURSIVE fibonacci (n, fib_n, next_fib_n) AS ( SELECT 1, 0, 1 UNION ALL SELECT n + 1, next_fib_n, fib_n + next_fib_n FROM fibonacci WHERE n < 10 ) SELECT * FROM fibonacci;
|
||||
---
|
||||
WITH cte1 AS (SELECT a, b FROM table1), cte2 AS (SELECT c, d FROM table2) SELECT b, d FROM cte1 JOIN cte2 WHERE cte1.a = cte2.c;
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span>
|
||||
<span style="color: #333;">customer_id</span><span >,</span>
|
||||
<span style="color: #333;">customer_name</span><span >,</span>
|
||||
<span style="font-weight:bold;">COUNT</span>(<span style="color: #333;">order_id</span>) <span style="font-weight:bold;">as</span> <span style="color: #333;">total</span>
|
||||
<span style="font-weight:bold;">COUNT</span>(<span style="color: #333;">order_id</span>) <span style="font-weight:bold;">AS</span> <span style="color: #333;">total</span>
|
||||
<span style="font-weight:bold;">FROM</span>
|
||||
<span style="color: #333;">customers</span>
|
||||
<span style="font-weight:bold;">INNER JOIN</span> <span style="color: #333;">orders</span> <span style="font-weight:bold;">ON</span> <span style="color: #333;">customers</span><span >.</span><span style="color: #333;">customer_id</span> <span >=</span> <span style="color: #333;">orders</span><span >.</span><span style="color: #333;">customer_id</span>
|
||||
@@ -21,12 +21,12 @@
|
||||
(
|
||||
<span style="font-weight:bold;">SELECT</span>
|
||||
<span style="color: #333;">customer_id</span><span >,</span>
|
||||
<span style="font-weight:bold;">count</span>(<span style="color: #333;">order_id</span>) <span style="font-weight:bold;">As</span> <span style="color: #333;">total</span>
|
||||
<span style="font-weight:bold;">COUNT</span>(<span style="color: #333;">order_id</span>) <span style="font-weight:bold;">AS</span> <span style="color: #333;">total</span>
|
||||
<span style="font-weight:bold;">FROM</span>
|
||||
<span style="color: #333;">orders</span>
|
||||
<span style="font-weight:bold;">GROUP BY</span>
|
||||
<span style="color: #333;">customer_id</span>
|
||||
) <span style="font-weight:bold;">As</span> <span style="color: #333;">ordersummary</span>
|
||||
) <span style="font-weight:bold;">AS</span> <span style="color: #333;">ordersummary</span>
|
||||
<span style="font-weight:bold;">WHERE</span>
|
||||
<span style="color: #333;">customers</span><span >.</span><span style="color: #333;">customer_id</span> <span >=</span> <span style="color: #333;">ordersummary</span><span >.</span><span style="color: #333;">customer_id</span></pre>
|
||||
---
|
||||
@@ -44,30 +44,30 @@
|
||||
<span style="font-weight:bold;">NAMES</span> <span style="color: blue;">'utf8'</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> <span style="color: purple;">`PREFIX_address`</span> (
|
||||
<span style="color: purple;">`id_address`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">auto_increment</span><span >,</span>
|
||||
<span style="color: purple;">`id_country`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_state`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_customer`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_manufacturer`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_supplier`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_warehouse`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_address`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`id_country`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_state`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_customer`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_manufacturer`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_supplier`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_warehouse`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`alias`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`company`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`company`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`lastname`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`firstname`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`address1`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">128</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`address2`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">128</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`postcode`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">12</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`address2`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">128</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`postcode`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">12</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`city`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`other`</span> <span style="color: #333;">text</span><span >,</span>
|
||||
<span style="color: purple;">`phone`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`phone_mobile`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`vat_number`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`phone`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`phone_mobile`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`vat_number`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`dni`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`date_add`</span> <span style="color: #333;">datetime</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`date_upd`</span> <span style="color: #333;">datetime</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`deleted`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`deleted`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="font-weight:bold;">PRIMARY</span> <span style="font-weight:bold;">KEY</span> (<span style="color: purple;">`id_address`</span>)<span >,</span>
|
||||
<span style="font-weight:bold;">KEY</span> <span style="color: purple;">`address_customer`</span> (<span style="color: purple;">`id_customer`</span>)<span >,</span>
|
||||
<span style="font-weight:bold;">KEY</span> <span style="color: purple;">`id_country`</span> (<span style="color: purple;">`id_country`</span>)<span >,</span>
|
||||
@@ -78,31 +78,31 @@
|
||||
) <span style="font-weight:bold;">ENGINE</span> <span >=</span> <span style="font-weight:bold;">ENGINE_TYPE</span> <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">CHARSET</span> <span >=</span> <span style="color: #333;">utf8</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> <span style="color: purple;">`PREFIX_alias`</span> (
|
||||
<span style="color: purple;">`id_alias`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">auto_increment</span><span >,</span>
|
||||
<span style="color: purple;">`id_alias`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`alias`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">255</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`search`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">255</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="font-weight:bold;">PRIMARY</span> <span style="font-weight:bold;">KEY</span> (<span style="color: purple;">`id_alias`</span>)<span >,</span>
|
||||
<span style="font-weight:bold;">UNIQUE</span> <span style="font-weight:bold;">KEY</span> <span style="color: purple;">`alias`</span> (<span style="color: purple;">`alias`</span>)
|
||||
) <span style="font-weight:bold;">ENGINE</span> <span >=</span> <span style="font-weight:bold;">ENGINE_TYPE</span> <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">CHARSET</span> <span >=</span> <span style="color: #333;">utf8</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> <span style="color: purple;">`PREFIX_carrier`</span> (
|
||||
<span style="color: purple;">`id_carrier`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`id_reference`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_tax_rules_group`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_carrier`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`id_reference`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_tax_rules_group`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`name`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`url`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">255</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`deleted`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_handling`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`range_behavior`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`is_module`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`is_free`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_external`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`need_range`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`deleted`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_handling`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`range_behavior`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`is_module`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`is_free`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_external`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`need_range`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`external_module_name`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_method`</span> <span style="color: #333;">int</span>(<span style="color: green;">2</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`position`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`position`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`max_width`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="color: green;">0</span><span >,</span>
|
||||
<span style="color: purple;">`max_height`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="color: green;">0</span><span >,</span>
|
||||
<span style="color: purple;">`max_depth`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="color: green;">0</span><span >,</span>
|
||||
@@ -114,13 +114,13 @@
|
||||
) <span style="font-weight:bold;">ENGINE</span> <span >=</span> <span style="font-weight:bold;">ENGINE_TYPE</span> <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">CHARSET</span> <span >=</span> <span style="color: #333;">utf8</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> <span style="font-weight:bold;">IF</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">EXISTS</span> <span style="color: purple;">`PREFIX_specific_price_rule`</span> (
|
||||
<span style="color: purple;">`id_specific_price_rule`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`id_specific_price_rule`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`name`</span> <span style="color: #333;">VARCHAR</span>(<span style="color: green;">255</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_shop`</span> <span style="color: #333;">int</span>(<span style="color: green;">11</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`id_currency`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_country`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_group`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`from_quantity`</span> <span style="color: #333;">mediumint</span>(<span style="color: green;">8</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_shop`</span> <span style="color: #333;">int</span>(<span style="color: green;">11</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`id_currency`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_country`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_group`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`from_quantity`</span> <span style="color: #333;">mediumint</span>(<span style="color: green;">8</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`price`</span> <span style="color: #333;">DECIMAL</span>(<span style="color: green;">20</span><span >,</span> <span style="color: green;">6</span>)<span >,</span>
|
||||
<span style="color: purple;">`reduction`</span> <span style="color: #333;">decimal</span>(<span style="color: green;">20</span><span >,</span> <span style="color: green;">6</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`reduction_type`</span> <span style="color: #333;">enum</span>(<span style="color: blue;">'amount'</span><span >,</span> <span style="color: blue;">'percentage'</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
@@ -454,7 +454,7 @@
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">ALTER TABLE</span>
|
||||
<span style="color: purple;">`PREFIX_employee`</span>
|
||||
<span style="font-weight:bold;">ADD</span>
|
||||
<span style="color: purple;">`bo_color`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AFTER</span> <span style="color: purple;">`stats_date_to`</span></pre>
|
||||
<span style="color: purple;">`bo_color`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AFTER</span> <span style="color: purple;">`stats_date_to`</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">INSERT</span> <span style="font-weight:bold;">INTO</span> <span style="color: purple;">`PREFIX_cms_category_lang`</span>
|
||||
<span style="font-weight:bold;">VALUES</span>
|
||||
@@ -779,16 +779,16 @@
|
||||
<span style="color: green;">2</span><span >,</span>
|
||||
<span style="color: green;">3</span>
|
||||
<span style="font-weight:bold;">WHERE</span>
|
||||
<span style="color: #333;">a</span> <span style="font-weight:bold;">in</span> (<span style="color: green;">1</span><span >,</span> <span style="color: green;">2</span><span >,</span> <span style="color: green;">3</span><span >,</span> <span style="color: green;">4</span><span >,</span> <span style="color: green;">5</span>)
|
||||
<span style="font-weight:bold;">and</span> <span style="color: #333;">b</span> <span >=</span> <span style="color: green;">5</span><span >;</span></pre>
|
||||
<span style="color: #333;">a</span> <span style="font-weight:bold;">IN</span> (<span style="color: green;">1</span><span >,</span> <span style="color: green;">2</span><span >,</span> <span style="color: green;">3</span><span >,</span> <span style="color: green;">4</span><span >,</span> <span style="color: green;">5</span>)
|
||||
<span style="font-weight:bold;">AND</span> <span style="color: #333;">b</span> <span >=</span> <span style="color: green;">5</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span>
|
||||
<span style="color: #333;">count</span> <span >-</span> <span style="color: green;">50</span>
|
||||
<span style="color: purple;">`count`</span> <span >-</span> <span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">WHERE</span>
|
||||
<span style="color: #333;">a</span> <span >-</span> <span style="color: green;">50</span> <span >=</span> <span style="color: #333;">b</span>
|
||||
<span style="font-weight:bold;">WHERE</span>
|
||||
<span style="color: green;">1</span>
|
||||
<span style="font-weight:bold;">and</span> <span >-</span><span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">AND</span> <span >-</span><span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">WHERE</span>
|
||||
<span >-</span><span style="color: green;">50</span> <span >=</span> <span style="color: #333;">a</span>
|
||||
<span style="font-weight:bold;">WHERE</span>
|
||||
@@ -799,11 +799,11 @@
|
||||
<span >-</span><span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">WHERE</span>
|
||||
<span style="color: green;">1</span>
|
||||
<span style="font-weight:bold;">and</span> <span >-</span><span style="color: green;">50</span><span >;</span></pre>
|
||||
<span style="font-weight:bold;">AND</span> <span >-</span><span style="color: green;">50</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span>
|
||||
<span style="color: #333;">@</span>
|
||||
<span style="font-weight:bold;">and</span> <span style="color: #333;">b</span><span >;</span></pre>
|
||||
<span style="font-weight:bold;">AND</span> <span style="color: #333;">b</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span>
|
||||
<span style="color: orange;">@"weird variable name"</span><span >;</span></pre>
|
||||
@@ -823,7 +823,7 @@
|
||||
<span style="color: #333;">a</span>
|
||||
<span style="font-weight:bold;">FROM</span>
|
||||
<span style="color: #333;">b</span>
|
||||
<span style="font-weight:bold;">LEFT OUTER JOIN</span> <span style="color: #333;">c</span> <span style="font-weight:bold;">on</span> (<span style="color: #333;">d</span> <span >=</span> <span style="color: #333;">f</span>)<span >;</span></pre>
|
||||
<span style="font-weight:bold;">LEFT OUTER JOIN</span> <span style="color: #333;">c</span> <span style="font-weight:bold;">ON</span> (<span style="color: #333;">d</span> <span >=</span> <span style="color: #333;">f</span>)<span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">WITH</span>
|
||||
<span style="color: #333;">cte</span> <span style="font-weight:bold;">AS</span> (
|
||||
@@ -831,7 +831,7 @@
|
||||
<span style="color: #333;">a</span><span >,</span>
|
||||
<span style="color: #333;">b</span>
|
||||
<span style="font-weight:bold;">FROM</span>
|
||||
<span style="font-weight:bold;">table</span>
|
||||
<span style="color: purple;">`table`</span>
|
||||
)<span >,</span>
|
||||
<span style="font-weight:bold;">RECURSIVE</span> <span style="color: #333;">fibonacci</span> (<span style="color: #333;">n</span><span >,</span> <span style="color: #333;">fib_n</span><span >,</span> <span style="color: #333;">next_fib_n</span>) <span style="font-weight:bold;">AS</span> (
|
||||
<span style="font-weight:bold;">SELECT</span>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
SELECT
|
||||
customer_id,
|
||||
customer_name,
|
||||
COUNT(order_id) as total
|
||||
COUNT(order_id) AS total
|
||||
FROM
|
||||
customers
|
||||
INNER JOIN orders ON customers.customer_id = orders.customer_id
|
||||
@@ -21,12 +21,12 @@ FROM
|
||||
(
|
||||
SELECT
|
||||
customer_id,
|
||||
count(order_id) As total
|
||||
COUNT(order_id) AS total
|
||||
FROM
|
||||
orders
|
||||
GROUP BY
|
||||
customer_id
|
||||
) As ordersummary
|
||||
) AS ordersummary
|
||||
WHERE
|
||||
customers.customer_id = ordersummary.customer_id
|
||||
---
|
||||
@@ -44,30 +44,30 @@ SET
|
||||
NAMES 'utf8';
|
||||
---
|
||||
CREATE TABLE `PREFIX_address` (
|
||||
`id_address` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_country` int(10) unsigned NOT NULL,
|
||||
`id_state` int(10) unsigned default NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL default '0',
|
||||
`id_manufacturer` int(10) unsigned NOT NULL default '0',
|
||||
`id_supplier` int(10) unsigned NOT NULL default '0',
|
||||
`id_warehouse` int(10) unsigned NOT NULL default '0',
|
||||
`id_address` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_country` int(10) UNSIGNED NOT NULL,
|
||||
`id_state` int(10) UNSIGNED DEFAULT NULL,
|
||||
`id_customer` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`id_manufacturer` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`id_supplier` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`id_warehouse` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`alias` varchar(32) NOT NULL,
|
||||
`company` varchar(64) default NULL,
|
||||
`company` varchar(64) DEFAULT NULL,
|
||||
`lastname` varchar(32) NOT NULL,
|
||||
`firstname` varchar(32) NOT NULL,
|
||||
`address1` varchar(128) NOT NULL,
|
||||
`address2` varchar(128) default NULL,
|
||||
`postcode` varchar(12) default NULL,
|
||||
`address2` varchar(128) DEFAULT NULL,
|
||||
`postcode` varchar(12) DEFAULT NULL,
|
||||
`city` varchar(64) NOT NULL,
|
||||
`other` text,
|
||||
`phone` varchar(16) default NULL,
|
||||
`phone_mobile` varchar(16) default NULL,
|
||||
`vat_number` varchar(32) default NULL,
|
||||
`phone` varchar(16) DEFAULT NULL,
|
||||
`phone_mobile` varchar(16) DEFAULT NULL,
|
||||
`vat_number` varchar(32) DEFAULT NULL,
|
||||
`dni` varchar(16) DEFAULT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL default '1',
|
||||
`deleted` tinyint(1) unsigned NOT NULL default '0',
|
||||
`active` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
|
||||
`deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id_address`),
|
||||
KEY `address_customer` (`id_customer`),
|
||||
KEY `id_country` (`id_country`),
|
||||
@@ -78,31 +78,31 @@ CREATE TABLE `PREFIX_address` (
|
||||
) ENGINE = ENGINE_TYPE DEFAULT CHARSET = utf8
|
||||
---
|
||||
CREATE TABLE `PREFIX_alias` (
|
||||
`id_alias` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_alias` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`alias` varchar(255) NOT NULL,
|
||||
`search` varchar(255) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL default '1',
|
||||
`active` tinyint(1) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`id_alias`),
|
||||
UNIQUE KEY `alias` (`alias`)
|
||||
) ENGINE = ENGINE_TYPE DEFAULT CHARSET = utf8
|
||||
---
|
||||
CREATE TABLE `PREFIX_carrier` (
|
||||
`id_carrier` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_reference` int(10) unsigned NOT NULL,
|
||||
`id_tax_rules_group` int(10) unsigned DEFAULT '0',
|
||||
`id_carrier` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_reference` int(10) UNSIGNED NOT NULL,
|
||||
`id_tax_rules_group` int(10) UNSIGNED DEFAULT '0',
|
||||
`name` varchar(64) NOT NULL,
|
||||
`url` varchar(255) DEFAULT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`shipping_handling` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
||||
`range_behavior` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`is_module` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`is_free` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`shipping_external` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`need_range` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`active` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`shipping_handling` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
|
||||
`range_behavior` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`is_module` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`is_free` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`shipping_external` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`need_range` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`external_module_name` varchar(64) DEFAULT NULL,
|
||||
`shipping_method` int(2) NOT NULL DEFAULT '0',
|
||||
`position` int(10) unsigned NOT NULL default '0',
|
||||
`position` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`max_width` int(10) DEFAULT 0,
|
||||
`max_height` int(10) DEFAULT 0,
|
||||
`max_depth` int(10) DEFAULT 0,
|
||||
@@ -114,13 +114,13 @@ CREATE TABLE `PREFIX_carrier` (
|
||||
) ENGINE = ENGINE_TYPE DEFAULT CHARSET = utf8
|
||||
---
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_specific_price_rule` (
|
||||
`id_specific_price_rule` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_specific_price_rule` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`id_shop` int(11) unsigned NOT NULL DEFAULT '1',
|
||||
`id_currency` int(10) unsigned NOT NULL,
|
||||
`id_country` int(10) unsigned NOT NULL,
|
||||
`id_group` int(10) unsigned NOT NULL,
|
||||
`from_quantity` mediumint(8) unsigned NOT NULL,
|
||||
`id_shop` int(11) UNSIGNED NOT NULL DEFAULT '1',
|
||||
`id_currency` int(10) UNSIGNED NOT NULL,
|
||||
`id_country` int(10) UNSIGNED NOT NULL,
|
||||
`id_group` int(10) UNSIGNED NOT NULL,
|
||||
`from_quantity` mediumint(8) UNSIGNED NOT NULL,
|
||||
`price` DECIMAL(20, 6),
|
||||
`reduction` decimal(20, 6) NOT NULL,
|
||||
`reduction_type` enum('amount', 'percentage') NOT NULL,
|
||||
@@ -454,7 +454,7 @@ WHERE
|
||||
ALTER TABLE
|
||||
`PREFIX_employee`
|
||||
ADD
|
||||
`bo_color` varchar(32) default NULL AFTER `stats_date_to`
|
||||
`bo_color` varchar(32) DEFAULT NULL AFTER `stats_date_to`
|
||||
---
|
||||
INSERT INTO `PREFIX_cms_category_lang`
|
||||
VALUES
|
||||
@@ -777,16 +777,16 @@ SELECT
|
||||
2,
|
||||
3
|
||||
WHERE
|
||||
a in (1, 2, 3, 4, 5)
|
||||
and b = 5;
|
||||
a IN (1, 2, 3, 4, 5)
|
||||
AND b = 5;
|
||||
---
|
||||
SELECT
|
||||
count - 50
|
||||
`count` - 50
|
||||
WHERE
|
||||
a - 50 = b
|
||||
WHERE
|
||||
1
|
||||
and -50
|
||||
AND -50
|
||||
WHERE
|
||||
-50 = a
|
||||
WHERE
|
||||
@@ -797,11 +797,11 @@ WHERE
|
||||
-50
|
||||
WHERE
|
||||
1
|
||||
and -50;
|
||||
AND -50;
|
||||
---
|
||||
SELECT
|
||||
@
|
||||
and b;
|
||||
AND b;
|
||||
---
|
||||
SELECT
|
||||
@"weird variable name";
|
||||
@@ -821,7 +821,7 @@ SELECT
|
||||
a
|
||||
FROM
|
||||
b
|
||||
LEFT OUTER JOIN c on (d = f);
|
||||
LEFT OUTER JOIN c ON (d = f);
|
||||
---
|
||||
WITH
|
||||
cte AS (
|
||||
@@ -829,7 +829,7 @@ WITH
|
||||
a,
|
||||
b
|
||||
FROM
|
||||
table
|
||||
`table`
|
||||
),
|
||||
RECURSIVE fibonacci (n, fib_n, next_fib_n) AS (
|
||||
SELECT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">customer_id</span><span >,</span> <span style="color: #333;">customer_name</span><span >,</span> <span style="font-weight:bold;">COUNT</span>(<span style="color: #333;">order_id</span>) <span style="font-weight:bold;">as</span> <span style="color: #333;">total</span>
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">customer_id</span><span >,</span> <span style="color: #333;">customer_name</span><span >,</span> <span style="font-weight:bold;">COUNT</span>(<span style="color: #333;">order_id</span>) <span style="font-weight:bold;">AS</span> <span style="color: #333;">total</span>
|
||||
<span style="font-weight:bold;">FROM</span> <span style="color: #333;">customers</span> <span style="font-weight:bold;">INNER JOIN</span> <span style="color: #333;">orders</span> <span style="font-weight:bold;">ON</span> <span style="color: #333;">customers</span><span >.</span><span style="color: #333;">customer_id</span> <span >=</span> <span style="color: #333;">orders</span><span >.</span><span style="color: #333;">customer_id</span>
|
||||
<span style="font-weight:bold;">GROUP BY</span> <span style="color: #333;">customer_id</span><span >,</span> <span style="color: #333;">customer_name</span>
|
||||
<span style="font-weight:bold;">HAVING</span> <span style="font-weight:bold;">COUNT</span>(<span style="color: #333;">order_id</span>) <span >></span> <span style="color: green;">5</span>
|
||||
@@ -6,8 +6,8 @@
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">UPDATE</span> <span style="color: #333;">customers</span>
|
||||
<span style="font-weight:bold;">SET</span> <span style="color: #333;">totalorders</span> <span >=</span> <span style="color: #333;">ordersummary</span><span >.</span><span style="color: #333;">total</span>
|
||||
<span style="font-weight:bold;">FROM</span> (<span style="font-weight:bold;">SELECT</span> <span style="color: #333;">customer_id</span><span >,</span> <span style="font-weight:bold;">count</span>(<span style="color: #333;">order_id</span>) <span style="font-weight:bold;">As</span> <span style="color: #333;">total</span>
|
||||
<span style="font-weight:bold;">FROM</span> <span style="color: #333;">orders</span> <span style="font-weight:bold;">GROUP BY</span> <span style="color: #333;">customer_id</span>) <span style="font-weight:bold;">As</span> <span style="color: #333;">ordersummary</span>
|
||||
<span style="font-weight:bold;">FROM</span> (<span style="font-weight:bold;">SELECT</span> <span style="color: #333;">customer_id</span><span >,</span> <span style="font-weight:bold;">COUNT</span>(<span style="color: #333;">order_id</span>) <span style="font-weight:bold;">AS</span> <span style="color: #333;">total</span>
|
||||
<span style="font-weight:bold;">FROM</span> <span style="color: #333;">orders</span> <span style="font-weight:bold;">GROUP BY</span> <span style="color: #333;">customer_id</span>) <span style="font-weight:bold;">AS</span> <span style="color: #333;">ordersummary</span>
|
||||
<span style="font-weight:bold;">WHERE</span> <span style="color: #333;">customers</span><span >.</span><span style="color: #333;">customer_id</span> <span >=</span> <span style="color: #333;">ordersummary</span><span >.</span><span style="color: #333;">customer_id</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span >*</span> <span style="font-weight:bold;">FROM</span> <span style="color: #333;">sometable</span>
|
||||
@@ -17,30 +17,30 @@
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SET</span> <span style="font-weight:bold;">NAMES</span> <span style="color: blue;">'utf8'</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> <span style="color: purple;">`PREFIX_address`</span> (
|
||||
<span style="color: purple;">`id_address`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">auto_increment</span><span >,</span>
|
||||
<span style="color: purple;">`id_country`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_state`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_customer`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_manufacturer`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_supplier`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_warehouse`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_address`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`id_country`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_state`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_customer`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_manufacturer`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_supplier`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_warehouse`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`alias`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`company`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`company`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`lastname`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`firstname`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`address1`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">128</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`address2`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">128</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`postcode`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">12</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`address2`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">128</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`postcode`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">12</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`city`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`other`</span> <span style="color: #333;">text</span><span >,</span>
|
||||
<span style="color: purple;">`phone`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`phone_mobile`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`vat_number`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`phone`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`phone_mobile`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`vat_number`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`dni`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">16</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`date_add`</span> <span style="color: #333;">datetime</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`date_upd`</span> <span style="color: #333;">datetime</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`deleted`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`deleted`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="font-weight:bold;">PRIMARY</span> <span style="font-weight:bold;">KEY</span> (<span style="color: purple;">`id_address`</span>)<span >,</span>
|
||||
<span style="font-weight:bold;">KEY</span> <span style="color: purple;">`address_customer`</span> (<span style="color: purple;">`id_customer`</span>)<span >,</span>
|
||||
<span style="font-weight:bold;">KEY</span> <span style="color: purple;">`id_country`</span> (<span style="color: purple;">`id_country`</span>)<span >,</span>
|
||||
@@ -51,31 +51,31 @@
|
||||
) <span style="font-weight:bold;">ENGINE</span><span >=</span><span style="font-weight:bold;">ENGINE_TYPE</span> <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">CHARSET</span><span >=</span><span style="color: #333;">utf8</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> <span style="color: purple;">`PREFIX_alias`</span> (
|
||||
<span style="color: purple;">`id_alias`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">auto_increment</span><span >,</span>
|
||||
<span style="color: purple;">`id_alias`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`alias`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">255</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`search`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">255</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="font-weight:bold;">PRIMARY</span> <span style="font-weight:bold;">KEY</span> (<span style="color: purple;">`id_alias`</span>)<span >,</span>
|
||||
<span style="font-weight:bold;">UNIQUE</span> <span style="font-weight:bold;">KEY</span> <span style="color: purple;">`alias`</span> (<span style="color: purple;">`alias`</span>)
|
||||
) <span style="font-weight:bold;">ENGINE</span><span >=</span><span style="font-weight:bold;">ENGINE_TYPE</span> <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">CHARSET</span><span >=</span><span style="color: #333;">utf8</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> <span style="color: purple;">`PREFIX_carrier`</span> (
|
||||
<span style="color: purple;">`id_carrier`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`id_reference`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_tax_rules_group`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`id_carrier`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`id_reference`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_tax_rules_group`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`name`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`url`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">255</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`deleted`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_handling`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`range_behavior`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`is_module`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`is_free`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_external`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`need_range`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`active`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`deleted`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_handling`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`range_behavior`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`is_module`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`is_free`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_external`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`need_range`</span> <span style="color: #333;">tinyint</span>(<span style="color: green;">1</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`external_module_name`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">64</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`shipping_method`</span> <span style="color: #333;">int</span>(<span style="color: green;">2</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`position`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">default</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`position`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'0'</span><span >,</span>
|
||||
<span style="color: purple;">`max_width`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="color: green;">0</span><span >,</span>
|
||||
<span style="color: purple;">`max_height`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="color: green;">0</span><span >,</span>
|
||||
<span style="color: purple;">`max_depth`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="color: green;">0</span><span >,</span>
|
||||
@@ -87,13 +87,13 @@
|
||||
) <span style="font-weight:bold;">ENGINE</span><span >=</span><span style="font-weight:bold;">ENGINE_TYPE</span> <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">CHARSET</span><span >=</span><span style="color: #333;">utf8</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> <span style="font-weight:bold;">IF</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">EXISTS</span> <span style="color: purple;">`PREFIX_specific_price_rule`</span> (
|
||||
<span style="color: purple;">`id_specific_price_rule`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`id_specific_price_rule`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AUTO_INCREMENT</span><span >,</span>
|
||||
<span style="color: purple;">`name`</span> <span style="color: #333;">VARCHAR</span>(<span style="color: green;">255</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_shop`</span> <span style="color: #333;">int</span>(<span style="color: green;">11</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`id_currency`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_country`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_group`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`from_quantity`</span> <span style="color: #333;">mediumint</span>(<span style="color: green;">8</span>) <span style="font-weight:bold;">unsigned</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_shop`</span> <span style="color: #333;">int</span>(<span style="color: green;">11</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">DEFAULT</span> <span style="color: blue;">'1'</span><span >,</span>
|
||||
<span style="color: purple;">`id_currency`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_country`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`id_group`</span> <span style="color: #333;">int</span>(<span style="color: green;">10</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`from_quantity`</span> <span style="color: #333;">mediumint</span>(<span style="color: green;">8</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`price`</span> <span style="color: #333;">DECIMAL</span>(<span style="color: green;">20</span><span >,</span><span style="color: green;">6</span>)<span >,</span>
|
||||
<span style="color: purple;">`reduction`</span> <span style="color: #333;">decimal</span>(<span style="color: green;">20</span><span >,</span><span style="color: green;">6</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
<span style="color: purple;">`reduction_type`</span> <span style="color: #333;">enum</span>(<span style="color: blue;">'amount'</span><span >,</span><span style="color: blue;">'percentage'</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span><span >,</span>
|
||||
@@ -145,7 +145,7 @@
|
||||
<span style="font-weight:bold;">OR</span>
|
||||
<span style="color: #333;">id_hook</span> <span >=</span> (<span style="font-weight:bold;">SELECT</span> <span style="color: #333;">id_hook</span> <span style="font-weight:bold;">FROM</span> <span style="color: purple;">`PREFIX_hook`</span> <span style="font-weight:bold;">WHERE</span> <span style="color: #333;">name</span> <span >=</span> <span style="color: blue;">'displayFooter'</span>) <span style="font-weight:bold;">AND</span> <span style="color: #333;">id_module</span> <span >=</span> (<span style="font-weight:bold;">SELECT</span> <span style="color: #333;">id_module</span> <span style="font-weight:bold;">FROM</span> <span style="color: purple;">`PREFIX_module`</span> <span style="font-weight:bold;">WHERE</span> <span style="color: #333;">name</span> <span >=</span> <span style="color: blue;">'blockreinsurance'</span>)</pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">ALTER TABLE</span> <span style="color: purple;">`PREFIX_employee`</span> <span style="font-weight:bold;">ADD</span> <span style="color: purple;">`bo_color`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">default</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AFTER</span> <span style="color: purple;">`stats_date_to`</span></pre>
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">ALTER TABLE</span> <span style="color: purple;">`PREFIX_employee`</span> <span style="font-weight:bold;">ADD</span> <span style="color: purple;">`bo_color`</span> <span style="color: #333;">varchar</span>(<span style="color: green;">32</span>) <span style="font-weight:bold;">DEFAULT</span> <span style="font-weight:bold;">NULL</span> <span style="font-weight:bold;">AFTER</span> <span style="color: purple;">`stats_date_to`</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">INSERT</span> <span style="font-weight:bold;">INTO</span> <span style="color: purple;">`PREFIX_cms_category_lang`</span> <span style="font-weight:bold;">VALUES</span>(<span style="color: green;">1</span><span >,</span> <span style="color: green;">3</span><span >,</span> <span style="color: blue;">'Inicio'</span><span >,</span> <span style="color: blue;">''</span><span >,</span> <span style="color: blue;">'home'</span><span >,</span> <span style="font-weight:bold;">NULL</span><span >,</span> <span style="font-weight:bold;">NULL</span><span >,</span> <span style="font-weight:bold;">NULL</span>)</pre>
|
||||
---
|
||||
@@ -249,17 +249,17 @@
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">ALTER TABLE</span> <span style="color: purple;">`test_change`</span> <span style="font-weight:bold;">CHANGE</span> <span style="color: purple;">`id`</span> <span style="color: purple;">`_id`</span> <span style="color: #333;">BIGINT</span>(<span style="color: green;">20</span>) <span style="font-weight:bold;">UNSIGNED</span> <span style="font-weight:bold;">NULL</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span >*</span> <span style="font-weight:bold;">LIMIT</span> <span style="color: green;">1</span><span >;</span> <span style="font-weight:bold;">SELECT</span> <span style="color: #333;">a</span><span >,</span><span style="color: #333;">b</span><span >,</span><span style="color: #333;">c</span><span >,</span><span style="color: #333;">d</span> <span style="font-weight:bold;">FROM</span> <span style="color: #333;">e</span> <span style="font-weight:bold;">LIMIT</span> <span style="color: green;">1</span><span >,</span> <span style="color: green;">2</span><span >;</span> <span style="font-weight:bold;">SELECT</span> <span style="color: green;">1</span><span >,</span><span style="color: green;">2</span><span >,</span><span style="color: green;">3</span> <span style="font-weight:bold;">WHERE</span> <span style="color: #333;">a</span> <span style="font-weight:bold;">in</span> (<span style="color: green;">1</span><span >,</span><span style="color: green;">2</span><span >,</span><span style="color: green;">3</span><span >,</span><span style="color: green;">4</span><span >,</span><span style="color: green;">5</span>) <span style="font-weight:bold;">and</span> <span style="color: #333;">b</span><span >=</span><span style="color: green;">5</span><span >;</span></pre>
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span >*</span> <span style="font-weight:bold;">LIMIT</span> <span style="color: green;">1</span><span >;</span> <span style="font-weight:bold;">SELECT</span> <span style="color: #333;">a</span><span >,</span><span style="color: #333;">b</span><span >,</span><span style="color: #333;">c</span><span >,</span><span style="color: #333;">d</span> <span style="font-weight:bold;">FROM</span> <span style="color: #333;">e</span> <span style="font-weight:bold;">LIMIT</span> <span style="color: green;">1</span><span >,</span> <span style="color: green;">2</span><span >;</span> <span style="font-weight:bold;">SELECT</span> <span style="color: green;">1</span><span >,</span><span style="color: green;">2</span><span >,</span><span style="color: green;">3</span> <span style="font-weight:bold;">WHERE</span> <span style="color: #333;">a</span> <span style="font-weight:bold;">IN</span> (<span style="color: green;">1</span><span >,</span><span style="color: green;">2</span><span >,</span><span style="color: green;">3</span><span >,</span><span style="color: green;">4</span><span >,</span><span style="color: green;">5</span>) <span style="font-weight:bold;">AND</span> <span style="color: #333;">b</span><span >=</span><span style="color: green;">5</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">count</span> <span >-</span> <span style="color: green;">50</span>
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: purple;">`count`</span> <span >-</span> <span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">WHERE</span> <span style="color: #333;">a</span><span >-</span><span style="color: green;">50</span> <span >=</span> <span style="color: #333;">b</span>
|
||||
<span style="font-weight:bold;">WHERE</span> <span style="color: green;">1</span> <span style="font-weight:bold;">and</span> <span >-</span> <span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">WHERE</span> <span style="color: green;">1</span> <span style="font-weight:bold;">AND</span> <span >-</span> <span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">WHERE</span> <span >-</span><span style="color: green;">50</span> <span >=</span> <span style="color: #333;">a</span>
|
||||
<span style="font-weight:bold;">WHERE</span> <span style="color: #333;">a</span> <span >=</span> <span >-</span><span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">WHERE</span> <span style="color: green;">1</span> <span style="color: #aaa;">/*test*/</span> <span >-</span> <span style="color: green;">50</span>
|
||||
<span style="font-weight:bold;">WHERE</span> <span style="color: green;">1</span> <span style="font-weight:bold;">and</span> <span >-</span><span style="color: green;">50</span><span >;</span></pre>
|
||||
<span style="font-weight:bold;">WHERE</span> <span style="color: green;">1</span> <span style="font-weight:bold;">AND</span> <span >-</span><span style="color: green;">50</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">@</span> <span style="font-weight:bold;">and</span> <span style="color: #333;">b</span><span >;</span></pre>
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">@</span> <span style="font-weight:bold;">AND</span> <span style="color: #333;">b</span><span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: orange;">@"weird variable name"</span><span >;</span></pre>
|
||||
---
|
||||
@@ -271,9 +271,9 @@
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">a</span> <span style="font-weight:bold;">FROM</span> <span style="color: #333;">b</span> <span style="font-weight:bold;">LEFT
|
||||
OUTER
|
||||
JOIN</span> <span style="color: #333;">c</span> <span style="font-weight:bold;">on</span> (<span style="color: #333;">d</span><span >=</span><span style="color: #333;">f</span>)<span >;</span></pre>
|
||||
JOIN</span> <span style="color: #333;">c</span> <span style="font-weight:bold;">ON</span> (<span style="color: #333;">d</span><span >=</span><span style="color: #333;">f</span>)<span >;</span></pre>
|
||||
---
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">WITH</span> <span style="color: #333;">cte</span> <span style="font-weight:bold;">AS</span> (<span style="font-weight:bold;">SELECT</span> <span style="color: #333;">a</span><span >,</span> <span style="color: #333;">b</span> <span style="font-weight:bold;">FROM</span> <span style="font-weight:bold;">table</span>)<span >,</span>
|
||||
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">WITH</span> <span style="color: #333;">cte</span> <span style="font-weight:bold;">AS</span> (<span style="font-weight:bold;">SELECT</span> <span style="color: #333;">a</span><span >,</span> <span style="color: #333;">b</span> <span style="font-weight:bold;">FROM</span> <span style="color: purple;">`table`</span>)<span >,</span>
|
||||
<span style="font-weight:bold;">RECURSIVE</span> <span style="color: #333;">fibonacci</span> (<span style="color: #333;">n</span><span >,</span> <span style="color: #333;">fib_n</span><span >,</span> <span style="color: #333;">next_fib_n</span>) <span style="font-weight:bold;">AS</span> (
|
||||
<span style="font-weight:bold;">SELECT</span> <span style="color: green;">1</span><span >,</span> <span style="color: green;">0</span><span >,</span> <span style="color: green;">1</span>
|
||||
<span style="font-weight:bold;">UNION ALL</span>
|
||||
|
||||
@@ -251,7 +251,7 @@ ALTER TABLE `test_change` CHANGE `id` `_id` BIGINT(20) UNSIGNED NULL;
|
||||
---
|
||||
SELECT * LIMIT 1; SELECT a,b,c,d FROM e LIMIT 1, 2; SELECT 1,2,3 WHERE a in (1,2,3,4,5) and b=5;
|
||||
---
|
||||
SELECT count - 50
|
||||
SELECT `count` - 50
|
||||
WHERE a-50 = b
|
||||
WHERE 1 and - 50
|
||||
WHERE -50 = a
|
||||
@@ -273,7 +273,7 @@ SELECT a FROM b LEFT
|
||||
OUTER
|
||||
JOIN c on (d=f);
|
||||
---
|
||||
WITH cte AS (SELECT a, b FROM table),
|
||||
WITH cte AS (SELECT a, b FROM `table`),
|
||||
RECURSIVE fibonacci (n, fib_n, next_fib_n) AS (
|
||||
SELECT 1, 0, 1
|
||||
UNION ALL
|
||||
|
||||
Reference in New Issue
Block a user