SQL database Simple operation

Source: Internet
Author: User

Introduction to SQL language
(1) A database is a file system that operates on a database using standard SQL
* Standard SQL, the use of statements in MySQL, in Oracle, DB2 can use this statement

(2) What is SQL
* Structured Query Language, structured querying language, operation of the database
* SQL non-procedural language, no need to rely on other conditions to run
* * Like in Java
if (a > 5) {
System.out .....
}

(3) Classification of SQL
First class: DDL (data definition language)
* CREATE DATABASE, CREATE database table
* Common Statement Create
Type II: DML (Data manipulation language)
* Increase the number of records in the table modify the delete operation
* Frequently used statements Insert Update Delete
Category III: DCL (Data Control Language)
* The programming language of the database
Class Fourth: DQL (data Query Language)
* Operations on queries in tables
* Frequently Used statements Select

* The main content of the study: Use SQL language to make a pruning (crud) operation on a database, a database table, and a record in a table

Using SQL for database operations
(1) Connect to the database
* Open cmd window, use command, connect MySQL database
* Command: mysql-u root-p password

(2) Create a database
* Statement: Name of the CREATE database;
* * Example: CREATE DATABASE testdb1;

(3) View all databases
* Statement: show databases;

(4) Deleting a database
* Statement: DROP database name to delete;
* * Example: drop database testdb1;

(5) Switch database
* If you want to create a database table, this table will be in a database, so you need to switch to the database
* Statement: Use the name of the database to switch;
* * Example: use TESTDB2;

SQL database Simple operation

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.