- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
Understanding Basic Commands in Software
Understanding Basic Commands Decode QR In None Using Barcode Control SDK for Software Control to generate, create, read, scan barcode image in Software applications. Denso QR Bar Code Maker In None Using Barcode generator for Software Control to generate, create QR Code image in Software applications. modify keys; alter the table type; and change the table name (among other things) The following sections discuss these capabilities in greater detail Read QR Code 2d Barcode In None Using Barcode scanner for Software Control to read, scan read, scan image in Software applications. Print Denso QR Bar Code In C# Using Barcode generator for .NET framework Control to generate, create Denso QR Bar Code image in .NET applications. PARTIII PART PART
QR Code Generator In Visual Studio .NET Using Barcode drawer for ASP.NET Control to generate, create QR Code ISO/IEC18004 image in ASP.NET applications. Draw QR Code ISO/IEC18004 In VS .NET Using Barcode encoder for .NET framework Control to generate, create QR image in VS .NET applications. Altering Table Names
Print QR Code In Visual Basic .NET Using Barcode drawer for .NET framework Control to generate, create QR-Code image in VS .NET applications. Generate UPC A In None Using Barcode printer for Software Control to generate, create GTIN - 12 image in Software applications. To alter a table name, use an ALTER TABLE statement with a supplementary RENAME clause The following example demonstrates by renaming table bills to invoices: Generate UCC-128 In None Using Barcode drawer for Software Control to generate, create EAN128 image in Software applications. Creating Barcode In None Using Barcode encoder for Software Control to generate, create barcode image in Software applications. mysql> ALTER TABLE airport RENAME TO cities; Query OK, 0 rows affected (028 sec) Making UPC - 13 In None Using Barcode printer for Software Control to generate, create EAN13 image in Software applications. Code 128 Code Set A Generator In None Using Barcode generation for Software Control to generate, create Code 128A image in Software applications. An alternative is to use the RENAME TABLE statement, which does the same thing Here s an example, which reverses the previous operation: Drawing ISBN In None Using Barcode creation for Software Control to generate, create Bookland EAN image in Software applications. Draw DataMatrix In None Using Barcode drawer for Excel Control to generate, create Data Matrix image in Microsoft Excel applications. mysql> RENAME TABLE cities TO airport; Query OK, 0 rows affected (006 sec) Barcode Recognizer In Java Using Barcode Control SDK for BIRT Control to generate, create, read, scan barcode image in BIRT applications. DataMatrix Generator In None Using Barcode generation for Font Control to generate, create ECC200 image in Font applications. Altering Field Names and Properties
Printing GTIN - 12 In .NET Using Barcode creation for ASP.NET Control to generate, create UPCA image in ASP.NET applications. UPCA Drawer In None Using Barcode encoder for Excel Control to generate, create Universal Product Code version A image in Office Excel applications. A CHANGE clause can be used to alter a field s name, type, and properties, simply by using a new field definition instead of the original one Here s an example, which changes the field named Runways defined as INT(11) to a field named NumRunways with definition TINYINT(1): Scan Barcode In VS .NET Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications. Making USS Code 39 In Objective-C Using Barcode creator for iPad Control to generate, create USS Code 39 image in iPad applications. mysql> ALTER TABLE airport CHANGE Runways NumRunways TINYINT(1); Query OK, 0 rows affected (023 sec) Records: 0 Duplicates: 0 Warnings: 0 When a field is changed from one type to another, MySQL will automatically attempt to convert the data in that field to the new type If the data in the field is inconsistent with the new field definition for example, a field defined as NOT NULL contains NULL values, or a field marked as UNIQUE contains duplicate values MySQL will generate an error To alter this default behavior, add an IGNORE clause to the ALTER TABLE statement that tells MySQL to ignore such inconsistencies Adding and Removing Fields and Keys
To add a new field to a table, place an ADD clause in your ALTER TABLE statement The following example demonstrates by adding a field named StartYear to the airports table: mysql> ALTER TABLE airport ADD StartYear YEAR NOT NULL; Query OK, 0 rows affected (026 sec) Records: 0 Duplicates: 0 Warnings: 0 To do the reverse delete an existing field from a table use a DROP clause instead of an ADD clause The following example removes the field added in the previous operation (along with any data it might have contained): mysql> ALTER TABLE airport DROP StartYear; Query OK, 0 rows affected (018 sec) Records: 0 Duplicates: 0 Warnings: 0 Part I: Usage
To delete a table s primary key, use the DROP PRIMARY KEY clause, as illustrated here: mysql> ALTER TABLE airport DROP PRIMARY KEY; Query OK, 0 rows affected (006 sec) To add a new primary key, use the ADD PRIMARY KEY clause, as illustrated here: mysql> ALTER TABLE airport ADD PRIMARY KEY (AirportID); Query OK, 0 rows affected (005 sec) Tip A table s primary key must always be NOT NULL
Altering Table Types
To alter the table s storage engine, add an ENGINE clause to the ALTER TABLE statement with the name of the new storage engine, as in the following example: mysql> ALTER TABLE airport ENGINE = INNODB; Query OK, 6 rows affected (011 sec) C auTioN To execute an ALTER TABLE statement, MySQL first creates a copy of the original
table, changes it, and then deletes the original table and replaces it with the changed copy For this reason, ALTER TABLE operations on large tables may take a fair amount of time Removing Tables and Databases
To remove a database, use the DROP DATABASE statement, which deletes the named database and all its tables permanently Similarly, to delete a table, use the DROP TABLE statement Try this out by creating and dropping a database and a table: mysql> CREATE DATABASE music; Query OK, 1 row affected (005 sec) mysql> CREATE TABLE member ( MemberID INT NOT NULL ); Query OK, 0 rows affected (000 sec) mysql> DROP TABLE member; Query OK, 0 rows affected (000 sec) mysql> DROP DATABASE music; Query OK, 0 rows affected (049 sec) These DROP statements will immediately wipe out the target, along with all the data it contains so use them with care!
|
|