LPI 102 - Shells, Scripting And Data Management 1- Marcus Vinicius Braga Alcantara

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Viniciusalcantar
V
Viniciusalcantar
Community Contributor
Quizzes Created: 11 | Total Attempts: 7,124
| Attempts: 527
SettingsSettings
Please wait...
  • 1/80 Questões

    O comando test -x /bin/sync tem qual finalidade ?

    • Testa se o arquivo existe e tem permissão de leitura.
    • Testa se o arquivo existe e tem permissão de execução.
    • Testa se o arquivo existe e tem permissão de escrita.
    • Testa se o arquivo existe e é um diretório.
Please wait...
LPI 102 - Shells, Scripting And Data Management 1- Marcus Vinicius Braga Alcantara - Quiz


Quiz Preview

  • 2. 

    Qual comando exclui a variável de ambiente FOOBAR?

    • unset FOOBAR

    • del $FOOBAR

    • export FOOBAR

    • export FOOBAR=

    Correct Answer
    A. unset FOOBAR
    Explanation
    The correct answer is "unset FOOBAR." This command is used to remove or delete the environment variable named FOOBAR.

    Rate this question:

  • 3. 

    Qual dos comandos abaixo, irá exibir informações sobre as variáveis de ambiente no seu sistema ?

    • builtin

    • join

    • env

    • source

    Correct Answer
    A. env
    Explanation
    The command "env" will display information about the environment variables in the system.

    Rate this question:

  • 4. 

    A primeira linha de um shell script deve sempre conter dois caracteres no início desta linha. Quais são eles?

    Correct Answer
    #!
    Explanation
    The first line of a shell script should always start with the characters #!. This is known as the shebang or hashbang and it is used to specify the interpreter that should be used to execute the script. In this case, the #! indicates that the script should be interpreted by the shell.

    Rate this question:

  • 5. 

    Você está escrevendo um script e gostaria de testar o estado de saída deste processo. Qual das opções abaixo é verdadeira?

    • O valor de saída normal difere.

    • Você não pode testar o valor de saída normal.

    • O valor de saída normal é de $EXIT.

    • O valor de saída normal é 0.

    Correct Answer
    A. O valor de saída normal é 0.
    Explanation
    The correct answer is "O valor de saída normal é 0." This is because in programming, a return value of 0 typically indicates a successful execution or completion of a process. Therefore, if you want to test the exit status of a process, you would check if the return value is 0 to determine if it exited normally.

    Rate this question:

  • 6. 

    Qual comando que fecha uma estrutura de condição if ?

    • fi

    • endfi

    • end

    • done

    Correct Answer
    A. fi
    Explanation
    The correct answer is "fi". In shell scripting, "fi" is used to close an if statement. It marks the end of the if block and allows the program to continue executing the code after the if statement.

    Rate this question:

  • 7. 

    Qual instrução SQL que modifica dados já inseridos em uma tabela ?

    • WHERE

    • DELETE

    • INSERT

    • UPDATE

    Correct Answer
    A. UPDATE
    Explanation
    The correct answer is UPDATE. The UPDATE statement in SQL is used to modify existing data in a table. It allows you to change the values of one or more columns in a specific row or multiple rows based on a specified condition using the WHERE clause. This statement is commonly used to update records with new values or to correct existing data in a database table.

    Rate this question:

  • 8. 

    Qual dos comandos abaixo irá incluir um registro na tabela CLIENTES ?

    • SELECT

    • DELETE

    • UPDATE

    • INSERT

    Correct Answer
    A. INSERT
    Explanation
    The INSERT command is used to add a new record to a table in a database. In this case, the command "INSERT" is the only option that explicitly states the action of adding a record to the table CLIENTES. The SELECT command is used to retrieve data from a table, the DELETE command is used to remove records from a table, and the UPDATE command is used to modify existing records in a table. Therefore, the correct answer is INSERT.

    Rate this question:

  • 9. 

    Na confecção de um novo script bash, qual deve ser o valor de sua primeira linha ?

    • !bash -x

    • #bash_script

    • #!/bin/bash

    • !#/bin/bash

    Correct Answer
    A. #!/bin/bash
    Explanation
    The correct answer is "#!/bin/bash". This is because the "#!" symbol is known as the shebang, and it is used to specify the interpreter that should be used to execute the script. In this case, the shebang specifies that the script should be executed using the bash interpreter.

    Rate this question:

  • 10. 

    Qual o comando que remove uma variável definida no shell corrente ?

    Correct Answer
    unset
    Explanation
    The "unset" command is used to remove a defined variable in the current shell. It allows the user to unset or delete the value and attributes associated with a variable, making it no longer available for use in the shell.

    Rate this question:

  • 11. 

    Qual das opções abaixo pode ser utilizada para criar uma variável chamada LINUX com a atribuição do valor; lpi ?

    • LINUX=lpi

    • Linux=lpi

    • $LINUX=lpi

    • N.D.A

    Correct Answer
    A. LINUX=lpi
    Explanation
    The correct answer is "LINUX=lpi" because it follows the correct syntax for creating a variable in Linux. In Linux, variables are typically written in uppercase letters, and the assignment of a value is done using the "=" sign. Therefore, "LINUX=lpi" is the correct way to create a variable called LINUX with the value "lpi".

    Rate this question:

  • 12. 

    Qual comando remove um alias do shell já definido ?

    • rmalias

    • rm

    • delalias

    • unalias

    Correct Answer
    A. unalias
    Explanation
    The correct answer is "unalias". This command is used to remove an alias that has been previously defined in the shell.

    Rate this question:

  • 13. 

    Qual o comando que torna uma variável do shell como sendo do tipo GLOBAL ?

    Correct Answer
    export
    Explanation
    The command "export" is used to make a shell variable global. When a variable is exported, it can be accessed by other processes or subshells. This allows the variable to be shared and used throughout the entire shell environment, rather than being limited to a specific shell or script.

    Rate this question:

  • 14. 

    Qual das alternativas abaixo pode ser utilizada para criar uma função chamada "palavra" que contenha as seguintes sequencias de comandos; cd /home/root ; echo "Linha Acrescentada" >> teste_func

    • palavra() { cd /home/root; echo "Linha Acrescentada" >> teste_func; }

    • palavra { cd /home/root; echo "Linha Acrescentada" >> teste_func; }

    • palavra[] { cd /home/root echo "Linha Acrescentada" >> teste_func; }

    • N.D.A

    Correct Answer
    A. palavra() { cd /home/root; echo "Linha Acrescentada" >> teste_func; }
    Explanation
    The correct answer is the first option, "palavra() { cd /home/root; echo "Linha Acrescentada" >> teste_func; }". This is because it correctly defines a function named "palavra" and includes the desired sequence of commands within the curly braces. The "cd /home/root" command changes the directory to "/home/root", and the "echo "Linha Acrescentada" >> teste_func" command appends the string "Linha Acrescentada" to the file "teste_func".

    Rate this question:

  • 15. 

    Quais são os dois arquivos no diretório home de um usuário que são usados para personalizar o ambiente bash?

    • bash e .bashrc

    • bashrc e bash_conf

    • bashrc e bashprofile

    • .bashrc e .bash_profile

    • bash.conf e .bash_profile

    Correct Answer
    A. .bashrc e .bash_profile
    Explanation
    The correct answer is .bashrc and .bash_profile. These two files are used to customize the bash environment for a user. The .bashrc file contains specific configurations and settings for the bash shell, such as aliases, functions, and environment variables. It is executed every time a new shell is opened. On the other hand, the .bash_profile file is executed only during the login process and can be used to set up environment variables and execute commands or scripts. Together, these files allow users to personalize their bash environment according to their preferences.

    Rate this question:

  • 16. 

    Qual o comando que fecha uma estrutura de seleção case ?

    Correct Answer
    esac
    Explanation
    The command "esac" is used to close a case selection structure in shell scripting. The "case" command is used to test a variable against multiple patterns and execute different commands based on the matching pattern. After listing all the patterns and their corresponding commands, the "esac" command is used to indicate the end of the case structure.

    Rate this question:

  • 17. 

    Qual das opções abaixo pode ser utilizada para exibir o conteúdo da variável LINUX ?

    • print $LINUX

    • env $LINUX

    • echo $LINUX

    • echo LINUX

    • export LINUX

    Correct Answer
    A. echo $LINUX
    Explanation
    The correct answer is "echo $LINUX" because the "echo" command is used to display the value of a variable in the terminal, and "$LINUX" refers to the variable named LINUX. By using "echo $LINUX", the content of the LINUX variable will be displayed on the screen.

    Rate this question:

  • 18. 

    Qual comando impede que um arquivo seja sobrescrito pelo caracter de redirecionamento > do shell ?

    • chmod o=-w

    • set -o noclobber

    • chattr +A

    • enable -n

    Correct Answer
    A. set -o noclobber
    Explanation
    The command "set -o noclobber" prevents a file from being overwritten by the shell redirection character ">". This command sets the noclobber option, which means that if a file already exists, the shell will not overwrite it when using the ">" redirection operator. Instead, it will display an error message. This is useful when you want to avoid accidentally overwriting important files.

    Rate this question:

  • 19. 

    Qual o valor da variável especial $! do shell BASH ?

    • Contém o PID do último processo executado pelo shell.

    • Contém o nome do último login que acessou o sistema.

    • O nome da variável é inválido e a mesma não faz parte das variáveis do shell BASH.

    • Armazena o valor PID do processo init.

    Correct Answer
    A. Contém o PID do último processo executado pelo shell.
    Explanation
    The correct answer is "Contém o PID do último processo executado pelo shell." This means that the variable $! in the BASH shell contains the Process ID (PID) of the last process that was executed by the shell.

    Rate this question:

  • 20. 

    Como eu posso verificar o sucesso ou não de um comando executado ?

    • Através do comando show_erros que faz parte dos comandos build-in do shell.

    • Pelo valor escrito em terminal do comando executado.

    • Através do valor presente na variável $?

    • Pela mensagem de erro do comando executado.

    Correct Answer
    A. Através do valor presente na variável $?
    Explanation
    The correct answer is "Através do valor presente na variável $?". This is because the value of the $? variable in the shell stores the exit status of the previously executed command. By checking the value of this variable, you can determine whether the command was successful or not.

    Rate this question:

  • 21. 

    Qual o comando incorporado ao shell BASH que lista todos os alias definidos ?

    Correct Answer
    alias
    Explanation
    The correct answer is "alias". In the BASH shell, the "alias" command is used to list all the aliases that have been defined. Aliases are shortcuts or alternate names for commands, allowing users to create their own custom commands or abbreviations for frequently used commands. By using the "alias" command, users can see a list of all the aliases they have set up in their BASH shell.

    Rate this question:

  • 22. 

    Qual é o propósito do arquivo /etc/profile ?

    • Ele contém variáveis ​​de ambiente que são definidas durante o login dos usuários.

    • Ele contém perfis de segurança que definem quais usuários têm permissão para fazer login.

    • Ele contém perfis de aplicação padrão para usuários que executam uma aplicação pela primeira vez.

    • Ele contém a mensagem de boas-vindas que é exibida após o login.

    Correct Answer
    A. Ele contém variáveis ​​de ambiente que são definidas durante o login dos usuários.
    Explanation
    O arquivo /etc/profile contém variáveis ​​de ambiente que são definidas durante o login dos usuários. Isso significa que ele armazena informações importantes sobre o ambiente de trabalho do usuário, como caminhos de diretório, configurações de idioma e outras variáveis ​​que afetam o comportamento do sistema. Essas variáveis ​​são carregadas durante o processo de login e estão disponíveis para todos os usuários do sistema.

    Rate this question:

  • 23. 

    Em qual arquivo posso definir uma variável global que será utilizada por todos os logins do sistema ? (Especifique o caminho completo do arquivo).

    Correct Answer
    /etc/profile
    Explanation
    The correct answer is /etc/profile. The /etc/profile file is a system-wide configuration file in Unix-like operating systems. It is executed by the login shell for all users upon login. In this file, you can define environment variables that will be available to all users of the system. By setting a variable in this file, it becomes a global variable that can be accessed by any user logging into the system.

    Rate this question:

  • 24. 

    Qual o valor da variável especial $$ do shell BASH ?

    • Contém o valor PID do processo em execução.

    • Contém a versão do BASH em uso.

    • Contém o tipo de terminal em uso.

    • Contém o nome do atual script em execução.

    Correct Answer
    A. Contém o valor PID do processo em execução.
    Explanation
    A variável especial $$ do shell BASH contém o valor PID do processo em execução.

    Rate this question:

  • 25. 

    Qual das opções abaixo pode ser utilizada para tornar a variável LINUX acessível a partir de outros shell (Sub-sequente)?

    • env LINUX

    • env $LINUX

    • export LINUX

    • export $LINUX

    • N.D.A

    Correct Answer
    A. export LINUX
    Explanation
    The correct answer is "export LINUX". The "export" command is used to make a variable accessible to other shell processes. By using "export LINUX", the variable LINUX will be available to other shell processes.

    Rate this question:

  • 26. 

    Qual arquivo do shell BASH é lido após um logout bem sucedido do sistema ?

    • ~/.exit

    • ~/.logout

    • ~/.bash_profile

    • ~/.bash_logout

    Correct Answer
    A. ~/.bash_logout
    Explanation
    After successfully logging out of the system, the BASH shell reads the ~/.bash_logout file. This file contains commands or scripts that need to be executed before the user completely logs out of the system. It can be used to clean up temporary files, close connections, or perform any other necessary tasks before the user session ends.

    Rate this question:

  • 27. 

    Você está olhando para um novo script que você recebeu do administrador sênior. Dentro do script você nota uma linha que inicia com #! seguido por um caminho para um binário. Para esta linha o interpretador de comandos irá:

    • Ignorar o script.

    • Usar esse binário para interpretar o script .

    • Usar esse binário para compilar o script.

    • Esta linha é somente um comentário.

    Correct Answer
    A. Usar esse binário para interpretar o script .
    Explanation
    A linha que começa com #! seguido por um caminho para um binário é chamada de shebang. Essa linha indica qual interpretador de comandos deve ser usado para executar o script. Portanto, a resposta correta é "Usar esse binário para interpretar o script".

    Rate this question:

  • 28. 

    Qual das opções abaixo pode ser utilizada para remover uma variável chamada LINUX ?

    • unset $LINUX

    • unset LINUX

    • set -r LINUX

    • unset linux

    • N.D.A

    Correct Answer
    A. unset LINUX
    Explanation
    The correct answer is "unset LINUX". This option can be used to remove a variable called LINUX. The "unset" command is used in Unix-like operating systems to unset or remove a variable from the environment. By specifying the variable name (LINUX) after the "unset" command, the variable is removed from the environment.

    Rate this question:

  • 29. 

    Qual das seguintes palavras é usada para restringir os registros que são retornados de uma consulta SQL SELECT com base em critérios fornecidos para os valores nos registros?

    • FROM

    • WHERE

    • IF

    • CASE

    Correct Answer
    A. WHERE
    Explanation
    The word "WHERE" is used in a SQL SELECT statement to restrict the records that are returned based on criteria provided for the values in the records. It allows you to specify conditions that the data must meet in order to be included in the result set.

    Rate this question:

  • 30. 

    Observe o seguinte script (test.sh) conforme a figura abaixo. Qual será o resultado exibido para o usuário após a execução do script com o seguinte argumento; sh test.sh /bin ?

    • Este script não pode ser executado.

    • Não será exibido nenhuma mensagem ao usuário.

    • 0

    • 1

    Correct Answer
    A. 0
    Explanation
    The correct answer is 0.

    Rate this question:

  • 31. 

    Você quer realizar uma pesquisa em uma base recorrente executando uma série de comandos. Você irá definir a série de comandos disponíveis a partir do início de sua sessão para executar no shell atual. Escolha a melhor solução:

    • Criar um programa shell.

    • Criar uma função.

    • Usar a seta para cima em seu terminal para encontrar os comandos.

    • Usar o built-in do Bash! função a ser executada na última iteração do comando pelo mesmo nome.

    Correct Answer
    A. Criar uma função.
    Explanation
    A melhor solução é criar uma função. Isso permitirá que você defina uma série de comandos que serão executados em sequência sempre que você chamar essa função. Dessa forma, você pode reutilizar essa função sempre que precisar executar a mesma série de comandos, tornando o processo mais eficiente e automatizado.

    Rate this question:

  • 32. 

    Qual arquivo será usado para configurar o shell bash interativo de um usuário?

    • ~/.int_bash

    • .bashrc

    • .profile

    • .bash

    Correct Answer
    A. .bashrc
    Explanation
    The correct answer is .bashrc. This file is used to configure the interactive shell for a user in the bash environment. It contains settings and configurations specific to the user's shell session, such as aliases, environment variables, and shell options. When a user logs in or opens a new shell, the .bashrc file is automatically executed, allowing the user to customize their shell environment according to their preferences.

    Rate this question:

  • 33. 

    Como um processo indica ao shell que encerrou com uma condição de erro?

    • Imprime uma mensagem de erro em stderr.

    • Imprime uma mensagem de erro em stdout.

    • Termina com a variável de código de saída com um valor zero.

    • Termina com a variável de código de saída com um valor diferente de zero.

    • Causa uma falta de segmentação.

    Correct Answer
    A. Termina com a variável de código de saída com um valor diferente de zero.
    Explanation
    When a process ends with a condition of error, it indicates this to the shell by terminating with the exit code variable having a value different from zero.

    Rate this question:

  • 34. 

    Supondo que você deseje remover um alias chamado ipconfig. Escreva a linha de comando completa para realizar esta tarefa.

    Correct Answer
    unalias ipconfig
    Explanation
    The given command "unalias ipconfig" is used to remove an alias called "ipconfig". An alias is a shortcut or alternate name for a command. By running this command, the alias "ipconfig" will be removed and the original command or function it represents will be used instead.

    Rate this question:

  • 35. 

    Escrevendo um shellscript você deseja verificar a existência do arquivo foobar e verificar se o mesmo é uma arquivo regular. Qual dos seguintes comandos de teste irá verificar a existência deste arquivo (foobar)?

    • test -d foobar

    • test -e foobar

    • test -b foobar

    • test -x foobar

    • test -f foobar

    Correct Answer
    A. test -f foobar
    Explanation
    The correct answer is "test -f foobar". This command will check if the file "foobar" exists and if it is a regular file. The "-f" option is used to test if the given file is a regular file.

    Rate this question:

  • 36. 

    A variável REPLY é utilizada por qual comando quando não definimos uma ?

    • set

    • read

    • goto

    • if

    Correct Answer
    A. read
    Explanation
    The variable "REPLY" is used by the "read" command when we do not define a specific variable to store the input. The "read" command is used to take input from the user in a shell script, and if no variable is specified, the input is stored in the default variable "REPLY".

    Rate this question:

  • 37. 

    Digite o caminho completo e o nome do arquivo de configuração global onde geralmente contém o sistema de configuração PATH, umask e ulimit: 

    Correct Answer
    /etc/profile
    Explanation
    The correct answer is "/etc/profile". This is because the file "/etc/profile" is the standard location for the global configuration file that contains system-wide configuration settings such as the PATH, umask, and ulimit. By editing this file, administrators can set environment variables and define system-wide behavior for all users on the system.

    Rate this question:

  • 38. 

    Qual dos seguintes comandos devem ser adicionados ao /etc/bash_profile a fim de mudar o idioma das mensagens para um programa internacionalizado para Português(pt)?

    • export UI_MESSAGES="pt"

    • export ALL_MESSAGES="pt"

    • export LC_MESSAGES="pt"

    • export MESSAGE="pt"

    • export LANGUAGE="pt"

    Correct Answer
    A. export LC_MESSAGES="pt"
    Explanation
    The correct answer is "export LC_MESSAGES="pt"". This command sets the LC_MESSAGES environment variable to "pt", indicating that the language for program messages should be changed to Portuguese (pt). By exporting this variable in the /etc/bash_profile file, the change will be applied system-wide, ensuring that all programs using internationalization will display messages in Portuguese.

    Rate this question:

  • 39. 

    Qual a diferença entre os comandos SET e ENV ?

    • SET exibe variáveis do shell corrente e ENV exibe todas as variáveis inclusive as que foram exportadas.

    • SET define uma variável para ser utilizada e ENV exibe todas as variáveis do Shell.

    • SET exibe variáveis exportadas e ENV somente as do shell ambiente.

    • SET e ENV possuem a mesma função. Ambos foram compilados pelo GCC.

    Correct Answer
    A. SET exibe variáveis do shell corrente e ENV exibe todas as variáveis inclusive as que foram exportadas.
    Explanation
    SET and ENV are two different commands used in shell scripting. The SET command displays variables specific to the current shell session, while ENV displays all variables, including those that have been exported. Therefore, the correct answer is that SET displays variables from the current shell session, and ENV displays all variables, including exported ones. The other options provided in the question are incorrect.

    Rate this question:

  • 40. 

    Para qual tarefa você precisará usar o operador BETWEEN?

    • Consulta de tabelas com valores desconhecidos.

    • Consulta de tabelas para uma faixa de valores.

    • Consulta de tabelas para um tipo de caracte.

    • Consulta de tabelas para valores específicos de uma lista.

    Correct Answer
    A. Consulta de tabelas para uma faixa de valores.
    Explanation
    O operador BETWEEN é usado para consultar tabelas para uma faixa de valores. Isso significa que você pode usar o operador BETWEEN para recuperar registros de uma tabela onde um determinado valor está dentro de um intervalo específico. Por exemplo, se você quiser selecionar todos os registros de uma tabela onde o valor de uma coluna esteja entre 10 e 20, você pode usar o operador BETWEEN para realizar essa consulta.

    Rate this question:

  • 41. 

    Qual das instruções abaixo é uma instrução SQL SELECT válida ?

    • SELECT nome, telefone FROM contatos;

    • SELECT FROM contatos nome, telefone;

    • SELECT nome FROM contatos, telefone;

    • SELECT contatos FROM nome, telefone;

    Correct Answer
    A. SELECT nome, telefone FROM contatos;
    Explanation
    The correct answer is "SELECT nome, telefone FROM contatos;". This is a valid SQL SELECT statement because it selects the columns "nome" and "telefone" from the table "contatos".

    Rate this question:

  • 42. 

    Qual das seguintes alternativas são requisitos, a fim de executar um shell script como um comando regular a partir de qualquer lugar no sistema de arquivos? (Escolha três respostas corretas). 

    • O usuário que emitir o comando deve pertencer ao grupo do proprietário do script.

    • O arquivo de script deve ser encontrado no $PATH.

    • O sistema de arquivos no qual reside o script deve ser montado com os scripts de opção.

    • O script deve começar com uma shebang-line ( # ! ) Que aponta para o interpretador de comandos correto.

    • O arquivo de script deve ter permissão de execução.

    Correct Answer(s)
    A. O arquivo de script deve ser encontrado no $PATH.
    A. O script deve começar com uma shebang-line ( # ! ) Que aponta para o interpretador de comandos correto.
    A. O arquivo de script deve ter permissão de execução.
    Explanation
    To execute a shell script as a regular command from anywhere in the file system, the following requirements must be met:
    1) The script file must be located in the $PATH, which is the list of directories where the system looks for executable files.
    2) The script must start with a shebang-line ( # ! ) that specifies the correct interpreter for the commands in the script.
    3) The script file must have execute permission, allowing it to be run as a command.

    Rate this question:

  • 43. 

    Você está criando um script em que precisa testar se um comando foi executado corretamente. Como você testa corretamente o "exit status" do comando executado?

    • if [ "$#" -eq "0" ]

    • if [ "$?" -eq "0" ]

    • if [ "$#" == 0 ]

    • if [ "$?" == "0"]

    • if [ $@ -eq 0 ]

    Correct Answer
    A. if [ "$?" -eq "0" ]
    Explanation
    The correct answer is "if [ "$?" -eq "0" ]". In shell scripting, the "$?" variable holds the exit status of the previously executed command. By comparing it to "0" using the "-eq" operator, we can determine if the command executed successfully.

    Rate this question:

  • 44. 

    Qual comando pode ser utilizado para listar as funções definidas em um shell bash?

    Correct Answer
    typeset -f
    declare -f
    set
    Explanation
    The correct answer is "typeset -f, declare -f, set". These commands can be used to list the functions defined in a bash shell. The "typeset -f" command lists all the function names and their definitions. The "declare -f" command also lists the function names and their definitions. The "set" command displays all the shell functions along with other shell variables and environment variables.

    Rate this question:

  • 45. 

    De acordo com as informações fornecidas abaixo escreva a instrução SQL que irá listar o nome e o artista de todas músicas cadastradas.

    Correct Answer
    select Nome, Artista from Musicas;
    Explanation
    The given SQL query is correct and will retrieve the name and artist of all registered songs from the "Musicas" table. It uses the "select" statement to specify the columns to be included in the result, which are "Nome" (name) and "Artista" (artist). The "from" keyword is used to indicate the table from which the data should be retrieved, which is "Musicas" in this case.

    Rate this question:

  • 46. 

    Qual das opções abaixo pode ser utilizada para listar apenas o primeiro valor da array FRUTAS?

    • echo $FRUTAS(1)

    • echo ${FRUTAS[1]}

    • echo ${FRUTAS[0]}

    • N.D.A

    Correct Answer
    A. echo ${FRUTAS[0]}
    Explanation
    The correct answer is "echo ${FRUTAS[0]}". In Bash, arrays are zero-indexed, so the first element of the array FRUTAS can be accessed using the syntax ${FRUTAS[0]}. The options "echo $FRUTAS(1)" and "echo ${FRUTAS[1]}" would access the second element of the array, not the first.

    Rate this question:

  • 47. 

    Considerando a consulta abaixo, o que é mostrado na coluna SALARY quando um valor NULL é retornado?

    • 0

    • NULL

    • SPACES

    • nothing

    Correct Answer
    A. 0
    Explanation
    Quando um valor NULL é retornado, o que é mostrado na coluna SALARY é o valor 0.

    Rate this question:

  • 48. 

    Ao escrever um script, o que você precisa para criar um loop, recebendo uma lista de variáveis, onde as declarações a serem realizadas são encontradas entre as palavras-chave _______ e done.

    Correct Answer
    do
    Explanation
    To create a loop in a script, the keyword "do" is used to indicate the beginning of the loop block, and the keyword "done" is used to indicate the end of the loop block. The statements to be executed within the loop are written between these two keywords.

    Rate this question:

  • 49. 

    Qual dos seguintes comandos lista todas as variáveis ​​e funções definidas dentro do Bash ?

    • set

    • env -a

    • env

    • echo $ENV

    Correct Answer
    A. set
    Explanation
    The "set" command lists all the variables and functions defined within the Bash environment.

    Rate this question:

Quiz Review Timeline (Updated): Oct 9, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Oct 09, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jul 19, 2016
    Quiz Created by
    Viniciusalcantar
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.