Develop a SQLAlchemy Python script that will take a big MariaDB database stored on a sql…
- User
Develop a SQLAlchemy Python script that will take a big MariaDB database stored on a sql file in the same directory (example.sql) and will return a small subset of the same database but making sure that no references are lost on the entries that are included, this means that it must be fully self-included. There is spanish text with spanish characters on the database so you must account for that. Finally I will provide the first few lines of the database so you understand how it works.
-- MariaDB dump 10.19 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64)
-- Host: localhost Database: project_ciiae
-- Server version 10.11.6-MariaDB-0+deb12u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /; /!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /; /!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /; /!40101 SET NAMES utf8mb4 /; /!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE /; /!40103 SET TIME_ZONE='+00:00' /; /!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 /; /!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 /; /!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' /; /!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-- -- Table structure for table
actuacionesDROP TABLE IF EXISTS
actuaciones; /*!40101 SET @saved_cs_client = @@character_set_client /; /!40101 SET character_set_client = utf8 /; CREATE TABLEactuaciones(idint(11) NOT NULL AUTO_INCREMENT,fechadate NOT NULL,horatime NOT NULL,idempresaint(11) NOT NULL,idcontactovarchar(250) DEFAULT NULL,idmedio_contactoint(11) DEFAULT NULL,idtipos_consultasint(11) DEFAULT NULL,idmedios_financiacionint(11) DEFAULT NULL,idconexiones_sectiint(11) DEFAULT NULL,descripcionblob DEFAULT NULL,idusuariovarchar(250) DEFAULT NULL,idproyectoint(11) NOT NULL DEFAULT 0,idfaseint(11) NOT NULL DEFAULT 0,idactividadint(11) NOT NULL DEFAULT 0,observacionesblob DEFAULT NULL,tipo_actint(1) NOT NULL DEFAULT 0,fichero_tablavarchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,idempresa_conectadaint(11) NOT NULL DEFAULT 0,idgrupo_conectadoint(11) NOT NULL DEFAULT 0,fichero_conexion_efectivavarchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, int(1) NOT NULL DEFAULT 0, int(11) NOT NULL DEFAULT 0, varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, int(1) NOT NULL DEFAULT 1, PRIMARY KEY (,,,), KEY (), KEY (), KEY (), KEY (), KEY (), KEY () ) ENGINE=MyISAM AUTO_INCREMENT=7206 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish_ci; /!40101 SET character_set_client = @saved_cs_client */; - Assistant