MySQL操作程序四十(Order summary网页程序4,各种输出)

返回


mysql> ALTER TABLE order1 ADD arrivaltime DATE NOT NULL DEFAULT '2011-00-00' aft er status; Query OK, 12383 rows affected (0.69 sec) Records: 12383 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE order1 ADD arrivalmemo TEXT after arrivaltime; Query OK, 12383 rows affected (0.55 sec) Records: 12383 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE order1 ADD size TEXT; Query OK, 12383 rows affected (0.75 sec) Records: 12383 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE order1 ADD weight TEXT; Query OK, 12383 rows affected (0.86 sec) Records: 12383 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE order1 ADD posttime DATE NOT NULL DEFAULT '2011-00-00' AFTER post; Query OK, 12383 rows affected (0.86 sec) Records: 12383 Duplicates: 0 Warnings: 0 mysql> show columns from order1; +-----------------+-----------+------+-----+------------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-----------+------+-----+------------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | time | date | YES | | NULL | | | orderno | text | YES | | NULL | | | ORIGINid | int(11) | YES | | NULL | | | PRICEid | int(11) | YES | | NULL | | | PAYMENTid | int(11) | YES | | NULL | | | DELIVERY | text | YES | | NULL | | | memo | text | YES | | NULL | | | consignee | text | YES | | NULL | | | changeprice | text | YES | | NULL | | | discount | text | YES | | NULL | | | total | text | YES | | NULL | | | LANGUAGEid | int(11) | YES | | NULL | | | packing_charge | text | YES | | NULL | | | freight_charges | text | YES | | NULL | | | delivery_charge | text | YES | | NULL | | | delivery_place | text | YES | | NULL | | | disc | text | YES | | NULL | | | shipping | text | YES | | NULL | | | packing | text | YES | | NULL | | | packing_info | text | YES | | NULL | | | post | char(100) | NO | | NO | | | paytime | date | NO | | 0000-00-00 | | | status | int(11) | NO | | 0 | | +-----------------+-----------+------+-----+------------+----------------+ 24 rows in set (1.00 sec) ------------------------------------------------------------------------------- mysql> ALTER TABLE owners ADD name CHAR(100) AFTER company; Query OK, 328 rows affected (0.41 sec) Records: 328 Duplicates: 0 Warnings: 0 mysql> show columns from owners; +----------+-----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | company | char(100) | YES | | NULL | | | name | char(100) | YES | | NULL | | | address | char(100) | YES | | NULL | | | person | char(50) | YES | | NULL | | | telfax | char(100) | YES | | NULL | | | email | char(100) | YES | | NULL | | | homepage | char(100) | YES | | NULL | | | memo | char(100) | YES | | NULL | | +----------+-----------+------+-----+---------+----------------+ 9 rows in set (0.02 sec) mysql> ALTER TABLE owners DELETE name; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELET E name' at line 1 mysql> ALTER TABLE owners DROP name; Query OK, 328 rows affected (0.47 sec) Records: 328 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE owners ADD name CHAR(100) NOT NULL DEFAULT 'NA'; Query OK, 327 rows affected (1.09 sec) Records: 327 Duplicates: 0 Warnings: 0 mysql> show columns from owners; +----------+-----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | company | char(100) | YES | | NULL | | | address | char(100) | YES | | NULL | | | person | char(50) | YES | | NULL | | | telfax | char(100) | YES | | NULL | | | email | char(100) | YES | | NULL | | | homepage | char(100) | YES | | NULL | | | memo | char(100) | YES | | NULL | | | name | char(100) | NO | | NA | | +----------+-----------+------+-----+---------+----------------+ 9 rows in set (0.01 sec) mysql> show columns from owners; +----------+-----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | company | char(100) | YES | | NULL | | | address | char(100) | YES | | NULL | | | person | char(50) | YES | | NULL | | | telfax | char(100) | YES | | NULL | | | email | char(100) | YES | | NULL | | | homepage | char(100) | YES | | NULL | | | memo | char(100) | YES | | NULL | | +----------+-----------+------+-----+---------+----------------+ 8 rows in set (0.23 sec) mysql> show columns from makers; +----------+-----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | company | char(100) | YES | | NULL | | | address | char(100) | YES | | NULL | | | person | char(50) | YES | | NULL | | | telfax | char(100) | YES | | NULL | | | email | char(100) | YES | | NULL | | | homepage | char(100) | YES | | NULL | | | memo | char(200) | YES | | NULL | | | nationid | int(11) | NO | | 2 | | +----------+-----------+------+-----+---------+----------------+ 9 rows in set (0.02 sec)
返回