How to return all table names and column data types of a database in Mysql
How to return all table names and column data types of a database in Mysql
Desc table name;
Show columns from table name;
Describe table name;
Show create table name;
Use
Detailed description of indexes required for SQL optimization l it is more appropriate to add indexes to columns that are frequently queried. ② there are only a few values in the column data, which is not suitable for indexing. ③ The content changes
MYSQL basic statement 1. createdatabase database name; Create Database Type 2. showdatabase; show all database information 3. use Database Name; select database 4. dropdatabase database name; delete database 5. createtable table name (field name 1
Oracle fragmentation key points-Multi-table joint query, collect basic database information 1. multi-table join query for oracle: www.2cto.com select. sname, B. stu_xb from student a, studentinf B where. stu_id = B. stu_id syntax 2. SQLStructur
When creating a table, we will inevitably consider the problem of weeks. Therefore, the table will be modified later.
The alter table statement is required to modify a table.
Modify Table NameCopy codeThe Code is as follows:Mysql> alter table
Mysqld regular MySQL ServerMysqld-opt optimizes the mysql server and provides some functions to mine better functions.Mysqld-max is the same as mysqld, But it supports update and more experimental functions (more unstable)
++ Install mysqlSee the
Last time we introduced: suitableBeginnersOfMySQL Study NotesLibrary operation example. This article describes some simpleTable operationsFor example, let's take a look at this part.
1. Create a table
Command: create table ( [,... ]);
mysql>
Mysql optimization is a comprehensive technology, mainly including
A: Table Design rationalization (in line with 3NF)
B: add an appropriate index. [four types: general index, primary key index, unique index unique, and full-text index]
C: Table
Clear, delete, and modify mysql tables.
I. Clear mysql table data
Delete from table name;Truncate table name;The delete statement without the where parameter can delete all content in the mysql table. You can also use the truncate table to clear all
Desc table name;Show columns from table name;Describe table name;Show create table name;Use information_schemaSelect * from columns where table_name = 'table name ';By the way:Show databases;You can alsoUse information_schemaSelect table_schema,
1. What is sqlplus? Sqlplus is an interactive tool for batch query. Sqlplus is installed for each oracle database. Sqlplus works in the command line mode. SQL * Plus has its own command set and environment. Sqlplus provides users with a way to
I personally think that we should not only check user input, but should check before SQL queries to better prevent injection, because there are always omissions.Common. inc. php 0x00
If (! Empty ($ _ SERVER ['request _ URI ']) strip_uri ($ _ SERVER [
MySQL database optimization Summary
I. Considerations for MySQL database Optimization
1. Database Design (rational table design) Three Paradigm (Standard Model)
The three paradigms include:
Paradigm 1: 1NF is a constraint on the atomicity of
Mysql reorganizes notes -- woods memo1. database 1. create database [if not exists] db_name [character set xxx] [collate xxx] * create a database named mydb1. Create database mydb1; * create a mydb2 database using the utf8 character set. Create
1. Oracle startup and Shutdown1. In a single-host environmentTo start or shut down the Oracle system, you must first switch to the Oracle user, as shown below:Su-Oracle
A. Start the Oracle SystemOracle> svrmgrlSvrmgr> connect internalSvrmgr>
Scott's password is: Tiger
The system password is Manager.
Sys password: change_on_install
If you have installed oralce9i, note the following when using system or sys for connection:
If the current connection is system/super Administrator
View the relationship between the user and the default tablespace.Select username, default_tablespace from dba_users;
1. view the table structure: DESC table name
2. view the table of the current user:
select table_name from user_tables;
3.
1 .. sqlplus operation
1. query all tables in a database -- "selec * From tab;2. Set pagesize 30;3. Set the number of lines displayed in each row to set linesize 300;4. Switch the user's conn user name [sys]/password [as sysdba/sys];5. view the
View the relationship between the user and the default tablespace.Select username, default_tablespace from dba_users;
1. view the table structure: DESC table name
2. view the table of the current user:
SelectTable_nameFromUser_tables;
3. view
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.