Create Database, Table in MySQL

Create Database, Table in MySQL

In this tutorial we will learn Create Database, Table in MySQL, also we will learn how to insert, Update, Delete data into MySQL table. MySQL has almost same syntax as SQL Server. In earlier post we had learnt How to Install MySQL in Windows 7.

Script:

Create schema dummy;

use dummy;

CREATE TABLE `dummy`.`employee` (
`idemployee` INT NOT NULL AUTO_INCREMENT,
`employeename` VARCHAR(45) NULL,
`employeelocation` VARCHAR(45) NULL,
PRIMARY KEY (`idemployee`));


insert into employee(employeename,employeelocation) values('Ram','Delhi');
insert into employee(employeename,employeelocation) values('Om','Delhi');
insert into employee(employeename,employeelocation) values('Jai','Gurgaon');
insert into employee(employeename,employeelocation) values('Aman','Delhi');

Select * from employee;

update employee set employeename='Mandeep' where idemployee=1;

delete from employee where idemployee=3

Video Tutorial: