Mysql Setup


  1. SHOW DATABASES lists the databases in the server to which you are connected.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The ‘SHOW DATABASES’ command is used to display the list of the databases that are being managed by the server to which connection is established. This list would vary from server to server.


  1. To see the table structure, which of the following commands is issued?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The ‘DESCRIBE’ command is issued to see the structure of the table ‘tbl_name’. It shows the structure in the format: Field-Type-Null-Key-Default-Extra. The ‘VIEW’ and ‘SELECT’ commands are used to see the contents of the table.



  1. What does ‘Student ’ & ‘name’ specify?
    CREATE TABLE Student (name);











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The ‘CREATE TABLE’ construct’s syntax is ‘CREATE TABLE tbl_name (column_specs)’. ‘tbl_name’ indicates the table name. ‘column_specs’ provides the specifications of the table attributes.


  1. Suppose you want to select a database named ‘sampledb’ as the default database. Which of the following commands do you use?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    ‘USE sampledb’ selects sampledb as the default database. Initially, ‘SELECT DATABASE();’ command displays ‘NULL’, since no database is selected by default. The other two are not valid commands.



  1. The query ‘SELECT NOW()’ shows the current _____________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    SELECT NOW() is an SQL query. It shows both the current date and the current time. It is generally displayed in the format ‘yyyy-mm-dd hh-mm-ss’. For example, 2009-04-21 11-51-36.