MySql Update table column from another table colunm

Updating a table fields from another table columns we can user following syntax

There are two tables table1 and table2. Both table have common id value. To select appropriate field from table inner join in used and updating table1 fields from table2 fields set statement is used. For example there are two tables with … Read more

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.

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