Use dB;
-- List all tables in the current database
Show tables;
Show tables like's % ';
Create Table Name
(
Column name type modification constraints,
Sid int (3) unsigned zerofill primary key auto_increment
Sgender Enum ('male', 'female ', 'confidential') default 'male'
) Engine = MyISAM default charset = utf8;
-- Create a
Label:1 CREATE TABLE A like BThis way, when you copy table B to a, the complete field structure and index of table B is copied to table A.2. CREATE TABLE A as SELECT * from BThis method
CREATE TABLE A like BThis way, when you copy table B to a, the complete field structure and index of table B is copied to table A.CREATE TABLE A as SELECT x,x,x,xx from B LIMIT 0This method only copies the field structure of
Table replication in MySQL: create table like and create table as select, tables in mysql
Copy codeThe Code is as follows:CREATE TABLE A LIKE B
In this way, when table B is copied to
Partitioning1 is suitable for processing large amount of data, such as TB class2 to improve reading and writing and query speed of mega database3 users can create tables by applying partitioning techniques to save data in a partitioned form4 partitioning is the separation of large tables or indexes into relatively small, independently managed parts. The partitioned table does not differ from the unpartition
Technorati label: before creating a table in PL/SQL, determine whether the table exists.
Delete the execution statement of the table if any.
Since PL/SQL is used for Oracle client operations, since SQL 2005 was used to execute "before creating a table, determine whether the table
Copy Code code as follows:
CREATE TABLE A like B
This way, when you copy table B to a, the complete field structure and index of table B are copied into table A.
Copy Code code as follows:
CREATE
1. Prepare
Create a base table first:
CREATE TABLE mytb1 (ID serial,name character varying,age integer);To create an index on the name field:
Create INDEX Mytb1_name_index on MYTB1 (name);
To view the MYTB1
Purpose: To test the difference between create table A as SELECT * from B and create table a like B
MySQL under test:
SOURCE table: Ti
Table structure is as follows
Root:test> Show CRE
temporary objects and temporary objects such as temporary stored procedures and temporary functions, temporary objects are stored in tempdb. Temporary tables with a prefix of # are local, so they can only be accessed in the current user session, while temporary tables with a prefix of # are global, so all user sessions can be accessed. A temporary table uses sessions as the boundary. As long as the session for creating a temporary
Grammar:CREATE [temporary] TABLE [IF not EXISTS] Tbl_name[(Create_definition,...)][Table_options] [Select_statement]CREATE [temporary] TABLE [IF not EXISTS] Tbl_name[(] like old_tbl_name [)];Test process:Original Data sheet:Mysql> Show CREATE TABLE Test_order \g*************
Create a tableData type int (shaping, Integer) not Null,char (character) tinyint (smallest shaping) varchar (variable-length character type)CREATE TABLE Xiaohu (ID Int (4) is not NULL,Name Char (a) is not NULL,Age tinyint (2) is not null default ' 0 ', (Can not be empty, but can give 0)Dept varchar (+) default null (can be NULL)Such asMysql>
Create a table, create a database, delete a table, delete a database
Create a database
Create DATABASE Text2 Text22. Deleting a databaseDrop database Text2 Delete the databases Text2
Create a postgresql Partition Table. Create a postgresql partition table.
In postgresql, there is no partition table creation command. It is created by creating rules such as inherited tables and constraints. The steps are cumbersome and troublesome, and a method is encapsu
If the data in one of the tables in your database meets the following criteria, you should consider creating a partitioned table.1. There is a lot of data in a table in the database. What are many concepts? 10,000 lines? 20,000 lines? Or 100,000 or 1 million? This, I think is the question of the benevolent see and the beholder. Of course, when the data in the data table
Tags: int pos creat GPO ble delete time arc primary KEY constraint1.Employees Employee table /** Create employees employee table **/
UseTSQL2012IF object_id('dbo. Employees','U') is not NULL
DROP TABLEdbo. EmployeesCREATE TABLEdbo. Employees (EmpidINT not NULL, FirstNameVARCHAR( -) not NULL, LastNameVARCHAR( -) not NULL, HireDate DATE not NULL, MgridINT
Solution:
1. query analyzer to log on to the remote server to create a table
2. the logon method remains unchanged. log on to the local SQL Server directly, and then use the following method to create a table on the linked server.
Create a connection method such as (u
1. Create a temporary tableA temporary table is a table, used to temporarily save some dataCharacteristics:Visible only to the user who created the temporary table ;When the session ends, MySQL automatically deletes the temporary table.The core of the temporal table: very li
Li Wu:Heng Learn to think together, honouring teachers save Thanksgiving. Leaf See root three return to one, rivers the same oneness.Meekness Conscience Lord, willing to do without regrets to the most bitter. Reading exercises to keep the body and mind, sincere advice and the line and cherish.
Data,
data, Lingen on the data. You must be cautious about operating the database. Give the most bitter code here, and take a look at it, to have your own judgment. Meet the choice, or ashamed t
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.