Examen SQL

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 Cristina Medina
Cristina Medina, QA and Testing
Cristina, a seasoned QA Engineer with nineteen years of experience in object-oriented software, thrives on continuous learning and collaborative teamwork. Her expertise ensures the quality and efficiency of software development processes.
Quizzes Created: 2 | Total Attempts: 23,367
| Attempts: 13,581 | preguntas: 17
Please wait...
Permite evaluar su nivel en sql básico. Es indispensable que ingrese su nombre completo para poder seguir con su proceso, de otra forma su prueba no tendra validez. Piense bien su respuesta ya que no podra regresar a revisar las mismas. Su tiempo para la prueba es de 40 minutos.
Question 1 / 17
0 %
0/100
Score 0/100
1. 11. El operador OR despliega registros si es que cualquiera de las condiciones son verdaderas. El operador AND despliega registros si todas las condiciones son verdaderas?

Explanation

The statement is true. The OR operator in programming displays records if any of the conditions are true. On the other hand, the AND operator displays records only if all the conditions are true. Therefore, the statement accurately describes the behavior of these operators.

Submit
Please wait...
About This Quiz
Examen SQL - Quiz

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. 16. Se requiere insertar el valor de "Pedro" en la columna  LAST_NAME de la tabla PERSONAS, Cuál sentencia utilizaría?

Explanation

The correct answer is "INSERT INTO PERSONAS (LAST_NAME) VALUES ('Pedro')". This is the correct syntax for inserting a value into a specific column in a table. The "INSERT INTO" statement is used to specify the table name and column names, followed by the "VALUES" keyword to specify the value to be inserted. In this case, the value 'Pedro' is being inserted into the LAST_NAME column of the PERSONAS table.

Submit
3. 15. Algunas veces la sentencia "SELECT COUNT(*)" puede retornar menos filas que la sentencia "SELECT COUNT(nombre_columna)"? 

Explanation

La sentencia "SELECT COUNT(*)" siempre retorna el número total de filas en una tabla, mientras que la sentencia "SELECT COUNT(nombre_columna)" retorna el número de filas donde la columna especificada no es nula. Por lo tanto, la sentencia "SELECT COUNT(nombre_columna)" puede retornar menos filas que la sentencia "SELECT COUNT(*)" si hay filas en la tabla donde la columna especificada es nula.

Submit
4. 12. Que tipo de LOCK(bloqueo) no permitira a los usuarios cualquier tipo de acceso a una tabla?

Explanation

An exclusive lock does not allow any type of access to a table by other users. This means that when a user holds an exclusive lock on a table, other users are not able to read, write, or modify the table until the lock is released.

Submit
5. 17. Cuáles de las siguientes sentencias es verdad acerca del truncate?

Explanation

TRUNCATE TABLE is functionally equivalent to DELETE TABLE. This means that both commands can be used to remove all the data from a table. However, there are some differences between them. TRUNCATE TABLE is faster and uses fewer system resources compared to DELETE TABLE because it does not generate any transaction logs. Additionally, TRUNCATE TABLE cannot be used with a WHERE clause, whereas DELETE TABLE allows for filtering based on specific conditions.

Submit
6. 6. Usted tiene dos tablas, PURCHASEORDERHEADER y PURCHASEORDERLINE,(el detalle de las tablas s encuentra abajo). La tabla PURCHASEORDERHEADER almacenará información sobre la orden de compra, mientras que la tabla PURCHASEORDERLINE almacenera información sobre el detalle de los productos. Basado en la información dada, como se establecerá una relación entre estas dos tablas?

Tabla: PURCHASEORDERHEADER
-----------------------------------------------------
order_id*
order_no
order_date
supplier_id

Tabla: PURCHASEORDERLINE
-----------------------------------------------------
line_id*
s_no
product_id

Explanation

The correct answer is to create a foreign key in the PURCHASEORDERLINE table that references the primary key of the PURCHASEORDERHEADER table. This means that the line items in the PURCHASEORDERLINE table will be linked to the corresponding purchase order in the PURCHASEORDERHEADER table. This allows for a one-to-many relationship, where one purchase order can have multiple line items.

Submit
7. 1. Se requiere pasar los datos desde una tabla que se encuentra en una base de datos oracle hacia una tabla con la misma estructura pero que se encuentra en sql-server, que herramienta utilizaria?

Explanation

The correct answer is bcp. BCP (Bulk Copy Program) is a command-line utility in SQL Server that allows for the bulk import or export of data between SQL Server databases and other data sources. In this scenario, where data needs to be transferred from an Oracle database to a SQL Server database, BCP would be the appropriate tool to use as it supports the transfer of data between different database management systems.

Submit
8. 3. Usted esta diseñando un modelo de datos en la cual la tabla de Clientes contiene un atributo que identifica el codigo del empleado el cual esta dedicado únicamente a la identificación de esa tabla, que regla de normalización viola este modelo?

Explanation

This model does not violate any normalization rule. The attribute in the Clients table that identifies the employee code is solely dedicated to the identification of that table and does not cause any redundancy or dependency issues. Therefore, it is already in compliance with the normalization rules and does not violate any of them.

Submit
9. 2. Como dueño de la base de datos, usted da permisos Franz para crear vistas y procedimientos almacenados en la base de datos de Finanzas. Franz crea un procedimiento almacenado que realiza un update a la tabla precios. El crea luego una vista que selecciona los datos de esa tabla para generar un reporte. El le da a Suzanne permiso de SELECT sobre la vista y permiso de EXECUTE sobre el procedimiento almacenado. Que tarea adicional hay que realizar para que Suzanne pueda obtener los resultados requeridos usando la vista y procedimiento almacenado?

Explanation

The correct answer is that you need to give Suzanne SELECT and UPDATE permissions on the prices table. This is because Suzanne needs to be able to both retrieve data from the table using the view created by Franz and also modify the data in the table through the stored procedure created by Franz. Without both SELECT and UPDATE permissions on the prices table, Suzanne will not be able to obtain the required results using the view and stored procedure.

Submit
10. 5. Qué establece un primary key de una tabla?

Explanation

Un primary key de una tabla establece la integridad de los registros. Esto significa que cada registro en la tabla debe tener un valor único en la columna que se ha designado como primary key. Esto garantiza que no haya registros duplicados en la tabla y ayuda a mantener la consistencia y la integridad de los datos almacenados en la misma.

Submit
11. 14. El left outer join es un tipo de outer join; otro tipo de outer join sería?

Explanation

The correct answer is "Todas las anteriores" (All of the above). This is because the left outer join is a type of outer join, and the other options listed (right, full, right outer, and full outer) are also types of outer joins. Therefore, all of the options mentioned are correct.

Submit
12. 9. Su supervisor de Ventas quiere un reporte que muestre los primeros cinco peores vendedores. Cuál de las siguientes setencias producirá el resultado deseado?

Explanation

This query will produce the desired result because it selects the top 5 SalesPersonaID and the sum of their OrderAmount from the SalesOrders table. It groups the results by SalesPersonaID to ensure that each individual salesperson's total order amount is considered. Finally, it orders the results by the sum of OrderAmount in descending order, which will display the first five worst salespeople.

Submit
13. 10. Usted tiene una tabla que guarda el saldo de la factura y otra tabla de facturas, cuyo detalle se muestra abajo, se requiere realizar un UPDATE de la tabla de saldo de facturas, del campo saldo igual al campo valor_factura, tomando en cuenta las facturas cuya fecha de vencimiento no sea mayor que la fecha actual. Escriba la sentencia que utilizaría?

RE_SALDO_FACTURA
----------------------------------
RE_SALDO_FACTURA
num_factura
cod_cliente
saldo
fecha_corte

RE_FACTURA
-----------------------
cod_empresa
num_factura
cod_cliente
fecha_factura
fecha_vencimiento
valor_factura

Explanation

The correct answer is the third option: "UPDATE saldo = valor_factura FROM RE_FACTURA, RE_SALDO_FACTURA WHERE RE_SALDO_FACTURA.cod_empresa = RE_FACTURA.cod_empresa AND RE_SALDO_FACTURA.num_factura = RE_FACTURA.num_factura AND RE_SALDO_FACTURA.cod_cliente = RE_FACTURA.cod_cliente AND fecha_vencimiento

Submit
14. 8. Usted tiene 3 tablas Authors, Books y Titleauthor en su base de datos. La tabla Titleauthor es usada para definir una relación muchos a muchos entre las tablas Authors y Books. Cuál  de las siguientes sentencias SQL  SELECT muestran el title_id de los libros que tienen mas de un autor?

Explanation

The correct answer is the first option: SELECT DISTINCT t1.title_id FROM titleauthor t1, titleauthor t2 WHERE t1.title_id = t2.title_id AND t1.au_id

Submit
15. 7. Cuál de las siguientes setencias es cierta sobre las relaciones?

Explanation

Las relaciones son enlaces lógicos entre las tablas implementadas a través de primary y foreign keys. Esto significa que las relaciones establecen una conexión entre dos tablas en una base de datos mediante el uso de claves primarias y claves foráneas. Esto permite que los datos de una tabla se relacionen y se vinculen con los datos de otra tabla de manera lógica y coherente. Además, las relaciones también definen explícitamente una asociación entre dos tablas, lo que ayuda a mantener la integridad y consistencia de los datos en la base de datos.

Submit
16. 4. Cuáles de las siguientes sentencias son ciertas sobre las vistas?

Explanation

A view represents a subset of the attributes of a table and can be designed to facilitate a particular use case. It allows for easier management of permissions and other administrative tasks compared to tables. A view is not used for quick data retrieval and it is not a quick description of a database.

Submit
17. 13. Considere el siguiente SELECT:
SELECT item_no FROM ITEM
WHERE expiry_date = (SELECT order_date FROM ORDER WHERE item_no =2)

¿Cuál de las siguientes sentencias es verdad?

Explanation

The nested SELECT statement in the given query will return the order date for item number 2 to the main SELECT statement. However, the main SELECT statement will return an error because it is trying to compare the expiry date of items with the order date of item number 2, which is not a valid comparison.

Submit
View My Results

Quiz Review Timeline (Updated): Jul 22, 2024 +

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

  • Current Version
  • Jul 22, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 16, 2009
    Quiz Created by
    Cristina Medina
Cancel
  • All
    All (17)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
11. El operador OR despliega registros si es que cualquiera de las...
16. Se requiere insertar el valor de "Pedro" en la columna ...
15. Algunas veces la sentencia "SELECT COUNT(*)" puede retornar menos...
12. Que tipo de LOCK(bloqueo) no permitira a los usuarios cualquier...
17. Cuáles de las siguientes sentencias es verdad acerca del...
6. Usted tiene dos tablas, PURCHASEORDERHEADER y PURCHASEORDERLINE,(el...
1. Se requiere pasar los datos desde una tabla que se encuentra en una...
3. Usted esta diseñando un modelo de datos en la cual la tabla de...
2. Como dueño de la base de datos, usted da permisos Franz para crear...
5. Qué establece un primary key de una tabla?
14. El left outer join es un tipo de outer join; otro tipo de outer...
9. Su supervisor de Ventas quiere un reporte que muestre los primeros...
10. Usted tiene una tabla que guarda el saldo de la factura y otra...
8. Usted tiene 3 tablas Authors, Books y Titleauthor en su base de...
7. Cuál de las siguientes setencias es cierta sobre las relaciones?
4. Cuáles de las siguientes sentencias son ciertas sobre las vistas?
13. Considere el siguiente SELECT:SELECT item_no FROM ITEM WHERE...
Alert!

Advertisement