5 Table Management Select Database5.1 View all tables
Mysql> Show tables;+-----------------+| TABLES_IN_DAY15 |+-----------------+| Student |+-----------------+1 row in Set (0.00 sec)
5.2 Creating a table
http://blog.csdn.net/pipisorry/article/details/46764495MySQL Common display command1. Displays the list of databases in the current database server:mysql> SHOW DATABASES;Note: MySQL library has the MySQL system information, we change the password
description of MySQL data_add function and date format function
Date_add (date, INTERVAL expr type) date_sub (date, INTERVAL expr type )
These functions perform date operations. Date is a DATETIME or date value used to specify the
Create Table 'User'('ID' int(Ten) not NULL,'username' varchar( -) not NULL,'Password' varchar( -) not NULL,Primary Key('ID'),Unique Key 'username');Reason for error: Remove the single quotation mark and change to the followingMysql> CREATE TABLE
1 Create proceduregh () #注意各个地方的分号! This code should run the section that removes the last sentence, and then run call GH to display the results that have been stored2 BEGIN3 DeclareC_noint; #声明数据类型的方法4 5 Select Count(*) intoC_no # Depositing a
11. Add DataAn existing student table is designed as follows:Sno Primary KEY and self-increment, saddress represents the address, set the default value: ' Guangdong province Guangzhou '1. Add a complete insert into tables values (Val1,val2,..., valn)
Six. Aggregation functionUsing the aggregation function, you can easily analyze the data, mainly have the following application scenarios:1. Determine the number of rows in a table (statistics)2. Sum the values of a column3. Find the table column
"Copyright Notice: respect for the original, reproduced please retain the source: blog.csdn.net/shallnet, the article only for learning Exchange, do not use for commercial purposes"SQL (Structured Query language) is a database query and programming
Environment: mysql 5.5
Create Database test:
test;
We can execute the code to create the test database. If you want to check whether the database test has been created, you can use the code to view all the databases in mysql.
show databases;
What
In actual development, you always encounter this situation.
Or in this case
If you are still using select fields from table where like '/%', it is definitely a thankless practice, taking a closer look at the built-in functions of MYSQL is
I want to get started with all the languages I want to learn. mysql is also the same as it is with basic syntax and data types. Let's take a look at the simple mysql tutorial.MySQL syntax The great thing you do in MySQL is that the "code" is easy to
Database selection, creation, discarding and changing the creation of data tables and indexes, changing and discarding the retrieval information from data tables
Database selection, creation, discarding and changing the creation of data tables and
SELECTfunction_baseurl.idASidFROMfunction_baseurlWHERETRUE: the code of a colleague added a backslash to all the fields, making the code very ugly. what is the significance of this operation? SELECT
Function_baseurl.
IdAS
IdFROM
MySQL provides this very powerful thing, but the documentation has limited instructions, so that you may doubt MySQL's capabilities!
Is a session-level quasi-system variable generated, maintained, and recycled by the server similar to MySQL
1、错误查询语句:$sql='select * from sh_admin where username=$username and password=$password limit 1';2、正确查询语句:$sql = "select * from sh_admin where username = '{$username}' and password = '{$password}' limit 1";
When PHP operation MySQL database Why must
First look at the classification of SQL statements supported by MySQL
1, database selection, creation, discard and change
Use
Create Database
Drap Database
ALTER DATABASE
2, data table and index creation, change and discard
CREATE table
drop
In actual development, you will always encounter this situation
or in this situation.
If you're still using the Select fields from table where you like '/% ' is definitely a thankless practice, then it's definitely a priority to study MySQL's
MySQL CONCAT (str1,str2,...)Returns the string that results from the connection parameter. If any one of the arguments is NULL, the return value is null. There may be one or more parameters. If all parameters are non-binary strings, the result is a
Defined:The first type:Case Case_value while When_value then statement_list [when When_value then Statement_list] ... [ELSE Statement_list] END caseThe second type:When the case is search_condition then statement_list [when
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.