MySql Update Table

To update records in a table we use update quey Syntax:

First select the table data

by this query we get a table ‘student’ which we have created in our database as shown above. To update the above table, we use the query:

we can see the updated table

If you … Read more

MySql Select Query

To select all records from a table we use following query Syntax

To select all row of student we use

It will show following result

To select perticular column from table we use

If we want to select id and name of student the we will write

ther is no … Read more

MySql Create New Database

To create database use following query: Syntax

To create a database with name ebhor use following query

This query will create a new database.

MySql Show all databases

To see all the created  databases we use show database query Syntax

Example

It will show all the databases created in mysql.

Changing the default value of column in MySQL

After create table if you want to change default value for any column of table the we can use alter command in following way Syntax

Example

above query will set default value for column_name to provided default value.

Show mysql create table query

To see created table structure show create table command is used Syntax

Example

Result

To avoid showing leading and trailing dots we use \G with command syntax is as below Example

Result *************************** 1. row *************************** Table: student Create Table: CREATE TABLE student ( id int(11) DEFAULT NULL, first_name varchar(30) DEFAULT … Read more

Set time zone in mysql

To set Time zone in GMT set time_zone is used with specified time_zone value

  To check our change reflated on database use following query

 

  Read More Setting innodb_lock_wait_timeout Granting Privileges to users Show engine innodb status Finding all column name of table