Mysql Query Optimization


  1. Which is the correct format to store date in the SQL?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    1991-11-01


  1. Which of the following are the valid “database datatypes” in Mysql?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Temporal, Text and Numerical are the valid “database datatypes” in Mysql.



  1. Find the error?
    CREATE TABLE Employee
    ( Employee_id SMALLINT, name VARCHAR, LAST VARCHAR
    CONSTRAINTS pk_Employee PRIMARY KEY (Employee_id));
    INSERT INTO Employee
    VALUES( Employee_id, name, LAST)
    (1, ’s’, ’p’);
    INSERT INTO person
    ( Employee_id, name, LAST)
    VALUES(1,’s’,’p’);











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Primary can never have same value.


  1. Find the error
    CREATE TABLE Employee
    (Employee_id SMALLINT, name VARCHAR, LAST VARCHAR, Bith_date DATE
    CONSTRAINTS pk_Employee PRIMARY KEY (Employee_id));
    INSERT INTO Employee
    VALUES(Employee_id, name, LAST, Birth_date)
    (1,’s’,’p’, 24-1991-01);











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Format for DATE datatype is YYYY-MM-DD.



  1. Which Key is used to link two tables in Mysql?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Foreign Key is only the Key which can link two tables.