Java EE Learning Journey 3--mysql

Source: Internet
Author: User

Just a serious project, the software needs to use the database, and I can't even use the basic database statements,

So learn the basic use of MySQL before you learn Java EE.

Installation and Configuration

This is not much to say, basically follow the default installation MSI, the most important thing is to remember the configuration when the password set.

Basic statement

A basic principle is that MySQL's unique statement in the command line without a semicolon, the operation of the database general statement to use a semicolon.

Here is the basic statement:

Create DATABASE DatabaseName creates a db

Use DatabaseName to switch the current database

CREATE table TableName (name varchar () not null primary key auto_increment) Create a table

Show tables See what tables are in the current database, but don't see the data in the table, and remember ' table ' to add ' s '

Insert INTO TableName (name,email) values(' Tom ', ' [email protected] ') inserting data into the table

SELECT * from TableName Query the contents of the entire table, remember to have * number

update TableName set name=' Bigtom ' where id=1 changes the record of the database

Delete from TableName where id=1 deletes data

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.