0% encontró este documento útil (0 votos)
11 vistas4 páginas

Tarea SQL 01: Creación y Consultas

La tarea SQL 01 consiste en la creación de una base de datos con tablas para clientes, proveedores, productos y pedidos, incluyendo sus respectivas claves y relaciones. Se requiere realizar la creación en una query SQL, crear un diagrama de base de datos, alimentar las tablas con datos específicos y practicar consultas SQL utilizando SELECT, FROM y WHERE. Además, se deben documentar los ejercicios en un documento de Word con el formato indicado.

Cargado por

Patricio Samaan
Derechos de autor
© All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd
0% encontró este documento útil (0 votos)
11 vistas4 páginas

Tarea SQL 01: Creación y Consultas

La tarea SQL 01 consiste en la creación de una base de datos con tablas para clientes, proveedores, productos y pedidos, incluyendo sus respectivas claves y relaciones. Se requiere realizar la creación en una query SQL, crear un diagrama de base de datos, alimentar las tablas con datos específicos y practicar consultas SQL utilizando SELECT, FROM y WHERE. Además, se deben documentar los ejercicios en un documento de Word con el formato indicado.

Cargado por

Patricio Samaan
Derechos de autor
© All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd

Tarea SQL 01

CLASE SQL

Salazar, Franco Emanuel


UADE | 2025
Tarea SQL 01 | Salazar, Franco Emanuel
Año 2025 V1
En un WORD en BLANCO poner de Titulo “RTA TAREA SQL 01- Apellido/Nombre”.
En dicho WORD ir poniendo los ejercicios usando TITULO 1.
Guardarlo en el formato dicho con el nombre propio y subirlo al espacio correspondiente.

Ejercicio 1
A partir del siguiente DER llevar adelante la creación de una base de datos con sus
respectivas claves y relaciones (REALIZARLO EN UNA QUERY y guardarlo como .sql).

Por ejemplo:
CREATE DATABASE GestionPedidosIDI;
USE GestionPedidosIDI;
Con el siguiente diseño por tabla:
TABLA CLIENTES
ID_Cliente: INT - PRIMARY KEY
NombreCliente: VARCHAR(100)
Direccion: VARCHAR(150)
Telefono: VARCHAR (15)
TABLA PROVEEDORES
ID_Proveedor: INT - PRIMARY KEY
NombreProveedor: VARCHAR(100)
DireccionProveedor: VARCHAR(150)

Página 1|3
Tarea SQL 01 | Salazar, Franco Emanuel
Año 2025 V1
TelefonoProveedor: VARCHAR(15)
TABLA PRODUCTOS
ID_Producto: INT - PRIMARY KEY
NombreProducto: VARCHAR(100)
Precio: DECIMAL(10, 2)
Stock: INT
ID_Proveedor: INT - FOREIGN KEY

TABLA PEDIDOS
ID_Pedido: INT - PRIMARY KEY
FechaPedido: DATE
ID_Cliente: INT - FOREIGN KEY
ID_Producto: INT - FOREIGN KEY

Cantidad: INT
PUnitario: DECIMAL(10, 2)

Ejercicio 2
Crear un Diagrama de Base de Datos con SSMS y adjuntar screenshots.

Ejercicio 3
Alimentar las tablas creadas usando los siguientes datos y adjuntar screenshots de los datos:

• CLIENTE:
o 1, Juan Perez, Calle Falsa 123, 555-1234
o 2, Maria Sanchez, Av. Siempre Viva 1842, 555-5678
o 3, Franco Martinez, Calle Lima 757, 555-9090
• PROVEEDOR:
o 1, Proveedor U, Zona Industrial Burzaco, 555-000
o 2, Proveedor A, Zona Industrial Canning, 555-909
o 3, Proveedor D, Zona Industrial Campana, 555-888
o 4, Proveedor E, Zona Industrial Talar, 666-666
• PRODUCTO:
o 1, X, 10.99, 100, 1
o 2. Y, 20.00, 200, 2
Página 2|3
Tarea SQL 01 | Salazar, Franco Emanuel
Año 2025 V1
o 3, Z, 30.00, 300, 3
• PEDIDO:
o 1, 2025-01-01, 1, 1, 10, 10.00
o 2, 2025-02-02, 2, 2, 5, 20.00
o 3, 2025-03-03, 3, 3, 2, 30.00
o 4, 2025-04-04, 1, 2, 1, 20.00
o 5, 2025-05-05, 2, 1, 3, 10.00

Ejercicio 4
Practicar SELECT, FROM y WHERE y adjuntar screenshots de los datos SIN EL USO DE SELECT*
donde se vea la consulta SQL y el panel de resultados:
1. Práctica 1: Obtener una lista de todos los productos cuyo precio sea superior a $20.
2. Práctica 2: Listar todos los pedidos que se realizaron el 3 de agosto de 2024.
3. Práctica 3: Obtener una lista de todos los clientes que viven en "Calle Falsa 123".

Ejemplo:
SELECT NombreCliente, Direccion, Telefono
FROM Clientes
WHERE Direccion = 'Calle Falsa 123';

Página 3|3

Common questions

Con tecnología de IA

The exercise of creating a database diagram assists in understanding the relationship between tables by visually representing how tables connect through foreign keys. This visual tool helps students grasp the concept of relational databases by showing entity relationships and the structure of a database, providing clarity on data flow and dependencies within the system, which is crucial for accurate database design .

The limitations in executing SQL tasks as outlined might include the lack of complex data manipulation operations such as JOINs, subqueries, or transactions which are crucial in managing real-world databases. The exercises focus mainly on basic CRUD operations, which, while foundational, may not cover the complexities of ensuring data consistency and atomicity in transactional scenarios. This might be insufficient for managing databases that require complex relational queries and integrity constraints .

The practice exercises enhance understanding by requiring queries that filter data based on specific conditions using SQL commands like SELECT, FROM, and WHERE. For example, the exercise to list products with a price greater than $20 requires using a WHERE clause to filter the "PRODUCTOS" table for entries that meet the price condition. This practice helps learners apply logical operators and conditions to extract meaningful subsets of data .

The SQL exercises show the design of relational databases by defining primary keys and foreign keys to establish relationships between tables. For instance, the "CLIENTES" table uses "ID_Cliente" as a primary key, which is referenced as a foreign key in the "PEDIDOS" table to link orders to specific clients. Similarly, the "PRODUCTOS" table has "ID_Producto" as a primary key and "ID_Proveedor" as a foreign key, establishing a relationship between products and their suppliers, which is stored in the "PROVEEDORES" table .

The design of these SQL tasks supports teaching systematic approaches to database creation and management by guiding learners through each stage of database development: defining schemas, creating tables with appropriate keys, populating data, and performing basic queries. Each task progressively builds upon the previous, reinforcing foundational concepts necessary for maintaining data integrity and ensuring efficient data retrieval, which are critical in systematic database management .

Students might face challenges such as understanding the syntax for defining keys and establishing relationships, constructing complex queries without SELECT*, and ensuring data integrity through proper use of foreign keys. Additionally, debugging syntax errors, especially in SQL query structures, might be difficult without prior experience, as even small mistakes can lead to non-functional scripts and incorrect database states .

Listing details of clients at a specific address enhances understanding of SQL filtering by demonstrating how condition-specific queries using the WHERE clause can retrieve precise data from larger datasets. This task illustrates the power of SQL to selectively access information, which is fundamental to effective data analysis and manipulation in database management .

The SQL exercises reflect best practices in database normalization by organizing data into separate tables to reduce redundancy and improve data integrity. Each entity such as "CLIENTES," "PROVEEDORES," "PRODUCTOS," and "PEDIDOS" is stored in its table, which prevents duplication of data and anomalies in data operations. The use of foreign keys to establish relationships between tables also enforces referential integrity, ensuring that entries in related tables remain consistent .

Supplementing tables with specific data sets reveals that data population is an essential step in initializing a database as it ensures that the tables are populated with necessary values for testing and verification. This step is critical for detecting potential issues related to data types, constraints, and relational mappings, and for validating that the database operates as intended before it goes into production .

Integrating practical SQL tasks into the curriculum offers educational benefits such as the development of hands-on experience with real SQL syntax, enhanced understanding of relational database concepts, and improved problem-solving skills related to data manipulation and retrieval. Such tasks allow students to apply theoretical knowledge in practical scenarios, facilitating a deeper comprehension of database management principles .

También podría gustarte