MYSQL basic

Query for creating table
query:

CREATE TABLE student_Detail(
   user_id INT AUTO_INCREMENT PRIMARY KEY,
   f_name VARCHAR(20),
   l_name VARCHAR(20)
); 

create-table

Query for inserting values into table
query:

insert into student_detail values('bhavesh','lakhani');
       insert into student_detail values('vivek','patel');
       insert into student_detail values('abhilash1','shah');

insert2

Query to See table
query:

 select *From student_detail;

table-data

Note: I have included mysql basic detail because i am going to use into
my java JDBC Program later we will see all concept about SQL.

MySQL Database Connection

We already installed mysql Database
so you can access database through

1. Mysql command line client
2. Mysql Workbench

In order open mysql just type “mysql” in start menu

mysql
Now We will proceed with Mysql command line client.
just click on mysql 5.5 Command line client
you will see below window

mysql12

Now we will use default user root.
provide password which you have created while installing my sql.

mysql11
Now we are connected to mysql database

Query to see list of database name from mysql database
query: show databases

show-database
Now you can use any database using database query called
query: use databasename;

use-test
Now you can perform any operation on database