• Auto Increment id in Mysql

      0 comments

    There is a structure of a table with an auto-increment ID.Last inserted id is 2145. What will be the next ID after following conditions?
    - Delete from tablename?
    - Delete from tablename where ID=”2145″
    - truncate table tablename

    2146, 2146, 1

  • Sql Join Operations

      0 comments

    What is the difference between inner join and outer join?

    Simply, inner join gives both table’s common fields and outer join gives uncommon fields.

    Inner join
    SELECT CUSTOMERS.NAME, ORDERS.NAME
    FROM CUSTOMERS
    INNER JOIN ORDERS
    ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID

    Outer join
    SELECT CUSTOMERS.NAME, ORDERS.NAME
    FROM CUSTOMERS
    LEFT JOIN ORDERS
    ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID