Home » MYSQL » Mysql Setup » Question
  1. Suppose you want to select a database named ‘sampledb’ as the default database. Which of the following commands do you use?
    1. USE DATABASE sampledb
    2. USE sampledb
    3. SELECT DATABASE sampledb
    4. SELECT DATABASE()
    5. None of these
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.



Your comments will be displayed only after manual approval.