Monday, January 1, 2018

MySql - Commands


  • create database employee;    
  • show databases;
  • use employee;
  • select database();
  • create table employeeDetailExample
  ( fName varchar(25) NOT NULL,
   lName varchar(25) NOT NULL,
                     state CHAR(2)  NOT NULL  DEFAULT "PA",
                     birth_date DATE NOT NULL ,
                     sex ENUM ('M','F') NOT NULL ,
                     empID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
                     lastWorkedDate TIMESTAMP,
                     money_owed FLOAT NULL
                   );

  •   show tables;
  •   create table employeeDetail
                     (
                   fName varchar(25) NOT NULL,
                   state CHAR(2)  NOT NULL  DEFAULT "PA",
                   sex ENUM ('M','F') NOT NULL ,
                   empID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
                   lastWorkedDate TIMESTAMP
                   );
  •    drop table employeeDetail ;
  •    quit
  •    desc employeeDetail;
  •    INSERT INTO employeeDetail VALUES('ROSHAN','AC','M',NULL,2222333444);
  •    INSERT INTO employeeDetail  VALUES(fName,lName ) values('roshan','sanjeewa');

  Resource Url :- https://www.youtube.com/watch?annotation_id=annotation_103363&feature=iv&src_vid=Em-AhbqVe48&v=9ywkQ9aGhVo

No comments:

Post a Comment

The AI Driven Software Developer, Optimize Innovate Transform

  The AI-Driven Software Developer: Optimize, Innovate, Transform": AI Transformation in Software Development : Understand how AI is re...