SQL must be known to initialize data

Source: Internet
Author: User

The MySQL working environment was previously configured, but there are also missing files that can be manipulated, i.e. a database and 5 tables are missing.

Download the relevant code

Download the relevant files in the URL http://www.forta.com/books/0672325675/, where I downloaded the MySQL (and MariaDB) SQL scripts.
After downloading, there will be two files: Create.txt and Populate.txt.

Establishment of the database

Input in MySQL: CREATE DATABASE orderdb;
Do not forget the semicolon, which is the syntax of MySQL.
In addition, MySQL is not sensitive to case, so it can also be used: Create DATABASE Orderdb;
You can then press ENTER to create a successful build. You can enter the command: show databases; you can see the ORDERDB database, but now the library is empty.

The establishment of tables in the database

Input mysql> use Orderdb;
Will enter the ORDERDB database.
Then, we follow the downloaded two files, step into the code and run (enter), where the Creat.txt code is the establishment of the table, populate is the data fill.
Note that when we paste the code, the--and the text behind it--doesn't have to be glued in.

End

After the establishment is complete, we will be able to follow the necessary knowledge of the order of the textbook training.

SQL must be known to initialize data

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.