Learn how to use MYsql databases from getting started to mastering MySQL _ mysql-MYsql tutorial

Source: Internet
Author: User
From getting started to mastering MYsql databases, learning and using bitsCN.com 1. access is easy to learn and suitable for the construction of small databases. the database capacity is about 1 GB.
MYSQL and SQL SERVER are suitable for medium-sized databases.
ORACLE is applicable to large databases.
2. RDBMS: the abbreviation of the relational database management system.
3. the dataset in the database is organized into a table. Each table consists of rows and columns. Each behavior in the table is a record. Records can contain several segments of information. each column in the table corresponds to a segment of the information.
4. Structured Query Language (SQL) is the standard database Language today. it is used by all major database systems. Example: create table company
(
Name char (30 ),
Num int,
Address char (30)
)
5. Architecture terminology of MySQL: Client/Server. common client programs include mysql, mysqlimport, and mysqldump.
1. obtain the permissions of the sample calendar database and its tables.
Grant all on samp-db. * to paul @ localhost identified by "secret"
Grant all on samp-db. * to paul @ % identified by "secret"
2. MYSQL refers to the entire MYSQLRDBMS, while mysql represents a specific client program name.
3. activate the mysql program and log on to: C:> mysql options; mysql _ h host_name _ u user_name _ p
4. create a user name: set user = paul
5. login successful:
Mysql _ u paul _ p
Enter password :******
Welcome to the MySQL monitor. Commands end with; or g.
Your MySQL connection id is 1805 to server version: 3. ss.25.log
Type 'HELP' for help.
Mysql>
6. end session: mysql> quit bye
7. publish query
Mysql> select now (),
_> User (),
_> Version ()
_>;
  
7. if you have typed a multi-row query and do not want to execute it immediately, you can skip it, such:
Mysql> select now (),
_> Version (),
_> C
Mysql>
8. you can store the query in a file and tell mysql to read the query from the file instead of waiting for keyboard input. For example:
Mysql You can call any required files in this way. Here, the suffix ". SQL" is used to indicate that the file contains SQL statements. This method of executing mysql is used in "add new records" when the input data is sent to the samp_db database. To load a table, it is easier for mysql to read the INSERT statements from a file than to manually type these statements each time.
1. database usage involves several steps:
Create (Initialize) a database.
Create a table in the database.
Insert, retrieve, modify, or delete a table.
2. create a database
Mysql> create database samp_db;
Set to the current database: mysql> use samp_db
Query: mysql> select database ();
3. create a table
Create table president
(
Last_name varchar (15) not null,
Fist_name varchar (15) not null,
Suffix varchar (5) null,
City varchar (20) not null,
State varchar (2) not null,
Birth date not null default "0000-00-00 ",
Death date null
;
)
You can also create a president table using a pre-written description File: % mysql samp_db <create_president. SQL
4. display databases, tables, and query tables
Mysql> show databases;
Mysql> show tables;
Mysql> describe president;
5. query
Select score. name, event. date, score. score, event. type
From score, event
Where event. date = "maid"
And score. event_id = event. event_id
6. create a table
Create table student
(
Name varchar (20) not null,
Sex ebitsCN.com

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.