Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL Delete Statement

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 232
    Comment on it

    Using Delete statement we can delete the record from a table in database . We can delete single or multiple row from a table in database .
    Syntax :

    delete from table_name where clause  ; // where clause is optional
    

    Example :

    Table name : Employee_Info

     Employee_name            Employee_Age          Employee _Salary
          Mukesh                  23                           100000
          Ayush                   24                           200000
          Ishan                   20                           400000
          Pranav                  35                           700000
          Abhishek                26                           800000
          Ravi                    25                           300000
          David                   40                           800000
    

    I want to delete the Ayush information , see below :

    delte from Employee_Info where Employee_Age = 24 ;
    

    Output :

     Employee_name            Employee_Age          Employee _Salary
          Mukesh                  23                           100000
          Ishan                   20                           400000
          Pranav                  35                           700000
          Abhishek                26                           800000
          Ravi                    25                           300000
          David                   40                           800000
    

    Ayush Infomation has been delted from a table .

    If where clause is not use then entire data will be deleted , only table structure will be present .
    Example :
    delete from Employee_Info ; Output :

     Employee_name            Employee_Age          Employee _Salary 

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: