6_4_Josemaria_Perez_Manriquez_practica4
SQL
CREATE TABLE videojuegos (
id_juego INT PRIMARY KEY,
nombre VARCHAR(50),
genero VARCHAR(30),
plataforma VARCHAR(30),
precio DECIMAL(6,2),
stock INT,
clasificacion VARCHAR(10),
fechanlan INT
);
INSERT INTO videojuegos VALUES
(1, "FIFA 24", "Deportes", "PS5", 1200.00, 10, "E", 2023),
(2, "Call of Duty", "Accion", "Xbox", 1500.00, 8, "M", 2022),
(3, "Minecraft", "Aventura", "PC", 800.00, 15, "E", 2011),
(4, "Fortnite", "Battle Royale", "PC", 0.00, 20, "T", 2017),
(5, "GTA V", "Accion", "PS5", 900.00, 5, "M", 2013),
(6, "The Sims 4", "Simulacion", "PC", 0.00, 12, "T", 2014),
(7, "Mario Kart 8", "Carreras", "Nintendo", 1100.00, 7, "E", 2017),
(8, "Zelda BOTW", "Aventura", "Nintendo", 1400.00, 6, "T", 2017),
(9, "Valorant", "Shooter", "PC", 0.00, 18, "T", 2020),
(10, "Resident Evil 4", "Terror", "PS5", 1300.00, 4, "M", 2023),
(11, "Halo Infinite", "Accion", "Xbox", 1000.00, 9, "T", 2021),
(12, "Among Us", "Casual", "PC", 100.00, 25, "E", 2018);
SELECT * FROM videojuegos;
SELECT nombre, precio FROM videojuegos;
SELECT * FROM videojuegos
WHERE precio > 1000;
SELECT * FROM videojuegos
WHERE precio = 0;
SELECT * FROM videojuegos
WHERE clasificacion = "M";
SELECT AVG(precio) AS promedio_precios
FROM videojuegos;
SELECT plataforma, COUNT(*) AS cantidad
FROM videojuegos
GROUP BY plataforma;
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.