Interacting With MySQL


  1. Suppose run_me.sh is a script file. Which command is used to make it executable?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The command ‘chmod +x file_name’ makes a script file executable. mysql supports reading from a script file and executing queries from it. Before a script is run, it is necessary for it to be made executable.


  1. MySQL can be used to execute script files.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    MySQL is capable of reading input from a file in batch mode. This is also known as the non-interactive mode. A lot of typing and time can be saved when commands are stored in a file and executed from a file.



  1. On UNIX, statements entered in ‘MySQL’ are saved in which file?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Statements entered in ‘MySQL’ are stored in the file named ‘.mysql_history’. This file is located in the home directory itself. The SQL statements can be directly pasted into this file.


  1. What does Control-_ do in MySQL input editor?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Control-_ undoes the last change that was made. This can be repeated. The mysql input editor has a variety of commands to facilitate editing while providing inputs to the command line itself.



  1. The command to move the cursor to the beginning of line in MySQL input editor is?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Control-A moves the cursor to the beginning of the line. Ctrl-E moves the cursor to the end of the line. Control-D deletes the character under the cursor whereas Esc-a is not valid.