Continuación de casos de negocio
Clase 20 de 24 • Curso de SQL y MySQL 2018
Contenido del curso
Clase 20 de 24 • Curso de SQL y MySQL 2018
Contenido del curso
Emmanuel Octavio Martinez C
Carlos Rodríguez Huerta
Cristian Orozco Benjumea
Daniel Prol
José López Cobeña
Miguel Angel Reyes Moreno
José Martín Miret
Yezid Garcia Medina
Camilo Ramirez Castillo
Emerson Y
Alejandro González Reyes
Daniel Páez
Facundo Nicolás García Martoni
Juan Camilo Lezcano Benitez
Yezid Garcia Medina
Usuario anónimo
Jesus David Urquijo Corredor
Sergio Rubiano
Arquimedes silvio
Smerlyn Javier Eusebio Bonifacio
Daniel Páez
Vicente Fernandez
Carlos Andres Perez Zapata
Alejandro Sanchez
JUAN DAVID PALACIOS MACHADO
Royer Guerrero Pinilla
Alejandro Giraldo Londoño
Luis Abdel Rangel Castro
Braian Peña
Omar Daniel Centeno
Adan Kenyiro Benítez Pérez
Marcos Iván Hernández Velásquez
Guillermo Luis Torres Ruiz
Gerson Pac
Marcos Iván Hernández Velásquez
Wilson Fernando Antury Torres
Para los que no tengan precios en la DB ejectuar:
TRUNCATE `books`; INSERT INTO `books` VALUES (1,1,'The Startup Playbook',2013,'en',NULL,10.00,1,5,'Advice from the experts'), (2,1,'The Startup Playbook',2014,'es',NULL,10.00,1,5,'Consejo de los expertos, traducido por Platzi'), (3,3,'Estudio en escarlata',1887,'es',NULL,5.00,1,10,'La primera novela de Sherlock Holmes'), (4,6,'Wallander: Asesinos sin rostro',1991,'es',NULL,15.00,1,3,''), (5,6,'Wallander: Los perros de Riga',1992,'es',NULL,15.00,1,3,''), (6,6,'Wallander: La leona blanca',1993,'es',NULL,15.00,1,3,''), (7,6,'Wallander: El hombre sonriente',1994,'es',NULL,15.00,1,3,''), (8,6,'Wallander: La falsa pista',1995,'es',NULL,15.00,1,3,''), (9,6,'Wallander: La quinta mujer',1996,'es',NULL,15.00,1,3,''), (10,6,'Wallander: Pisando los talones',1997,'es',NULL,15.00,1,3,''), (11,6,'Wallander: Cortafuegos',1998,'es',NULL,15.00,1,3,''), (12,5,'El llano en llamas',1953,'es',NULL,10.00,0,1,'Cuentos mexicanos'), (13,7,'Fundamentals of Wavelets',1900,'en',NULL,15.20,1,4,NULL), (14,8,'Data Smart',1900,'en',NULL,20.5,1,4,NULL), (15,9,'God Created the Integers',1900,'en',NULL,12.5,1,4,NULL), (16,10,'Superfreakonomics',1900,'en',NULL,10.5,1,4,NULL), (17,11,'Orientalism',1900,'en',NULL,21.2,1,4,NULL), (18,12,'The Nature of Statistical Learning Theory',1900,'en',NULL,15.0,1,4,NULL), (19,13,'Integration of the Indian States',1900,'en',NULL,13.5,1,4,NULL), (20,14,'The Drunkard\'s Walk',1900,'en',NULL,21.2,1,4,NULL), (21,15,'Image Processing & Mathematical Morphology',1900,'en',NULL,12.3,1,4,NULL), (22,16,'How to Think Like Sherlock Holmes',1900,'en',NULL,15.2,1,4,NULL), (23,17,'Data Scientists at Work',1900,'en',NULL,15.2,1,4,NULL), (24,18,'Slaughterhouse Five',1900,'en',NULL,15.2,1,4,NULL), (25,19,'Birth of a Theorem',1900,'en',NULL,10.5,1,4,NULL), (26,20,'Structure & Interpretation of Computer Programs',1900,'en',NULL,10.5,1,4,NULL), (27,21,'The Age of Wrath',1900,'en',NULL,10.5,1,4,NULL), (28,22,'The Trial',1900,'en',NULL,15.5,1,4,NULL), (29,23,'Statistical Decision Theory',1900,'en',NULL,15.5,1,4,NULL), (30,24,'Data Mining Handbook',1900,'en',NULL,15.5,1,4,NULL), (31,25,'The New Machiavelli',1900,'en',NULL,15.5,1,4,NULL), (32,26,'Physics & Philosophy',1900,'en',NULL,10.2,1,4,NULL), (33,27,'Making Software',1900,'en',NULL,11.2,1,4,NULL), (34,28,'Vol I Analysis',1900,'en',NULL,15.3,1,4,NULL), (35,29,'Machine Learning for Hackers',1900,'en',NULL,10.5,1,4,NULL), (36,30,'The Signal and the Noise',1900,'en',NULL,12.5,1,4,NULL), (37,31,'Python for Data Analysis',1900,'en',NULL,10.0,1,4,NULL), (38,32,'Introduction to Algorithms',1900,'en',NULL,21.5,1,4,NULL), (39,33,'The Beautiful and the Damned',1900,'en',NULL,20.5,1,4,NULL), (40,34,'The Outsider',1900,'en',NULL,22.5,1,4,NULL), (41,3,'The - Vol I Complete Sherlock Holmes',1900,'en',NULL,23.5,1,4,NULL), (42,3,'The - Vol II Complete Sherlock Holmes',1900,'en',NULL,21.5,1,4,NULL), (43,37,'The Wealth of Nations',1900,'en',NULL,22.5,1,4,NULL), (44,38,'The Pillars of the Earth',1900,'en',NULL,24.5,1,4,NULL), (45,39,'The Tao of Physics',1900,'en',NULL,15.5,1,4,NULL), (46,40,'Surely You\'s re Joking Mr Feynman',1900,'en',NULL,12.3,1,4,NULL), (47,41,'A Farewell to Arms',1900,'en',NULL,14.6,1,4,NULL), (48,42,'The Veteran',1900,'en',NULL,10.6,1,4,NULL), (49,43,'False Impressions',1900,'en',NULL,12.4,1,4,NULL), (50,44,'The Last Lecture',1900,'en',NULL,13.6,1,4,NULL), (51,45,'Return of the Primitive',1900,'en',NULL,14.3,1,4,NULL), (52,46,'Jurassic Park',1900,'en',NULL,13.5,1,4,NULL), (53,47,'A Russian Journal',1900,'en',NULL,17.5,1,4,NULL), (54,48,'Tales of Mystery and Imagination',1900,'en',NULL,19.5,1,4,NULL), (55,10,'Freakonomics',1900,'en',NULL,19.99,1,4,NULL), (56,39,'The Hidden Connections',1900,'en',NULL,15.98,1,4,NULL), (57,51,'The Story of Philosophy',1900,'en',NULL,14.89,1,4,NULL), (58,52,'Asami Asami',1900,'en',NULL,15.6,1,4,NULL), (59,47,'Journal of a Novel',1900,'en',NULL,14.5,1,4,NULL), (60,47,'Once There Was a War',1900,'en',NULL,14.6,1,4,NULL), (61,47,'The Moon is Down',1900,'en',NULL,21.5,1,4,NULL), (62,56,'The Brethren',1900,'en',NULL,22.6,1,4,NULL), (63,57,'In a Free State',1900,'en',NULL,22.4,1,4,NULL), (64,58,'Catch 22',1900,'en',NULL,20.5,1,4,NULL), (65,59,'The Complete Mastermind',1900,'en',NULL,14.6,1,4,NULL), (66,60,'Dylan on Dylan',1900,'en',NULL,13.8,1,4,NULL), (67,61,'Soft Computing & Intelligent Systems',1900,'en',NULL,17.8,1,4,NULL), (68,62,'Textbook of Economic Theory',1900,'en',NULL,17.4,1,4,NULL), (69,63,'Econometric Analysis',1900,'en',NULL,18.9,1,4,NULL), (70,64,'Learning OpenCV',1900,'en',NULL,18.54,1,4,NULL), (71,65,'Data Structures Using C & C++',1900,'en',NULL,17.6,1,4,NULL), (72,66,'A Modern Approach Computer Vision',1900,'en',NULL,13.5,1,4,NULL), (73,67,'Principles of Communication Systems',1900,'en',NULL,15.4,1,4,NULL), (74,68,'Let Us C',1900,'en',NULL,15.6,1,4,NULL), (75,69,'The Amulet of Samarkand',1900,'en',NULL,14.6,1,4,NULL), (76,70,'Crime and Punishment',1900,'en',NULL,17.5,1,4,NULL), (77,71,'Angels & Demons',1900,'en',NULL,15.3,1,4,NULL), (78,72,'The Argumentative Indian',1900,'en',NULL,18.9,1,4,NULL), (79,73,'Sea of Poppies',1900,'en',NULL,24.5,1,4,NULL), (80,72,'The Idea of Justice',1900,'en',NULL,26.3,1,4,NULL), (81,75,'A Raisin in the Sun',1900,'en',NULL,27.8,1,4,NULL), (82,76,'All the President\'s Men',1900,'en',NULL,29.5,1,4,NULL), (83,43,'A Prisoner of Birth',1900,'en',NULL,28.7,1,4,NULL), (84,78,'Scoop!',1900,'en',NULL,28.9,1,4,NULL), (85,79,'Ahe Manohar Tari',1900,'en',NULL,24.1,1,4,NULL), (86,80,'The Last Mughal',1900,'en',NULL,15.3,1,4,NULL), (87,81,'Vol 39 No. 1 Social Choice & Welfare',1900,'en',NULL,13.6,1,4,NULL), (88,52,'Radiowaril Bhashane & Shrutika',1900,'en',NULL,18.4,1,4,NULL), (89,52,'Gun Gayin Awadi',1900,'en',NULL,24.1,1,4,NULL), (90,52,'Aghal Paghal',1900,'en',NULL,26.68,1,4,NULL), (91,85,'Maqta-e-Ghalib',1900,'en',NULL,25.3,1,4,NULL), (92,86,'Manasa',1900,'en',NULL,24.3,1,4,NULL), (93,87,'India from Midnight to Milennium',1900,'en',NULL,23.6,1,4,NULL), (94,87,'The Great Indian Novel',1900,'en',NULL,21.0,1,4,NULL), (95,89,'O Jerusalem!',1900,'en',NULL,20.20,1,4,NULL), (96,89,'The City of Joy',1900,'en',NULL,20.0,1,4,NULL), (97,89,'Freedom at Midnight',1900,'en',NULL,19.98,1,4,NULL), (98,47,'The Winter of Our Discontent',1900,'en',NULL,27.0,1,4,NULL), (99,93,'On Education',1900,'en',NULL,21.8,1,4,NULL), (100,94,'Free Will',1900,'en',NULL,11.4,1,4,NULL), (101,87,'Bookless in Baghdad',1900,'en',NULL,13.6,1,4,NULL), (102,96,'The Case of the Lame Canary',1900,'en',NULL,15.6,1,4,NULL), (103,9,'The Theory of Everything',1900,'en',NULL,14.6,1,4,NULL), (104,98,'New Markets & Other Essays',1900,'en',NULL,13.5,1,4,NULL), (105,99,'Electric Universe',1900,'en',NULL,18.5,1,4,NULL), (106,100,'The Hunchback of Notre Dame',1900,'en',NULL,17.7,1,4,NULL), (107,47,'Burning Bright',1900,'en',NULL,17.7,1,4,NULL), (108,98,'The Age of Discontuinity',1900,'en',NULL,15.5,1,4,NULL), (109,103,'Doctor in the Nude',1900,'en',NULL,24.1,1,4,NULL), (110,104,'Down and Out in Paris & London',1900,'en',NULL,13.3,1,4,NULL), (111,72,'Identity & Violence',1900,'en',NULL,16.65,1,4,NULL), (112,80,'Beyond the Three Seas',1900,'en',NULL,15.21,1,4,NULL), (113,107,'Talking Straight',1900,'en',NULL,17.5,1,4,NULL), (114,108,'Vol 3 Maugham\'s Collected Short Stories',1900,'en',NULL,14.4,1,4,NULL), (115,42,'The Phantom of Manhattan',1900,'en',NULL,14.23,1,4,NULL), (116,108,'Ashenden of The British Agent',1900,'en',NULL,13.25,1,4,NULL), (117,111,'Zen & The Art of Motorcycle Maintenance',1900,'en',NULL,17.8,1,4,NULL), (118,112,'The Great War for Civilization',1900,'en',NULL,17.8,1,4,NULL), (119,45,'We the Living',1900,'en',NULL,16.5,1,4,NULL), (120,114,'The Artist and the Mathematician',1900,'en',NULL,12.21,1,4,NULL), (121,93,'History of Western Philosophy',1900,'en',NULL,21.12,1,4,NULL), (122,72,'Rationality & Freedom',1900,'en',NULL,8.6,1,4,NULL), (123,117,'Clash of Civilizations and Remaking of the World Order',1900,'en',NULL,12.3,1,4,NULL), (124,39,'Uncommon Wisdom',1900,'en',NULL,11.20,1,4,NULL), (125,119,'One',1900,'en',NULL,11.01,1,4,NULL), (126,120,'To Sir With Love',1900,'en',NULL,18.7,1,4,NULL), (127,121,'Half A Life',1900,'en',NULL,24.42,1,4,NULL), (128,122,'The Discovery of India',1900,'en',NULL,23.25,1,4,NULL), (129,52,'Apulki',1900,'en',NULL,21.09,1,4,NULL), (130,93,'Unpopular Essays',1900,'en',NULL,12.65,1,4,NULL), (131,42,'The Deceiver',1900,'en',NULL,13.51,1,4,NULL), (132,76,'Veil: Secret Wars of the CIA',1900,'en',NULL,41.20,1,4,NULL), (133,52,'Char Shabda',1900,'en',NULL,14.32,1,4,NULL), (134,128,'Rosy is My Relative',1900,'en',NULL,42.5,1,4,NULL), (135,108,'The Moon and Sixpence',1900,'en',NULL,14.30,1,4,NULL), (136,130,'A Short History of the World',1900,'en',NULL,18.68,1,4,NULL), (137,108,'The Trembling of a Leaf',1900,'en',NULL,17.21,1,4,NULL), (138,103,'Doctor on the Brain',1900,'en',NULL,21.10,1,4,NULL), (139,133,'Simpsons & Their Mathematical Secrets',1900,'en',NULL,21.41,1,4,NULL), (140,134,'Pattern Classification',1900,'en',NULL,21.4,1,4,NULL), (141,135,'From Beirut to Jerusalem',1900,'en',NULL,22.32,1,4,NULL), (142,133,'The Code Book',1900,'en',NULL,24.1,1,4,NULL), (143,112,'The Age of the Warrior',1900,'en',NULL,10.62,1,4,NULL), (144,138,'The Numbers Behind Numb3rs',1900,'en',NULL,11.56,1,4,NULL), (145,47,'A Life in Letters',1900,'en',NULL,14.3,1,4,NULL), (146,140,'The Information',1900,'en',NULL,16.15,1,4,NULL), (147,141,'Elements of Information Theory',1900,'en',NULL,17.52,1,4,NULL), (148,142,'Power Electronics - Rashid',1900,'en',NULL,14.10,1,4,NULL), (149,143,'Power Electronics - Mohan',1900,'en',NULL,17.51,1,4,NULL), (150,144,'Neural Networks',1900,'en',NULL,21.20,1,4,NULL), (151,47,'The Grapes of Wrath',1900,'en',NULL,10.52,1,4,NULL), (152,52,'Vyakti ani Valli',1900,'en',NULL,10.10,1,4,NULL), (153,12,'Statistical Learning Theory',1900,'en',NULL,10.99,1,4,NULL), (154,148,'Empire of the Mughal - The Tainted Throne',1900,'en',NULL,10.87,1,4,NULL), (155,148,'Empire of the Mughal - Brothers at War',1900,'en',NULL,14.25,1,4,NULL), (156,148,'Empire of the Mughal - Ruler of the World',1900,'en',NULL,18.58,1,4,NULL), (157,148,'Empire of the Mughal - The Serpent\'s Tooth',1900,'en',NULL,14.65,1,4,NULL), (158,148,'Empire of the Mughal - Raiders from the North',1900,'en',NULL,17.89,1,4,NULL), (159,153,'Mossad',1900,'en',NULL,14.56,1,4,NULL), (160,154,'Jim Corbett Omnibus',1900,'en',NULL,14.19,1,4,NULL), (161,155,'20000 Leagues Under the Sea',1900,'en',NULL,19.41,1,4,NULL), (162,156,'Batatyachi Chal',1900,'en',NULL,18.57,1,4,NULL), (163,156,'Hafasavnuk',1900,'en',NULL,24.12,1,4,NULL), (164,156,'Urlasurla',1900,'en',NULL,12.35,1,4,NULL), (165,68,'Pointers in C',1900,'en',NULL,45.4,1,4,NULL), (166,160,'The Cathedral and the Bazaar',1900,'en',NULL,14.25,1,4,NULL), (167,161,'Design with OpAmps',1900,'en',NULL,14.21,1,4,NULL), (168,162,'Think Complexity',1900,'en',NULL,12.63,1,4,NULL), (169,163,'The Devil\'s Advocate',1900,'en',NULL,14.56,1,4,NULL), (170,45,'Ayn Rand Answers',1900,'en',NULL,24.24,1,4,NULL), (171,45,'Philosophy: Who Needs It',1900,'en',NULL,13.52,1,4,NULL), (172,166,'Data Analysis with Open Source Tools',1900,'en',NULL,18.9,1,4,NULL), (173,167,'Broca\'s Brain',1900,'en',NULL,18.98,1,4,NULL), (174,168,'Men of Mathematics',1900,'en',NULL,17.54,1,4,NULL), (175,169,'Oxford book of Modern Science Writing',1900,'en',NULL,17.58,1,4,NULL), (176,170,'Judiciary and Democracy Justice',1900,'en',NULL,14.89,1,4,NULL), (177,171,'The Arthashastra',1900,'en',NULL,15.87,1,4,NULL), (178,172,'We the People',1900,'en',NULL,16.25,1,4,NULL), (179,172,'We the Nation',1900,'en',NULL,11.145,1,4,NULL), (180,174,'The Courtroom Genius',1900,'en',NULL,12.25,1,4,NULL), (181,175,'Dongri to Dubai',1900,'en',NULL,14.00,1,4,NULL), (182,176,'Foundation History of England',1900,'en',NULL,16.52,1,4,NULL), (183,80,'City of Djinns',1900,'en',NULL,17.52,1,4,NULL), (184,178,'India\'s Legal System',1900,'en',NULL,13.25,1,4,NULL), (185,179,'More Tears to Cry',1900,'en',NULL,18.65,1,4,NULL), (186,180,'The Ropemaker',1900,'en',NULL,17.85,1,4,NULL), (188,182,'The Prince',1900,'en',NULL,19.52,1,4,NULL), (189,183,'Eyeless in Gaza',1900,'en',NULL,13.25,1,4,NULL), (190,184,'Tales of Beedle the Bard',1900,'en',NULL,25.63,1,4,NULL), (191,185,'Girl with the Dragon Tattoo',1900,'en',NULL,18.58,1,4,NULL), (192,185,'Girl who kicked the Hornet\'s Nest',1900,'en',NULL,17.56,1,4,NULL), (193,185,'Girl who played with Fire',1900,'en',NULL,16.52,1,4,NULL), (194,28,'Structure and Randomness',1900,'en',NULL,16.34,1,4,NULL), (195,189,'Image Processing with MATLAB',1900,'en',NULL,13.28,1,4,NULL), (196,104,'Animal Farm',1900,'en',NULL,24.24,1,4,NULL), (197,70,'The Idiot',1900,'en',NULL,26.34,1,4,NULL), (198,192,'A Christmas Carol',1900,'en',NULL,27.17,1,4,NULL);
Pequeña observación de la primera línea para que funcione correctamente.
TRUNCATE TABLE `books`;
Luego ejecutar el script con lo enseñado por el profesor.
$ mysql -u root -p -D "nombre de la BD" < "nombre del script"
Importante encontrarse dentro de la carpeta que contiene el script para ejecutar, en la consola, el comando que escribí.
Muchas gracias por el aporte, me ahorró mucho tiempo.
Gracias, buen regalo
Más casos de negocio:
¿Cuál es el promedio/desviación standard del precio de libros + idem, pero por nacionalidad
SELECT nationality, COUNT(book_id) AS libros AVG(price) AS prom STADDEV(price) AS std FROM books as b JOIN authors as a ON a.author_id = b.author_id GROUP BY nationality ORDER BY libros DESC;
¿Cuál es el precio máximo/mínimo de un libro?
SELECT nationality, MAX(price), MIN(price) FROM books AS b JOIN authors AS a ON a.author_id = b.author_id GROUP BY nationality
¿Cómo quedaría el reporte final de préstamos?
SELECT c.name, t.type, b.title CONCAT (a.name, " (", a.nationality, ")") AS autor TO_DAYS(NOW()) - TO_DAYS(t.created_at) AS ago FROM transactions AS t LEFT JOIN clients AS c ON c.client_id = t.client_id LEFT JOIN books AS b ON b.book_id = t.book_id LEFT JOIN authors AS a ON b.author_id = a.author_id
A tu ultimo query le faltaba las ( , )
SELECT c.name, t.type, b.title, CONCAT(a.name," (",a.nationality,")") AS autor, TO_DAYS(NOW()) - TO_DAYS(t.created_at) AS ago FROM transactions AS t LEFT JOIN clients AS c ON c.client_id = t.client_id LEFT JOIN books AS b ON b.book_id = t.book_id LEFT JOIN authors AS a ON b.author_id = a.author_id;
Tu primer query tiene errores de sintaxis, lo correcto es:
SELECT nationality, COUNT(book_id) AS libros, AVG(price) AS prom, STDDEV(price) AS std FROM books as b JOIN authors as a ON a.author_id = b.author_id GROUP BY nationality ORDER BY libros DESC;
Y el tercero también:
SELECT nationality, COUNT(book_id) AS libros, AVG(price) AS prom, STDDEV(price) AS std FROM books AS b JOIN authors AS a ON a.author_id = b.author_id GROUP BY nationality ORDER BY libros DESC;
Dato de color:
1- El calendario gregoriano comenzó a usarse en el año 1582 D.C., impulsado por el papa Gregorio XIII.
2- El que se utilizaba antes de eso era el calendario Juliano, desde el año 45 A.C.
3- El año 0 no existe, del 1 A.C. pasa directamente al 1 D.C., tomandose el 0 como un instante de tiempo y no como un período.
4- Los días del 5 al 14 de octubre de 1582 jamás existieron, es el tiempo que se suprimió para corregir el desfase entre lo calendarios Juliano y Gregoriano.
Oh, interesante :O
Hola Jose, ¿esto no lo tiene en cuenta la función TO_DAYS()?
Resumen de la clase.
-- 4. ¿Cuál es el promedio/desviación standard del precio de libros? SELECT a.nationality, AVG(b.price) AS promedio, STDDEV(b.price) AS std FROM books AS b JOIN authors AS a ON a.author_id = b.author_id GROUP BY a.nationality ORDER BY promedio DESC; -- 5. ¿Cuál es el promedio/desviación standard del precio de libros por nacionalidad? -- Agrupar por la columna pivot SELECT a.nationality, COUNT(b.book_id) AS libros, AVG(b.price) AS promedio, STDDEV(b.price) AS std FROM books AS b JOIN authors AS a ON a.author_id = b.author_id GROUP BY a.nationality ORDER BY libros DESC; -- 6. ¿Cuál es el precio máximo/mínimo de un libro? SELECT nationality, MAX(price), MIN(price) FROM books AS b JOIN authors AS a ON a.author_id = b.author_id GROUP BY nationality; -- 7. ¿cómo quedaría el reporte de préstamos? -- CONCAT: para concatenar en cadenas de texto. -- TO_DAYS: recibe un timestamp ó un datetime SELECT c.name, t.type, b.title, CONCAT(a.name, " (", a.nationality, ")") AS autor, TO_DAYS(NOW()) - TO_DAYS(t.created_at) FROM transactions AS t LEFT JOIN clients AS c ON c.client_id = t.client_id LEFT JOIN books AS b ON b.book_id = t.book_id LEFT JOIN authors AS a ON b.author_id = a.author_id;
> SELECT TO_DAYS(NOW()) trae los días desde el día 0 del año cero hasta hoy.
> SELECT TO_DAYS('0000-01-01'); el día uno
Muy, pero muy mal la organización de los materiales de apoyo para este curso. Pierdes tiempo en buscar los archivos correctos, con la data correcta.
Poner mas atención a esto por favor
Realmente es cierto pero use eso como incentivo para crear los datos yo mismo, usandoo mi cabeza un poco para no hacerlo tan lento
Lo pudiste ver como una oportunidad !
@jsconestilo Podrías darme más detalles sobre que archivos faltan en que clases? Así realizo los reportes correspondientes al equipo de Platzi
Sería bueno que pusieran el archivo con los datos actualizados, ya que el que está para descargar tiene casi todos los precios en NULL.
un compañero ya lo actualizo con datos INSERT
Ese es una buena opción.
Los datos que fueron ofrecidos son diferentes a los usados, ya tuve problemas con la tabla de transactions y sus datos (Ya lo solucioné) y ahora me doy cuenta de que el precio de todos los libros a partir del 12 están en null :(
Si, ese tambien fue mi problema
Felicitaciones al profesor alberto muy buen curso y muy facil de entender.
Esto que compartiste está genial, el orden de ejecución , Para qué lo buscaste en si?
Me gustaría que el profesor utilizará los mismos datos que se encuentra en la pestaña de "Archivos y Enlaces" para que nos dieran los mismos resultados... De todas maneras, muy buena clase, he aprendido.
El contenido del archivo de All.sql no coincide con lo que muestra el profesor en pantalla. Solo 12 libros me aparecen con precio, de resto todos en NULL :/
Cuando veo que sacan desviación estándar y promedios ya veo que si es necesario el curso de estadística para programadores de platzi.
Es verdad que "debería verse como una oportunidad para aplicar otras cosas" PERO, DEBE ser responsabilidad de una plataforma PAGADA tener los archivos en condiciones adecuadas para su utilización. Es 2022 y todavía la tabla books aparece con precios en NULL.
Es necesario que le presten atención a ese asunto.
Basicamente esto se trata de hacer preguntas y convertir los datos almacenados en informacion valiosa para los usuarios
RESUMEN:
SELECT nationality, COUNT(book_id) as libros, AVG(price) as prom, STDDEV(price) as std FROM books AS b JOIN authors as a ON a.author_id= b.author_id GROUP BY nationality ORDER BY libros ;
5. ¿Cual es el precio máximo/mínimo de un libro?
SELECT nationality, MAX(price), MIN(price) FROM books AS b JOIN authors as a On a.author_id= b.author_id GROUP BY nationality ;
SELECT c.name, t.type, b.title, CONCAT (a.name, " (", a.nationality, ")") as autor, TO_DAYS (NOW()) - TO_DAYS (t.created_at) FROM transactions AS t LEFT JOIN clients AS c ON c.client_id = t.client_id LEFT JOIN books AS b ON b.book_id = t.book_id LEFT JOIN authors AS a ON b.author_id =a.author_id ;
QUÉ ES LA DESVIACIÓN ESTÁNDAR Y COMO INTERPRETARLA #1 trading center vol dólarPara muchos la palabra desviación estándar puede sonar desconocida y no la habrán oído nombrar a menos que hayan asistido a una clase de estadística.
Sin embargo no se preocupe, es probable que si ha escuchado la palabra volatilidad, volatilidad del mercado, volatilidad del precio, ya esta familiarizado con el tema, ya que volatilidad lo podemos connotar como movimiento, y significa lo mismo que desviación estándar sino que esta última palabra es usada en estricto sentido matemático
Que es desviación estándar?
Justamente la desviación Estándar, en un conjunto de datos (precios en el caso del mercado de valores) es una medida de dispersión, que nos indica cuánto pueden alejarse los valores respecto al promedio (media), por lo tanto es útil para buscar probabilidades de que un evento ocurra, o en el caso del mercado bursátil, determinar entre que rango de precios puede moverse un determinado activo, y determinar que tipo de activos pueden ser mas volátiles que otros.
Los operadores del mercado están interesados en la dirección del precio de un activo y en la velocidad de los movimientos del subyacente para determinar que tan riesgoso o vólatil puede llegar a ser un activo. Los mercados cuyos precios se mueven lentamente son mercados de baja volatilidad, los mercados cuyos precios se mueven a alta velocidad son mercados de alta volatilidad.
Gracias por el aporte.
10 preguntas frecuentes de SQL en entrevistas de trabajo
Según: java67 . 1: SQL para encontrar el segundo salario más alto de los empleados:
select MAX(Salary) from Employee WHERE Salary NOT IN (select MAX(Salary) from Employee );
2: SQL para encontrar el salario máximo de cada departamento.
SELECT DeptID, MAX(Salary) FROM Employee GROUP BY DeptID. ```
3: Escriba una consulta SQL para mostrar la fecha actual.
SELECT GetDate();
4: Escriba una consulta SQL para comprobar si la fecha pasada a la consulta es la fecha del formato dado o no.
SELECT ISDATE(‘1/08/13’) AS “MM/DD/YY”;
5: Escriba una consulta SQL para imprimir el nombre del empleado distinto cuya fecha de nacimiento es entre el 01/01/1960 al 31/12/1975.
SELECT DISTINCT EmpName FROM Employees WHERE DOB BETWEEN ‘01/01/1960’ AND ‘31/12/1975’;
6: Escriba una consulta SQL para encontrar el número de empleados según el género cuya fecha de nacimiento sea entre el 01/01/1960 y el 31/12/1975.
SELECT COUNT(*), sex from Employees WHERE DOB BETWEEN ‘01/01/1960’ AND ‘31/12/1975’ GROUP BY sex
7: Escriba una consulta SQL para encontrar un empleado cuyo salario sea igual o superior a 10000.
SELECT EmpName FROM Employees WHERE Salary>=10000;
8: Escriba una consulta SQL para encontrar el nombre del empleado cuyo nombre comience con "M"
SELECT * FROM Employees WHERE EmpName like ‘M%’;
9: busque todos los registros de empleados que contengan la palabra “Joe”, independientemente de si se almacenó como JOE, Joe o joe.
SELECT * from Employees WHERE UPPER(EmpName) like '%JOE%';
10: Escriba una consulta SQL para encontrar el año desde la fecha.
SELECT YEAR(GETDATE()) as “Year”;
Para quellos que no tengan los precios faltantes del la tabla en books, les recomiendo lo siguiente.
$ mysql -u root -p -D "nombre de la BD" < "nombre del script"
TRUNCATE TABLE `books`; INSERT INTO `books` VALUES (1,1,'The Startup Playbook',2013,'en',NULL,10.00,1,5,'Advice from the experts'), (2,1,'The Startup Playbook',2014,'es',NULL,10.00,1,5,'Consejo de los expertos, traducido por Platzi'), (3,3,'Estudio en escarlata',1887,'es',NULL,5.00,1,10,'La primera novela de Sherlock Holmes'), (4,6,'Wallander: Asesinos sin rostro',1991,'es',NULL,15.00,1,3,''), (5,6,'Wallander: Los perros de Riga',1992,'es',NULL,15.00,1,3,''), (6,6,'Wallander: La leona blanca',1993,'es',NULL,15.00,1,3,''), (7,6,'Wallander: El hombre sonriente',1994,'es',NULL,15.00,1,3,''), (8,6,'Wallander: La falsa pista',1995,'es',NULL,15.00,1,3,''), (9,6,'Wallander: La quinta mujer',1996,'es',NULL,15.00,1,3,''), (10,6,'Wallander: Pisando los talones',1997,'es',NULL,15.00,1,3,''), (11,6,'Wallander: Cortafuegos',1998,'es',NULL,15.00,1,3,''), (12,5,'El llano en llamas',1953,'es',NULL,10.00,0,1,'Cuentos mexicanos'), (13,7,'Fundamentals of Wavelets',1900,'en',NULL,15.20,1,4,NULL), (14,8,'Data Smart',1900,'en',NULL,20.5,1,4,NULL), (15,9,'God Created the Integers',1900,'en',NULL,12.5,1,4,NULL), (16,10,'Superfreakonomics',1900,'en',NULL,10.5,1,4,NULL), (17,11,'Orientalism',1900,'en',NULL,21.2,1,4,NULL), (18,12,'The Nature of Statistical Learning Theory',1900,'en',NULL,15.0,1,4,NULL), (19,13,'Integration of the Indian States',1900,'en',NULL,13.5,1,4,NULL), (20,14,'The Drunkard\s Walk',1900,'en',NULL,21.2,1,4,NULL), (21,15,'Image Processing & Mathematical Morphology',1900,'en',NULL,12.3,1,4,NULL), (22,16,'How to Think Like Sherlock Holmes',1900,'en',NULL,15.2,1,4,NULL), (23,17,'Data Scientists at Work',1900,'en',NULL,15.2,1,4,NULL), (24,18,'Slaughterhouse Five',1900,'en',NULL,15.2,1,4,NULL), (25,19,'Birth of a Theorem',1900,'en',NULL,10.5,1,4,NULL), (26,20,'Structure & Interpretation of Computer Programs',1900,'en',NULL,10.5,1,4,NULL), (27,21,'The Age of Wrath',1900,'en',NULL,10.5,1,4,NULL), (28,22,'The Trial',1900,'en',NULL,15.5,1,4,NULL), (29,23,'Statistical Decision Theory',1900,'en',NULL,15.5,1,4,NULL), (30,24,'Data Mining Handbook',1900,'en',NULL,15.5,1,4,NULL), (31,25,'The New Machiavelli',1900,'en',NULL,15.5,1,4,NULL), (32,26,'Physics & Philosophy',1900,'en',NULL,10.2,1,4,NULL), (33,27,'Making Software',1900,'en',NULL,11.2,1,4,NULL), (34,28,'Vol I Analysis',1900,'en',NULL,15.3,1,4,NULL), (35,29,'Machine Learning for Hackers',1900,'en',NULL,10.5,1,4,NULL), (36,30,'The Signal and the Noise',1900,'en',NULL,12.5,1,4,NULL), (37,31,'Python for Data Analysis',1900,'en',NULL,10.0,1,4,NULL), (38,32,'Introduction to Algorithms',1900,'en',NULL,21.5,1,4,NULL), (39,33,'The Beautiful and the Damned',1900,'en',NULL,20.5,1,4,NULL), (40,34,'The Outsider',1900,'en',NULL,22.5,1,4,NULL), (41,3,'The - Vol I Complete Sherlock Holmes',1900,'en',NULL,23.5,1,4,NULL), (42,3,'The - Vol II Complete Sherlock Holmes',1900,'en',NULL,21.5,1,4,NULL), (43,37,'The Wealth of Nations',1900,'en',NULL,22.5,1,4,NULL), (44,38,'The Pillars of the Earth',1900,'en',NULL,24.5,1,4,NULL), (45,39,'The Tao of Physics',1900,'en',NULL,15.5,1,4,NULL), (46,40,'Surely You\s re Joking Mr Feynman',1900,'en',NULL,12.3,1,4,NULL), (47,41,'A Farewell to Arms',1900,'en',NULL,14.6,1,4,NULL), (48,42,'The Veteran',1900,'en',NULL,10.6,1,4,NULL), (49,43,'False Impressions',1900,'en',NULL,12.4,1,4,NULL), (50,44,'The Last Lecture',1900,'en',NULL,13.6,1,4,NULL), (51,45,'Return of the Primitive',1900,'en',NULL,14.3,1,4,NULL), (52,46,'Jurassic Park',1900,'en',NULL,13.5,1,4,NULL), (53,47,'A Russian Journal',1900,'en',NULL,17.5,1,4,NULL), (54,48,'Tales of Mystery and Imagination',1900,'en',NULL,19.5,1,4,NULL), (55,10,'Freakonomics',1900,'en',NULL,19.99,1,4,NULL), (56,39,'The Hidden Connections',1900,'en',NULL,15.98,1,4,NULL), (57,51,'The Story of Philosophy',1900,'en',NULL,14.89,1,4,NULL), (58,52,'Asami Asami',1900,'en',NULL,15.6,1,4,NULL), (59,47,'Journal of a Novel',1900,'en',NULL,14.5,1,4,NULL), (60,47,'Once There Was a War',1900,'en',NULL,14.6,1,4,NULL), (61,47,'The Moon is Down',1900,'en',NULL,21.5,1,4,NULL), (62,56,'The Brethren',1900,'en',NULL,22.6,1,4,NULL), (63,57,'In a Free State',1900,'en',NULL,22.4,1,4,NULL), (64,58,'Catch 22',1900,'en',NULL,20.5,1,4,NULL), (65,59,'The Complete Mastermind',1900,'en',NULL,14.6,1,4,NULL), (66,60,'Dylan on Dylan',1900,'en',NULL,13.8,1,4,NULL), (67,61,'Soft Computing & Intelligent Systems',1900,'en',NULL,17.8,1,4,NULL), (68,62,'Textbook of Economic Theory',1900,'en',NULL,17.4,1,4,NULL), (69,63,'Econometric Analysis',1900,'en',NULL,18.9,1,4,NULL), (70,64,'Learning OpenCV',1900,'en',NULL,18.54,1,4,NULL), (71,65,'Data Structures Using C & C++',1900,'en',NULL,17.6,1,4,NULL), (72,66,'A Modern Approach Computer Vision',1900,'en',NULL,13.5,1,4,NULL), (73,67,'Principles of Communication Systems',1900,'en',NULL,15.4,1,4,NULL), (74,68,'Let Us C',1900,'en',NULL,15.6,1,4,NULL), (75,69,'The Amulet of Samarkand',1900,'en',NULL,14.6,1,4,NULL), (76,70,'Crime and Punishment',1900,'en',NULL,17.5,1,4,NULL), (77,71,'Angels & Demons',1900,'en',NULL,15.3,1,4,NULL), (78,72,'The Argumentative Indian',1900,'en',NULL,18.9,1,4,NULL), (79,73,'Sea of Poppies',1900,'en',NULL,24.5,1,4,NULL), (80,72,'The Idea of Justice',1900,'en',NULL,26.3,1,4,NULL), (81,75,'A Raisin in the Sun',1900,'en',NULL,27.8,1,4,NULL), (82,76,'All the President\s Men',1900,'en',NULL,29.5,1,4,NULL), (83,43,'A Prisoner of Birth',1900,'en',NULL,28.7,1,4,NULL), (84,78,'Scoop!',1900,'en',NULL,28.9,1,4,NULL), (85,79,'Ahe Manohar Tari',1900,'en',NULL,24.1,1,4,NULL), (86,80,'The Last Mughal',1900,'en',NULL,15.3,1,4,NULL), (87,81,'Vol 39 No. 1 Social Choice & Welfare',1900,'en',NULL,13.6,1,4,NULL), (88,52,'Radiowaril Bhashane & Shrutika',1900,'en',NULL,18.4,1,4,NULL), (89,52,'Gun Gayin Awadi',1900,'en',NULL,24.1,1,4,NULL), (90,52,'Aghal Paghal',1900,'en',NULL,26.68,1,4,NULL), (91,85,'Maqta-e-Ghalib',1900,'en',NULL,25.3,1,4,NULL), (92,86,'Manasa',1900,'en',NULL,24.3,1,4,NULL), (93,87,'India from Midnight to Milennium',1900,'en',NULL,23.6,1,4,NULL), (94,87,'The Great Indian Novel',1900,'en',NULL,21.0,1,4,NULL), (95,89,'O Jerusalem!',1900,'en',NULL,20.20,1,4,NULL), (96,89,'The City of Joy',1900,'en',NULL,20.0,1,4,NULL), (97,89,'Freedom at Midnight',1900,'en',NULL,19.98,1,4,NULL), (98,47,'The Winter of Our Discontent',1900,'en',NULL,27.0,1,4,NULL), (99,93,'On Education',1900,'en',NULL,21.8,1,4,NULL), (100,94,'Free Will',1900,'en',NULL,11.4,1,4,NULL), (101,87,'Bookless in Baghdad',1900,'en',NULL,13.6,1,4,NULL), (102,96,'The Case of the Lame Canary',1900,'en',NULL,15.6,1,4,NULL), (103,9,'The Theory of Everything',1900,'en',NULL,14.6,1,4,NULL), (104,98,'New Markets & Other Essays',1900,'en',NULL,13.5,1,4,NULL), (105,99,'Electric Universe',1900,'en',NULL,18.5,1,4,NULL), (106,100,'The Hunchback of Notre Dame',1900,'en',NULL,17.7,1,4,NULL), (107,47,'Burning Bright',1900,'en',NULL,17.7,1,4,NULL), (108,98,'The Age of Discontuinity',1900,'en',NULL,15.5,1,4,NULL), (109,103,'Doctor in the Nude',1900,'en',NULL,24.1,1,4,NULL), (110,104,'Down and Out in Paris & London',1900,'en',NULL,13.3,1,4,NULL), (111,72,'Identity & Violence',1900,'en',NULL,16.65,1,4,NULL), (112,80,'Beyond the Three Seas',1900,'en',NULL,15.21,1,4,NULL), (113,107,'Talking Straight',1900,'en',NULL,17.5,1,4,NULL), (114,108,'Vol 3 Maugham\s Collected Short Stories',1900,'en',NULL,14.4,1,4,NULL), (115,42,'The Phantom of Manhattan',1900,'en',NULL,14.23,1,4,NULL), (116,108,'Ashenden of The British Agent',1900,'en',NULL,13.25,1,4,NULL), (117,111,'Zen & The Art of Motorcycle Maintenance',1900,'en',NULL,17.8,1,4,NULL), (118,112,'The Great War for Civilization',1900,'en',NULL,17.8,1,4,NULL), (119,45,'We the Living',1900,'en',NULL,16.5,1,4,NULL), (120,114,'The Artist and the Mathematician',1900,'en',NULL,12.21,1,4,NULL), (121,93,'History of Western Philosophy',1900,'en',NULL,21.12,1,4,NULL), (122,72,'Rationality & Freedom',1900,'en',NULL,8.6,1,4,NULL), (123,117,'Clash of Civilizations and Remaking of the World Order',1900,'en',NULL,12.3,1,4,NULL), (124,39,'Uncommon Wisdom',1900,'en',NULL,11.20,1,4,NULL), (125,119,'One',1900,'en',NULL,11.01,1,4,NULL), (126,120,'To Sir With Love',1900,'en',NULL,18.7,1,4,NULL), (127,121,'Half A Life',1900,'en',NULL,24.42,1,4,NULL), (128,122,'The Discovery of India',1900,'en',NULL,23.25,1,4,NULL), (129,52,'Apulki',1900,'en',NULL,21.09,1,4,NULL), (130,93,'Unpopular Essays',1900,'en',NULL,12.65,1,4,NULL), (131,42,'The Deceiver',1900,'en',NULL,13.51,1,4,NULL), (132,76,'Veil: Secret Wars of the CIA',1900,'en',NULL,41.20,1,4,NULL), (133,52,'Char Shabda',1900,'en',NULL,14.32,1,4,NULL), (134,128,'Rosy is My Relative',1900,'en',NULL,42.5,1,4,NULL), (135,108,'The Moon and Sixpence',1900,'en',NULL,14.30,1,4,NULL), (136,130,'A Short History of the World',1900,'en',NULL,18.68,1,4,NULL), (137,108,'The Trembling of a Leaf',1900,'en',NULL,17.21,1,4,NULL), (138,103,'Doctor on the Brain',1900,'en',NULL,21.10,1,4,NULL), (139,133,'Simpsons & Their Mathematical Secrets',1900,'en',NULL,21.41,1,4,NULL), (140,134,'Pattern Classification',1900,'en',NULL,21.4,1,4,NULL), (141,135,'From Beirut to Jerusalem',1900,'en',NULL,22.32,1,4,NULL), (142,133,'The Code Book',1900,'en',NULL,24.1,1,4,NULL), (143,112,'The Age of the Warrior',1900,'en',NULL,10.62,1,4,NULL), (144,138,'The Numbers Behind Numb3rs',1900,'en',NULL,11.56,1,4,NULL), (145,47,'A Life in Letters',1900,'en',NULL,14.3,1,4,NULL), (146,140,'The Information',1900,'en',NULL,16.15,1,4,NULL), (147,141,'Elements of Information Theory',1900,'en',NULL,17.52,1,4,NULL), (148,142,'Power Electronics - Rashid',1900,'en',NULL,14.10,1,4,NULL), (149,143,'Power Electronics - Mohan',1900,'en',NULL,17.51,1,4,NULL), (150,144,'Neural Networks',1900,'en',NULL,21.20,1,4,NULL), (151,47,'The Grapes of Wrath',1900,'en',NULL,10.52,1,4,NULL), (152,52,'Vyakti ani Valli',1900,'en',NULL,10.10,1,4,NULL), (153,12,'Statistical Learning Theory',1900,'en',NULL,10.99,1,4,NULL), (154,148,'Empire of the Mughal - The Tainted Throne',1900,'en',NULL,10.87,1,4,NULL), (155,148,'Empire of the Mughal - Brothers at War',1900,'en',NULL,14.25,1,4,NULL), (156,148,'Empire of the Mughal - Ruler of the World',1900,'en',NULL,18.58,1,4,NULL), (157,148,'Empire of the Mughal - The Serpent\s Tooth',1900,'en',NULL,14.65,1,4,NULL), (158,148,'Empire of the Mughal - Raiders from the North',1900,'en',NULL,17.89,1,4,NULL), (159,153,'Mossad',1900,'en',NULL,14.56,1,4,NULL), (160,154,'Jim Corbett Omnibus',1900,'en',NULL,14.19,1,4,NULL), (161,155,'20000 Leagues Under the Sea',1900,'en',NULL,19.41,1,4,NULL), (162,156,'Batatyachi Chal',1900,'en',NULL,18.57,1,4,NULL), (163,156,'Hafasavnuk',1900,'en',NULL,24.12,1,4,NULL), (164,156,'Urlasurla',1900,'en',NULL,12.35,1,4,NULL), (165,68,'Pointers in C',1900,'en',NULL,45.4,1,4,NULL), (166,160,'The Cathedral and the Bazaar',1900,'en',NULL,14.25,1,4,NULL), (167,161,'Design with OpAmps',1900,'en',NULL,14.21,1,4,NULL), (168,162,'Think Complexity',1900,'en',NULL,12.63,1,4,NULL), (169,163,'The Devil\s Advocate',1900,'en',NULL,14.56,1,4,NULL), (170,45,'Ayn Rand Answers',1900,'en',NULL,24.24,1,4,NULL), (171,45,'Philosophy: Who Needs It',1900,'en',NULL,13.52,1,4,NULL), (172,166,'Data Analysis with Open Source Tools',1900,'en',NULL,18.9,1,4,NULL), (173,167,'Broca\s Brain',1900,'en',NULL,18.98,1,4,NULL), (174,168,'Men of Mathematics',1900,'en',NULL,17.54,1,4,NULL), (175,169,'Oxford book of Modern Science Writing',1900,'en',NULL,17.58,1,4,NULL), (176,170,'Judiciary and Democracy Justice',1900,'en',NULL,14.89,1,4,NULL), (177,171,'The Arthashastra',1900,'en',NULL,15.87,1,4,NULL), (178,172,'We the People',1900,'en',NULL,16.25,1,4,NULL), (179,172,'We the Nation',1900,'en',NULL,11.145,1,4,NULL), (180,174,'The Courtroom Genius',1900,'en',NULL,12.25,1,4,NULL), (181,175,'Dongri to Dubai',1900,'en',NULL,14.00,1,4,NULL), (182,176,'Foundation History of England',1900,'en',NULL,16.52,1,4,NULL), (183,80,'City of Djinns',1900,'en',NULL,17.52,1,4,NULL), (184,178,'India\s Legal System',1900,'en',NULL,13.25,1,4,NULL), (185,179,'More Tears to Cry',1900,'en',NULL,18.65,1,4,NULL), (186,180,'The Ropemaker',1900,'en',NULL,17.85,1,4,NULL), (188,182,'The Prince',1900,'en',NULL,19.52,1,4,NULL), (189,183,'Eyeless in Gaza',1900,'en',NULL,13.25,1,4,NULL), (190,184,'Tales of Beedle the Bard',1900,'en',NULL,25.63,1,4,NULL), (191,185,'Girl with the Dragon Tattoo',1900,'en',NULL,18.58,1,4,NULL), (192,185,'Girl who kicked the Hornet\s Nest',1900,'en',NULL,17.56,1,4,NULL), (193,185,'Girl who played with Fire',1900,'en',NULL,16.52,1,4,NULL), (194,28,'Structure and Randomness',1900,'en',NULL,16.34,1,4,NULL), (195,189,'Image Processing with MATLAB',1900,'en',NULL,13.28,1,4,NULL), (196,104,'Animal Farm',1900,'en',NULL,24.24,1,4,NULL), (197,70,'The Idiot',1900,'en',NULL,26.34,1,4,NULL), (198,192,'A Christmas Carol',1900,'en',NULL,27.17,1,4,NULL);
Tuve que limpiar algunas comillas simples por que sobraban. :)
Recordar que tienen que estar en la misma carpeta del script, al momento de ejecutar el comando
excelente , gracias por el aporte .. .
Solo me aparecen con precio los primeros libros ya todos los demas me muestra con null :/
eso es porque no tienes datos en los precios ve el primer comentario
Las funciones built-in de MySql aligeran el trabajo de un backend, ya teniendo datos procesados el backend puede visualizarlas en un frontend.