Thursday, February 16, 2012

Database Day 01: MySQL Commands

CREATE DATABASE myfirstsqldb;

CREATE TABLE employees (empid int not null, lastname varchar(30), firstname varchar(30), salary float, primary key (empid));

INSERT INTO `myfirstsqldb`.`employees` (`empid`, `lastname`, `firstname`, `salary`) VALUES ('1', 'Smith', 'John', '50000.00');

AlTER TABLE `myfirstsqldb`.`employees` ADD `streetnumber` INT, ADD `streetname` VARCHAR( 30 ), ADD `streettype` VARCHAR(20);


UPDATE `myfirstsqldb`.`employees` SET `streetnumber` = '1', `streetname` = 'Gold', `streettype` = 'Road' WHERE `employees`.`empid` =1;

No comments:

Post a Comment

Mounting USB drives in Windows Subsystem for Linux

Windows Subsystem for Linux can use (mount): SD card USB drives CD drives (CDFS) Network drives UNC paths Local storage / drives Drives form...