1.
¿Qué significa SQL?
Correct Answer
A. Structured Query Language
Explanation
SQL stands for Structured Query Language. It is a programming language used to manage and manipulate relational databases. With SQL, users can create, modify, and retrieve data from databases. It is a standardized language that provides a set of commands and syntax for interacting with databases. SQL is widely used in the field of data management and is essential for working with databases in various applications and industries.
2.
¿Qué declaración SQL se utiliza para extraer datos de una base de datos?
Correct Answer
A. SELECT
Explanation
The correct answer is SELECT. In SQL, the SELECT statement is used to extract or retrieve data from a database. It allows you to specify the columns you want to retrieve and the table(s) from which you want to retrieve the data. It is one of the fundamental statements in SQL and is commonly used in querying and retrieving data from databases.
3.
¿Qué declaración SQL se utiliza para actualizar los datos en una base de datos?
Correct Answer
A. UPDATE
Explanation
The correct answer is UPDATE. The UPDATE statement is used in SQL to modify or update existing data in a database. It allows you to change the values of one or more columns in a table based on specified conditions. This statement is commonly used to make changes to data such as updating a specific record, changing values in multiple rows, or even updating data in multiple tables at once.
4.
¿Qué declaración SQL se utiliza para eliminar datos de una base de datos?
Correct Answer
A. DELETE
Explanation
The correct answer is DELETE. In SQL, the DELETE statement is used to remove data from a database. It allows you to specify the table from which you want to delete data and can also include conditions to delete specific rows based on certain criteria. The DELETE statement is an essential part of data manipulation in SQL and is commonly used to remove unwanted or outdated data from a database.
5.
¿Qué declaración SQL se utiliza para insertar nuevos datos en una base de datos?
Correct Answer
A. INSERT INTO
Explanation
The correct answer is "INSERT INTO". This statement is used in SQL to insert new data into a database. It is followed by the name of the table where the data will be inserted and then the values to be inserted. This statement allows for the addition of new records to a database table.
6.
Con SQL, ¿cómo se selecciona una columna llamada "Nombre" de una tabla llamada "Personas"?
Correct Answer
A. SELECT Nombre FROM Personas
Explanation
The correct answer is "SELECT Nombre FROM Personas". In SQL, to select a specific column from a table, you use the SELECT keyword followed by the name of the column you want to select, in this case "Nombre", and then specify the table name "Personas". This query will retrieve the values from the "Nombre" column of the "Personas" table.
7.
Con SQL, ¿cómo se seleccionan todas las columnas de una tabla llamada "Personas"?
Correct Answer
A. SELECT * FROM Personas
Explanation
The correct answer is "SELECT * FROM Personas". This SQL statement selects all columns from the table "Personas". The asterisk (*) represents a wildcard that is used to select all columns in the table.
8.
Con SQL, ¿cómo se seleccionan todos los registros de una tabla llamada "Personas" donde el valor de la columna "Nombre" es "Pedro"?
Correct Answer
A. SELECT [all] FROM Personas WHERE Nombre='Peter'
Explanation
The correct answer is "SELECT [all] FROM Personas WHERE Nombre='Peter'". This SQL statement is used to select all the records from the table "Personas" where the value of the column "Nombre" is "Peter". The keyword "SELECT" is used to specify the columns to be retrieved, "[all]" indicates that all columns will be selected, "FROM" specifies the table to select from, and "WHERE" is used to specify the condition for selecting the records. In this case, the condition is that the value of the column "Nombre" must be equal to "Peter".
9.
Con SQL, ¿cómo se seleccionan todos los registros de una tabla llamada "Personas" en la que el valor de la columna "Nombre" comienza con una "a"?
Correct Answer
A. SELECT * FROM Personas WHERE Nombre LIKE 'a%'
Explanation
The correct answer is "SELECT * FROM Personas WHERE Nombre LIKE 'a%'". This is because the "LIKE" keyword is used to search for a specified pattern in a column. In this case, we want to select all records from the "Personas" table where the value in the "Nombre" column starts with the letter "a". The "%" symbol is a wildcard that represents any number of characters, so "a%" will match any value that starts with "a".
10.
El operador OR muestra un registro si CUALQUIER condición listada es verdadera. El operador AND muestra un registro si TODAS las condiciones enumeradas son verdaderas
Correct Answer
A. True
Explanation
The explanation for the given correct answer is that the OR operator in programming displays a record if ANY of the listed conditions is true. On the other hand, the AND operator displays a record only if ALL of the listed conditions are true. Therefore, the statement is true.
11.
Con SQL, ¿cómo se seleccionan todos los registros de una tabla llamada "Personas" donde el "Nombre" es "Peter" y el "Apellido" es "Jackson"?
Correct Answer
A. SELECT * FROM Personas WHERE Nombre='Peter' AND Apellido='Jackson'
Explanation
The correct answer is the first option: SELECT * FROM Personas WHERE Nombre='Peter' AND Apellido='Jackson'. This query uses the SELECT statement to retrieve all columns (*) from the table "Personas" where the "Nombre" column is equal to 'Peter' and the "Apellido" column is equal to 'Jackson'.
12.
Con SQL, ¿cómo se seleccionan todos los registros de una tabla llamada "Personas" donde el "Apellido" está alfabéticamente entre (e incluyendo) "Hansen" y "Pettersen"?
Correct Answer
A. SELECT * FROM Personas WHERE Apellido BETWEEN 'Hansen' AND 'Pettersen'
Explanation
The correct answer is "SELECT * FROM Personas WHERE Apellido BETWEEN 'Hansen' AND 'Pettersen'". This query will select all the records from the "Personas" table where the "Apellido" (Last Name) is alphabetically between (including) "Hansen" and "Pettersen".
13.
¿Qué declaración SQL se utiliza para devolver sólo valores diferentes?
Correct Answer
A. SELECT DISTINCT
Explanation
The correct answer is "SELECT DISTINCT". This SQL statement is used to retrieve only unique values from a table or a result set. It eliminates duplicate rows and returns only distinct values.
14.
¿Qué palabra clave SQL se utiliza para ordenar el conjunto de resultados?
Correct Answer
A. ORDER BY
Explanation
The correct answer is "ORDER BY." In SQL, the "ORDER BY" keyword is used to sort the result set in ascending or descending order based on one or more columns. It allows the user to specify the column(s) to sort by and the sorting direction (ascending or descending). The other options, "SORT BY," "ORDER," and "SORT," are not valid keywords in SQL for sorting the result set.
15.
Con SQL, ¿cómo se pueden devolver todos los registros de una tabla llamada "Personas" ordenados de forma descendente por "Nombre"?
Correct Answer
A. SELECT * FROM Personas ORDER BY Nombre DESC
Explanation
The correct answer is "SELECT * FROM Personas ORDER BY Nombre DESC". This query selects all records from the "Personas" table and orders them in descending order based on the "Nombre" column.
16.
Con SQL, ¿cómo se puede insertar un nuevo registro en la tabla de "Personas"?
Correct Answer
A. INSERT INTO Personas VALUES ('Jimmy', 'Jackson')
Explanation
The correct answer is "INSERT INTO Personas VALUES ('Jimmy', 'Jackson')". This is the correct syntax for inserting a new record into the "Personas" table in SQL. The INSERT statement is used to add new data into a table, and the VALUES keyword is used to specify the values for each column in the table. In this case, the values 'Jimmy' and 'Jackson' are being inserted into the "Personas" table. The other options provided in the question are not valid SQL syntax for inserting a new record.
17.
Con SQL, ¿cómo se puede insertar "Olsen" como "Apellido" en la tabla de "Personas"?
Correct Answer
A. INSERT INTO Personas (Apellido) VALUES ('Olsen')
Explanation
The correct answer is INSERT INTO Personas (Apellido) VALUES ('Olsen'). This is the correct syntax for inserting the value "Olsen" into the "Apellido" column of the "Personas" table using SQL.
18.
¿Cómo puedes cambiar "Hansen" por "Nilsen" en la columna de "Apellidos" en la tabla de Personas?
Correct Answer
A. UPDATE Personas SET Apellido='Nilsen' WHERE Apellido='Hansen'
Explanation
The correct answer is "UPDATE Personas SET Apellido='Nilsen' WHERE Apellido='Hansen'". This is the correct SQL statement to update the value in the "Apellido" column from "Hansen" to "Nilsen" in the "Personas" table. The UPDATE command is used to modify existing records in a table, and the WHERE clause specifies the condition that must be met for the update to occur. In this case, it specifies that the value in the "Apellido" column must be "Hansen" for the update to take place.
19.
Con SQL, ¿cómo se pueden borrar los registros donde el "Nombre" es "Peter" en la Tabla de Personas?
Correct Answer
A. DELETE FROM Personas WHERE Nombre = 'Peter'
Explanation
The correct answer is "DELETE FROM Personas WHERE Nombre = 'Peter'". This is the correct SQL syntax for deleting records from the "Personas" table where the "Nombre" column is equal to "Peter". The other options provided do not follow the correct syntax for deleting records in SQL.
20.
Con SQL, ¿cómo se puede devolver el número de registros en la tabla de "Personas"?
Correct Answer
A. SELECT COUNT(*) FROM Personas
Explanation
The correct answer is SELECT COUNT(*) FROM Personas. This query uses the COUNT function in SQL to return the number of records in the "Personas" table. The asterisk (*) is used as a wildcard to count all the rows in the table. The other options provided in the question are not valid SQL syntax for counting the number of records in a table.
21.
¿Cuál es el tipo de unión más común?
Correct Answer
A. INNER JOIN
Explanation
The correct answer is INNER JOIN. An INNER JOIN is the most common type of join in a database query. It combines rows from two or more tables based on a related column between them, only including the rows that have matching values in both tables. This type of join is commonly used to retrieve data that exists in both tables, allowing for the combination of information from different tables into a single result set.
22.
¿Qué operador se utiliza para seleccionar los valores dentro de un rango?
Correct Answer
A. BETWEEN
Explanation
The operator used to select values within a range is BETWEEN. This operator is commonly used in SQL queries to specify a range of values for a particular condition. It allows for inclusive selection of values within the specified range.
23.
La restricción NO NULL hace que una columna no acepte valores NULL.
Correct Answer
A. True
Explanation
The statement is true because the "NO NULL" constraint in a database table ensures that a column cannot have NULL values. This means that when inserting or updating data, the column must always have a valid value and cannot be left empty or undefined. By setting this constraint, it enforces data integrity and helps to prevent any inconsistencies or errors in the database.
24.
¿Qué operador se utiliza para buscar un patrón específico en una columna?
Correct Answer
A. LIKE
Explanation
The operator "LIKE" is used to search for a specific pattern in a column. It allows the user to use wildcards such as "%" to represent any number of characters or "_" to represent a single character. This operator is commonly used in SQL queries to retrieve data that matches a certain pattern, making it a suitable choice for searching for specific patterns in a column.
25.
¿Qué declaración SQL se utiliza para crear una tabla en una base de datos?
Correct Answer
A. CREATE TABLE
Explanation
The correct answer is "CREATE TABLE". This SQL statement is used to create a new table in a database. It specifies the name of the table and the columns it will contain, along with their data types and any constraints.