2012年3月3日 星期六

This Site Will Stop for a While

Finally found that I should stay in my field. In stead of keep learning a lot of other database techniques, reinforce my current skills should be the best strategy. There are a lot of good small databases in this world. But for this stage. I would say I'll stay on my track for a while. Hope to see you again soon. Thanks for your supporting and visiting. Good luck!

2012年2月21日 星期二

Creating Schemas and Tables

We installed the MySQL database on a Windows platform few days ago.

Now we’ll do something to the database. Let me show you how to create a new schema, and tables.

Create Schema

Launch MySQL Workbench 5.2 CE

image

Edit Table Data

image

Choose Stored Connection, you should see only one for now. Next.

image

For now, we cannot add the schema through this wizard, let’s pick test first, then Finish.

image

The SQL Editor appeared.

image

Right click on schema test, and choose Create Schema

image

Give the name of the schema, in my case is stock_schema, then Apply

image

The sql statement is displayed, then Apply.

image

The SQL script was successfully applied to the database, then Finish.

image

Create Table

You’ll see a new schema appeared in the left, close the create schema window by click on the X

image

Now, we need to create a table. Right click on the Tables(Expand the arrow of your schema, then you’ll see it) , then Create Table…

image

Give the table name and the column name, for this column (Stock_Info_ID) I want a number generated by the database, so I checked the Auto Increment. Please do NOT Apply yet.

image

Scroll down a little bit, then you can add another column here.This column I’m putting the Stock_Code and it’s Unique and Not null. Then Apply.

image

Again, the SQL Statement appeared. Apply to continue.

image

Finish

image

You’ll see one table under Tables

image

Now let’s put some data in the table. Right click on your table and then Edit Table Data.

image

Because the Stock_Info_ID is Auto Increment, so I just put the Stock_Code and then Apply.

image

The SQL Statement appeared again, then Apply.

image

The script was successfully applied, then Finish.

image

You’ll see the Stock_Info_ID was filled automatically.

image

Summary

Now we’ve have a new schema and a new table under this schema. Next time I’ll create another table put these two tables into a view. See you.

2012年2月20日 星期一

Installing MySQL on Windows

This blog SQL Your Life, is mainly focus any database but not Oracle. Today, I’m going to introduce you how to install MySQL on Windows. If you like my blog, you may share it on twitter or facebook via my blog tools.

Download

Go to url http://dev.mysql.com/downloads/, press the Download button

image

And in the next page, Download again.

image

You can either register an new account or just say “No thanks, just take me to the downloads!

image

Choose the closest mirror site to you, and save the file in the folder you like.image

Installation

Run the mysql-installer-5.n.nn.n.msi (n is the version number, not sure which version will it be when you’re browsing this blog)

image

.Net Framework 4.0

This message tells us that we need to install the .Net Framework 4.0.

image

Let’s go to http://go.microsoft.com/fwlink/?LinkId=181012, and click on Download to download the framework.

image

You may either Run or Save the file.

image

Check the checkbox then Install.

image

The installation is processing…

image

Finish to complete the installation of .Net Framework 4.0

image

MySQL

Run the  mysql-installer-5.n.nn.n.msi again.

Choose Install MySQL Products.

image

Check the I accept the license terms, then Next.

image

Check the Skip the check for updates, then Next.

image

Choose Developer Default as Setup Type, and Next.

image

Execute and it will launch the installer of Visual C++ 2010 runtime installer.

image

Check the checkbox, and then Install.

image

Finish to complete the installation of Visual C++ 2010 runtime.

image

Note that the green check appeared in the Microsoft Visual C++ 2010, then Next.

image

Review the products will be installed, then Execute

image

Installing…

image

All install success, then Next.

image

Configuration

Next to do the configuration.

image

Choose Developer Machine, then Next.

image

Give the password of MySQL Root, then Next.

image

Next to continue.

image

Installation Complete, Finish to continue

image

The MySQL Workbench will be launched.

image

What’s Next

That’s all for the installation. Next we’ll do something to the database.

See you next time.