It is always customary to compare with Oracle database when learning MySQL. When learning the storage structure of MySQL InnoDB, it is also unavoidable to compare with Oracle. Oracle's data storage is table space, segments, blocks, chunks, data
One: The conversion method between various datepublic class Timetest {public static void main (string[] args) {Date date = new Date (); First, get the current system time and date and format the output: SimpleDateFormat df = new SimpleDateFormat
Chapter III MySQL advanced query (i) I. Four classifications for SQL language
1. DML(data manipulation Language): Used to insert, modify, and delete data in a table, such as insert,update,delect
.
2. DDL(data definitionLanguage):
Premise: To implement MySQL database and PowerDesigner interaction need to install MySQL database driver locallyMysql-connector-odbc-5.1.5-win32.msi.
MySQL Database object Import powerdesigner
1. For example 16.5, open File-->reverse
Examples of items to buy:① Gets the quantity of inventory from the database.② Check if the quantity of stock is sufficient.The quantity of ③ inventory minus the amount purchased by the buyer (in the case of each user buying one).④ final purchase
1.Unix_timestampMySQL provides the unix_timestamp () function to calculate The number of seconds that have elapsed since 1970-01-01 08:00:00. The start time here is 1970-01-01 08:00:00, not 1970-01-01 00:00:00. For time earlier than 1970-01-01 08:00
A lot of information on the Internet, and finally found a viable, share the following:Database size query:Select Concat (Round (sum (data_length/1024/1024), 2), ' M ') from INFORMATION_SCHEMA. TABLES where table_schema= ' database name ';Table size
Date_format (date, FORMAT) function usageThe Date_format (date, format) function formats the date value according to the format string.1. Convert a string to a date formatInstance:SELECT date_format (' 2017-09-20 08:30:45 ', '%y-%m-%d%h:%i:%s
The product is landing fast. Can no longer secretly use the root user, the information center of the people to come to the root user confiscated back. DistressedI can only secretly add a user with full privileges ah hahaFirst, create a user.Using
Original: MySQL in subquery causes the index to be unusableToday, I saw a blog about MySQL in sub-query optimization case,At first it felt a bit dubious (if it was a swap in SQL Server, this would be absolutely impossible, and a simple test would be
We'll start with the index because it's the most important tool for speeding up queries. There are other techniques for speeding up the query, but the most effective way is to use the index appropriately.On the MySQL mailing list, people often ask
One by one-to-many, many-to-one11.1establish a multi-pair, one-to-many relationship needs attention2 The associated table is created first, and the associated field must be guaranteed to be unique.3 when you create an associated table, the
1. InnoDB Engine IndexInnoDB supports indexes in the following ways:(1) Hash index(2) Full-text indexing(1) B + Tree index can be divided into clustered index and secondary indexThe creation of the index can be done in the CREATE TABLE statement, or
Mysql modification to enable remote connection, mysql modification to enable
Regarding the remote connection to mysql, we often encounter mysql databases stored on a certain computer during our work. If you want to connect to the mysql service, the
MySQL alter command, mysqlalter
Use the alter command in mysql to edit the table structure. The details are as follows:
Modify Field Type
mysql> alter table employee change depno depno int(5) not null;
Add Index
Mysql> alter table name add index
Detailed explanation of the encapsulation of JDBC database links and related methods, detailed explanation of jdbc database Encapsulation
Details about the encapsulation of JDBC database links and related methods
The MySQL database is used. First,
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service