[{"data":1,"prerenderedAt":6872},["ShallowReactive",2],{"tutorials-pandas":3,"category-items-pandas":387,"content-/pandas/database-export":388},[4,21,31,40,49,58,67,78,87,96,105,116,125,134,143,154,163,172,181,192,201,210,219,228,239,248,257,266,276,285,294,303,313,322,331,341,350,359,369,378],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":6,"title":8,"description":9,"slug":10,"order":11,"isParent":12,"icon":13,"_type":14,"_id":15,"_source":16,"_file":17,"_stem":18,"_extension":19,"children":20,"expanded":12},"/pandas","",false,"Getting Started","Learn the basics of Pandas, Python's powerful data analysis library for working with spreadsheet-like data","getting-started",1,true,"pi pi-play","markdown","content:pandas:1.index.md","content","pandas/1.index.md","pandas/1.index","md",[21,31,40,49,58],{"_path":22,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":14,"_id":28,"_source":16,"_file":29,"_stem":30,"_extension":19},"/pandas/what-is-pandas","pandas","What is Pandas","Understand what Pandas is, why it's essential for data analysis, and how it makes working with data simple and powerful","what-is-pandas",2,"content:pandas:2.what-is-pandas.md","pandas/2.what-is-pandas.md","pandas/2.what-is-pandas",{"_path":32,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":14,"_id":37,"_source":16,"_file":38,"_stem":39,"_extension":19},"/pandas/installing-pandas","Installing Pandas","Learn how to install Pandas on your computer and verify it's working properly","installing-pandas",3,"content:pandas:3.installing-pandas.md","pandas/3.installing-pandas.md","pandas/3.installing-pandas",{"_path":41,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":14,"_id":46,"_source":16,"_file":47,"_stem":48,"_extension":19},"/pandas/your-first-dataframe","Your First DataFrame","Create your first Pandas DataFrame and learn the basics of working with tabular data","your-first-dataframe",4,"content:pandas:4.your-first-dataframe.md","pandas/4.your-first-dataframe.md","pandas/4.your-first-dataframe",{"_path":50,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":14,"_id":55,"_source":16,"_file":56,"_stem":57,"_extension":19},"/pandas/series-vs-dataframe","Series vs DataFrame","Understand the difference between Pandas Series and DataFrames, and learn when to use each one","series-vs-dataframe",5,"content:pandas:5.series-vs-dataframe.md","pandas/5.series-vs-dataframe.md","pandas/5.series-vs-dataframe",{"_path":59,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":14,"_id":64,"_source":16,"_file":65,"_stem":66,"_extension":19},"/pandas/basic-dataframe-info","Basic DataFrame Info","Learn how to explore and get basic information about your DataFrames to understand your data","basic-dataframe-info",6,"content:pandas:6.basic-dataframe-info.md","pandas/6.basic-dataframe-info.md","pandas/6.basic-dataframe-info",{"_path":68,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":69,"description":70,"slug":71,"order":72,"isParent":12,"icon":73,"_type":14,"_id":74,"_source":16,"_file":75,"_stem":76,"_extension":19,"children":77,"expanded":12},"/pandas/loading-data","Loading Data","Learn how to load data from various sources into Pandas DataFrames","loading-data",7,"pi pi-download","content:pandas:7.loading-data.md","pandas/7.loading-data.md","pandas/7.loading-data",[78,87,96],{"_path":79,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":80,"description":81,"slug":82,"parentId":68,"order":83,"_type":14,"_id":84,"_source":16,"_file":85,"_stem":86,"_extension":19},"/pandas/reading-files","Reading Files (CSV, Excel, JSON)","Learn how to load data from CSV, Excel, and JSON files into Pandas DataFrames","reading-files",8,"content:pandas:8.reading-files.md","pandas/8.reading-files.md","pandas/8.reading-files",{"_path":88,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":89,"description":90,"slug":91,"parentId":68,"order":92,"_type":14,"_id":93,"_source":16,"_file":94,"_stem":95,"_extension":19},"/pandas/loading-from-databases","Loading from Databases","Learn how to connect to databases and load data directly into Pandas DataFrames","loading-from-databases",9,"content:pandas:9.loading-from-databases.md","pandas/9.loading-from-databases.md","pandas/9.loading-from-databases",{"_path":97,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":98,"description":99,"slug":100,"parentId":68,"order":101,"_type":14,"_id":102,"_source":16,"_file":103,"_stem":104,"_extension":19},"/pandas/handling-file-errors","Handling File Errors","Learn how to handle common errors when loading data files and how to troubleshoot loading problems","handling-file-errors",10,"content:pandas:10.handling-file-errors.md","pandas/10.handling-file-errors.md","pandas/10.handling-file-errors",{"_path":106,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":107,"description":108,"slug":109,"order":110,"isParent":12,"icon":111,"_type":14,"_id":112,"_source":16,"_file":113,"_stem":114,"_extension":19,"children":115,"expanded":12},"/pandas/data-exploration","Data Exploration","Learn how to explore and understand your data using Pandas methods and techniques","data-exploration",11,"pi pi-search","content:pandas:11.data-exploration.md","pandas/11.data-exploration.md","pandas/11.data-exploration",[116,125,134],{"_path":117,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":118,"description":119,"slug":120,"parentId":106,"order":121,"_type":14,"_id":122,"_source":16,"_file":123,"_stem":124,"_extension":19},"/pandas/viewing-your-data","Viewing Your Data","Learn different ways to look at and sample your DataFrame data for exploration and understanding","viewing-your-data",12,"content:pandas:12.viewing-your-data.md","pandas/12.viewing-your-data.md","pandas/12.viewing-your-data",{"_path":126,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":127,"description":128,"slug":129,"parentId":106,"order":130,"_type":14,"_id":131,"_source":16,"_file":132,"_stem":133,"_extension":19},"/pandas/data-shape-and-statistics","Data Shape and Statistics","Learn how to understand your DataFrame's size, structure, and get basic statistical summaries","data-shape-and-statistics",13,"content:pandas:13.data-shape-and-statistics.md","pandas/13.data-shape-and-statistics.md","pandas/13.data-shape-and-statistics",{"_path":135,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":136,"description":137,"slug":138,"parentId":106,"order":139,"_type":14,"_id":140,"_source":16,"_file":141,"_stem":142,"_extension":19},"/pandas/column-information-and-data-types","Column Information and Data Types","Learn how to explore individual columns and understand different data types in your DataFrames","column-information-and-data-types",14,"content:pandas:14.column-information-and-data-types.md","pandas/14.column-information-and-data-types.md","pandas/14.column-information-and-data-types",{"_path":144,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":145,"description":146,"slug":147,"order":148,"isParent":12,"icon":149,"_type":14,"_id":150,"_source":16,"_file":151,"_stem":152,"_extension":19,"children":153,"expanded":12},"/pandas/selecting-data","Selecting Data","Learn how to select specific columns, rows, and subsets of data from your DataFrames","selecting-data",15,"pi pi-filter","content:pandas:15.selecting-data.md","pandas/15.selecting-data.md","pandas/15.selecting-data",[154,163,172],{"_path":155,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":156,"description":157,"slug":158,"parentId":144,"order":159,"_type":14,"_id":160,"_source":16,"_file":161,"_stem":162,"_extension":19},"/pandas/selecting-columns-and-rows","Selecting Columns and Rows","Learn how to select specific columns and rows from your DataFrames using basic selection techniques","selecting-columns-and-rows",16,"content:pandas:16.selecting-columns-and-rows.md","pandas/16.selecting-columns-and-rows.md","pandas/16.selecting-columns-and-rows",{"_path":164,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":165,"description":166,"slug":167,"parentId":144,"order":168,"_type":14,"_id":169,"_source":16,"_file":170,"_stem":171,"_extension":19},"/pandas/using-loc-and-iloc","Using loc and iloc","Master precise data selection with label-based (loc) and position-based (iloc) indexing in pandas","using-loc-and-iloc",17,"content:pandas:17.using-loc-and-iloc.md","pandas/17.using-loc-and-iloc.md","pandas/17.using-loc-and-iloc",{"_path":173,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":174,"description":175,"slug":176,"parentId":144,"order":177,"_type":14,"_id":178,"_source":16,"_file":179,"_stem":180,"_extension":19},"/pandas/boolean-and-conditional-selection","Boolean and Conditional Selection","Learn to filter DataFrames using conditions, boolean logic, and multiple criteria for precise data selection","boolean-and-conditional-selection",18,"content:pandas:18.boolean-and-conditional-selection.md","pandas/18.boolean-and-conditional-selection.md","pandas/18.boolean-and-conditional-selection",{"_path":182,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":183,"description":184,"slug":185,"order":186,"isParent":12,"icon":187,"_type":14,"_id":188,"_source":16,"_file":189,"_stem":190,"_extension":19,"children":191,"expanded":12},"/pandas/data-cleaning","Data Cleaning","Learn essential data cleaning techniques to prepare messy data for analysis","data-cleaning",19,"pi pi-wrench","content:pandas:19.data-cleaning.md","pandas/19.data-cleaning.md","pandas/19.data-cleaning",[192,201,210,219],{"_path":193,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":194,"description":195,"slug":196,"parentId":182,"order":197,"_type":14,"_id":198,"_source":16,"_file":199,"_stem":200,"_extension":19},"/pandas/handling-missing-data","Handling Missing Data","Learn to identify, fill, and remove missing values in your DataFrames effectively","handling-missing-data",20,"content:pandas:20.handling-missing-data.md","pandas/20.handling-missing-data.md","pandas/20.handling-missing-data",{"_path":202,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":203,"description":204,"slug":205,"parentId":182,"order":206,"_type":14,"_id":207,"_source":16,"_file":208,"_stem":209,"_extension":19},"/pandas/removing-duplicates","Removing Duplicates","Learn to find and eliminate duplicate rows from your DataFrames to ensure data quality","removing-duplicates",21,"content:pandas:21.removing-duplicates.md","pandas/21.removing-duplicates.md","pandas/21.removing-duplicates",{"_path":211,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":212,"description":213,"slug":214,"parentId":182,"order":215,"_type":14,"_id":216,"_source":16,"_file":217,"_stem":218,"_extension":19},"/pandas/data-type-conversion","Data Type Conversion","Learn to convert data to the right types for proper analysis and calculations","data-type-conversion",22,"content:pandas:22.data-type-conversion.md","pandas/22.data-type-conversion.md","pandas/22.data-type-conversion",{"_path":220,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":221,"description":222,"slug":223,"parentId":182,"order":224,"_type":14,"_id":225,"_source":16,"_file":226,"_stem":227,"_extension":19},"/pandas/string-cleaning-operations","String Cleaning Operations","Learn to clean and standardize text data for consistent analysis using pandas string methods","string-cleaning-operations",23,"content:pandas:23.string-cleaning-operations.md","pandas/23.string-cleaning-operations.md","pandas/23.string-cleaning-operations",{"_path":229,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":230,"description":231,"slug":232,"order":233,"isParent":12,"icon":234,"_type":14,"_id":235,"_source":16,"_file":236,"_stem":237,"_extension":19,"children":238,"expanded":12},"/pandas/data-transformation","Data Transformation","Learn how to modify, add, and transform data in your DataFrames for analysis","data-transformation",24,"pi pi-folder","content:pandas:24.data-transformation.md","pandas/24.data-transformation.md","pandas/24.data-transformation",[239,248,257],{"_path":240,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":241,"description":242,"slug":243,"parentId":229,"order":244,"_type":14,"_id":245,"_source":16,"_file":246,"_stem":247,"_extension":19},"/pandas/adding-and-modifying-columns","Adding and Modifying Columns","Learn how to create new columns and update existing ones with calculations and conditional logic","adding-and-modifying-columns",25,"content:pandas:25.adding-and-modifying-columns.md","pandas/25.adding-and-modifying-columns.md","pandas/25.adding-and-modifying-columns",{"_path":249,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":250,"description":251,"slug":252,"parentId":229,"order":253,"_type":14,"_id":254,"_source":16,"_file":255,"_stem":256,"_extension":19},"/pandas/applying-functions","Applying Functions","Use built-in and custom functions to transform your data efficiently","applying-functions",26,"content:pandas:26.applying-functions.md","pandas/26.applying-functions.md","pandas/26.applying-functions",{"_path":258,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":259,"description":260,"slug":261,"parentId":229,"order":262,"_type":14,"_id":263,"_source":16,"_file":264,"_stem":265,"_extension":19},"/pandas/renaming-and-sorting-data","Renaming and Sorting Data","Organize your DataFrame with better column names and logical data ordering","renaming-and-sorting-data",27,"content:pandas:27.renaming-and-sorting-data.md","pandas/27.renaming-and-sorting-data.md","pandas/27.renaming-and-sorting-data",{"_path":267,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":268,"description":269,"slug":270,"order":271,"isParent":12,"icon":234,"_type":14,"_id":272,"_source":16,"_file":273,"_stem":274,"_extension":19,"children":275,"expanded":12},"/pandas/grouping-and-aggregation","Grouping and Aggregation","Learn to group data and calculate summary statistics for powerful data analysis","grouping-and-aggregation",28,"content:pandas:28.grouping-and-aggregation.md","pandas/28.grouping-and-aggregation.md","pandas/28.grouping-and-aggregation",[276,285,294],{"_path":277,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":278,"description":279,"slug":280,"parentId":267,"order":281,"_type":14,"_id":282,"_source":16,"_file":283,"_stem":284,"_extension":19},"/pandas/groupby-operations","GroupBy Operations","Learn the fundamentals of splitting data into groups and basic aggregations","groupby-operations",29,"content:pandas:29.groupby-operations.md","pandas/29.groupby-operations.md","pandas/29.groupby-operations",{"_path":286,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":287,"description":288,"slug":289,"parentId":267,"order":290,"_type":14,"_id":291,"_source":16,"_file":292,"_stem":293,"_extension":19},"/pandas/aggregation-functions","Aggregation Functions","Explore different ways to summarize your grouped data with built-in and custom functions","aggregation-functions",30,"content:pandas:30.aggregation-functions.md","pandas/30.aggregation-functions.md","pandas/30.aggregation-functions",{"_path":295,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":296,"description":297,"slug":298,"parentId":267,"order":299,"_type":14,"_id":300,"_source":16,"_file":301,"_stem":302,"_extension":19},"/pandas/pivot-tables-and-cross-tabulation","Pivot Tables and Cross Tabulation","Create powerful summary tables and cross-tabulations for analysis","pivot-tables-and-cross-tabulation",31,"content:pandas:31.pivot-tables-and-cross-tabulation.md","pandas/31.pivot-tables-and-cross-tabulation.md","pandas/31.pivot-tables-and-cross-tabulation",{"_path":304,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":305,"description":306,"slug":307,"order":308,"isParent":12,"icon":234,"_type":14,"_id":309,"_source":16,"_file":310,"_stem":311,"_extension":19,"children":312,"expanded":12},"/pandas/combining-data","Combining Data","Learn to combine data from multiple DataFrames for comprehensive analysis","combining-data",32,"content:pandas:32.combining-data.md","pandas/32.combining-data.md","pandas/32.combining-data",[313,322],{"_path":314,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":315,"description":316,"slug":317,"parentId":304,"order":318,"_type":14,"_id":319,"_source":16,"_file":320,"_stem":321,"_extension":19},"/pandas/concatenating-dataframes","Concatenating DataFrames","Learn to stack DataFrames vertically and horizontally for simple data combination","concatenating-dataframes",33,"content:pandas:33.concatenating-dataframes.md","pandas/33.concatenating-dataframes.md","pandas/33.concatenating-dataframes",{"_path":323,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":324,"description":325,"slug":326,"parentId":304,"order":327,"_type":14,"_id":328,"_source":16,"_file":329,"_stem":330,"_extension":19},"/pandas/merging-and-join-operations","Merging and Join Operations","Master different types of joins to combine related data from multiple sources","merging-and-join-operations",34,"content:pandas:34.merging-and-join-operations.md","pandas/34.merging-and-join-operations.md","pandas/34.merging-and-join-operations",{"_path":332,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":333,"description":334,"slug":335,"order":336,"isParent":12,"icon":234,"_type":14,"_id":337,"_source":16,"_file":338,"_stem":339,"_extension":19,"children":340,"expanded":12},"/pandas/working-with-dates","Working with Dates","Master date and time operations for time-based analysis and reporting","working-with-dates",35,"content:pandas:35.working-with-dates.md","pandas/35.working-with-dates.md","pandas/35.working-with-dates",[341,350],{"_path":342,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":343,"description":344,"slug":345,"parentId":332,"order":346,"_type":14,"_id":347,"_source":16,"_file":348,"_stem":349,"_extension":19},"/pandas/datetime-operations","DateTime Operations","Learn to convert, manipulate, and extract information from dates and times","datetime-operations",36,"content:pandas:36.datetime-operations.md","pandas/36.datetime-operations.md","pandas/36.datetime-operations",{"_path":351,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":352,"description":353,"slug":354,"parentId":332,"order":355,"_type":14,"_id":356,"_source":16,"_file":357,"_stem":358,"_extension":19},"/pandas/time-series-and-resampling","Time Series and Resampling","Discover how to analyze data over time periods and aggregate by different time intervals","time-series-and-resampling",37,"content:pandas:37.time-series-and-resampling.md","pandas/37.time-series-and-resampling.md","pandas/37.time-series-and-resampling",{"_path":360,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":361,"description":362,"slug":363,"order":364,"isParent":12,"icon":234,"_type":14,"_id":365,"_source":16,"_file":366,"_stem":367,"_extension":19,"children":368,"expanded":12},"/pandas/saving-your-work","Saving Your Work","Learn to export your analyzed data to different formats for sharing and reporting","saving-your-work",38,"content:pandas:38.saving-your-work.md","pandas/38.saving-your-work.md","pandas/38.saving-your-work",[369,378],{"_path":370,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":371,"description":372,"slug":373,"parentId":360,"order":374,"_type":14,"_id":375,"_source":16,"_file":376,"_stem":377,"_extension":19},"/pandas/exporting-data","Exporting Data (CSV, Excel, JSON)","Learn to save your DataFrames to common file formats for sharing and reporting","exporting-data",39,"content:pandas:39.exporting-data.md","pandas/39.exporting-data.md","pandas/39.exporting-data",{"_path":379,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":380,"description":381,"slug":382,"parentId":360,"order":383,"_type":14,"_id":384,"_source":16,"_file":385,"_stem":386,"_extension":19},"/pandas/database-export","Database Export","Discover how to save data back to databases for integration with other systems","database-export",40,"content:pandas:40.database-export.md","pandas/40.database-export.md","pandas/40.database-export",[378],{"_path":379,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":380,"description":381,"slug":382,"parentId":360,"order":383,"body":389,"_type":14,"_id":384,"_source":16,"_file":385,"_stem":386,"_extension":19},{"type":390,"children":391,"toc":6857},"root",[392,401,407,412,1046,1053,1058,1192,1198,1203,1407,1413,1418,2063,2070,2966,2972,2977,3102,3108,3838,3844,3849,3977,4839,4845,4850,6408,6414,6419,6579,6585,6776,6782,6787,6815,6823,6846,6851],{"type":393,"tag":394,"props":395,"children":397},"element","h1",{"id":396},"️-database-export",[398],{"type":399,"value":400},"text","🗄️ Database Export",{"type":393,"tag":402,"props":403,"children":404},"p",{},[405],{"type":399,"value":406},"Saving your analyzed data back to databases is essential for integrating with other systems! Whether you're updating a data warehouse, feeding results to a web application, or creating data pipelines, pandas makes database export straightforward and reliable.",{"type":393,"tag":402,"props":408,"children":409},{},[410],{"type":399,"value":411},"Think of database export like delivering your analysis results directly to the systems that need them, creating a seamless data workflow.",{"type":393,"tag":413,"props":414,"children":415},"code-try",{},[416],{"type":393,"tag":417,"props":418,"children":422},"pre",{"className":419,"code":420,"language":421,"meta":6,"style":6},"language-python shiki shiki-themes github-light github-dark","import pandas as pd\nimport sqlite3\n\n# Sample processed data ready for database\nprocessed_data = pd.DataFrame({\n    'customer_id': [1001, 1002, 1003, 1004],\n    'total_orders': [8, 12, 5, 15],\n    'total_spent': [2450.75, 3890.25, 1205.50, 4560.00],\n    'customer_segment': ['Premium', 'Premium', 'Standard', 'Premium'],\n    'last_order_date': pd.to_datetime(['2023-03-15', '2023-03-20', '2023-03-10', '2023-03-25'])\n})\n\nprint(\"Processed customer data:\")\nprint(processed_data)\nprint()\n\n# Create connection to SQLite database (file-based, no server needed)\nconn = sqlite3.connect('customer_analysis.db')\n\n# Export DataFrame to database table\nprocessed_data.to_sql('customer_summary', conn, if_exists='replace', index=False)\nprint(\"✅ Data exported to database table: customer_summary\")\n\n# Verify the export by reading back\nverification = pd.read_sql('SELECT * FROM customer_summary', conn)\nprint(\"\\nVerification - data in database:\")\nprint(verification)\n\n# Close connection\nconn.close()\n","python",[423],{"type":393,"tag":424,"props":425,"children":426},"code",{"__ignoreMap":6},[427,454,466,474,483,501,554,602,650,696,746,754,761,784,796,808,815,823,849,856,864,919,939,946,954,981,1011,1023,1030,1038],{"type":393,"tag":428,"props":429,"children":431},"span",{"class":430,"line":11},"line",[432,438,444,449],{"type":393,"tag":428,"props":433,"children":435},{"style":434},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[436],{"type":399,"value":437},"import",{"type":393,"tag":428,"props":439,"children":441},{"style":440},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[442],{"type":399,"value":443}," pandas ",{"type":393,"tag":428,"props":445,"children":446},{"style":434},[447],{"type":399,"value":448},"as",{"type":393,"tag":428,"props":450,"children":451},{"style":440},[452],{"type":399,"value":453}," pd\n",{"type":393,"tag":428,"props":455,"children":456},{"class":430,"line":27},[457,461],{"type":393,"tag":428,"props":458,"children":459},{"style":434},[460],{"type":399,"value":437},{"type":393,"tag":428,"props":462,"children":463},{"style":440},[464],{"type":399,"value":465}," sqlite3\n",{"type":393,"tag":428,"props":467,"children":468},{"class":430,"line":36},[469],{"type":393,"tag":428,"props":470,"children":471},{"emptyLinePlaceholder":12},[472],{"type":399,"value":473},"\n",{"type":393,"tag":428,"props":475,"children":476},{"class":430,"line":45},[477],{"type":393,"tag":428,"props":478,"children":480},{"style":479},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[481],{"type":399,"value":482},"# Sample processed data ready for database\n",{"type":393,"tag":428,"props":484,"children":485},{"class":430,"line":54},[486,491,496],{"type":393,"tag":428,"props":487,"children":488},{"style":440},[489],{"type":399,"value":490},"processed_data ",{"type":393,"tag":428,"props":492,"children":493},{"style":434},[494],{"type":399,"value":495},"=",{"type":393,"tag":428,"props":497,"children":498},{"style":440},[499],{"type":399,"value":500}," pd.DataFrame({\n",{"type":393,"tag":428,"props":502,"children":503},{"class":430,"line":63},[504,510,515,521,526,531,535,540,544,549],{"type":393,"tag":428,"props":505,"children":507},{"style":506},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[508],{"type":399,"value":509},"    'customer_id'",{"type":393,"tag":428,"props":511,"children":512},{"style":440},[513],{"type":399,"value":514},": [",{"type":393,"tag":428,"props":516,"children":518},{"style":517},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[519],{"type":399,"value":520},"1001",{"type":393,"tag":428,"props":522,"children":523},{"style":440},[524],{"type":399,"value":525},", ",{"type":393,"tag":428,"props":527,"children":528},{"style":517},[529],{"type":399,"value":530},"1002",{"type":393,"tag":428,"props":532,"children":533},{"style":440},[534],{"type":399,"value":525},{"type":393,"tag":428,"props":536,"children":537},{"style":517},[538],{"type":399,"value":539},"1003",{"type":393,"tag":428,"props":541,"children":542},{"style":440},[543],{"type":399,"value":525},{"type":393,"tag":428,"props":545,"children":546},{"style":517},[547],{"type":399,"value":548},"1004",{"type":393,"tag":428,"props":550,"children":551},{"style":440},[552],{"type":399,"value":553},"],\n",{"type":393,"tag":428,"props":555,"children":556},{"class":430,"line":72},[557,562,566,571,575,580,584,589,593,598],{"type":393,"tag":428,"props":558,"children":559},{"style":506},[560],{"type":399,"value":561},"    'total_orders'",{"type":393,"tag":428,"props":563,"children":564},{"style":440},[565],{"type":399,"value":514},{"type":393,"tag":428,"props":567,"children":568},{"style":517},[569],{"type":399,"value":570},"8",{"type":393,"tag":428,"props":572,"children":573},{"style":440},[574],{"type":399,"value":525},{"type":393,"tag":428,"props":576,"children":577},{"style":517},[578],{"type":399,"value":579},"12",{"type":393,"tag":428,"props":581,"children":582},{"style":440},[583],{"type":399,"value":525},{"type":393,"tag":428,"props":585,"children":586},{"style":517},[587],{"type":399,"value":588},"5",{"type":393,"tag":428,"props":590,"children":591},{"style":440},[592],{"type":399,"value":525},{"type":393,"tag":428,"props":594,"children":595},{"style":517},[596],{"type":399,"value":597},"15",{"type":393,"tag":428,"props":599,"children":600},{"style":440},[601],{"type":399,"value":553},{"type":393,"tag":428,"props":603,"children":604},{"class":430,"line":83},[605,610,614,619,623,628,632,637,641,646],{"type":393,"tag":428,"props":606,"children":607},{"style":506},[608],{"type":399,"value":609},"    'total_spent'",{"type":393,"tag":428,"props":611,"children":612},{"style":440},[613],{"type":399,"value":514},{"type":393,"tag":428,"props":615,"children":616},{"style":517},[617],{"type":399,"value":618},"2450.75",{"type":393,"tag":428,"props":620,"children":621},{"style":440},[622],{"type":399,"value":525},{"type":393,"tag":428,"props":624,"children":625},{"style":517},[626],{"type":399,"value":627},"3890.25",{"type":393,"tag":428,"props":629,"children":630},{"style":440},[631],{"type":399,"value":525},{"type":393,"tag":428,"props":633,"children":634},{"style":517},[635],{"type":399,"value":636},"1205.50",{"type":393,"tag":428,"props":638,"children":639},{"style":440},[640],{"type":399,"value":525},{"type":393,"tag":428,"props":642,"children":643},{"style":517},[644],{"type":399,"value":645},"4560.00",{"type":393,"tag":428,"props":647,"children":648},{"style":440},[649],{"type":399,"value":553},{"type":393,"tag":428,"props":651,"children":652},{"class":430,"line":92},[653,658,662,667,671,675,679,684,688,692],{"type":393,"tag":428,"props":654,"children":655},{"style":506},[656],{"type":399,"value":657},"    'customer_segment'",{"type":393,"tag":428,"props":659,"children":660},{"style":440},[661],{"type":399,"value":514},{"type":393,"tag":428,"props":663,"children":664},{"style":506},[665],{"type":399,"value":666},"'Premium'",{"type":393,"tag":428,"props":668,"children":669},{"style":440},[670],{"type":399,"value":525},{"type":393,"tag":428,"props":672,"children":673},{"style":506},[674],{"type":399,"value":666},{"type":393,"tag":428,"props":676,"children":677},{"style":440},[678],{"type":399,"value":525},{"type":393,"tag":428,"props":680,"children":681},{"style":506},[682],{"type":399,"value":683},"'Standard'",{"type":393,"tag":428,"props":685,"children":686},{"style":440},[687],{"type":399,"value":525},{"type":393,"tag":428,"props":689,"children":690},{"style":506},[691],{"type":399,"value":666},{"type":393,"tag":428,"props":693,"children":694},{"style":440},[695],{"type":399,"value":553},{"type":393,"tag":428,"props":697,"children":698},{"class":430,"line":101},[699,704,709,714,718,723,727,732,736,741],{"type":393,"tag":428,"props":700,"children":701},{"style":506},[702],{"type":399,"value":703},"    'last_order_date'",{"type":393,"tag":428,"props":705,"children":706},{"style":440},[707],{"type":399,"value":708},": pd.to_datetime([",{"type":393,"tag":428,"props":710,"children":711},{"style":506},[712],{"type":399,"value":713},"'2023-03-15'",{"type":393,"tag":428,"props":715,"children":716},{"style":440},[717],{"type":399,"value":525},{"type":393,"tag":428,"props":719,"children":720},{"style":506},[721],{"type":399,"value":722},"'2023-03-20'",{"type":393,"tag":428,"props":724,"children":725},{"style":440},[726],{"type":399,"value":525},{"type":393,"tag":428,"props":728,"children":729},{"style":506},[730],{"type":399,"value":731},"'2023-03-10'",{"type":393,"tag":428,"props":733,"children":734},{"style":440},[735],{"type":399,"value":525},{"type":393,"tag":428,"props":737,"children":738},{"style":506},[739],{"type":399,"value":740},"'2023-03-25'",{"type":393,"tag":428,"props":742,"children":743},{"style":440},[744],{"type":399,"value":745},"])\n",{"type":393,"tag":428,"props":747,"children":748},{"class":430,"line":110},[749],{"type":393,"tag":428,"props":750,"children":751},{"style":440},[752],{"type":399,"value":753},"})\n",{"type":393,"tag":428,"props":755,"children":756},{"class":430,"line":121},[757],{"type":393,"tag":428,"props":758,"children":759},{"emptyLinePlaceholder":12},[760],{"type":399,"value":473},{"type":393,"tag":428,"props":762,"children":763},{"class":430,"line":130},[764,769,774,779],{"type":393,"tag":428,"props":765,"children":766},{"style":517},[767],{"type":399,"value":768},"print",{"type":393,"tag":428,"props":770,"children":771},{"style":440},[772],{"type":399,"value":773},"(",{"type":393,"tag":428,"props":775,"children":776},{"style":506},[777],{"type":399,"value":778},"\"Processed customer data:\"",{"type":393,"tag":428,"props":780,"children":781},{"style":440},[782],{"type":399,"value":783},")\n",{"type":393,"tag":428,"props":785,"children":786},{"class":430,"line":139},[787,791],{"type":393,"tag":428,"props":788,"children":789},{"style":517},[790],{"type":399,"value":768},{"type":393,"tag":428,"props":792,"children":793},{"style":440},[794],{"type":399,"value":795},"(processed_data)\n",{"type":393,"tag":428,"props":797,"children":798},{"class":430,"line":148},[799,803],{"type":393,"tag":428,"props":800,"children":801},{"style":517},[802],{"type":399,"value":768},{"type":393,"tag":428,"props":804,"children":805},{"style":440},[806],{"type":399,"value":807},"()\n",{"type":393,"tag":428,"props":809,"children":810},{"class":430,"line":159},[811],{"type":393,"tag":428,"props":812,"children":813},{"emptyLinePlaceholder":12},[814],{"type":399,"value":473},{"type":393,"tag":428,"props":816,"children":817},{"class":430,"line":168},[818],{"type":393,"tag":428,"props":819,"children":820},{"style":479},[821],{"type":399,"value":822},"# Create connection to SQLite database (file-based, no server needed)\n",{"type":393,"tag":428,"props":824,"children":825},{"class":430,"line":177},[826,831,835,840,845],{"type":393,"tag":428,"props":827,"children":828},{"style":440},[829],{"type":399,"value":830},"conn ",{"type":393,"tag":428,"props":832,"children":833},{"style":434},[834],{"type":399,"value":495},{"type":393,"tag":428,"props":836,"children":837},{"style":440},[838],{"type":399,"value":839}," sqlite3.connect(",{"type":393,"tag":428,"props":841,"children":842},{"style":506},[843],{"type":399,"value":844},"'customer_analysis.db'",{"type":393,"tag":428,"props":846,"children":847},{"style":440},[848],{"type":399,"value":783},{"type":393,"tag":428,"props":850,"children":851},{"class":430,"line":186},[852],{"type":393,"tag":428,"props":853,"children":854},{"emptyLinePlaceholder":12},[855],{"type":399,"value":473},{"type":393,"tag":428,"props":857,"children":858},{"class":430,"line":197},[859],{"type":393,"tag":428,"props":860,"children":861},{"style":479},[862],{"type":399,"value":863},"# Export DataFrame to database table\n",{"type":393,"tag":428,"props":865,"children":866},{"class":430,"line":206},[867,872,877,882,888,892,897,901,906,910,915],{"type":393,"tag":428,"props":868,"children":869},{"style":440},[870],{"type":399,"value":871},"processed_data.to_sql(",{"type":393,"tag":428,"props":873,"children":874},{"style":506},[875],{"type":399,"value":876},"'customer_summary'",{"type":393,"tag":428,"props":878,"children":879},{"style":440},[880],{"type":399,"value":881},", conn, ",{"type":393,"tag":428,"props":883,"children":885},{"style":884},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[886],{"type":399,"value":887},"if_exists",{"type":393,"tag":428,"props":889,"children":890},{"style":434},[891],{"type":399,"value":495},{"type":393,"tag":428,"props":893,"children":894},{"style":506},[895],{"type":399,"value":896},"'replace'",{"type":393,"tag":428,"props":898,"children":899},{"style":440},[900],{"type":399,"value":525},{"type":393,"tag":428,"props":902,"children":903},{"style":884},[904],{"type":399,"value":905},"index",{"type":393,"tag":428,"props":907,"children":908},{"style":434},[909],{"type":399,"value":495},{"type":393,"tag":428,"props":911,"children":912},{"style":517},[913],{"type":399,"value":914},"False",{"type":393,"tag":428,"props":916,"children":917},{"style":440},[918],{"type":399,"value":783},{"type":393,"tag":428,"props":920,"children":921},{"class":430,"line":215},[922,926,930,935],{"type":393,"tag":428,"props":923,"children":924},{"style":517},[925],{"type":399,"value":768},{"type":393,"tag":428,"props":927,"children":928},{"style":440},[929],{"type":399,"value":773},{"type":393,"tag":428,"props":931,"children":932},{"style":506},[933],{"type":399,"value":934},"\"✅ Data exported to database table: customer_summary\"",{"type":393,"tag":428,"props":936,"children":937},{"style":440},[938],{"type":399,"value":783},{"type":393,"tag":428,"props":940,"children":941},{"class":430,"line":224},[942],{"type":393,"tag":428,"props":943,"children":944},{"emptyLinePlaceholder":12},[945],{"type":399,"value":473},{"type":393,"tag":428,"props":947,"children":948},{"class":430,"line":233},[949],{"type":393,"tag":428,"props":950,"children":951},{"style":479},[952],{"type":399,"value":953},"# Verify the export by reading back\n",{"type":393,"tag":428,"props":955,"children":956},{"class":430,"line":244},[957,962,966,971,976],{"type":393,"tag":428,"props":958,"children":959},{"style":440},[960],{"type":399,"value":961},"verification ",{"type":393,"tag":428,"props":963,"children":964},{"style":434},[965],{"type":399,"value":495},{"type":393,"tag":428,"props":967,"children":968},{"style":440},[969],{"type":399,"value":970}," pd.read_sql(",{"type":393,"tag":428,"props":972,"children":973},{"style":506},[974],{"type":399,"value":975},"'SELECT * FROM customer_summary'",{"type":393,"tag":428,"props":977,"children":978},{"style":440},[979],{"type":399,"value":980},", conn)\n",{"type":393,"tag":428,"props":982,"children":983},{"class":430,"line":253},[984,988,992,997,1002,1007],{"type":393,"tag":428,"props":985,"children":986},{"style":517},[987],{"type":399,"value":768},{"type":393,"tag":428,"props":989,"children":990},{"style":440},[991],{"type":399,"value":773},{"type":393,"tag":428,"props":993,"children":994},{"style":506},[995],{"type":399,"value":996},"\"",{"type":393,"tag":428,"props":998,"children":999},{"style":517},[1000],{"type":399,"value":1001},"\\n",{"type":393,"tag":428,"props":1003,"children":1004},{"style":506},[1005],{"type":399,"value":1006},"Verification - data in database:\"",{"type":393,"tag":428,"props":1008,"children":1009},{"style":440},[1010],{"type":399,"value":783},{"type":393,"tag":428,"props":1012,"children":1013},{"class":430,"line":262},[1014,1018],{"type":393,"tag":428,"props":1015,"children":1016},{"style":517},[1017],{"type":399,"value":768},{"type":393,"tag":428,"props":1019,"children":1020},{"style":440},[1021],{"type":399,"value":1022},"(verification)\n",{"type":393,"tag":428,"props":1024,"children":1025},{"class":430,"line":271},[1026],{"type":393,"tag":428,"props":1027,"children":1028},{"emptyLinePlaceholder":12},[1029],{"type":399,"value":473},{"type":393,"tag":428,"props":1031,"children":1032},{"class":430,"line":281},[1033],{"type":393,"tag":428,"props":1034,"children":1035},{"style":479},[1036],{"type":399,"value":1037},"# Close connection\n",{"type":393,"tag":428,"props":1039,"children":1040},{"class":430,"line":290},[1041],{"type":393,"tag":428,"props":1042,"children":1043},{"style":440},[1044],{"type":399,"value":1045},"conn.close()\n",{"type":393,"tag":1047,"props":1048,"children":1050},"h2",{"id":1049},"why-export-to-databases",[1051],{"type":399,"value":1052},"🎯 Why Export to Databases?",{"type":393,"tag":402,"props":1054,"children":1055},{},[1056],{"type":399,"value":1057},"Database export enables powerful data integration:",{"type":393,"tag":1059,"props":1060,"children":1064},"info-box",{"emoji":1061,"title":1062,"type":1063},"🎯","Database Export Benefits","info",[1065,1074,1099,1107,1130,1138,1161,1169],{"type":393,"tag":402,"props":1066,"children":1067},{},[1068],{"type":393,"tag":1069,"props":1070,"children":1071},"strong",{},[1072],{"type":399,"value":1073},"System Integration:",{"type":393,"tag":1075,"props":1076,"children":1077},"ul",{},[1078,1084,1089,1094],{"type":393,"tag":1079,"props":1080,"children":1081},"li",{},[1082],{"type":399,"value":1083},"Feed results to web applications",{"type":393,"tag":1079,"props":1085,"children":1086},{},[1087],{"type":399,"value":1088},"Update data warehouses",{"type":393,"tag":1079,"props":1090,"children":1091},{},[1092],{"type":399,"value":1093},"Create automated data pipelines",{"type":393,"tag":1079,"props":1095,"children":1096},{},[1097],{"type":399,"value":1098},"Share with other analysis tools",{"type":393,"tag":402,"props":1100,"children":1101},{},[1102],{"type":393,"tag":1069,"props":1103,"children":1104},{},[1105],{"type":399,"value":1106},"Data Management:",{"type":393,"tag":1075,"props":1108,"children":1109},{},[1110,1115,1120,1125],{"type":393,"tag":1079,"props":1111,"children":1112},{},[1113],{"type":399,"value":1114},"Structured storage with schemas",{"type":393,"tag":1079,"props":1116,"children":1117},{},[1118],{"type":399,"value":1119},"Multi-user access and permissions",{"type":393,"tag":1079,"props":1121,"children":1122},{},[1123],{"type":399,"value":1124},"Transaction safety and consistency",{"type":393,"tag":1079,"props":1126,"children":1127},{},[1128],{"type":399,"value":1129},"Backup and recovery capabilities",{"type":393,"tag":402,"props":1131,"children":1132},{},[1133],{"type":393,"tag":1069,"props":1134,"children":1135},{},[1136],{"type":399,"value":1137},"Performance:",{"type":393,"tag":1075,"props":1139,"children":1140},{},[1141,1146,1151,1156],{"type":393,"tag":1079,"props":1142,"children":1143},{},[1144],{"type":399,"value":1145},"Efficient querying of large datasets",{"type":393,"tag":1079,"props":1147,"children":1148},{},[1149],{"type":399,"value":1150},"Indexed access for fast lookups",{"type":393,"tag":1079,"props":1152,"children":1153},{},[1154],{"type":399,"value":1155},"Concurrent access by multiple users",{"type":393,"tag":1079,"props":1157,"children":1158},{},[1159],{"type":399,"value":1160},"Optimized storage and retrieval",{"type":393,"tag":402,"props":1162,"children":1163},{},[1164],{"type":393,"tag":1069,"props":1165,"children":1166},{},[1167],{"type":399,"value":1168},"Common Use Cases:",{"type":393,"tag":1075,"props":1170,"children":1171},{},[1172,1177,1182,1187],{"type":393,"tag":1079,"props":1173,"children":1174},{},[1175],{"type":399,"value":1176},"Customer segmentation results",{"type":393,"tag":1079,"props":1178,"children":1179},{},[1180],{"type":399,"value":1181},"Sales forecasts and projections",{"type":393,"tag":1079,"props":1183,"children":1184},{},[1185],{"type":399,"value":1186},"Product recommendations",{"type":393,"tag":1079,"props":1188,"children":1189},{},[1190],{"type":399,"value":1191},"Financial reports and metrics",{"type":393,"tag":1047,"props":1193,"children":1195},{"id":1194},"database-connection-basics",[1196],{"type":399,"value":1197},"🔧 Database Connection Basics",{"type":393,"tag":402,"props":1199,"children":1200},{},[1201],{"type":399,"value":1202},"Understanding how to connect to different database types:",{"type":393,"tag":1059,"props":1204,"children":1208},{"emoji":1205,"title":1206,"type":1207},"🔧","Database Connection Types","success",[1209,1217,1244,1252,1289,1297,1330,1338,1367,1375],{"type":393,"tag":402,"props":1210,"children":1211},{},[1212],{"type":393,"tag":1069,"props":1213,"children":1214},{},[1215],{"type":399,"value":1216},"SQLite (File-based):",{"type":393,"tag":1075,"props":1218,"children":1219},{},[1220,1225,1230,1239],{"type":393,"tag":1079,"props":1221,"children":1222},{},[1223],{"type":399,"value":1224},"Perfect for development and small applications",{"type":393,"tag":1079,"props":1226,"children":1227},{},[1228],{"type":399,"value":1229},"No server setup required",{"type":393,"tag":1079,"props":1231,"children":1232},{},[1233],{"type":393,"tag":424,"props":1234,"children":1236},{"className":1235},[],[1237],{"type":399,"value":1238},"sqlite3.connect('database.db')",{"type":393,"tag":1079,"props":1240,"children":1241},{},[1242],{"type":399,"value":1243},"Great for learning and prototyping",{"type":393,"tag":402,"props":1245,"children":1246},{},[1247],{"type":393,"tag":1069,"props":1248,"children":1249},{},[1250],{"type":399,"value":1251},"PostgreSQL:",{"type":393,"tag":1075,"props":1253,"children":1254},{},[1255,1260,1265,1284],{"type":393,"tag":1079,"props":1256,"children":1257},{},[1258],{"type":399,"value":1259},"Production-grade database",{"type":393,"tag":1079,"props":1261,"children":1262},{},[1263],{"type":399,"value":1264},"Advanced features and performance",{"type":393,"tag":1079,"props":1266,"children":1267},{},[1268,1274,1276,1282],{"type":393,"tag":424,"props":1269,"children":1271},{"className":1270},[],[1272],{"type":399,"value":1273},"psycopg2",{"type":399,"value":1275}," or ",{"type":393,"tag":424,"props":1277,"children":1279},{"className":1278},[],[1280],{"type":399,"value":1281},"sqlalchemy",{"type":399,"value":1283}," libraries",{"type":393,"tag":1079,"props":1285,"children":1286},{},[1287],{"type":399,"value":1288},"Common in enterprise environments",{"type":393,"tag":402,"props":1290,"children":1291},{},[1292],{"type":393,"tag":1069,"props":1293,"children":1294},{},[1295],{"type":399,"value":1296},"MySQL:",{"type":393,"tag":1075,"props":1298,"children":1299},{},[1300,1305,1310,1325],{"type":393,"tag":1079,"props":1301,"children":1302},{},[1303],{"type":399,"value":1304},"Popular web application database",{"type":393,"tag":1079,"props":1306,"children":1307},{},[1308],{"type":399,"value":1309},"Good performance and reliability",{"type":393,"tag":1079,"props":1311,"children":1312},{},[1313,1319,1320],{"type":393,"tag":424,"props":1314,"children":1316},{"className":1315},[],[1317],{"type":399,"value":1318},"mysql-connector-python",{"type":399,"value":1275},{"type":393,"tag":424,"props":1321,"children":1323},{"className":1322},[],[1324],{"type":399,"value":1281},{"type":393,"tag":1079,"props":1326,"children":1327},{},[1328],{"type":399,"value":1329},"Widely supported",{"type":393,"tag":402,"props":1331,"children":1332},{},[1333],{"type":393,"tag":1069,"props":1334,"children":1335},{},[1336],{"type":399,"value":1337},"SQL Server:",{"type":393,"tag":1075,"props":1339,"children":1340},{},[1341,1346,1362],{"type":393,"tag":1079,"props":1342,"children":1343},{},[1344],{"type":399,"value":1345},"Microsoft enterprise database",{"type":393,"tag":1079,"props":1347,"children":1348},{},[1349,1355,1356,1361],{"type":393,"tag":424,"props":1350,"children":1352},{"className":1351},[],[1353],{"type":399,"value":1354},"pyodbc",{"type":399,"value":1275},{"type":393,"tag":424,"props":1357,"children":1359},{"className":1358},[],[1360],{"type":399,"value":1281},{"type":399,"value":1283},{"type":393,"tag":1079,"props":1363,"children":1364},{},[1365],{"type":399,"value":1366},"Windows integration features",{"type":393,"tag":402,"props":1368,"children":1369},{},[1370],{"type":393,"tag":1069,"props":1371,"children":1372},{},[1373],{"type":399,"value":1374},"Connection Pattern:",{"type":393,"tag":1376,"props":1377,"children":1378},"ol",{},[1379,1384,1389,1402],{"type":393,"tag":1079,"props":1380,"children":1381},{},[1382],{"type":399,"value":1383},"Import appropriate library",{"type":393,"tag":1079,"props":1385,"children":1386},{},[1387],{"type":399,"value":1388},"Create connection string/object",{"type":393,"tag":1079,"props":1390,"children":1391},{},[1392,1394,1400],{"type":399,"value":1393},"Use pandas ",{"type":393,"tag":424,"props":1395,"children":1397},{"className":1396},[],[1398],{"type":399,"value":1399},"to_sql()",{"type":399,"value":1401}," method",{"type":393,"tag":1079,"props":1403,"children":1404},{},[1405],{"type":399,"value":1406},"Always close connections",{"type":393,"tag":1047,"props":1408,"children":1410},{"id":1409},"sqlite-export-beginner-friendly",[1411],{"type":399,"value":1412},"💾 SQLite Export (Beginner-Friendly)",{"type":393,"tag":402,"props":1414,"children":1415},{},[1416],{"type":399,"value":1417},"SQLite is perfect for learning database operations:",{"type":393,"tag":413,"props":1419,"children":1420},{},[1421],{"type":393,"tag":417,"props":1422,"children":1424},{"className":419,"code":1423,"language":421,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\n# Sales analysis results\nsales_analysis = pd.DataFrame({\n    'product_category': ['Electronics', 'Books', 'Clothing', 'Home'],\n    'total_revenue': [125000, 45000, 78000, 52000],\n    'total_units': [450, 890, 620, 340],\n    'avg_price': [277.78, 50.56, 125.81, 152.94],\n    'profit_margin': [0.22, 0.35, 0.28, 0.31]\n})\n\nprint(\"Sales analysis results:\")\nprint(sales_analysis)\nprint()\n\n# Connect to SQLite database\nconn = sqlite3.connect('sales_analysis.db')\n\n# Export to database table\nsales_analysis.to_sql('product_performance', \n                     conn, \n                     if_exists='replace',  # Replace table if exists\n                     index=False)         # Don't include pandas index\n\nprint(\"✅ Exported to database table: product_performance\")\n\n# Query the data back to verify\nquery = \"SELECT product_category, total_revenue FROM product_performance ORDER BY total_revenue DESC\"\ntop_categories = pd.read_sql(query, conn)\n\nprint(\"\\nTop performing categories (from database):\")\nprint(top_categories)\n\n# Close connection\nconn.close()\n",[1425],{"type":393,"tag":424,"props":1426,"children":1427},{"__ignoreMap":6},[1428,1447,1458,1465,1473,1489,1537,1585,1633,1681,1730,1737,1744,1764,1776,1787,1794,1802,1826,1833,1841,1859,1867,1893,1919,1926,1946,1953,1961,1978,1995,2002,2030,2042,2049,2056],{"type":393,"tag":428,"props":1429,"children":1430},{"class":430,"line":11},[1431,1435,1439,1443],{"type":393,"tag":428,"props":1432,"children":1433},{"style":434},[1434],{"type":399,"value":437},{"type":393,"tag":428,"props":1436,"children":1437},{"style":440},[1438],{"type":399,"value":443},{"type":393,"tag":428,"props":1440,"children":1441},{"style":434},[1442],{"type":399,"value":448},{"type":393,"tag":428,"props":1444,"children":1445},{"style":440},[1446],{"type":399,"value":453},{"type":393,"tag":428,"props":1448,"children":1449},{"class":430,"line":27},[1450,1454],{"type":393,"tag":428,"props":1451,"children":1452},{"style":434},[1453],{"type":399,"value":437},{"type":393,"tag":428,"props":1455,"children":1456},{"style":440},[1457],{"type":399,"value":465},{"type":393,"tag":428,"props":1459,"children":1460},{"class":430,"line":36},[1461],{"type":393,"tag":428,"props":1462,"children":1463},{"emptyLinePlaceholder":12},[1464],{"type":399,"value":473},{"type":393,"tag":428,"props":1466,"children":1467},{"class":430,"line":45},[1468],{"type":393,"tag":428,"props":1469,"children":1470},{"style":479},[1471],{"type":399,"value":1472},"# Sales analysis results\n",{"type":393,"tag":428,"props":1474,"children":1475},{"class":430,"line":54},[1476,1481,1485],{"type":393,"tag":428,"props":1477,"children":1478},{"style":440},[1479],{"type":399,"value":1480},"sales_analysis ",{"type":393,"tag":428,"props":1482,"children":1483},{"style":434},[1484],{"type":399,"value":495},{"type":393,"tag":428,"props":1486,"children":1487},{"style":440},[1488],{"type":399,"value":500},{"type":393,"tag":428,"props":1490,"children":1491},{"class":430,"line":63},[1492,1497,1501,1506,1510,1515,1519,1524,1528,1533],{"type":393,"tag":428,"props":1493,"children":1494},{"style":506},[1495],{"type":399,"value":1496},"    'product_category'",{"type":393,"tag":428,"props":1498,"children":1499},{"style":440},[1500],{"type":399,"value":514},{"type":393,"tag":428,"props":1502,"children":1503},{"style":506},[1504],{"type":399,"value":1505},"'Electronics'",{"type":393,"tag":428,"props":1507,"children":1508},{"style":440},[1509],{"type":399,"value":525},{"type":393,"tag":428,"props":1511,"children":1512},{"style":506},[1513],{"type":399,"value":1514},"'Books'",{"type":393,"tag":428,"props":1516,"children":1517},{"style":440},[1518],{"type":399,"value":525},{"type":393,"tag":428,"props":1520,"children":1521},{"style":506},[1522],{"type":399,"value":1523},"'Clothing'",{"type":393,"tag":428,"props":1525,"children":1526},{"style":440},[1527],{"type":399,"value":525},{"type":393,"tag":428,"props":1529,"children":1530},{"style":506},[1531],{"type":399,"value":1532},"'Home'",{"type":393,"tag":428,"props":1534,"children":1535},{"style":440},[1536],{"type":399,"value":553},{"type":393,"tag":428,"props":1538,"children":1539},{"class":430,"line":72},[1540,1545,1549,1554,1558,1563,1567,1572,1576,1581],{"type":393,"tag":428,"props":1541,"children":1542},{"style":506},[1543],{"type":399,"value":1544},"    'total_revenue'",{"type":393,"tag":428,"props":1546,"children":1547},{"style":440},[1548],{"type":399,"value":514},{"type":393,"tag":428,"props":1550,"children":1551},{"style":517},[1552],{"type":399,"value":1553},"125000",{"type":393,"tag":428,"props":1555,"children":1556},{"style":440},[1557],{"type":399,"value":525},{"type":393,"tag":428,"props":1559,"children":1560},{"style":517},[1561],{"type":399,"value":1562},"45000",{"type":393,"tag":428,"props":1564,"children":1565},{"style":440},[1566],{"type":399,"value":525},{"type":393,"tag":428,"props":1568,"children":1569},{"style":517},[1570],{"type":399,"value":1571},"78000",{"type":393,"tag":428,"props":1573,"children":1574},{"style":440},[1575],{"type":399,"value":525},{"type":393,"tag":428,"props":1577,"children":1578},{"style":517},[1579],{"type":399,"value":1580},"52000",{"type":393,"tag":428,"props":1582,"children":1583},{"style":440},[1584],{"type":399,"value":553},{"type":393,"tag":428,"props":1586,"children":1587},{"class":430,"line":83},[1588,1593,1597,1602,1606,1611,1615,1620,1624,1629],{"type":393,"tag":428,"props":1589,"children":1590},{"style":506},[1591],{"type":399,"value":1592},"    'total_units'",{"type":393,"tag":428,"props":1594,"children":1595},{"style":440},[1596],{"type":399,"value":514},{"type":393,"tag":428,"props":1598,"children":1599},{"style":517},[1600],{"type":399,"value":1601},"450",{"type":393,"tag":428,"props":1603,"children":1604},{"style":440},[1605],{"type":399,"value":525},{"type":393,"tag":428,"props":1607,"children":1608},{"style":517},[1609],{"type":399,"value":1610},"890",{"type":393,"tag":428,"props":1612,"children":1613},{"style":440},[1614],{"type":399,"value":525},{"type":393,"tag":428,"props":1616,"children":1617},{"style":517},[1618],{"type":399,"value":1619},"620",{"type":393,"tag":428,"props":1621,"children":1622},{"style":440},[1623],{"type":399,"value":525},{"type":393,"tag":428,"props":1625,"children":1626},{"style":517},[1627],{"type":399,"value":1628},"340",{"type":393,"tag":428,"props":1630,"children":1631},{"style":440},[1632],{"type":399,"value":553},{"type":393,"tag":428,"props":1634,"children":1635},{"class":430,"line":92},[1636,1641,1645,1650,1654,1659,1663,1668,1672,1677],{"type":393,"tag":428,"props":1637,"children":1638},{"style":506},[1639],{"type":399,"value":1640},"    'avg_price'",{"type":393,"tag":428,"props":1642,"children":1643},{"style":440},[1644],{"type":399,"value":514},{"type":393,"tag":428,"props":1646,"children":1647},{"style":517},[1648],{"type":399,"value":1649},"277.78",{"type":393,"tag":428,"props":1651,"children":1652},{"style":440},[1653],{"type":399,"value":525},{"type":393,"tag":428,"props":1655,"children":1656},{"style":517},[1657],{"type":399,"value":1658},"50.56",{"type":393,"tag":428,"props":1660,"children":1661},{"style":440},[1662],{"type":399,"value":525},{"type":393,"tag":428,"props":1664,"children":1665},{"style":517},[1666],{"type":399,"value":1667},"125.81",{"type":393,"tag":428,"props":1669,"children":1670},{"style":440},[1671],{"type":399,"value":525},{"type":393,"tag":428,"props":1673,"children":1674},{"style":517},[1675],{"type":399,"value":1676},"152.94",{"type":393,"tag":428,"props":1678,"children":1679},{"style":440},[1680],{"type":399,"value":553},{"type":393,"tag":428,"props":1682,"children":1683},{"class":430,"line":101},[1684,1689,1693,1698,1702,1707,1711,1716,1720,1725],{"type":393,"tag":428,"props":1685,"children":1686},{"style":506},[1687],{"type":399,"value":1688},"    'profit_margin'",{"type":393,"tag":428,"props":1690,"children":1691},{"style":440},[1692],{"type":399,"value":514},{"type":393,"tag":428,"props":1694,"children":1695},{"style":517},[1696],{"type":399,"value":1697},"0.22",{"type":393,"tag":428,"props":1699,"children":1700},{"style":440},[1701],{"type":399,"value":525},{"type":393,"tag":428,"props":1703,"children":1704},{"style":517},[1705],{"type":399,"value":1706},"0.35",{"type":393,"tag":428,"props":1708,"children":1709},{"style":440},[1710],{"type":399,"value":525},{"type":393,"tag":428,"props":1712,"children":1713},{"style":517},[1714],{"type":399,"value":1715},"0.28",{"type":393,"tag":428,"props":1717,"children":1718},{"style":440},[1719],{"type":399,"value":525},{"type":393,"tag":428,"props":1721,"children":1722},{"style":517},[1723],{"type":399,"value":1724},"0.31",{"type":393,"tag":428,"props":1726,"children":1727},{"style":440},[1728],{"type":399,"value":1729},"]\n",{"type":393,"tag":428,"props":1731,"children":1732},{"class":430,"line":110},[1733],{"type":393,"tag":428,"props":1734,"children":1735},{"style":440},[1736],{"type":399,"value":753},{"type":393,"tag":428,"props":1738,"children":1739},{"class":430,"line":121},[1740],{"type":393,"tag":428,"props":1741,"children":1742},{"emptyLinePlaceholder":12},[1743],{"type":399,"value":473},{"type":393,"tag":428,"props":1745,"children":1746},{"class":430,"line":130},[1747,1751,1755,1760],{"type":393,"tag":428,"props":1748,"children":1749},{"style":517},[1750],{"type":399,"value":768},{"type":393,"tag":428,"props":1752,"children":1753},{"style":440},[1754],{"type":399,"value":773},{"type":393,"tag":428,"props":1756,"children":1757},{"style":506},[1758],{"type":399,"value":1759},"\"Sales analysis results:\"",{"type":393,"tag":428,"props":1761,"children":1762},{"style":440},[1763],{"type":399,"value":783},{"type":393,"tag":428,"props":1765,"children":1766},{"class":430,"line":139},[1767,1771],{"type":393,"tag":428,"props":1768,"children":1769},{"style":517},[1770],{"type":399,"value":768},{"type":393,"tag":428,"props":1772,"children":1773},{"style":440},[1774],{"type":399,"value":1775},"(sales_analysis)\n",{"type":393,"tag":428,"props":1777,"children":1778},{"class":430,"line":148},[1779,1783],{"type":393,"tag":428,"props":1780,"children":1781},{"style":517},[1782],{"type":399,"value":768},{"type":393,"tag":428,"props":1784,"children":1785},{"style":440},[1786],{"type":399,"value":807},{"type":393,"tag":428,"props":1788,"children":1789},{"class":430,"line":159},[1790],{"type":393,"tag":428,"props":1791,"children":1792},{"emptyLinePlaceholder":12},[1793],{"type":399,"value":473},{"type":393,"tag":428,"props":1795,"children":1796},{"class":430,"line":168},[1797],{"type":393,"tag":428,"props":1798,"children":1799},{"style":479},[1800],{"type":399,"value":1801},"# Connect to SQLite database\n",{"type":393,"tag":428,"props":1803,"children":1804},{"class":430,"line":177},[1805,1809,1813,1817,1822],{"type":393,"tag":428,"props":1806,"children":1807},{"style":440},[1808],{"type":399,"value":830},{"type":393,"tag":428,"props":1810,"children":1811},{"style":434},[1812],{"type":399,"value":495},{"type":393,"tag":428,"props":1814,"children":1815},{"style":440},[1816],{"type":399,"value":839},{"type":393,"tag":428,"props":1818,"children":1819},{"style":506},[1820],{"type":399,"value":1821},"'sales_analysis.db'",{"type":393,"tag":428,"props":1823,"children":1824},{"style":440},[1825],{"type":399,"value":783},{"type":393,"tag":428,"props":1827,"children":1828},{"class":430,"line":186},[1829],{"type":393,"tag":428,"props":1830,"children":1831},{"emptyLinePlaceholder":12},[1832],{"type":399,"value":473},{"type":393,"tag":428,"props":1834,"children":1835},{"class":430,"line":197},[1836],{"type":393,"tag":428,"props":1837,"children":1838},{"style":479},[1839],{"type":399,"value":1840},"# Export to database table\n",{"type":393,"tag":428,"props":1842,"children":1843},{"class":430,"line":206},[1844,1849,1854],{"type":393,"tag":428,"props":1845,"children":1846},{"style":440},[1847],{"type":399,"value":1848},"sales_analysis.to_sql(",{"type":393,"tag":428,"props":1850,"children":1851},{"style":506},[1852],{"type":399,"value":1853},"'product_performance'",{"type":393,"tag":428,"props":1855,"children":1856},{"style":440},[1857],{"type":399,"value":1858},", \n",{"type":393,"tag":428,"props":1860,"children":1861},{"class":430,"line":215},[1862],{"type":393,"tag":428,"props":1863,"children":1864},{"style":440},[1865],{"type":399,"value":1866},"                     conn, \n",{"type":393,"tag":428,"props":1868,"children":1869},{"class":430,"line":224},[1870,1875,1879,1883,1888],{"type":393,"tag":428,"props":1871,"children":1872},{"style":884},[1873],{"type":399,"value":1874},"                     if_exists",{"type":393,"tag":428,"props":1876,"children":1877},{"style":434},[1878],{"type":399,"value":495},{"type":393,"tag":428,"props":1880,"children":1881},{"style":506},[1882],{"type":399,"value":896},{"type":393,"tag":428,"props":1884,"children":1885},{"style":440},[1886],{"type":399,"value":1887},",  ",{"type":393,"tag":428,"props":1889,"children":1890},{"style":479},[1891],{"type":399,"value":1892},"# Replace table if exists\n",{"type":393,"tag":428,"props":1894,"children":1895},{"class":430,"line":233},[1896,1901,1905,1909,1914],{"type":393,"tag":428,"props":1897,"children":1898},{"style":884},[1899],{"type":399,"value":1900},"                     index",{"type":393,"tag":428,"props":1902,"children":1903},{"style":434},[1904],{"type":399,"value":495},{"type":393,"tag":428,"props":1906,"children":1907},{"style":517},[1908],{"type":399,"value":914},{"type":393,"tag":428,"props":1910,"children":1911},{"style":440},[1912],{"type":399,"value":1913},")         ",{"type":393,"tag":428,"props":1915,"children":1916},{"style":479},[1917],{"type":399,"value":1918},"# Don't include pandas index\n",{"type":393,"tag":428,"props":1920,"children":1921},{"class":430,"line":244},[1922],{"type":393,"tag":428,"props":1923,"children":1924},{"emptyLinePlaceholder":12},[1925],{"type":399,"value":473},{"type":393,"tag":428,"props":1927,"children":1928},{"class":430,"line":253},[1929,1933,1937,1942],{"type":393,"tag":428,"props":1930,"children":1931},{"style":517},[1932],{"type":399,"value":768},{"type":393,"tag":428,"props":1934,"children":1935},{"style":440},[1936],{"type":399,"value":773},{"type":393,"tag":428,"props":1938,"children":1939},{"style":506},[1940],{"type":399,"value":1941},"\"✅ Exported to database table: product_performance\"",{"type":393,"tag":428,"props":1943,"children":1944},{"style":440},[1945],{"type":399,"value":783},{"type":393,"tag":428,"props":1947,"children":1948},{"class":430,"line":262},[1949],{"type":393,"tag":428,"props":1950,"children":1951},{"emptyLinePlaceholder":12},[1952],{"type":399,"value":473},{"type":393,"tag":428,"props":1954,"children":1955},{"class":430,"line":271},[1956],{"type":393,"tag":428,"props":1957,"children":1958},{"style":479},[1959],{"type":399,"value":1960},"# Query the data back to verify\n",{"type":393,"tag":428,"props":1962,"children":1963},{"class":430,"line":281},[1964,1969,1973],{"type":393,"tag":428,"props":1965,"children":1966},{"style":440},[1967],{"type":399,"value":1968},"query ",{"type":393,"tag":428,"props":1970,"children":1971},{"style":434},[1972],{"type":399,"value":495},{"type":393,"tag":428,"props":1974,"children":1975},{"style":506},[1976],{"type":399,"value":1977}," \"SELECT product_category, total_revenue FROM product_performance ORDER BY total_revenue DESC\"\n",{"type":393,"tag":428,"props":1979,"children":1980},{"class":430,"line":290},[1981,1986,1990],{"type":393,"tag":428,"props":1982,"children":1983},{"style":440},[1984],{"type":399,"value":1985},"top_categories ",{"type":393,"tag":428,"props":1987,"children":1988},{"style":434},[1989],{"type":399,"value":495},{"type":393,"tag":428,"props":1991,"children":1992},{"style":440},[1993],{"type":399,"value":1994}," pd.read_sql(query, conn)\n",{"type":393,"tag":428,"props":1996,"children":1997},{"class":430,"line":299},[1998],{"type":393,"tag":428,"props":1999,"children":2000},{"emptyLinePlaceholder":12},[2001],{"type":399,"value":473},{"type":393,"tag":428,"props":2003,"children":2004},{"class":430,"line":308},[2005,2009,2013,2017,2021,2026],{"type":393,"tag":428,"props":2006,"children":2007},{"style":517},[2008],{"type":399,"value":768},{"type":393,"tag":428,"props":2010,"children":2011},{"style":440},[2012],{"type":399,"value":773},{"type":393,"tag":428,"props":2014,"children":2015},{"style":506},[2016],{"type":399,"value":996},{"type":393,"tag":428,"props":2018,"children":2019},{"style":517},[2020],{"type":399,"value":1001},{"type":393,"tag":428,"props":2022,"children":2023},{"style":506},[2024],{"type":399,"value":2025},"Top performing categories (from database):\"",{"type":393,"tag":428,"props":2027,"children":2028},{"style":440},[2029],{"type":399,"value":783},{"type":393,"tag":428,"props":2031,"children":2032},{"class":430,"line":318},[2033,2037],{"type":393,"tag":428,"props":2034,"children":2035},{"style":517},[2036],{"type":399,"value":768},{"type":393,"tag":428,"props":2038,"children":2039},{"style":440},[2040],{"type":399,"value":2041},"(top_categories)\n",{"type":393,"tag":428,"props":2043,"children":2044},{"class":430,"line":327},[2045],{"type":393,"tag":428,"props":2046,"children":2047},{"emptyLinePlaceholder":12},[2048],{"type":399,"value":473},{"type":393,"tag":428,"props":2050,"children":2051},{"class":430,"line":336},[2052],{"type":393,"tag":428,"props":2053,"children":2054},{"style":479},[2055],{"type":399,"value":1037},{"type":393,"tag":428,"props":2057,"children":2058},{"class":430,"line":346},[2059],{"type":393,"tag":428,"props":2060,"children":2061},{"style":440},[2062],{"type":399,"value":1045},{"type":393,"tag":2064,"props":2065,"children":2067},"h3",{"id":2066},"multiple-tables-export",[2068],{"type":399,"value":2069},"Multiple Tables Export",{"type":393,"tag":413,"props":2071,"children":2072},{},[2073],{"type":393,"tag":417,"props":2074,"children":2076},{"className":419,"code":2075,"language":421,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\n# Create multiple related datasets\ncustomers = pd.DataFrame({\n    'customer_id': [1, 2, 3, 4],\n    'name': ['Alice', 'Bob', 'Charlie', 'Diana'],\n    'segment': ['Premium', 'Standard', 'Standard', 'Premium']\n})\n\norders = pd.DataFrame({\n    'order_id': [101, 102, 103, 104, 105],\n    'customer_id': [1, 2, 1, 3, 4],\n    'amount': [299.99, 149.50, 89.99, 199.99, 449.99],\n    'order_date': pd.to_datetime(['2023-01-15', '2023-01-20', '2023-02-01', '2023-02-05', '2023-02-10'])\n})\n\nprint(\"Customers table:\")\nprint(customers)\nprint(\"\\nOrders table:\")\nprint(orders)\n\n# Connect and export multiple tables\nconn = sqlite3.connect('business_data.db')\n\n# Export both tables\ncustomers.to_sql('customers', conn, if_exists='replace', index=False)\norders.to_sql('orders', conn, if_exists='replace', index=False)\n\nprint(\"\\n✅ Exported multiple tables to database\")\n\n# Query with JOIN to verify relationships\nquery = \"\"\"\nSELECT c.name, c.segment, COUNT(o.order_id) as order_count, SUM(o.amount) as total_spent\nFROM customers c\nLEFT JOIN orders o ON c.customer_id = o.customer_id\nGROUP BY c.customer_id, c.name, c.segment\nORDER BY total_spent DESC\n\"\"\"\n\ncustomer_summary = pd.read_sql(query, conn)\nprint(\"\\nCustomer summary (joined from multiple tables):\")\nprint(customer_summary)\n\nconn.close()\n",[2077],{"type":393,"tag":424,"props":2078,"children":2079},{"__ignoreMap":6},[2080,2099,2110,2117,2125,2141,2188,2236,2280,2287,2294,2310,2367,2418,2475,2532,2539,2546,2566,2578,2606,2618,2625,2633,2657,2664,2672,2721,2770,2777,2805,2812,2820,2836,2844,2852,2860,2868,2876,2884,2891,2908,2937,2950,2958],{"type":393,"tag":428,"props":2081,"children":2082},{"class":430,"line":11},[2083,2087,2091,2095],{"type":393,"tag":428,"props":2084,"children":2085},{"style":434},[2086],{"type":399,"value":437},{"type":393,"tag":428,"props":2088,"children":2089},{"style":440},[2090],{"type":399,"value":443},{"type":393,"tag":428,"props":2092,"children":2093},{"style":434},[2094],{"type":399,"value":448},{"type":393,"tag":428,"props":2096,"children":2097},{"style":440},[2098],{"type":399,"value":453},{"type":393,"tag":428,"props":2100,"children":2101},{"class":430,"line":27},[2102,2106],{"type":393,"tag":428,"props":2103,"children":2104},{"style":434},[2105],{"type":399,"value":437},{"type":393,"tag":428,"props":2107,"children":2108},{"style":440},[2109],{"type":399,"value":465},{"type":393,"tag":428,"props":2111,"children":2112},{"class":430,"line":36},[2113],{"type":393,"tag":428,"props":2114,"children":2115},{"emptyLinePlaceholder":12},[2116],{"type":399,"value":473},{"type":393,"tag":428,"props":2118,"children":2119},{"class":430,"line":45},[2120],{"type":393,"tag":428,"props":2121,"children":2122},{"style":479},[2123],{"type":399,"value":2124},"# Create multiple related datasets\n",{"type":393,"tag":428,"props":2126,"children":2127},{"class":430,"line":54},[2128,2133,2137],{"type":393,"tag":428,"props":2129,"children":2130},{"style":440},[2131],{"type":399,"value":2132},"customers ",{"type":393,"tag":428,"props":2134,"children":2135},{"style":434},[2136],{"type":399,"value":495},{"type":393,"tag":428,"props":2138,"children":2139},{"style":440},[2140],{"type":399,"value":500},{"type":393,"tag":428,"props":2142,"children":2143},{"class":430,"line":63},[2144,2148,2152,2157,2161,2166,2170,2175,2179,2184],{"type":393,"tag":428,"props":2145,"children":2146},{"style":506},[2147],{"type":399,"value":509},{"type":393,"tag":428,"props":2149,"children":2150},{"style":440},[2151],{"type":399,"value":514},{"type":393,"tag":428,"props":2153,"children":2154},{"style":517},[2155],{"type":399,"value":2156},"1",{"type":393,"tag":428,"props":2158,"children":2159},{"style":440},[2160],{"type":399,"value":525},{"type":393,"tag":428,"props":2162,"children":2163},{"style":517},[2164],{"type":399,"value":2165},"2",{"type":393,"tag":428,"props":2167,"children":2168},{"style":440},[2169],{"type":399,"value":525},{"type":393,"tag":428,"props":2171,"children":2172},{"style":517},[2173],{"type":399,"value":2174},"3",{"type":393,"tag":428,"props":2176,"children":2177},{"style":440},[2178],{"type":399,"value":525},{"type":393,"tag":428,"props":2180,"children":2181},{"style":517},[2182],{"type":399,"value":2183},"4",{"type":393,"tag":428,"props":2185,"children":2186},{"style":440},[2187],{"type":399,"value":553},{"type":393,"tag":428,"props":2189,"children":2190},{"class":430,"line":72},[2191,2196,2200,2205,2209,2214,2218,2223,2227,2232],{"type":393,"tag":428,"props":2192,"children":2193},{"style":506},[2194],{"type":399,"value":2195},"    'name'",{"type":393,"tag":428,"props":2197,"children":2198},{"style":440},[2199],{"type":399,"value":514},{"type":393,"tag":428,"props":2201,"children":2202},{"style":506},[2203],{"type":399,"value":2204},"'Alice'",{"type":393,"tag":428,"props":2206,"children":2207},{"style":440},[2208],{"type":399,"value":525},{"type":393,"tag":428,"props":2210,"children":2211},{"style":506},[2212],{"type":399,"value":2213},"'Bob'",{"type":393,"tag":428,"props":2215,"children":2216},{"style":440},[2217],{"type":399,"value":525},{"type":393,"tag":428,"props":2219,"children":2220},{"style":506},[2221],{"type":399,"value":2222},"'Charlie'",{"type":393,"tag":428,"props":2224,"children":2225},{"style":440},[2226],{"type":399,"value":525},{"type":393,"tag":428,"props":2228,"children":2229},{"style":506},[2230],{"type":399,"value":2231},"'Diana'",{"type":393,"tag":428,"props":2233,"children":2234},{"style":440},[2235],{"type":399,"value":553},{"type":393,"tag":428,"props":2237,"children":2238},{"class":430,"line":83},[2239,2244,2248,2252,2256,2260,2264,2268,2272,2276],{"type":393,"tag":428,"props":2240,"children":2241},{"style":506},[2242],{"type":399,"value":2243},"    'segment'",{"type":393,"tag":428,"props":2245,"children":2246},{"style":440},[2247],{"type":399,"value":514},{"type":393,"tag":428,"props":2249,"children":2250},{"style":506},[2251],{"type":399,"value":666},{"type":393,"tag":428,"props":2253,"children":2254},{"style":440},[2255],{"type":399,"value":525},{"type":393,"tag":428,"props":2257,"children":2258},{"style":506},[2259],{"type":399,"value":683},{"type":393,"tag":428,"props":2261,"children":2262},{"style":440},[2263],{"type":399,"value":525},{"type":393,"tag":428,"props":2265,"children":2266},{"style":506},[2267],{"type":399,"value":683},{"type":393,"tag":428,"props":2269,"children":2270},{"style":440},[2271],{"type":399,"value":525},{"type":393,"tag":428,"props":2273,"children":2274},{"style":506},[2275],{"type":399,"value":666},{"type":393,"tag":428,"props":2277,"children":2278},{"style":440},[2279],{"type":399,"value":1729},{"type":393,"tag":428,"props":2281,"children":2282},{"class":430,"line":92},[2283],{"type":393,"tag":428,"props":2284,"children":2285},{"style":440},[2286],{"type":399,"value":753},{"type":393,"tag":428,"props":2288,"children":2289},{"class":430,"line":101},[2290],{"type":393,"tag":428,"props":2291,"children":2292},{"emptyLinePlaceholder":12},[2293],{"type":399,"value":473},{"type":393,"tag":428,"props":2295,"children":2296},{"class":430,"line":110},[2297,2302,2306],{"type":393,"tag":428,"props":2298,"children":2299},{"style":440},[2300],{"type":399,"value":2301},"orders ",{"type":393,"tag":428,"props":2303,"children":2304},{"style":434},[2305],{"type":399,"value":495},{"type":393,"tag":428,"props":2307,"children":2308},{"style":440},[2309],{"type":399,"value":500},{"type":393,"tag":428,"props":2311,"children":2312},{"class":430,"line":121},[2313,2318,2322,2327,2331,2336,2340,2345,2349,2354,2358,2363],{"type":393,"tag":428,"props":2314,"children":2315},{"style":506},[2316],{"type":399,"value":2317},"    'order_id'",{"type":393,"tag":428,"props":2319,"children":2320},{"style":440},[2321],{"type":399,"value":514},{"type":393,"tag":428,"props":2323,"children":2324},{"style":517},[2325],{"type":399,"value":2326},"101",{"type":393,"tag":428,"props":2328,"children":2329},{"style":440},[2330],{"type":399,"value":525},{"type":393,"tag":428,"props":2332,"children":2333},{"style":517},[2334],{"type":399,"value":2335},"102",{"type":393,"tag":428,"props":2337,"children":2338},{"style":440},[2339],{"type":399,"value":525},{"type":393,"tag":428,"props":2341,"children":2342},{"style":517},[2343],{"type":399,"value":2344},"103",{"type":393,"tag":428,"props":2346,"children":2347},{"style":440},[2348],{"type":399,"value":525},{"type":393,"tag":428,"props":2350,"children":2351},{"style":517},[2352],{"type":399,"value":2353},"104",{"type":393,"tag":428,"props":2355,"children":2356},{"style":440},[2357],{"type":399,"value":525},{"type":393,"tag":428,"props":2359,"children":2360},{"style":517},[2361],{"type":399,"value":2362},"105",{"type":393,"tag":428,"props":2364,"children":2365},{"style":440},[2366],{"type":399,"value":553},{"type":393,"tag":428,"props":2368,"children":2369},{"class":430,"line":130},[2370,2374,2378,2382,2386,2390,2394,2398,2402,2406,2410,2414],{"type":393,"tag":428,"props":2371,"children":2372},{"style":506},[2373],{"type":399,"value":509},{"type":393,"tag":428,"props":2375,"children":2376},{"style":440},[2377],{"type":399,"value":514},{"type":393,"tag":428,"props":2379,"children":2380},{"style":517},[2381],{"type":399,"value":2156},{"type":393,"tag":428,"props":2383,"children":2384},{"style":440},[2385],{"type":399,"value":525},{"type":393,"tag":428,"props":2387,"children":2388},{"style":517},[2389],{"type":399,"value":2165},{"type":393,"tag":428,"props":2391,"children":2392},{"style":440},[2393],{"type":399,"value":525},{"type":393,"tag":428,"props":2395,"children":2396},{"style":517},[2397],{"type":399,"value":2156},{"type":393,"tag":428,"props":2399,"children":2400},{"style":440},[2401],{"type":399,"value":525},{"type":393,"tag":428,"props":2403,"children":2404},{"style":517},[2405],{"type":399,"value":2174},{"type":393,"tag":428,"props":2407,"children":2408},{"style":440},[2409],{"type":399,"value":525},{"type":393,"tag":428,"props":2411,"children":2412},{"style":517},[2413],{"type":399,"value":2183},{"type":393,"tag":428,"props":2415,"children":2416},{"style":440},[2417],{"type":399,"value":553},{"type":393,"tag":428,"props":2419,"children":2420},{"class":430,"line":139},[2421,2426,2430,2435,2439,2444,2448,2453,2457,2462,2466,2471],{"type":393,"tag":428,"props":2422,"children":2423},{"style":506},[2424],{"type":399,"value":2425},"    'amount'",{"type":393,"tag":428,"props":2427,"children":2428},{"style":440},[2429],{"type":399,"value":514},{"type":393,"tag":428,"props":2431,"children":2432},{"style":517},[2433],{"type":399,"value":2434},"299.99",{"type":393,"tag":428,"props":2436,"children":2437},{"style":440},[2438],{"type":399,"value":525},{"type":393,"tag":428,"props":2440,"children":2441},{"style":517},[2442],{"type":399,"value":2443},"149.50",{"type":393,"tag":428,"props":2445,"children":2446},{"style":440},[2447],{"type":399,"value":525},{"type":393,"tag":428,"props":2449,"children":2450},{"style":517},[2451],{"type":399,"value":2452},"89.99",{"type":393,"tag":428,"props":2454,"children":2455},{"style":440},[2456],{"type":399,"value":525},{"type":393,"tag":428,"props":2458,"children":2459},{"style":517},[2460],{"type":399,"value":2461},"199.99",{"type":393,"tag":428,"props":2463,"children":2464},{"style":440},[2465],{"type":399,"value":525},{"type":393,"tag":428,"props":2467,"children":2468},{"style":517},[2469],{"type":399,"value":2470},"449.99",{"type":393,"tag":428,"props":2472,"children":2473},{"style":440},[2474],{"type":399,"value":553},{"type":393,"tag":428,"props":2476,"children":2477},{"class":430,"line":148},[2478,2483,2487,2492,2496,2501,2505,2510,2514,2519,2523,2528],{"type":393,"tag":428,"props":2479,"children":2480},{"style":506},[2481],{"type":399,"value":2482},"    'order_date'",{"type":393,"tag":428,"props":2484,"children":2485},{"style":440},[2486],{"type":399,"value":708},{"type":393,"tag":428,"props":2488,"children":2489},{"style":506},[2490],{"type":399,"value":2491},"'2023-01-15'",{"type":393,"tag":428,"props":2493,"children":2494},{"style":440},[2495],{"type":399,"value":525},{"type":393,"tag":428,"props":2497,"children":2498},{"style":506},[2499],{"type":399,"value":2500},"'2023-01-20'",{"type":393,"tag":428,"props":2502,"children":2503},{"style":440},[2504],{"type":399,"value":525},{"type":393,"tag":428,"props":2506,"children":2507},{"style":506},[2508],{"type":399,"value":2509},"'2023-02-01'",{"type":393,"tag":428,"props":2511,"children":2512},{"style":440},[2513],{"type":399,"value":525},{"type":393,"tag":428,"props":2515,"children":2516},{"style":506},[2517],{"type":399,"value":2518},"'2023-02-05'",{"type":393,"tag":428,"props":2520,"children":2521},{"style":440},[2522],{"type":399,"value":525},{"type":393,"tag":428,"props":2524,"children":2525},{"style":506},[2526],{"type":399,"value":2527},"'2023-02-10'",{"type":393,"tag":428,"props":2529,"children":2530},{"style":440},[2531],{"type":399,"value":745},{"type":393,"tag":428,"props":2533,"children":2534},{"class":430,"line":159},[2535],{"type":393,"tag":428,"props":2536,"children":2537},{"style":440},[2538],{"type":399,"value":753},{"type":393,"tag":428,"props":2540,"children":2541},{"class":430,"line":168},[2542],{"type":393,"tag":428,"props":2543,"children":2544},{"emptyLinePlaceholder":12},[2545],{"type":399,"value":473},{"type":393,"tag":428,"props":2547,"children":2548},{"class":430,"line":177},[2549,2553,2557,2562],{"type":393,"tag":428,"props":2550,"children":2551},{"style":517},[2552],{"type":399,"value":768},{"type":393,"tag":428,"props":2554,"children":2555},{"style":440},[2556],{"type":399,"value":773},{"type":393,"tag":428,"props":2558,"children":2559},{"style":506},[2560],{"type":399,"value":2561},"\"Customers table:\"",{"type":393,"tag":428,"props":2563,"children":2564},{"style":440},[2565],{"type":399,"value":783},{"type":393,"tag":428,"props":2567,"children":2568},{"class":430,"line":186},[2569,2573],{"type":393,"tag":428,"props":2570,"children":2571},{"style":517},[2572],{"type":399,"value":768},{"type":393,"tag":428,"props":2574,"children":2575},{"style":440},[2576],{"type":399,"value":2577},"(customers)\n",{"type":393,"tag":428,"props":2579,"children":2580},{"class":430,"line":197},[2581,2585,2589,2593,2597,2602],{"type":393,"tag":428,"props":2582,"children":2583},{"style":517},[2584],{"type":399,"value":768},{"type":393,"tag":428,"props":2586,"children":2587},{"style":440},[2588],{"type":399,"value":773},{"type":393,"tag":428,"props":2590,"children":2591},{"style":506},[2592],{"type":399,"value":996},{"type":393,"tag":428,"props":2594,"children":2595},{"style":517},[2596],{"type":399,"value":1001},{"type":393,"tag":428,"props":2598,"children":2599},{"style":506},[2600],{"type":399,"value":2601},"Orders table:\"",{"type":393,"tag":428,"props":2603,"children":2604},{"style":440},[2605],{"type":399,"value":783},{"type":393,"tag":428,"props":2607,"children":2608},{"class":430,"line":206},[2609,2613],{"type":393,"tag":428,"props":2610,"children":2611},{"style":517},[2612],{"type":399,"value":768},{"type":393,"tag":428,"props":2614,"children":2615},{"style":440},[2616],{"type":399,"value":2617},"(orders)\n",{"type":393,"tag":428,"props":2619,"children":2620},{"class":430,"line":215},[2621],{"type":393,"tag":428,"props":2622,"children":2623},{"emptyLinePlaceholder":12},[2624],{"type":399,"value":473},{"type":393,"tag":428,"props":2626,"children":2627},{"class":430,"line":224},[2628],{"type":393,"tag":428,"props":2629,"children":2630},{"style":479},[2631],{"type":399,"value":2632},"# Connect and export multiple tables\n",{"type":393,"tag":428,"props":2634,"children":2635},{"class":430,"line":233},[2636,2640,2644,2648,2653],{"type":393,"tag":428,"props":2637,"children":2638},{"style":440},[2639],{"type":399,"value":830},{"type":393,"tag":428,"props":2641,"children":2642},{"style":434},[2643],{"type":399,"value":495},{"type":393,"tag":428,"props":2645,"children":2646},{"style":440},[2647],{"type":399,"value":839},{"type":393,"tag":428,"props":2649,"children":2650},{"style":506},[2651],{"type":399,"value":2652},"'business_data.db'",{"type":393,"tag":428,"props":2654,"children":2655},{"style":440},[2656],{"type":399,"value":783},{"type":393,"tag":428,"props":2658,"children":2659},{"class":430,"line":244},[2660],{"type":393,"tag":428,"props":2661,"children":2662},{"emptyLinePlaceholder":12},[2663],{"type":399,"value":473},{"type":393,"tag":428,"props":2665,"children":2666},{"class":430,"line":253},[2667],{"type":393,"tag":428,"props":2668,"children":2669},{"style":479},[2670],{"type":399,"value":2671},"# Export both tables\n",{"type":393,"tag":428,"props":2673,"children":2674},{"class":430,"line":262},[2675,2680,2685,2689,2693,2697,2701,2705,2709,2713,2717],{"type":393,"tag":428,"props":2676,"children":2677},{"style":440},[2678],{"type":399,"value":2679},"customers.to_sql(",{"type":393,"tag":428,"props":2681,"children":2682},{"style":506},[2683],{"type":399,"value":2684},"'customers'",{"type":393,"tag":428,"props":2686,"children":2687},{"style":440},[2688],{"type":399,"value":881},{"type":393,"tag":428,"props":2690,"children":2691},{"style":884},[2692],{"type":399,"value":887},{"type":393,"tag":428,"props":2694,"children":2695},{"style":434},[2696],{"type":399,"value":495},{"type":393,"tag":428,"props":2698,"children":2699},{"style":506},[2700],{"type":399,"value":896},{"type":393,"tag":428,"props":2702,"children":2703},{"style":440},[2704],{"type":399,"value":525},{"type":393,"tag":428,"props":2706,"children":2707},{"style":884},[2708],{"type":399,"value":905},{"type":393,"tag":428,"props":2710,"children":2711},{"style":434},[2712],{"type":399,"value":495},{"type":393,"tag":428,"props":2714,"children":2715},{"style":517},[2716],{"type":399,"value":914},{"type":393,"tag":428,"props":2718,"children":2719},{"style":440},[2720],{"type":399,"value":783},{"type":393,"tag":428,"props":2722,"children":2723},{"class":430,"line":271},[2724,2729,2734,2738,2742,2746,2750,2754,2758,2762,2766],{"type":393,"tag":428,"props":2725,"children":2726},{"style":440},[2727],{"type":399,"value":2728},"orders.to_sql(",{"type":393,"tag":428,"props":2730,"children":2731},{"style":506},[2732],{"type":399,"value":2733},"'orders'",{"type":393,"tag":428,"props":2735,"children":2736},{"style":440},[2737],{"type":399,"value":881},{"type":393,"tag":428,"props":2739,"children":2740},{"style":884},[2741],{"type":399,"value":887},{"type":393,"tag":428,"props":2743,"children":2744},{"style":434},[2745],{"type":399,"value":495},{"type":393,"tag":428,"props":2747,"children":2748},{"style":506},[2749],{"type":399,"value":896},{"type":393,"tag":428,"props":2751,"children":2752},{"style":440},[2753],{"type":399,"value":525},{"type":393,"tag":428,"props":2755,"children":2756},{"style":884},[2757],{"type":399,"value":905},{"type":393,"tag":428,"props":2759,"children":2760},{"style":434},[2761],{"type":399,"value":495},{"type":393,"tag":428,"props":2763,"children":2764},{"style":517},[2765],{"type":399,"value":914},{"type":393,"tag":428,"props":2767,"children":2768},{"style":440},[2769],{"type":399,"value":783},{"type":393,"tag":428,"props":2771,"children":2772},{"class":430,"line":281},[2773],{"type":393,"tag":428,"props":2774,"children":2775},{"emptyLinePlaceholder":12},[2776],{"type":399,"value":473},{"type":393,"tag":428,"props":2778,"children":2779},{"class":430,"line":290},[2780,2784,2788,2792,2796,2801],{"type":393,"tag":428,"props":2781,"children":2782},{"style":517},[2783],{"type":399,"value":768},{"type":393,"tag":428,"props":2785,"children":2786},{"style":440},[2787],{"type":399,"value":773},{"type":393,"tag":428,"props":2789,"children":2790},{"style":506},[2791],{"type":399,"value":996},{"type":393,"tag":428,"props":2793,"children":2794},{"style":517},[2795],{"type":399,"value":1001},{"type":393,"tag":428,"props":2797,"children":2798},{"style":506},[2799],{"type":399,"value":2800},"✅ Exported multiple tables to database\"",{"type":393,"tag":428,"props":2802,"children":2803},{"style":440},[2804],{"type":399,"value":783},{"type":393,"tag":428,"props":2806,"children":2807},{"class":430,"line":299},[2808],{"type":393,"tag":428,"props":2809,"children":2810},{"emptyLinePlaceholder":12},[2811],{"type":399,"value":473},{"type":393,"tag":428,"props":2813,"children":2814},{"class":430,"line":308},[2815],{"type":393,"tag":428,"props":2816,"children":2817},{"style":479},[2818],{"type":399,"value":2819},"# Query with JOIN to verify relationships\n",{"type":393,"tag":428,"props":2821,"children":2822},{"class":430,"line":318},[2823,2827,2831],{"type":393,"tag":428,"props":2824,"children":2825},{"style":440},[2826],{"type":399,"value":1968},{"type":393,"tag":428,"props":2828,"children":2829},{"style":434},[2830],{"type":399,"value":495},{"type":393,"tag":428,"props":2832,"children":2833},{"style":506},[2834],{"type":399,"value":2835}," \"\"\"\n",{"type":393,"tag":428,"props":2837,"children":2838},{"class":430,"line":327},[2839],{"type":393,"tag":428,"props":2840,"children":2841},{"style":506},[2842],{"type":399,"value":2843},"SELECT c.name, c.segment, COUNT(o.order_id) as order_count, SUM(o.amount) as total_spent\n",{"type":393,"tag":428,"props":2845,"children":2846},{"class":430,"line":336},[2847],{"type":393,"tag":428,"props":2848,"children":2849},{"style":506},[2850],{"type":399,"value":2851},"FROM customers c\n",{"type":393,"tag":428,"props":2853,"children":2854},{"class":430,"line":346},[2855],{"type":393,"tag":428,"props":2856,"children":2857},{"style":506},[2858],{"type":399,"value":2859},"LEFT JOIN orders o ON c.customer_id = o.customer_id\n",{"type":393,"tag":428,"props":2861,"children":2862},{"class":430,"line":355},[2863],{"type":393,"tag":428,"props":2864,"children":2865},{"style":506},[2866],{"type":399,"value":2867},"GROUP BY c.customer_id, c.name, c.segment\n",{"type":393,"tag":428,"props":2869,"children":2870},{"class":430,"line":364},[2871],{"type":393,"tag":428,"props":2872,"children":2873},{"style":506},[2874],{"type":399,"value":2875},"ORDER BY total_spent DESC\n",{"type":393,"tag":428,"props":2877,"children":2878},{"class":430,"line":374},[2879],{"type":393,"tag":428,"props":2880,"children":2881},{"style":506},[2882],{"type":399,"value":2883},"\"\"\"\n",{"type":393,"tag":428,"props":2885,"children":2886},{"class":430,"line":383},[2887],{"type":393,"tag":428,"props":2888,"children":2889},{"emptyLinePlaceholder":12},[2890],{"type":399,"value":473},{"type":393,"tag":428,"props":2892,"children":2894},{"class":430,"line":2893},41,[2895,2900,2904],{"type":393,"tag":428,"props":2896,"children":2897},{"style":440},[2898],{"type":399,"value":2899},"customer_summary ",{"type":393,"tag":428,"props":2901,"children":2902},{"style":434},[2903],{"type":399,"value":495},{"type":393,"tag":428,"props":2905,"children":2906},{"style":440},[2907],{"type":399,"value":1994},{"type":393,"tag":428,"props":2909,"children":2911},{"class":430,"line":2910},42,[2912,2916,2920,2924,2928,2933],{"type":393,"tag":428,"props":2913,"children":2914},{"style":517},[2915],{"type":399,"value":768},{"type":393,"tag":428,"props":2917,"children":2918},{"style":440},[2919],{"type":399,"value":773},{"type":393,"tag":428,"props":2921,"children":2922},{"style":506},[2923],{"type":399,"value":996},{"type":393,"tag":428,"props":2925,"children":2926},{"style":517},[2927],{"type":399,"value":1001},{"type":393,"tag":428,"props":2929,"children":2930},{"style":506},[2931],{"type":399,"value":2932},"Customer summary (joined from multiple tables):\"",{"type":393,"tag":428,"props":2934,"children":2935},{"style":440},[2936],{"type":399,"value":783},{"type":393,"tag":428,"props":2938,"children":2940},{"class":430,"line":2939},43,[2941,2945],{"type":393,"tag":428,"props":2942,"children":2943},{"style":517},[2944],{"type":399,"value":768},{"type":393,"tag":428,"props":2946,"children":2947},{"style":440},[2948],{"type":399,"value":2949},"(customer_summary)\n",{"type":393,"tag":428,"props":2951,"children":2953},{"class":430,"line":2952},44,[2954],{"type":393,"tag":428,"props":2955,"children":2956},{"emptyLinePlaceholder":12},[2957],{"type":399,"value":473},{"type":393,"tag":428,"props":2959,"children":2961},{"class":430,"line":2960},45,[2962],{"type":393,"tag":428,"props":2963,"children":2964},{"style":440},[2965],{"type":399,"value":1045},{"type":393,"tag":1047,"props":2967,"children":2969},{"id":2968},"connection-string-patterns",[2970],{"type":399,"value":2971},"🌐 Connection String Patterns",{"type":393,"tag":402,"props":2973,"children":2974},{},[2975],{"type":399,"value":2976},"For production databases, you'll use connection strings:",{"type":393,"tag":1059,"props":2978,"children":2981},{"emoji":2979,"title":2980,"type":1063},"🌐","Database Connection Examples",[2982,2990,3017,3025,3061,3069,3092],{"type":393,"tag":402,"props":2983,"children":2984},{},[2985],{"type":393,"tag":1069,"props":2986,"children":2987},{},[2988],{"type":399,"value":2989},"SQLAlchemy (Recommended):",{"type":393,"tag":1075,"props":2991,"children":2992},{},[2993,2998,3003,3008],{"type":393,"tag":1079,"props":2994,"children":2995},{},[2996],{"type":399,"value":2997},"Universal database interface",{"type":393,"tag":1079,"props":2999,"children":3000},{},[3001],{"type":399,"value":3002},"Works with multiple database types",{"type":393,"tag":1079,"props":3004,"children":3005},{},[3006],{"type":399,"value":3007},"Better error handling and features",{"type":393,"tag":1079,"props":3009,"children":3010},{},[3011],{"type":393,"tag":424,"props":3012,"children":3014},{"className":3013},[],[3015],{"type":399,"value":3016},"from sqlalchemy import create_engine",{"type":393,"tag":402,"props":3018,"children":3019},{},[3020],{"type":393,"tag":1069,"props":3021,"children":3022},{},[3023],{"type":399,"value":3024},"Connection String Examples:",{"type":393,"tag":1075,"props":3026,"children":3027},{},[3028,3039,3050],{"type":393,"tag":1079,"props":3029,"children":3030},{},[3031,3033],{"type":399,"value":3032},"PostgreSQL: ",{"type":393,"tag":424,"props":3034,"children":3036},{"className":3035},[],[3037],{"type":399,"value":3038},"postgresql://user:password@host:5432/database",{"type":393,"tag":1079,"props":3040,"children":3041},{},[3042,3044],{"type":399,"value":3043},"MySQL: ",{"type":393,"tag":424,"props":3045,"children":3047},{"className":3046},[],[3048],{"type":399,"value":3049},"mysql+pymysql://user:password@host:3306/database",{"type":393,"tag":1079,"props":3051,"children":3052},{},[3053,3055],{"type":399,"value":3054},"SQL Server: ",{"type":393,"tag":424,"props":3056,"children":3058},{"className":3057},[],[3059],{"type":399,"value":3060},"mssql+pyodbc://user:password@host/database?driver=ODBC+Driver+17+for+SQL+Server",{"type":393,"tag":402,"props":3062,"children":3063},{},[3064],{"type":393,"tag":1069,"props":3065,"children":3066},{},[3067],{"type":399,"value":3068},"Benefits:",{"type":393,"tag":1075,"props":3070,"children":3071},{},[3072,3077,3082,3087],{"type":393,"tag":1079,"props":3073,"children":3074},{},[3075],{"type":399,"value":3076},"Standardized interface across databases",{"type":393,"tag":1079,"props":3078,"children":3079},{},[3080],{"type":399,"value":3081},"Connection pooling and optimization",{"type":393,"tag":1079,"props":3083,"children":3084},{},[3085],{"type":399,"value":3086},"Better security and error handling",{"type":393,"tag":1079,"props":3088,"children":3089},{},[3090],{"type":399,"value":3091},"Advanced features like reflection",{"type":393,"tag":402,"props":3093,"children":3094},{},[3095,3100],{"type":393,"tag":1069,"props":3096,"children":3097},{},[3098],{"type":399,"value":3099},"Note:",{"type":399,"value":3101}," For production use, always use environment variables for credentials!",{"type":393,"tag":2064,"props":3103,"children":3105},{"id":3104},"using-sqlalchemy-production-pattern",[3106],{"type":399,"value":3107},"Using SQLAlchemy (Production Pattern)",{"type":393,"tag":413,"props":3109,"children":3110},{},[3111],{"type":393,"tag":417,"props":3112,"children":3114},{"className":419,"code":3113,"language":421,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n# For production, you would use: from sqlalchemy import create_engine\n\n# Simulate production data export workflow\nmonthly_report = pd.DataFrame({\n    'report_month': ['2023-01', '2023-02', '2023-03'],\n    'total_sales': [125000, 135000, 145000],\n    'new_customers': [45, 52, 38],\n    'customer_retention': [0.92, 0.88, 0.90],\n    'avg_order_value': [285.50, 295.75, 310.25]\n})\n\nprint(\"Monthly report data:\")\nprint(monthly_report)\nprint()\n\n# Using SQLite for this example (in production, use SQLAlchemy)\nconn = sqlite3.connect('reporting.db')\n\n# Export with data type specification\nmonthly_report.to_sql('monthly_reports', \n                     conn,\n                     if_exists='append',    # Add to existing data\n                     index=False,\n                     dtype={\n                         'report_month': 'TEXT',\n                         'total_sales': 'INTEGER',\n                         'new_customers': 'INTEGER',\n                         'customer_retention': 'REAL',\n                         'avg_order_value': 'REAL'\n                     })\n\nprint(\"✅ Exported with specified data types\")\n\n# Verify the data types\nschema_query = \"PRAGMA table_info(monthly_reports)\"\nschema_info = pd.read_sql(schema_query, conn)\nprint(\"\\nTable schema:\")\nprint(schema_info[['name', 'type']])\n\nconn.close()\n",[3115],{"type":393,"tag":424,"props":3116,"children":3117},{"__ignoreMap":6},[3118,3137,3148,3156,3163,3171,3187,3226,3264,3303,3342,3381,3388,3395,3415,3427,3438,3445,3453,3477,3484,3492,3509,3517,3543,3563,3580,3602,3623,3643,3664,3681,3689,3696,3716,3723,3731,3748,3765,3793,3824,3831],{"type":393,"tag":428,"props":3119,"children":3120},{"class":430,"line":11},[3121,3125,3129,3133],{"type":393,"tag":428,"props":3122,"children":3123},{"style":434},[3124],{"type":399,"value":437},{"type":393,"tag":428,"props":3126,"children":3127},{"style":440},[3128],{"type":399,"value":443},{"type":393,"tag":428,"props":3130,"children":3131},{"style":434},[3132],{"type":399,"value":448},{"type":393,"tag":428,"props":3134,"children":3135},{"style":440},[3136],{"type":399,"value":453},{"type":393,"tag":428,"props":3138,"children":3139},{"class":430,"line":27},[3140,3144],{"type":393,"tag":428,"props":3141,"children":3142},{"style":434},[3143],{"type":399,"value":437},{"type":393,"tag":428,"props":3145,"children":3146},{"style":440},[3147],{"type":399,"value":465},{"type":393,"tag":428,"props":3149,"children":3150},{"class":430,"line":36},[3151],{"type":393,"tag":428,"props":3152,"children":3153},{"style":479},[3154],{"type":399,"value":3155},"# For production, you would use: from sqlalchemy import create_engine\n",{"type":393,"tag":428,"props":3157,"children":3158},{"class":430,"line":45},[3159],{"type":393,"tag":428,"props":3160,"children":3161},{"emptyLinePlaceholder":12},[3162],{"type":399,"value":473},{"type":393,"tag":428,"props":3164,"children":3165},{"class":430,"line":54},[3166],{"type":393,"tag":428,"props":3167,"children":3168},{"style":479},[3169],{"type":399,"value":3170},"# Simulate production data export workflow\n",{"type":393,"tag":428,"props":3172,"children":3173},{"class":430,"line":63},[3174,3179,3183],{"type":393,"tag":428,"props":3175,"children":3176},{"style":440},[3177],{"type":399,"value":3178},"monthly_report ",{"type":393,"tag":428,"props":3180,"children":3181},{"style":434},[3182],{"type":399,"value":495},{"type":393,"tag":428,"props":3184,"children":3185},{"style":440},[3186],{"type":399,"value":500},{"type":393,"tag":428,"props":3188,"children":3189},{"class":430,"line":72},[3190,3195,3199,3204,3208,3213,3217,3222],{"type":393,"tag":428,"props":3191,"children":3192},{"style":506},[3193],{"type":399,"value":3194},"    'report_month'",{"type":393,"tag":428,"props":3196,"children":3197},{"style":440},[3198],{"type":399,"value":514},{"type":393,"tag":428,"props":3200,"children":3201},{"style":506},[3202],{"type":399,"value":3203},"'2023-01'",{"type":393,"tag":428,"props":3205,"children":3206},{"style":440},[3207],{"type":399,"value":525},{"type":393,"tag":428,"props":3209,"children":3210},{"style":506},[3211],{"type":399,"value":3212},"'2023-02'",{"type":393,"tag":428,"props":3214,"children":3215},{"style":440},[3216],{"type":399,"value":525},{"type":393,"tag":428,"props":3218,"children":3219},{"style":506},[3220],{"type":399,"value":3221},"'2023-03'",{"type":393,"tag":428,"props":3223,"children":3224},{"style":440},[3225],{"type":399,"value":553},{"type":393,"tag":428,"props":3227,"children":3228},{"class":430,"line":83},[3229,3234,3238,3242,3246,3251,3255,3260],{"type":393,"tag":428,"props":3230,"children":3231},{"style":506},[3232],{"type":399,"value":3233},"    'total_sales'",{"type":393,"tag":428,"props":3235,"children":3236},{"style":440},[3237],{"type":399,"value":514},{"type":393,"tag":428,"props":3239,"children":3240},{"style":517},[3241],{"type":399,"value":1553},{"type":393,"tag":428,"props":3243,"children":3244},{"style":440},[3245],{"type":399,"value":525},{"type":393,"tag":428,"props":3247,"children":3248},{"style":517},[3249],{"type":399,"value":3250},"135000",{"type":393,"tag":428,"props":3252,"children":3253},{"style":440},[3254],{"type":399,"value":525},{"type":393,"tag":428,"props":3256,"children":3257},{"style":517},[3258],{"type":399,"value":3259},"145000",{"type":393,"tag":428,"props":3261,"children":3262},{"style":440},[3263],{"type":399,"value":553},{"type":393,"tag":428,"props":3265,"children":3266},{"class":430,"line":92},[3267,3272,3276,3281,3285,3290,3294,3299],{"type":393,"tag":428,"props":3268,"children":3269},{"style":506},[3270],{"type":399,"value":3271},"    'new_customers'",{"type":393,"tag":428,"props":3273,"children":3274},{"style":440},[3275],{"type":399,"value":514},{"type":393,"tag":428,"props":3277,"children":3278},{"style":517},[3279],{"type":399,"value":3280},"45",{"type":393,"tag":428,"props":3282,"children":3283},{"style":440},[3284],{"type":399,"value":525},{"type":393,"tag":428,"props":3286,"children":3287},{"style":517},[3288],{"type":399,"value":3289},"52",{"type":393,"tag":428,"props":3291,"children":3292},{"style":440},[3293],{"type":399,"value":525},{"type":393,"tag":428,"props":3295,"children":3296},{"style":517},[3297],{"type":399,"value":3298},"38",{"type":393,"tag":428,"props":3300,"children":3301},{"style":440},[3302],{"type":399,"value":553},{"type":393,"tag":428,"props":3304,"children":3305},{"class":430,"line":101},[3306,3311,3315,3320,3324,3329,3333,3338],{"type":393,"tag":428,"props":3307,"children":3308},{"style":506},[3309],{"type":399,"value":3310},"    'customer_retention'",{"type":393,"tag":428,"props":3312,"children":3313},{"style":440},[3314],{"type":399,"value":514},{"type":393,"tag":428,"props":3316,"children":3317},{"style":517},[3318],{"type":399,"value":3319},"0.92",{"type":393,"tag":428,"props":3321,"children":3322},{"style":440},[3323],{"type":399,"value":525},{"type":393,"tag":428,"props":3325,"children":3326},{"style":517},[3327],{"type":399,"value":3328},"0.88",{"type":393,"tag":428,"props":3330,"children":3331},{"style":440},[3332],{"type":399,"value":525},{"type":393,"tag":428,"props":3334,"children":3335},{"style":517},[3336],{"type":399,"value":3337},"0.90",{"type":393,"tag":428,"props":3339,"children":3340},{"style":440},[3341],{"type":399,"value":553},{"type":393,"tag":428,"props":3343,"children":3344},{"class":430,"line":110},[3345,3350,3354,3359,3363,3368,3372,3377],{"type":393,"tag":428,"props":3346,"children":3347},{"style":506},[3348],{"type":399,"value":3349},"    'avg_order_value'",{"type":393,"tag":428,"props":3351,"children":3352},{"style":440},[3353],{"type":399,"value":514},{"type":393,"tag":428,"props":3355,"children":3356},{"style":517},[3357],{"type":399,"value":3358},"285.50",{"type":393,"tag":428,"props":3360,"children":3361},{"style":440},[3362],{"type":399,"value":525},{"type":393,"tag":428,"props":3364,"children":3365},{"style":517},[3366],{"type":399,"value":3367},"295.75",{"type":393,"tag":428,"props":3369,"children":3370},{"style":440},[3371],{"type":399,"value":525},{"type":393,"tag":428,"props":3373,"children":3374},{"style":517},[3375],{"type":399,"value":3376},"310.25",{"type":393,"tag":428,"props":3378,"children":3379},{"style":440},[3380],{"type":399,"value":1729},{"type":393,"tag":428,"props":3382,"children":3383},{"class":430,"line":121},[3384],{"type":393,"tag":428,"props":3385,"children":3386},{"style":440},[3387],{"type":399,"value":753},{"type":393,"tag":428,"props":3389,"children":3390},{"class":430,"line":130},[3391],{"type":393,"tag":428,"props":3392,"children":3393},{"emptyLinePlaceholder":12},[3394],{"type":399,"value":473},{"type":393,"tag":428,"props":3396,"children":3397},{"class":430,"line":139},[3398,3402,3406,3411],{"type":393,"tag":428,"props":3399,"children":3400},{"style":517},[3401],{"type":399,"value":768},{"type":393,"tag":428,"props":3403,"children":3404},{"style":440},[3405],{"type":399,"value":773},{"type":393,"tag":428,"props":3407,"children":3408},{"style":506},[3409],{"type":399,"value":3410},"\"Monthly report data:\"",{"type":393,"tag":428,"props":3412,"children":3413},{"style":440},[3414],{"type":399,"value":783},{"type":393,"tag":428,"props":3416,"children":3417},{"class":430,"line":148},[3418,3422],{"type":393,"tag":428,"props":3419,"children":3420},{"style":517},[3421],{"type":399,"value":768},{"type":393,"tag":428,"props":3423,"children":3424},{"style":440},[3425],{"type":399,"value":3426},"(monthly_report)\n",{"type":393,"tag":428,"props":3428,"children":3429},{"class":430,"line":159},[3430,3434],{"type":393,"tag":428,"props":3431,"children":3432},{"style":517},[3433],{"type":399,"value":768},{"type":393,"tag":428,"props":3435,"children":3436},{"style":440},[3437],{"type":399,"value":807},{"type":393,"tag":428,"props":3439,"children":3440},{"class":430,"line":168},[3441],{"type":393,"tag":428,"props":3442,"children":3443},{"emptyLinePlaceholder":12},[3444],{"type":399,"value":473},{"type":393,"tag":428,"props":3446,"children":3447},{"class":430,"line":177},[3448],{"type":393,"tag":428,"props":3449,"children":3450},{"style":479},[3451],{"type":399,"value":3452},"# Using SQLite for this example (in production, use SQLAlchemy)\n",{"type":393,"tag":428,"props":3454,"children":3455},{"class":430,"line":186},[3456,3460,3464,3468,3473],{"type":393,"tag":428,"props":3457,"children":3458},{"style":440},[3459],{"type":399,"value":830},{"type":393,"tag":428,"props":3461,"children":3462},{"style":434},[3463],{"type":399,"value":495},{"type":393,"tag":428,"props":3465,"children":3466},{"style":440},[3467],{"type":399,"value":839},{"type":393,"tag":428,"props":3469,"children":3470},{"style":506},[3471],{"type":399,"value":3472},"'reporting.db'",{"type":393,"tag":428,"props":3474,"children":3475},{"style":440},[3476],{"type":399,"value":783},{"type":393,"tag":428,"props":3478,"children":3479},{"class":430,"line":197},[3480],{"type":393,"tag":428,"props":3481,"children":3482},{"emptyLinePlaceholder":12},[3483],{"type":399,"value":473},{"type":393,"tag":428,"props":3485,"children":3486},{"class":430,"line":206},[3487],{"type":393,"tag":428,"props":3488,"children":3489},{"style":479},[3490],{"type":399,"value":3491},"# Export with data type specification\n",{"type":393,"tag":428,"props":3493,"children":3494},{"class":430,"line":215},[3495,3500,3505],{"type":393,"tag":428,"props":3496,"children":3497},{"style":440},[3498],{"type":399,"value":3499},"monthly_report.to_sql(",{"type":393,"tag":428,"props":3501,"children":3502},{"style":506},[3503],{"type":399,"value":3504},"'monthly_reports'",{"type":393,"tag":428,"props":3506,"children":3507},{"style":440},[3508],{"type":399,"value":1858},{"type":393,"tag":428,"props":3510,"children":3511},{"class":430,"line":224},[3512],{"type":393,"tag":428,"props":3513,"children":3514},{"style":440},[3515],{"type":399,"value":3516},"                     conn,\n",{"type":393,"tag":428,"props":3518,"children":3519},{"class":430,"line":233},[3520,3524,3528,3533,3538],{"type":393,"tag":428,"props":3521,"children":3522},{"style":884},[3523],{"type":399,"value":1874},{"type":393,"tag":428,"props":3525,"children":3526},{"style":434},[3527],{"type":399,"value":495},{"type":393,"tag":428,"props":3529,"children":3530},{"style":506},[3531],{"type":399,"value":3532},"'append'",{"type":393,"tag":428,"props":3534,"children":3535},{"style":440},[3536],{"type":399,"value":3537},",    ",{"type":393,"tag":428,"props":3539,"children":3540},{"style":479},[3541],{"type":399,"value":3542},"# Add to existing data\n",{"type":393,"tag":428,"props":3544,"children":3545},{"class":430,"line":244},[3546,3550,3554,3558],{"type":393,"tag":428,"props":3547,"children":3548},{"style":884},[3549],{"type":399,"value":1900},{"type":393,"tag":428,"props":3551,"children":3552},{"style":434},[3553],{"type":399,"value":495},{"type":393,"tag":428,"props":3555,"children":3556},{"style":517},[3557],{"type":399,"value":914},{"type":393,"tag":428,"props":3559,"children":3560},{"style":440},[3561],{"type":399,"value":3562},",\n",{"type":393,"tag":428,"props":3564,"children":3565},{"class":430,"line":253},[3566,3571,3575],{"type":393,"tag":428,"props":3567,"children":3568},{"style":884},[3569],{"type":399,"value":3570},"                     dtype",{"type":393,"tag":428,"props":3572,"children":3573},{"style":434},[3574],{"type":399,"value":495},{"type":393,"tag":428,"props":3576,"children":3577},{"style":440},[3578],{"type":399,"value":3579},"{\n",{"type":393,"tag":428,"props":3581,"children":3582},{"class":430,"line":262},[3583,3588,3593,3598],{"type":393,"tag":428,"props":3584,"children":3585},{"style":506},[3586],{"type":399,"value":3587},"                         'report_month'",{"type":393,"tag":428,"props":3589,"children":3590},{"style":440},[3591],{"type":399,"value":3592},": ",{"type":393,"tag":428,"props":3594,"children":3595},{"style":506},[3596],{"type":399,"value":3597},"'TEXT'",{"type":393,"tag":428,"props":3599,"children":3600},{"style":440},[3601],{"type":399,"value":3562},{"type":393,"tag":428,"props":3603,"children":3604},{"class":430,"line":271},[3605,3610,3614,3619],{"type":393,"tag":428,"props":3606,"children":3607},{"style":506},[3608],{"type":399,"value":3609},"                         'total_sales'",{"type":393,"tag":428,"props":3611,"children":3612},{"style":440},[3613],{"type":399,"value":3592},{"type":393,"tag":428,"props":3615,"children":3616},{"style":506},[3617],{"type":399,"value":3618},"'INTEGER'",{"type":393,"tag":428,"props":3620,"children":3621},{"style":440},[3622],{"type":399,"value":3562},{"type":393,"tag":428,"props":3624,"children":3625},{"class":430,"line":281},[3626,3631,3635,3639],{"type":393,"tag":428,"props":3627,"children":3628},{"style":506},[3629],{"type":399,"value":3630},"                         'new_customers'",{"type":393,"tag":428,"props":3632,"children":3633},{"style":440},[3634],{"type":399,"value":3592},{"type":393,"tag":428,"props":3636,"children":3637},{"style":506},[3638],{"type":399,"value":3618},{"type":393,"tag":428,"props":3640,"children":3641},{"style":440},[3642],{"type":399,"value":3562},{"type":393,"tag":428,"props":3644,"children":3645},{"class":430,"line":290},[3646,3651,3655,3660],{"type":393,"tag":428,"props":3647,"children":3648},{"style":506},[3649],{"type":399,"value":3650},"                         'customer_retention'",{"type":393,"tag":428,"props":3652,"children":3653},{"style":440},[3654],{"type":399,"value":3592},{"type":393,"tag":428,"props":3656,"children":3657},{"style":506},[3658],{"type":399,"value":3659},"'REAL'",{"type":393,"tag":428,"props":3661,"children":3662},{"style":440},[3663],{"type":399,"value":3562},{"type":393,"tag":428,"props":3665,"children":3666},{"class":430,"line":299},[3667,3672,3676],{"type":393,"tag":428,"props":3668,"children":3669},{"style":506},[3670],{"type":399,"value":3671},"                         'avg_order_value'",{"type":393,"tag":428,"props":3673,"children":3674},{"style":440},[3675],{"type":399,"value":3592},{"type":393,"tag":428,"props":3677,"children":3678},{"style":506},[3679],{"type":399,"value":3680},"'REAL'\n",{"type":393,"tag":428,"props":3682,"children":3683},{"class":430,"line":308},[3684],{"type":393,"tag":428,"props":3685,"children":3686},{"style":440},[3687],{"type":399,"value":3688},"                     })\n",{"type":393,"tag":428,"props":3690,"children":3691},{"class":430,"line":318},[3692],{"type":393,"tag":428,"props":3693,"children":3694},{"emptyLinePlaceholder":12},[3695],{"type":399,"value":473},{"type":393,"tag":428,"props":3697,"children":3698},{"class":430,"line":327},[3699,3703,3707,3712],{"type":393,"tag":428,"props":3700,"children":3701},{"style":517},[3702],{"type":399,"value":768},{"type":393,"tag":428,"props":3704,"children":3705},{"style":440},[3706],{"type":399,"value":773},{"type":393,"tag":428,"props":3708,"children":3709},{"style":506},[3710],{"type":399,"value":3711},"\"✅ Exported with specified data types\"",{"type":393,"tag":428,"props":3713,"children":3714},{"style":440},[3715],{"type":399,"value":783},{"type":393,"tag":428,"props":3717,"children":3718},{"class":430,"line":336},[3719],{"type":393,"tag":428,"props":3720,"children":3721},{"emptyLinePlaceholder":12},[3722],{"type":399,"value":473},{"type":393,"tag":428,"props":3724,"children":3725},{"class":430,"line":346},[3726],{"type":393,"tag":428,"props":3727,"children":3728},{"style":479},[3729],{"type":399,"value":3730},"# Verify the data types\n",{"type":393,"tag":428,"props":3732,"children":3733},{"class":430,"line":355},[3734,3739,3743],{"type":393,"tag":428,"props":3735,"children":3736},{"style":440},[3737],{"type":399,"value":3738},"schema_query ",{"type":393,"tag":428,"props":3740,"children":3741},{"style":434},[3742],{"type":399,"value":495},{"type":393,"tag":428,"props":3744,"children":3745},{"style":506},[3746],{"type":399,"value":3747}," \"PRAGMA table_info(monthly_reports)\"\n",{"type":393,"tag":428,"props":3749,"children":3750},{"class":430,"line":364},[3751,3756,3760],{"type":393,"tag":428,"props":3752,"children":3753},{"style":440},[3754],{"type":399,"value":3755},"schema_info ",{"type":393,"tag":428,"props":3757,"children":3758},{"style":434},[3759],{"type":399,"value":495},{"type":393,"tag":428,"props":3761,"children":3762},{"style":440},[3763],{"type":399,"value":3764}," pd.read_sql(schema_query, conn)\n",{"type":393,"tag":428,"props":3766,"children":3767},{"class":430,"line":374},[3768,3772,3776,3780,3784,3789],{"type":393,"tag":428,"props":3769,"children":3770},{"style":517},[3771],{"type":399,"value":768},{"type":393,"tag":428,"props":3773,"children":3774},{"style":440},[3775],{"type":399,"value":773},{"type":393,"tag":428,"props":3777,"children":3778},{"style":506},[3779],{"type":399,"value":996},{"type":393,"tag":428,"props":3781,"children":3782},{"style":517},[3783],{"type":399,"value":1001},{"type":393,"tag":428,"props":3785,"children":3786},{"style":506},[3787],{"type":399,"value":3788},"Table schema:\"",{"type":393,"tag":428,"props":3790,"children":3791},{"style":440},[3792],{"type":399,"value":783},{"type":393,"tag":428,"props":3794,"children":3795},{"class":430,"line":383},[3796,3800,3805,3810,3814,3819],{"type":393,"tag":428,"props":3797,"children":3798},{"style":517},[3799],{"type":399,"value":768},{"type":393,"tag":428,"props":3801,"children":3802},{"style":440},[3803],{"type":399,"value":3804},"(schema_info[[",{"type":393,"tag":428,"props":3806,"children":3807},{"style":506},[3808],{"type":399,"value":3809},"'name'",{"type":393,"tag":428,"props":3811,"children":3812},{"style":440},[3813],{"type":399,"value":525},{"type":393,"tag":428,"props":3815,"children":3816},{"style":506},[3817],{"type":399,"value":3818},"'type'",{"type":393,"tag":428,"props":3820,"children":3821},{"style":440},[3822],{"type":399,"value":3823},"]])\n",{"type":393,"tag":428,"props":3825,"children":3826},{"class":430,"line":2893},[3827],{"type":393,"tag":428,"props":3828,"children":3829},{"emptyLinePlaceholder":12},[3830],{"type":399,"value":473},{"type":393,"tag":428,"props":3832,"children":3833},{"class":430,"line":2910},[3834],{"type":393,"tag":428,"props":3835,"children":3836},{"style":440},[3837],{"type":399,"value":1045},{"type":393,"tag":1047,"props":3839,"children":3841},{"id":3840},"update-strategies",[3842],{"type":399,"value":3843},"🔄 Update Strategies",{"type":393,"tag":402,"props":3845,"children":3846},{},[3847],{"type":399,"value":3848},"Different approaches for updating database data:",{"type":393,"tag":1059,"props":3850,"children":3854},{"emoji":3851,"title":3852,"type":3853},"🔄","Update Strategies","warning",[3855,3863,3897,3905,3946,3954],{"type":393,"tag":402,"props":3856,"children":3857},{},[3858],{"type":393,"tag":1069,"props":3859,"children":3860},{},[3861],{"type":399,"value":3862},"if_exists Options:",{"type":393,"tag":1075,"props":3864,"children":3865},{},[3866,3876,3886],{"type":393,"tag":1079,"props":3867,"children":3868},{},[3869,3874],{"type":393,"tag":424,"props":3870,"children":3872},{"className":3871},[],[3873],{"type":399,"value":896},{"type":399,"value":3875}," - Drop and recreate table (data loss risk)",{"type":393,"tag":1079,"props":3877,"children":3878},{},[3879,3884],{"type":393,"tag":424,"props":3880,"children":3882},{"className":3881},[],[3883],{"type":399,"value":3532},{"type":399,"value":3885}," - Add new rows to existing table",{"type":393,"tag":1079,"props":3887,"children":3888},{},[3889,3895],{"type":393,"tag":424,"props":3890,"children":3892},{"className":3891},[],[3893],{"type":399,"value":3894},"'fail'",{"type":399,"value":3896}," - Raise error if table exists (safe default)",{"type":393,"tag":402,"props":3898,"children":3899},{},[3900],{"type":393,"tag":1069,"props":3901,"children":3902},{},[3903],{"type":399,"value":3904},"Best Practices:",{"type":393,"tag":1075,"props":3906,"children":3907},{},[3908,3920,3931,3941],{"type":393,"tag":1079,"props":3909,"children":3910},{},[3911,3913,3918],{"type":399,"value":3912},"Use ",{"type":393,"tag":424,"props":3914,"children":3916},{"className":3915},[],[3917],{"type":399,"value":3532},{"type":399,"value":3919}," for incremental updates",{"type":393,"tag":1079,"props":3921,"children":3922},{},[3923,3924,3929],{"type":399,"value":3912},{"type":393,"tag":424,"props":3925,"children":3927},{"className":3926},[],[3928],{"type":399,"value":896},{"type":399,"value":3930}," only when you want to completely refresh",{"type":393,"tag":1079,"props":3932,"children":3933},{},[3934,3936],{"type":399,"value":3935},"Always backup before using ",{"type":393,"tag":424,"props":3937,"children":3939},{"className":3938},[],[3940],{"type":399,"value":896},{"type":393,"tag":1079,"props":3942,"children":3943},{},[3944],{"type":399,"value":3945},"Consider using unique constraints to prevent duplicates",{"type":393,"tag":402,"props":3947,"children":3948},{},[3949],{"type":393,"tag":1069,"props":3950,"children":3951},{},[3952],{"type":399,"value":3953},"Advanced Patterns:",{"type":393,"tag":1075,"props":3955,"children":3956},{},[3957,3962,3967,3972],{"type":393,"tag":1079,"props":3958,"children":3959},{},[3960],{"type":399,"value":3961},"Upsert operations (insert or update)",{"type":393,"tag":1079,"props":3963,"children":3964},{},[3965],{"type":399,"value":3966},"Staged loading (load to temp table first)",{"type":393,"tag":1079,"props":3968,"children":3969},{},[3970],{"type":399,"value":3971},"Delta processing (only changed records)",{"type":393,"tag":1079,"props":3973,"children":3974},{},[3975],{"type":399,"value":3976},"Transaction management for consistency",{"type":393,"tag":413,"props":3978,"children":3979},{},[3980],{"type":393,"tag":417,"props":3981,"children":3983},{"className":419,"code":3982,"language":421,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\n# Initial data\ninitial_inventory = pd.DataFrame({\n    'product_id': [1, 2, 3],\n    'product_name': ['Laptop', 'Mouse', 'Keyboard'],\n    'current_stock': [15, 50, 25],\n    'last_updated': pd.to_datetime(['2023-03-01', '2023-03-01', '2023-03-01'])\n})\n\n# New inventory update\ninventory_update = pd.DataFrame({\n    'product_id': [2, 3, 4],  # Product 2 & 3 updates, Product 4 is new\n    'product_name': ['Mouse', 'Keyboard', 'Monitor'],\n    'current_stock': [45, 30, 20],  # Updated quantities\n    'last_updated': pd.to_datetime(['2023-03-15', '2023-03-15', '2023-03-15'])\n})\n\nprint(\"Initial inventory:\")\nprint(initial_inventory)\nprint(\"\\nInventory update:\")\nprint(inventory_update)\n\n# Set up database\nconn = sqlite3.connect('inventory.db')\n\n# Load initial data\ninitial_inventory.to_sql('inventory', conn, if_exists='replace', index=False)\nprint(\"\\n✅ Loaded initial inventory data\")\n\n# Append new data (this will add Product 4 and duplicate updates for 2&3)\ninventory_update.to_sql('inventory', conn, if_exists='append', index=False)\nprint(\"✅ Appended inventory updates\")\n\n# Check the result\ncurrent_inventory = pd.read_sql('SELECT * FROM inventory ORDER BY product_id', conn)\nprint(\"\\nCurrent inventory in database:\")\nprint(current_inventory)\n\nprint(\"\\n⚠️  Note: Products 2 and 3 now have duplicate entries\")\nprint(\"In production, you'd use upsert operations to handle this properly\")\n\nconn.close()\n",[3984],{"type":393,"tag":424,"props":3985,"children":3986},{"__ignoreMap":6},[3987,4006,4017,4024,4032,4048,4084,4123,4161,4198,4205,4212,4220,4236,4277,4313,4355,4390,4397,4404,4424,4436,4464,4476,4483,4491,4515,4522,4530,4579,4607,4614,4622,4670,4690,4697,4705,4730,4758,4770,4777,4805,4825,4832],{"type":393,"tag":428,"props":3988,"children":3989},{"class":430,"line":11},[3990,3994,3998,4002],{"type":393,"tag":428,"props":3991,"children":3992},{"style":434},[3993],{"type":399,"value":437},{"type":393,"tag":428,"props":3995,"children":3996},{"style":440},[3997],{"type":399,"value":443},{"type":393,"tag":428,"props":3999,"children":4000},{"style":434},[4001],{"type":399,"value":448},{"type":393,"tag":428,"props":4003,"children":4004},{"style":440},[4005],{"type":399,"value":453},{"type":393,"tag":428,"props":4007,"children":4008},{"class":430,"line":27},[4009,4013],{"type":393,"tag":428,"props":4010,"children":4011},{"style":434},[4012],{"type":399,"value":437},{"type":393,"tag":428,"props":4014,"children":4015},{"style":440},[4016],{"type":399,"value":465},{"type":393,"tag":428,"props":4018,"children":4019},{"class":430,"line":36},[4020],{"type":393,"tag":428,"props":4021,"children":4022},{"emptyLinePlaceholder":12},[4023],{"type":399,"value":473},{"type":393,"tag":428,"props":4025,"children":4026},{"class":430,"line":45},[4027],{"type":393,"tag":428,"props":4028,"children":4029},{"style":479},[4030],{"type":399,"value":4031},"# Initial data\n",{"type":393,"tag":428,"props":4033,"children":4034},{"class":430,"line":54},[4035,4040,4044],{"type":393,"tag":428,"props":4036,"children":4037},{"style":440},[4038],{"type":399,"value":4039},"initial_inventory ",{"type":393,"tag":428,"props":4041,"children":4042},{"style":434},[4043],{"type":399,"value":495},{"type":393,"tag":428,"props":4045,"children":4046},{"style":440},[4047],{"type":399,"value":500},{"type":393,"tag":428,"props":4049,"children":4050},{"class":430,"line":63},[4051,4056,4060,4064,4068,4072,4076,4080],{"type":393,"tag":428,"props":4052,"children":4053},{"style":506},[4054],{"type":399,"value":4055},"    'product_id'",{"type":393,"tag":428,"props":4057,"children":4058},{"style":440},[4059],{"type":399,"value":514},{"type":393,"tag":428,"props":4061,"children":4062},{"style":517},[4063],{"type":399,"value":2156},{"type":393,"tag":428,"props":4065,"children":4066},{"style":440},[4067],{"type":399,"value":525},{"type":393,"tag":428,"props":4069,"children":4070},{"style":517},[4071],{"type":399,"value":2165},{"type":393,"tag":428,"props":4073,"children":4074},{"style":440},[4075],{"type":399,"value":525},{"type":393,"tag":428,"props":4077,"children":4078},{"style":517},[4079],{"type":399,"value":2174},{"type":393,"tag":428,"props":4081,"children":4082},{"style":440},[4083],{"type":399,"value":553},{"type":393,"tag":428,"props":4085,"children":4086},{"class":430,"line":72},[4087,4092,4096,4101,4105,4110,4114,4119],{"type":393,"tag":428,"props":4088,"children":4089},{"style":506},[4090],{"type":399,"value":4091},"    'product_name'",{"type":393,"tag":428,"props":4093,"children":4094},{"style":440},[4095],{"type":399,"value":514},{"type":393,"tag":428,"props":4097,"children":4098},{"style":506},[4099],{"type":399,"value":4100},"'Laptop'",{"type":393,"tag":428,"props":4102,"children":4103},{"style":440},[4104],{"type":399,"value":525},{"type":393,"tag":428,"props":4106,"children":4107},{"style":506},[4108],{"type":399,"value":4109},"'Mouse'",{"type":393,"tag":428,"props":4111,"children":4112},{"style":440},[4113],{"type":399,"value":525},{"type":393,"tag":428,"props":4115,"children":4116},{"style":506},[4117],{"type":399,"value":4118},"'Keyboard'",{"type":393,"tag":428,"props":4120,"children":4121},{"style":440},[4122],{"type":399,"value":553},{"type":393,"tag":428,"props":4124,"children":4125},{"class":430,"line":83},[4126,4131,4135,4139,4143,4148,4152,4157],{"type":393,"tag":428,"props":4127,"children":4128},{"style":506},[4129],{"type":399,"value":4130},"    'current_stock'",{"type":393,"tag":428,"props":4132,"children":4133},{"style":440},[4134],{"type":399,"value":514},{"type":393,"tag":428,"props":4136,"children":4137},{"style":517},[4138],{"type":399,"value":597},{"type":393,"tag":428,"props":4140,"children":4141},{"style":440},[4142],{"type":399,"value":525},{"type":393,"tag":428,"props":4144,"children":4145},{"style":517},[4146],{"type":399,"value":4147},"50",{"type":393,"tag":428,"props":4149,"children":4150},{"style":440},[4151],{"type":399,"value":525},{"type":393,"tag":428,"props":4153,"children":4154},{"style":517},[4155],{"type":399,"value":4156},"25",{"type":393,"tag":428,"props":4158,"children":4159},{"style":440},[4160],{"type":399,"value":553},{"type":393,"tag":428,"props":4162,"children":4163},{"class":430,"line":92},[4164,4169,4173,4178,4182,4186,4190,4194],{"type":393,"tag":428,"props":4165,"children":4166},{"style":506},[4167],{"type":399,"value":4168},"    'last_updated'",{"type":393,"tag":428,"props":4170,"children":4171},{"style":440},[4172],{"type":399,"value":708},{"type":393,"tag":428,"props":4174,"children":4175},{"style":506},[4176],{"type":399,"value":4177},"'2023-03-01'",{"type":393,"tag":428,"props":4179,"children":4180},{"style":440},[4181],{"type":399,"value":525},{"type":393,"tag":428,"props":4183,"children":4184},{"style":506},[4185],{"type":399,"value":4177},{"type":393,"tag":428,"props":4187,"children":4188},{"style":440},[4189],{"type":399,"value":525},{"type":393,"tag":428,"props":4191,"children":4192},{"style":506},[4193],{"type":399,"value":4177},{"type":393,"tag":428,"props":4195,"children":4196},{"style":440},[4197],{"type":399,"value":745},{"type":393,"tag":428,"props":4199,"children":4200},{"class":430,"line":101},[4201],{"type":393,"tag":428,"props":4202,"children":4203},{"style":440},[4204],{"type":399,"value":753},{"type":393,"tag":428,"props":4206,"children":4207},{"class":430,"line":110},[4208],{"type":393,"tag":428,"props":4209,"children":4210},{"emptyLinePlaceholder":12},[4211],{"type":399,"value":473},{"type":393,"tag":428,"props":4213,"children":4214},{"class":430,"line":121},[4215],{"type":393,"tag":428,"props":4216,"children":4217},{"style":479},[4218],{"type":399,"value":4219},"# New inventory update\n",{"type":393,"tag":428,"props":4221,"children":4222},{"class":430,"line":130},[4223,4228,4232],{"type":393,"tag":428,"props":4224,"children":4225},{"style":440},[4226],{"type":399,"value":4227},"inventory_update ",{"type":393,"tag":428,"props":4229,"children":4230},{"style":434},[4231],{"type":399,"value":495},{"type":393,"tag":428,"props":4233,"children":4234},{"style":440},[4235],{"type":399,"value":500},{"type":393,"tag":428,"props":4237,"children":4238},{"class":430,"line":139},[4239,4243,4247,4251,4255,4259,4263,4267,4272],{"type":393,"tag":428,"props":4240,"children":4241},{"style":506},[4242],{"type":399,"value":4055},{"type":393,"tag":428,"props":4244,"children":4245},{"style":440},[4246],{"type":399,"value":514},{"type":393,"tag":428,"props":4248,"children":4249},{"style":517},[4250],{"type":399,"value":2165},{"type":393,"tag":428,"props":4252,"children":4253},{"style":440},[4254],{"type":399,"value":525},{"type":393,"tag":428,"props":4256,"children":4257},{"style":517},[4258],{"type":399,"value":2174},{"type":393,"tag":428,"props":4260,"children":4261},{"style":440},[4262],{"type":399,"value":525},{"type":393,"tag":428,"props":4264,"children":4265},{"style":517},[4266],{"type":399,"value":2183},{"type":393,"tag":428,"props":4268,"children":4269},{"style":440},[4270],{"type":399,"value":4271},"],  ",{"type":393,"tag":428,"props":4273,"children":4274},{"style":479},[4275],{"type":399,"value":4276},"# Product 2 & 3 updates, Product 4 is new\n",{"type":393,"tag":428,"props":4278,"children":4279},{"class":430,"line":148},[4280,4284,4288,4292,4296,4300,4304,4309],{"type":393,"tag":428,"props":4281,"children":4282},{"style":506},[4283],{"type":399,"value":4091},{"type":393,"tag":428,"props":4285,"children":4286},{"style":440},[4287],{"type":399,"value":514},{"type":393,"tag":428,"props":4289,"children":4290},{"style":506},[4291],{"type":399,"value":4109},{"type":393,"tag":428,"props":4293,"children":4294},{"style":440},[4295],{"type":399,"value":525},{"type":393,"tag":428,"props":4297,"children":4298},{"style":506},[4299],{"type":399,"value":4118},{"type":393,"tag":428,"props":4301,"children":4302},{"style":440},[4303],{"type":399,"value":525},{"type":393,"tag":428,"props":4305,"children":4306},{"style":506},[4307],{"type":399,"value":4308},"'Monitor'",{"type":393,"tag":428,"props":4310,"children":4311},{"style":440},[4312],{"type":399,"value":553},{"type":393,"tag":428,"props":4314,"children":4315},{"class":430,"line":159},[4316,4320,4324,4328,4332,4337,4341,4346,4350],{"type":393,"tag":428,"props":4317,"children":4318},{"style":506},[4319],{"type":399,"value":4130},{"type":393,"tag":428,"props":4321,"children":4322},{"style":440},[4323],{"type":399,"value":514},{"type":393,"tag":428,"props":4325,"children":4326},{"style":517},[4327],{"type":399,"value":3280},{"type":393,"tag":428,"props":4329,"children":4330},{"style":440},[4331],{"type":399,"value":525},{"type":393,"tag":428,"props":4333,"children":4334},{"style":517},[4335],{"type":399,"value":4336},"30",{"type":393,"tag":428,"props":4338,"children":4339},{"style":440},[4340],{"type":399,"value":525},{"type":393,"tag":428,"props":4342,"children":4343},{"style":517},[4344],{"type":399,"value":4345},"20",{"type":393,"tag":428,"props":4347,"children":4348},{"style":440},[4349],{"type":399,"value":4271},{"type":393,"tag":428,"props":4351,"children":4352},{"style":479},[4353],{"type":399,"value":4354},"# Updated quantities\n",{"type":393,"tag":428,"props":4356,"children":4357},{"class":430,"line":168},[4358,4362,4366,4370,4374,4378,4382,4386],{"type":393,"tag":428,"props":4359,"children":4360},{"style":506},[4361],{"type":399,"value":4168},{"type":393,"tag":428,"props":4363,"children":4364},{"style":440},[4365],{"type":399,"value":708},{"type":393,"tag":428,"props":4367,"children":4368},{"style":506},[4369],{"type":399,"value":713},{"type":393,"tag":428,"props":4371,"children":4372},{"style":440},[4373],{"type":399,"value":525},{"type":393,"tag":428,"props":4375,"children":4376},{"style":506},[4377],{"type":399,"value":713},{"type":393,"tag":428,"props":4379,"children":4380},{"style":440},[4381],{"type":399,"value":525},{"type":393,"tag":428,"props":4383,"children":4384},{"style":506},[4385],{"type":399,"value":713},{"type":393,"tag":428,"props":4387,"children":4388},{"style":440},[4389],{"type":399,"value":745},{"type":393,"tag":428,"props":4391,"children":4392},{"class":430,"line":177},[4393],{"type":393,"tag":428,"props":4394,"children":4395},{"style":440},[4396],{"type":399,"value":753},{"type":393,"tag":428,"props":4398,"children":4399},{"class":430,"line":186},[4400],{"type":393,"tag":428,"props":4401,"children":4402},{"emptyLinePlaceholder":12},[4403],{"type":399,"value":473},{"type":393,"tag":428,"props":4405,"children":4406},{"class":430,"line":197},[4407,4411,4415,4420],{"type":393,"tag":428,"props":4408,"children":4409},{"style":517},[4410],{"type":399,"value":768},{"type":393,"tag":428,"props":4412,"children":4413},{"style":440},[4414],{"type":399,"value":773},{"type":393,"tag":428,"props":4416,"children":4417},{"style":506},[4418],{"type":399,"value":4419},"\"Initial inventory:\"",{"type":393,"tag":428,"props":4421,"children":4422},{"style":440},[4423],{"type":399,"value":783},{"type":393,"tag":428,"props":4425,"children":4426},{"class":430,"line":206},[4427,4431],{"type":393,"tag":428,"props":4428,"children":4429},{"style":517},[4430],{"type":399,"value":768},{"type":393,"tag":428,"props":4432,"children":4433},{"style":440},[4434],{"type":399,"value":4435},"(initial_inventory)\n",{"type":393,"tag":428,"props":4437,"children":4438},{"class":430,"line":215},[4439,4443,4447,4451,4455,4460],{"type":393,"tag":428,"props":4440,"children":4441},{"style":517},[4442],{"type":399,"value":768},{"type":393,"tag":428,"props":4444,"children":4445},{"style":440},[4446],{"type":399,"value":773},{"type":393,"tag":428,"props":4448,"children":4449},{"style":506},[4450],{"type":399,"value":996},{"type":393,"tag":428,"props":4452,"children":4453},{"style":517},[4454],{"type":399,"value":1001},{"type":393,"tag":428,"props":4456,"children":4457},{"style":506},[4458],{"type":399,"value":4459},"Inventory update:\"",{"type":393,"tag":428,"props":4461,"children":4462},{"style":440},[4463],{"type":399,"value":783},{"type":393,"tag":428,"props":4465,"children":4466},{"class":430,"line":224},[4467,4471],{"type":393,"tag":428,"props":4468,"children":4469},{"style":517},[4470],{"type":399,"value":768},{"type":393,"tag":428,"props":4472,"children":4473},{"style":440},[4474],{"type":399,"value":4475},"(inventory_update)\n",{"type":393,"tag":428,"props":4477,"children":4478},{"class":430,"line":233},[4479],{"type":393,"tag":428,"props":4480,"children":4481},{"emptyLinePlaceholder":12},[4482],{"type":399,"value":473},{"type":393,"tag":428,"props":4484,"children":4485},{"class":430,"line":244},[4486],{"type":393,"tag":428,"props":4487,"children":4488},{"style":479},[4489],{"type":399,"value":4490},"# Set up database\n",{"type":393,"tag":428,"props":4492,"children":4493},{"class":430,"line":253},[4494,4498,4502,4506,4511],{"type":393,"tag":428,"props":4495,"children":4496},{"style":440},[4497],{"type":399,"value":830},{"type":393,"tag":428,"props":4499,"children":4500},{"style":434},[4501],{"type":399,"value":495},{"type":393,"tag":428,"props":4503,"children":4504},{"style":440},[4505],{"type":399,"value":839},{"type":393,"tag":428,"props":4507,"children":4508},{"style":506},[4509],{"type":399,"value":4510},"'inventory.db'",{"type":393,"tag":428,"props":4512,"children":4513},{"style":440},[4514],{"type":399,"value":783},{"type":393,"tag":428,"props":4516,"children":4517},{"class":430,"line":262},[4518],{"type":393,"tag":428,"props":4519,"children":4520},{"emptyLinePlaceholder":12},[4521],{"type":399,"value":473},{"type":393,"tag":428,"props":4523,"children":4524},{"class":430,"line":271},[4525],{"type":393,"tag":428,"props":4526,"children":4527},{"style":479},[4528],{"type":399,"value":4529},"# Load initial data\n",{"type":393,"tag":428,"props":4531,"children":4532},{"class":430,"line":281},[4533,4538,4543,4547,4551,4555,4559,4563,4567,4571,4575],{"type":393,"tag":428,"props":4534,"children":4535},{"style":440},[4536],{"type":399,"value":4537},"initial_inventory.to_sql(",{"type":393,"tag":428,"props":4539,"children":4540},{"style":506},[4541],{"type":399,"value":4542},"'inventory'",{"type":393,"tag":428,"props":4544,"children":4545},{"style":440},[4546],{"type":399,"value":881},{"type":393,"tag":428,"props":4548,"children":4549},{"style":884},[4550],{"type":399,"value":887},{"type":393,"tag":428,"props":4552,"children":4553},{"style":434},[4554],{"type":399,"value":495},{"type":393,"tag":428,"props":4556,"children":4557},{"style":506},[4558],{"type":399,"value":896},{"type":393,"tag":428,"props":4560,"children":4561},{"style":440},[4562],{"type":399,"value":525},{"type":393,"tag":428,"props":4564,"children":4565},{"style":884},[4566],{"type":399,"value":905},{"type":393,"tag":428,"props":4568,"children":4569},{"style":434},[4570],{"type":399,"value":495},{"type":393,"tag":428,"props":4572,"children":4573},{"style":517},[4574],{"type":399,"value":914},{"type":393,"tag":428,"props":4576,"children":4577},{"style":440},[4578],{"type":399,"value":783},{"type":393,"tag":428,"props":4580,"children":4581},{"class":430,"line":290},[4582,4586,4590,4594,4598,4603],{"type":393,"tag":428,"props":4583,"children":4584},{"style":517},[4585],{"type":399,"value":768},{"type":393,"tag":428,"props":4587,"children":4588},{"style":440},[4589],{"type":399,"value":773},{"type":393,"tag":428,"props":4591,"children":4592},{"style":506},[4593],{"type":399,"value":996},{"type":393,"tag":428,"props":4595,"children":4596},{"style":517},[4597],{"type":399,"value":1001},{"type":393,"tag":428,"props":4599,"children":4600},{"style":506},[4601],{"type":399,"value":4602},"✅ Loaded initial inventory data\"",{"type":393,"tag":428,"props":4604,"children":4605},{"style":440},[4606],{"type":399,"value":783},{"type":393,"tag":428,"props":4608,"children":4609},{"class":430,"line":299},[4610],{"type":393,"tag":428,"props":4611,"children":4612},{"emptyLinePlaceholder":12},[4613],{"type":399,"value":473},{"type":393,"tag":428,"props":4615,"children":4616},{"class":430,"line":308},[4617],{"type":393,"tag":428,"props":4618,"children":4619},{"style":479},[4620],{"type":399,"value":4621},"# Append new data (this will add Product 4 and duplicate updates for 2&3)\n",{"type":393,"tag":428,"props":4623,"children":4624},{"class":430,"line":318},[4625,4630,4634,4638,4642,4646,4650,4654,4658,4662,4666],{"type":393,"tag":428,"props":4626,"children":4627},{"style":440},[4628],{"type":399,"value":4629},"inventory_update.to_sql(",{"type":393,"tag":428,"props":4631,"children":4632},{"style":506},[4633],{"type":399,"value":4542},{"type":393,"tag":428,"props":4635,"children":4636},{"style":440},[4637],{"type":399,"value":881},{"type":393,"tag":428,"props":4639,"children":4640},{"style":884},[4641],{"type":399,"value":887},{"type":393,"tag":428,"props":4643,"children":4644},{"style":434},[4645],{"type":399,"value":495},{"type":393,"tag":428,"props":4647,"children":4648},{"style":506},[4649],{"type":399,"value":3532},{"type":393,"tag":428,"props":4651,"children":4652},{"style":440},[4653],{"type":399,"value":525},{"type":393,"tag":428,"props":4655,"children":4656},{"style":884},[4657],{"type":399,"value":905},{"type":393,"tag":428,"props":4659,"children":4660},{"style":434},[4661],{"type":399,"value":495},{"type":393,"tag":428,"props":4663,"children":4664},{"style":517},[4665],{"type":399,"value":914},{"type":393,"tag":428,"props":4667,"children":4668},{"style":440},[4669],{"type":399,"value":783},{"type":393,"tag":428,"props":4671,"children":4672},{"class":430,"line":327},[4673,4677,4681,4686],{"type":393,"tag":428,"props":4674,"children":4675},{"style":517},[4676],{"type":399,"value":768},{"type":393,"tag":428,"props":4678,"children":4679},{"style":440},[4680],{"type":399,"value":773},{"type":393,"tag":428,"props":4682,"children":4683},{"style":506},[4684],{"type":399,"value":4685},"\"✅ Appended inventory updates\"",{"type":393,"tag":428,"props":4687,"children":4688},{"style":440},[4689],{"type":399,"value":783},{"type":393,"tag":428,"props":4691,"children":4692},{"class":430,"line":336},[4693],{"type":393,"tag":428,"props":4694,"children":4695},{"emptyLinePlaceholder":12},[4696],{"type":399,"value":473},{"type":393,"tag":428,"props":4698,"children":4699},{"class":430,"line":346},[4700],{"type":393,"tag":428,"props":4701,"children":4702},{"style":479},[4703],{"type":399,"value":4704},"# Check the result\n",{"type":393,"tag":428,"props":4706,"children":4707},{"class":430,"line":355},[4708,4713,4717,4721,4726],{"type":393,"tag":428,"props":4709,"children":4710},{"style":440},[4711],{"type":399,"value":4712},"current_inventory ",{"type":393,"tag":428,"props":4714,"children":4715},{"style":434},[4716],{"type":399,"value":495},{"type":393,"tag":428,"props":4718,"children":4719},{"style":440},[4720],{"type":399,"value":970},{"type":393,"tag":428,"props":4722,"children":4723},{"style":506},[4724],{"type":399,"value":4725},"'SELECT * FROM inventory ORDER BY product_id'",{"type":393,"tag":428,"props":4727,"children":4728},{"style":440},[4729],{"type":399,"value":980},{"type":393,"tag":428,"props":4731,"children":4732},{"class":430,"line":364},[4733,4737,4741,4745,4749,4754],{"type":393,"tag":428,"props":4734,"children":4735},{"style":517},[4736],{"type":399,"value":768},{"type":393,"tag":428,"props":4738,"children":4739},{"style":440},[4740],{"type":399,"value":773},{"type":393,"tag":428,"props":4742,"children":4743},{"style":506},[4744],{"type":399,"value":996},{"type":393,"tag":428,"props":4746,"children":4747},{"style":517},[4748],{"type":399,"value":1001},{"type":393,"tag":428,"props":4750,"children":4751},{"style":506},[4752],{"type":399,"value":4753},"Current inventory in database:\"",{"type":393,"tag":428,"props":4755,"children":4756},{"style":440},[4757],{"type":399,"value":783},{"type":393,"tag":428,"props":4759,"children":4760},{"class":430,"line":374},[4761,4765],{"type":393,"tag":428,"props":4762,"children":4763},{"style":517},[4764],{"type":399,"value":768},{"type":393,"tag":428,"props":4766,"children":4767},{"style":440},[4768],{"type":399,"value":4769},"(current_inventory)\n",{"type":393,"tag":428,"props":4771,"children":4772},{"class":430,"line":383},[4773],{"type":393,"tag":428,"props":4774,"children":4775},{"emptyLinePlaceholder":12},[4776],{"type":399,"value":473},{"type":393,"tag":428,"props":4778,"children":4779},{"class":430,"line":2893},[4780,4784,4788,4792,4796,4801],{"type":393,"tag":428,"props":4781,"children":4782},{"style":517},[4783],{"type":399,"value":768},{"type":393,"tag":428,"props":4785,"children":4786},{"style":440},[4787],{"type":399,"value":773},{"type":393,"tag":428,"props":4789,"children":4790},{"style":506},[4791],{"type":399,"value":996},{"type":393,"tag":428,"props":4793,"children":4794},{"style":517},[4795],{"type":399,"value":1001},{"type":393,"tag":428,"props":4797,"children":4798},{"style":506},[4799],{"type":399,"value":4800},"⚠️  Note: Products 2 and 3 now have duplicate entries\"",{"type":393,"tag":428,"props":4802,"children":4803},{"style":440},[4804],{"type":399,"value":783},{"type":393,"tag":428,"props":4806,"children":4807},{"class":430,"line":2910},[4808,4812,4816,4821],{"type":393,"tag":428,"props":4809,"children":4810},{"style":517},[4811],{"type":399,"value":768},{"type":393,"tag":428,"props":4813,"children":4814},{"style":440},[4815],{"type":399,"value":773},{"type":393,"tag":428,"props":4817,"children":4818},{"style":506},[4819],{"type":399,"value":4820},"\"In production, you'd use upsert operations to handle this properly\"",{"type":393,"tag":428,"props":4822,"children":4823},{"style":440},[4824],{"type":399,"value":783},{"type":393,"tag":428,"props":4826,"children":4827},{"class":430,"line":2939},[4828],{"type":393,"tag":428,"props":4829,"children":4830},{"emptyLinePlaceholder":12},[4831],{"type":399,"value":473},{"type":393,"tag":428,"props":4833,"children":4834},{"class":430,"line":2952},[4835],{"type":393,"tag":428,"props":4836,"children":4837},{"style":440},[4838],{"type":399,"value":1045},{"type":393,"tag":1047,"props":4840,"children":4842},{"id":4841},"real-world-database-export-example",[4843],{"type":399,"value":4844},"📊 Real-World Database Export Example",{"type":393,"tag":402,"props":4846,"children":4847},{},[4848],{"type":399,"value":4849},"Complete workflow for business intelligence export:",{"type":393,"tag":413,"props":4851,"children":4852},{},[4853],{"type":393,"tag":417,"props":4854,"children":4856},{"className":419,"code":4855,"language":421,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\n# Comprehensive business intelligence data\ncustomer_metrics = pd.DataFrame({\n    'customer_id': [1001, 1002, 1003, 1004, 1005],\n    'acquisition_date': pd.to_datetime(['2022-01-15', '2022-03-20', '2022-06-10', '2022-08-05', '2022-11-12']),\n    'total_orders': [15, 8, 22, 12, 18],\n    'total_revenue': [4500.75, 2390.50, 6780.25, 3450.00, 5220.80],\n    'avg_order_value': [300.05, 298.81, 308.19, 287.50, 290.04],\n    'last_order_date': pd.to_datetime(['2023-03-20', '2023-02-15', '2023-03-25', '2023-03-10', '2023-03-22']),\n    'customer_lifetime_days': [430, 360, 288, 217, 130],\n    'predicted_churn_risk': [0.15, 0.35, 0.08, 0.25, 0.12]\n})\n\nproduct_performance = pd.DataFrame({\n    'product_id': [101, 102, 103, 104, 105],\n    'product_name': ['Laptop Pro', 'Wireless Mouse', 'Mechanical Keyboard', '4K Monitor', 'Webcam HD'],\n    'category': ['Computers', 'Accessories', 'Accessories', 'Monitors', 'Accessories'],\n    'units_sold_ytd': [145, 320, 180, 95, 240],\n    'revenue_ytd': [217500, 16000, 22500, 47500, 14400],\n    'profit_margin': [0.22, 0.35, 0.28, 0.25, 0.40],\n    'inventory_turnover': [4.2, 8.5, 6.1, 3.8, 9.2]\n})\n\nprint(\"Customer metrics:\")\nprint(customer_metrics.head())\nprint(\"\\nProduct performance:\")\nprint(product_performance.head())\n\n# Connect to business intelligence database\nconn = sqlite3.connect('business_intelligence.db')\n\n# Export comprehensive business data\ncustomer_metrics.to_sql('customer_analytics', \n                       conn, \n                       if_exists='replace', \n                       index=False)\n\nproduct_performance.to_sql('product_analytics', \n                          conn, \n                          if_exists='replace', \n                          index=False)\n\nprint(\"\\n✅ Exported comprehensive business intelligence data\")\n\n# Create a business summary view with SQL\nsummary_query = \"\"\"\nSELECT \n    'Customer Metrics' as data_type,\n    COUNT(*) as record_count,\n    AVG(total_revenue) as avg_value\nFROM customer_analytics\nUNION ALL\nSELECT \n    'Product Performance' as data_type,\n    COUNT(*) as record_count,\n    AVG(revenue_ytd) as avg_value\nFROM product_analytics\n\"\"\"\n\nsummary_stats = pd.read_sql(summary_query, conn)\nprint(\"\\nBusiness intelligence summary:\")\nprint(summary_stats)\n\n# Export summary back to database for dashboards\nsummary_stats.to_sql('bi_summary', conn, if_exists='replace', index=False)\nprint(\"\\n✅ Created summary table for dashboard consumption\")\n\nconn.close()\n",[4857],{"type":393,"tag":424,"props":4858,"children":4859},{"__ignoreMap":6},[4860,4879,4890,4897,4905,4921,4973,5031,5084,5140,5196,5249,5306,5362,5369,5376,5392,5443,5499,5554,5611,5668,5720,5777,5784,5791,5811,5823,5851,5863,5870,5878,5902,5909,5917,5934,5942,5962,5982,5989,6006,6014,6034,6054,6061,6089,6097,6106,6123,6132,6141,6150,6159,6168,6177,6185,6194,6202,6211,6220,6228,6236,6254,6283,6296,6304,6313,6363,6392,6400],{"type":393,"tag":428,"props":4861,"children":4862},{"class":430,"line":11},[4863,4867,4871,4875],{"type":393,"tag":428,"props":4864,"children":4865},{"style":434},[4866],{"type":399,"value":437},{"type":393,"tag":428,"props":4868,"children":4869},{"style":440},[4870],{"type":399,"value":443},{"type":393,"tag":428,"props":4872,"children":4873},{"style":434},[4874],{"type":399,"value":448},{"type":393,"tag":428,"props":4876,"children":4877},{"style":440},[4878],{"type":399,"value":453},{"type":393,"tag":428,"props":4880,"children":4881},{"class":430,"line":27},[4882,4886],{"type":393,"tag":428,"props":4883,"children":4884},{"style":434},[4885],{"type":399,"value":437},{"type":393,"tag":428,"props":4887,"children":4888},{"style":440},[4889],{"type":399,"value":465},{"type":393,"tag":428,"props":4891,"children":4892},{"class":430,"line":36},[4893],{"type":393,"tag":428,"props":4894,"children":4895},{"emptyLinePlaceholder":12},[4896],{"type":399,"value":473},{"type":393,"tag":428,"props":4898,"children":4899},{"class":430,"line":45},[4900],{"type":393,"tag":428,"props":4901,"children":4902},{"style":479},[4903],{"type":399,"value":4904},"# Comprehensive business intelligence data\n",{"type":393,"tag":428,"props":4906,"children":4907},{"class":430,"line":54},[4908,4913,4917],{"type":393,"tag":428,"props":4909,"children":4910},{"style":440},[4911],{"type":399,"value":4912},"customer_metrics ",{"type":393,"tag":428,"props":4914,"children":4915},{"style":434},[4916],{"type":399,"value":495},{"type":393,"tag":428,"props":4918,"children":4919},{"style":440},[4920],{"type":399,"value":500},{"type":393,"tag":428,"props":4922,"children":4923},{"class":430,"line":63},[4924,4928,4932,4936,4940,4944,4948,4952,4956,4960,4964,4969],{"type":393,"tag":428,"props":4925,"children":4926},{"style":506},[4927],{"type":399,"value":509},{"type":393,"tag":428,"props":4929,"children":4930},{"style":440},[4931],{"type":399,"value":514},{"type":393,"tag":428,"props":4933,"children":4934},{"style":517},[4935],{"type":399,"value":520},{"type":393,"tag":428,"props":4937,"children":4938},{"style":440},[4939],{"type":399,"value":525},{"type":393,"tag":428,"props":4941,"children":4942},{"style":517},[4943],{"type":399,"value":530},{"type":393,"tag":428,"props":4945,"children":4946},{"style":440},[4947],{"type":399,"value":525},{"type":393,"tag":428,"props":4949,"children":4950},{"style":517},[4951],{"type":399,"value":539},{"type":393,"tag":428,"props":4953,"children":4954},{"style":440},[4955],{"type":399,"value":525},{"type":393,"tag":428,"props":4957,"children":4958},{"style":517},[4959],{"type":399,"value":548},{"type":393,"tag":428,"props":4961,"children":4962},{"style":440},[4963],{"type":399,"value":525},{"type":393,"tag":428,"props":4965,"children":4966},{"style":517},[4967],{"type":399,"value":4968},"1005",{"type":393,"tag":428,"props":4970,"children":4971},{"style":440},[4972],{"type":399,"value":553},{"type":393,"tag":428,"props":4974,"children":4975},{"class":430,"line":72},[4976,4981,4985,4990,4994,4999,5003,5008,5012,5017,5021,5026],{"type":393,"tag":428,"props":4977,"children":4978},{"style":506},[4979],{"type":399,"value":4980},"    'acquisition_date'",{"type":393,"tag":428,"props":4982,"children":4983},{"style":440},[4984],{"type":399,"value":708},{"type":393,"tag":428,"props":4986,"children":4987},{"style":506},[4988],{"type":399,"value":4989},"'2022-01-15'",{"type":393,"tag":428,"props":4991,"children":4992},{"style":440},[4993],{"type":399,"value":525},{"type":393,"tag":428,"props":4995,"children":4996},{"style":506},[4997],{"type":399,"value":4998},"'2022-03-20'",{"type":393,"tag":428,"props":5000,"children":5001},{"style":440},[5002],{"type":399,"value":525},{"type":393,"tag":428,"props":5004,"children":5005},{"style":506},[5006],{"type":399,"value":5007},"'2022-06-10'",{"type":393,"tag":428,"props":5009,"children":5010},{"style":440},[5011],{"type":399,"value":525},{"type":393,"tag":428,"props":5013,"children":5014},{"style":506},[5015],{"type":399,"value":5016},"'2022-08-05'",{"type":393,"tag":428,"props":5018,"children":5019},{"style":440},[5020],{"type":399,"value":525},{"type":393,"tag":428,"props":5022,"children":5023},{"style":506},[5024],{"type":399,"value":5025},"'2022-11-12'",{"type":393,"tag":428,"props":5027,"children":5028},{"style":440},[5029],{"type":399,"value":5030},"]),\n",{"type":393,"tag":428,"props":5032,"children":5033},{"class":430,"line":83},[5034,5038,5042,5046,5050,5054,5058,5063,5067,5071,5075,5080],{"type":393,"tag":428,"props":5035,"children":5036},{"style":506},[5037],{"type":399,"value":561},{"type":393,"tag":428,"props":5039,"children":5040},{"style":440},[5041],{"type":399,"value":514},{"type":393,"tag":428,"props":5043,"children":5044},{"style":517},[5045],{"type":399,"value":597},{"type":393,"tag":428,"props":5047,"children":5048},{"style":440},[5049],{"type":399,"value":525},{"type":393,"tag":428,"props":5051,"children":5052},{"style":517},[5053],{"type":399,"value":570},{"type":393,"tag":428,"props":5055,"children":5056},{"style":440},[5057],{"type":399,"value":525},{"type":393,"tag":428,"props":5059,"children":5060},{"style":517},[5061],{"type":399,"value":5062},"22",{"type":393,"tag":428,"props":5064,"children":5065},{"style":440},[5066],{"type":399,"value":525},{"type":393,"tag":428,"props":5068,"children":5069},{"style":517},[5070],{"type":399,"value":579},{"type":393,"tag":428,"props":5072,"children":5073},{"style":440},[5074],{"type":399,"value":525},{"type":393,"tag":428,"props":5076,"children":5077},{"style":517},[5078],{"type":399,"value":5079},"18",{"type":393,"tag":428,"props":5081,"children":5082},{"style":440},[5083],{"type":399,"value":553},{"type":393,"tag":428,"props":5085,"children":5086},{"class":430,"line":92},[5087,5091,5095,5100,5104,5109,5113,5118,5122,5127,5131,5136],{"type":393,"tag":428,"props":5088,"children":5089},{"style":506},[5090],{"type":399,"value":1544},{"type":393,"tag":428,"props":5092,"children":5093},{"style":440},[5094],{"type":399,"value":514},{"type":393,"tag":428,"props":5096,"children":5097},{"style":517},[5098],{"type":399,"value":5099},"4500.75",{"type":393,"tag":428,"props":5101,"children":5102},{"style":440},[5103],{"type":399,"value":525},{"type":393,"tag":428,"props":5105,"children":5106},{"style":517},[5107],{"type":399,"value":5108},"2390.50",{"type":393,"tag":428,"props":5110,"children":5111},{"style":440},[5112],{"type":399,"value":525},{"type":393,"tag":428,"props":5114,"children":5115},{"style":517},[5116],{"type":399,"value":5117},"6780.25",{"type":393,"tag":428,"props":5119,"children":5120},{"style":440},[5121],{"type":399,"value":525},{"type":393,"tag":428,"props":5123,"children":5124},{"style":517},[5125],{"type":399,"value":5126},"3450.00",{"type":393,"tag":428,"props":5128,"children":5129},{"style":440},[5130],{"type":399,"value":525},{"type":393,"tag":428,"props":5132,"children":5133},{"style":517},[5134],{"type":399,"value":5135},"5220.80",{"type":393,"tag":428,"props":5137,"children":5138},{"style":440},[5139],{"type":399,"value":553},{"type":393,"tag":428,"props":5141,"children":5142},{"class":430,"line":101},[5143,5147,5151,5156,5160,5165,5169,5174,5178,5183,5187,5192],{"type":393,"tag":428,"props":5144,"children":5145},{"style":506},[5146],{"type":399,"value":3349},{"type":393,"tag":428,"props":5148,"children":5149},{"style":440},[5150],{"type":399,"value":514},{"type":393,"tag":428,"props":5152,"children":5153},{"style":517},[5154],{"type":399,"value":5155},"300.05",{"type":393,"tag":428,"props":5157,"children":5158},{"style":440},[5159],{"type":399,"value":525},{"type":393,"tag":428,"props":5161,"children":5162},{"style":517},[5163],{"type":399,"value":5164},"298.81",{"type":393,"tag":428,"props":5166,"children":5167},{"style":440},[5168],{"type":399,"value":525},{"type":393,"tag":428,"props":5170,"children":5171},{"style":517},[5172],{"type":399,"value":5173},"308.19",{"type":393,"tag":428,"props":5175,"children":5176},{"style":440},[5177],{"type":399,"value":525},{"type":393,"tag":428,"props":5179,"children":5180},{"style":517},[5181],{"type":399,"value":5182},"287.50",{"type":393,"tag":428,"props":5184,"children":5185},{"style":440},[5186],{"type":399,"value":525},{"type":393,"tag":428,"props":5188,"children":5189},{"style":517},[5190],{"type":399,"value":5191},"290.04",{"type":393,"tag":428,"props":5193,"children":5194},{"style":440},[5195],{"type":399,"value":553},{"type":393,"tag":428,"props":5197,"children":5198},{"class":430,"line":110},[5199,5203,5207,5211,5215,5220,5224,5228,5232,5236,5240,5245],{"type":393,"tag":428,"props":5200,"children":5201},{"style":506},[5202],{"type":399,"value":703},{"type":393,"tag":428,"props":5204,"children":5205},{"style":440},[5206],{"type":399,"value":708},{"type":393,"tag":428,"props":5208,"children":5209},{"style":506},[5210],{"type":399,"value":722},{"type":393,"tag":428,"props":5212,"children":5213},{"style":440},[5214],{"type":399,"value":525},{"type":393,"tag":428,"props":5216,"children":5217},{"style":506},[5218],{"type":399,"value":5219},"'2023-02-15'",{"type":393,"tag":428,"props":5221,"children":5222},{"style":440},[5223],{"type":399,"value":525},{"type":393,"tag":428,"props":5225,"children":5226},{"style":506},[5227],{"type":399,"value":740},{"type":393,"tag":428,"props":5229,"children":5230},{"style":440},[5231],{"type":399,"value":525},{"type":393,"tag":428,"props":5233,"children":5234},{"style":506},[5235],{"type":399,"value":731},{"type":393,"tag":428,"props":5237,"children":5238},{"style":440},[5239],{"type":399,"value":525},{"type":393,"tag":428,"props":5241,"children":5242},{"style":506},[5243],{"type":399,"value":5244},"'2023-03-22'",{"type":393,"tag":428,"props":5246,"children":5247},{"style":440},[5248],{"type":399,"value":5030},{"type":393,"tag":428,"props":5250,"children":5251},{"class":430,"line":121},[5252,5257,5261,5266,5270,5275,5279,5284,5288,5293,5297,5302],{"type":393,"tag":428,"props":5253,"children":5254},{"style":506},[5255],{"type":399,"value":5256},"    'customer_lifetime_days'",{"type":393,"tag":428,"props":5258,"children":5259},{"style":440},[5260],{"type":399,"value":514},{"type":393,"tag":428,"props":5262,"children":5263},{"style":517},[5264],{"type":399,"value":5265},"430",{"type":393,"tag":428,"props":5267,"children":5268},{"style":440},[5269],{"type":399,"value":525},{"type":393,"tag":428,"props":5271,"children":5272},{"style":517},[5273],{"type":399,"value":5274},"360",{"type":393,"tag":428,"props":5276,"children":5277},{"style":440},[5278],{"type":399,"value":525},{"type":393,"tag":428,"props":5280,"children":5281},{"style":517},[5282],{"type":399,"value":5283},"288",{"type":393,"tag":428,"props":5285,"children":5286},{"style":440},[5287],{"type":399,"value":525},{"type":393,"tag":428,"props":5289,"children":5290},{"style":517},[5291],{"type":399,"value":5292},"217",{"type":393,"tag":428,"props":5294,"children":5295},{"style":440},[5296],{"type":399,"value":525},{"type":393,"tag":428,"props":5298,"children":5299},{"style":517},[5300],{"type":399,"value":5301},"130",{"type":393,"tag":428,"props":5303,"children":5304},{"style":440},[5305],{"type":399,"value":553},{"type":393,"tag":428,"props":5307,"children":5308},{"class":430,"line":130},[5309,5314,5318,5323,5327,5331,5335,5340,5344,5349,5353,5358],{"type":393,"tag":428,"props":5310,"children":5311},{"style":506},[5312],{"type":399,"value":5313},"    'predicted_churn_risk'",{"type":393,"tag":428,"props":5315,"children":5316},{"style":440},[5317],{"type":399,"value":514},{"type":393,"tag":428,"props":5319,"children":5320},{"style":517},[5321],{"type":399,"value":5322},"0.15",{"type":393,"tag":428,"props":5324,"children":5325},{"style":440},[5326],{"type":399,"value":525},{"type":393,"tag":428,"props":5328,"children":5329},{"style":517},[5330],{"type":399,"value":1706},{"type":393,"tag":428,"props":5332,"children":5333},{"style":440},[5334],{"type":399,"value":525},{"type":393,"tag":428,"props":5336,"children":5337},{"style":517},[5338],{"type":399,"value":5339},"0.08",{"type":393,"tag":428,"props":5341,"children":5342},{"style":440},[5343],{"type":399,"value":525},{"type":393,"tag":428,"props":5345,"children":5346},{"style":517},[5347],{"type":399,"value":5348},"0.25",{"type":393,"tag":428,"props":5350,"children":5351},{"style":440},[5352],{"type":399,"value":525},{"type":393,"tag":428,"props":5354,"children":5355},{"style":517},[5356],{"type":399,"value":5357},"0.12",{"type":393,"tag":428,"props":5359,"children":5360},{"style":440},[5361],{"type":399,"value":1729},{"type":393,"tag":428,"props":5363,"children":5364},{"class":430,"line":139},[5365],{"type":393,"tag":428,"props":5366,"children":5367},{"style":440},[5368],{"type":399,"value":753},{"type":393,"tag":428,"props":5370,"children":5371},{"class":430,"line":148},[5372],{"type":393,"tag":428,"props":5373,"children":5374},{"emptyLinePlaceholder":12},[5375],{"type":399,"value":473},{"type":393,"tag":428,"props":5377,"children":5378},{"class":430,"line":159},[5379,5384,5388],{"type":393,"tag":428,"props":5380,"children":5381},{"style":440},[5382],{"type":399,"value":5383},"product_performance ",{"type":393,"tag":428,"props":5385,"children":5386},{"style":434},[5387],{"type":399,"value":495},{"type":393,"tag":428,"props":5389,"children":5390},{"style":440},[5391],{"type":399,"value":500},{"type":393,"tag":428,"props":5393,"children":5394},{"class":430,"line":168},[5395,5399,5403,5407,5411,5415,5419,5423,5427,5431,5435,5439],{"type":393,"tag":428,"props":5396,"children":5397},{"style":506},[5398],{"type":399,"value":4055},{"type":393,"tag":428,"props":5400,"children":5401},{"style":440},[5402],{"type":399,"value":514},{"type":393,"tag":428,"props":5404,"children":5405},{"style":517},[5406],{"type":399,"value":2326},{"type":393,"tag":428,"props":5408,"children":5409},{"style":440},[5410],{"type":399,"value":525},{"type":393,"tag":428,"props":5412,"children":5413},{"style":517},[5414],{"type":399,"value":2335},{"type":393,"tag":428,"props":5416,"children":5417},{"style":440},[5418],{"type":399,"value":525},{"type":393,"tag":428,"props":5420,"children":5421},{"style":517},[5422],{"type":399,"value":2344},{"type":393,"tag":428,"props":5424,"children":5425},{"style":440},[5426],{"type":399,"value":525},{"type":393,"tag":428,"props":5428,"children":5429},{"style":517},[5430],{"type":399,"value":2353},{"type":393,"tag":428,"props":5432,"children":5433},{"style":440},[5434],{"type":399,"value":525},{"type":393,"tag":428,"props":5436,"children":5437},{"style":517},[5438],{"type":399,"value":2362},{"type":393,"tag":428,"props":5440,"children":5441},{"style":440},[5442],{"type":399,"value":553},{"type":393,"tag":428,"props":5444,"children":5445},{"class":430,"line":177},[5446,5450,5454,5459,5463,5468,5472,5477,5481,5486,5490,5495],{"type":393,"tag":428,"props":5447,"children":5448},{"style":506},[5449],{"type":399,"value":4091},{"type":393,"tag":428,"props":5451,"children":5452},{"style":440},[5453],{"type":399,"value":514},{"type":393,"tag":428,"props":5455,"children":5456},{"style":506},[5457],{"type":399,"value":5458},"'Laptop Pro'",{"type":393,"tag":428,"props":5460,"children":5461},{"style":440},[5462],{"type":399,"value":525},{"type":393,"tag":428,"props":5464,"children":5465},{"style":506},[5466],{"type":399,"value":5467},"'Wireless Mouse'",{"type":393,"tag":428,"props":5469,"children":5470},{"style":440},[5471],{"type":399,"value":525},{"type":393,"tag":428,"props":5473,"children":5474},{"style":506},[5475],{"type":399,"value":5476},"'Mechanical Keyboard'",{"type":393,"tag":428,"props":5478,"children":5479},{"style":440},[5480],{"type":399,"value":525},{"type":393,"tag":428,"props":5482,"children":5483},{"style":506},[5484],{"type":399,"value":5485},"'4K Monitor'",{"type":393,"tag":428,"props":5487,"children":5488},{"style":440},[5489],{"type":399,"value":525},{"type":393,"tag":428,"props":5491,"children":5492},{"style":506},[5493],{"type":399,"value":5494},"'Webcam HD'",{"type":393,"tag":428,"props":5496,"children":5497},{"style":440},[5498],{"type":399,"value":553},{"type":393,"tag":428,"props":5500,"children":5501},{"class":430,"line":186},[5502,5507,5511,5516,5520,5525,5529,5533,5537,5542,5546,5550],{"type":393,"tag":428,"props":5503,"children":5504},{"style":506},[5505],{"type":399,"value":5506},"    'category'",{"type":393,"tag":428,"props":5508,"children":5509},{"style":440},[5510],{"type":399,"value":514},{"type":393,"tag":428,"props":5512,"children":5513},{"style":506},[5514],{"type":399,"value":5515},"'Computers'",{"type":393,"tag":428,"props":5517,"children":5518},{"style":440},[5519],{"type":399,"value":525},{"type":393,"tag":428,"props":5521,"children":5522},{"style":506},[5523],{"type":399,"value":5524},"'Accessories'",{"type":393,"tag":428,"props":5526,"children":5527},{"style":440},[5528],{"type":399,"value":525},{"type":393,"tag":428,"props":5530,"children":5531},{"style":506},[5532],{"type":399,"value":5524},{"type":393,"tag":428,"props":5534,"children":5535},{"style":440},[5536],{"type":399,"value":525},{"type":393,"tag":428,"props":5538,"children":5539},{"style":506},[5540],{"type":399,"value":5541},"'Monitors'",{"type":393,"tag":428,"props":5543,"children":5544},{"style":440},[5545],{"type":399,"value":525},{"type":393,"tag":428,"props":5547,"children":5548},{"style":506},[5549],{"type":399,"value":5524},{"type":393,"tag":428,"props":5551,"children":5552},{"style":440},[5553],{"type":399,"value":553},{"type":393,"tag":428,"props":5555,"children":5556},{"class":430,"line":197},[5557,5562,5566,5571,5575,5580,5584,5589,5593,5598,5602,5607],{"type":393,"tag":428,"props":5558,"children":5559},{"style":506},[5560],{"type":399,"value":5561},"    'units_sold_ytd'",{"type":393,"tag":428,"props":5563,"children":5564},{"style":440},[5565],{"type":399,"value":514},{"type":393,"tag":428,"props":5567,"children":5568},{"style":517},[5569],{"type":399,"value":5570},"145",{"type":393,"tag":428,"props":5572,"children":5573},{"style":440},[5574],{"type":399,"value":525},{"type":393,"tag":428,"props":5576,"children":5577},{"style":517},[5578],{"type":399,"value":5579},"320",{"type":393,"tag":428,"props":5581,"children":5582},{"style":440},[5583],{"type":399,"value":525},{"type":393,"tag":428,"props":5585,"children":5586},{"style":517},[5587],{"type":399,"value":5588},"180",{"type":393,"tag":428,"props":5590,"children":5591},{"style":440},[5592],{"type":399,"value":525},{"type":393,"tag":428,"props":5594,"children":5595},{"style":517},[5596],{"type":399,"value":5597},"95",{"type":393,"tag":428,"props":5599,"children":5600},{"style":440},[5601],{"type":399,"value":525},{"type":393,"tag":428,"props":5603,"children":5604},{"style":517},[5605],{"type":399,"value":5606},"240",{"type":393,"tag":428,"props":5608,"children":5609},{"style":440},[5610],{"type":399,"value":553},{"type":393,"tag":428,"props":5612,"children":5613},{"class":430,"line":206},[5614,5619,5623,5628,5632,5637,5641,5646,5650,5655,5659,5664],{"type":393,"tag":428,"props":5615,"children":5616},{"style":506},[5617],{"type":399,"value":5618},"    'revenue_ytd'",{"type":393,"tag":428,"props":5620,"children":5621},{"style":440},[5622],{"type":399,"value":514},{"type":393,"tag":428,"props":5624,"children":5625},{"style":517},[5626],{"type":399,"value":5627},"217500",{"type":393,"tag":428,"props":5629,"children":5630},{"style":440},[5631],{"type":399,"value":525},{"type":393,"tag":428,"props":5633,"children":5634},{"style":517},[5635],{"type":399,"value":5636},"16000",{"type":393,"tag":428,"props":5638,"children":5639},{"style":440},[5640],{"type":399,"value":525},{"type":393,"tag":428,"props":5642,"children":5643},{"style":517},[5644],{"type":399,"value":5645},"22500",{"type":393,"tag":428,"props":5647,"children":5648},{"style":440},[5649],{"type":399,"value":525},{"type":393,"tag":428,"props":5651,"children":5652},{"style":517},[5653],{"type":399,"value":5654},"47500",{"type":393,"tag":428,"props":5656,"children":5657},{"style":440},[5658],{"type":399,"value":525},{"type":393,"tag":428,"props":5660,"children":5661},{"style":517},[5662],{"type":399,"value":5663},"14400",{"type":393,"tag":428,"props":5665,"children":5666},{"style":440},[5667],{"type":399,"value":553},{"type":393,"tag":428,"props":5669,"children":5670},{"class":430,"line":215},[5671,5675,5679,5683,5687,5691,5695,5699,5703,5707,5711,5716],{"type":393,"tag":428,"props":5672,"children":5673},{"style":506},[5674],{"type":399,"value":1688},{"type":393,"tag":428,"props":5676,"children":5677},{"style":440},[5678],{"type":399,"value":514},{"type":393,"tag":428,"props":5680,"children":5681},{"style":517},[5682],{"type":399,"value":1697},{"type":393,"tag":428,"props":5684,"children":5685},{"style":440},[5686],{"type":399,"value":525},{"type":393,"tag":428,"props":5688,"children":5689},{"style":517},[5690],{"type":399,"value":1706},{"type":393,"tag":428,"props":5692,"children":5693},{"style":440},[5694],{"type":399,"value":525},{"type":393,"tag":428,"props":5696,"children":5697},{"style":517},[5698],{"type":399,"value":1715},{"type":393,"tag":428,"props":5700,"children":5701},{"style":440},[5702],{"type":399,"value":525},{"type":393,"tag":428,"props":5704,"children":5705},{"style":517},[5706],{"type":399,"value":5348},{"type":393,"tag":428,"props":5708,"children":5709},{"style":440},[5710],{"type":399,"value":525},{"type":393,"tag":428,"props":5712,"children":5713},{"style":517},[5714],{"type":399,"value":5715},"0.40",{"type":393,"tag":428,"props":5717,"children":5718},{"style":440},[5719],{"type":399,"value":553},{"type":393,"tag":428,"props":5721,"children":5722},{"class":430,"line":224},[5723,5728,5732,5737,5741,5746,5750,5755,5759,5764,5768,5773],{"type":393,"tag":428,"props":5724,"children":5725},{"style":506},[5726],{"type":399,"value":5727},"    'inventory_turnover'",{"type":393,"tag":428,"props":5729,"children":5730},{"style":440},[5731],{"type":399,"value":514},{"type":393,"tag":428,"props":5733,"children":5734},{"style":517},[5735],{"type":399,"value":5736},"4.2",{"type":393,"tag":428,"props":5738,"children":5739},{"style":440},[5740],{"type":399,"value":525},{"type":393,"tag":428,"props":5742,"children":5743},{"style":517},[5744],{"type":399,"value":5745},"8.5",{"type":393,"tag":428,"props":5747,"children":5748},{"style":440},[5749],{"type":399,"value":525},{"type":393,"tag":428,"props":5751,"children":5752},{"style":517},[5753],{"type":399,"value":5754},"6.1",{"type":393,"tag":428,"props":5756,"children":5757},{"style":440},[5758],{"type":399,"value":525},{"type":393,"tag":428,"props":5760,"children":5761},{"style":517},[5762],{"type":399,"value":5763},"3.8",{"type":393,"tag":428,"props":5765,"children":5766},{"style":440},[5767],{"type":399,"value":525},{"type":393,"tag":428,"props":5769,"children":5770},{"style":517},[5771],{"type":399,"value":5772},"9.2",{"type":393,"tag":428,"props":5774,"children":5775},{"style":440},[5776],{"type":399,"value":1729},{"type":393,"tag":428,"props":5778,"children":5779},{"class":430,"line":233},[5780],{"type":393,"tag":428,"props":5781,"children":5782},{"style":440},[5783],{"type":399,"value":753},{"type":393,"tag":428,"props":5785,"children":5786},{"class":430,"line":244},[5787],{"type":393,"tag":428,"props":5788,"children":5789},{"emptyLinePlaceholder":12},[5790],{"type":399,"value":473},{"type":393,"tag":428,"props":5792,"children":5793},{"class":430,"line":253},[5794,5798,5802,5807],{"type":393,"tag":428,"props":5795,"children":5796},{"style":517},[5797],{"type":399,"value":768},{"type":393,"tag":428,"props":5799,"children":5800},{"style":440},[5801],{"type":399,"value":773},{"type":393,"tag":428,"props":5803,"children":5804},{"style":506},[5805],{"type":399,"value":5806},"\"Customer metrics:\"",{"type":393,"tag":428,"props":5808,"children":5809},{"style":440},[5810],{"type":399,"value":783},{"type":393,"tag":428,"props":5812,"children":5813},{"class":430,"line":262},[5814,5818],{"type":393,"tag":428,"props":5815,"children":5816},{"style":517},[5817],{"type":399,"value":768},{"type":393,"tag":428,"props":5819,"children":5820},{"style":440},[5821],{"type":399,"value":5822},"(customer_metrics.head())\n",{"type":393,"tag":428,"props":5824,"children":5825},{"class":430,"line":271},[5826,5830,5834,5838,5842,5847],{"type":393,"tag":428,"props":5827,"children":5828},{"style":517},[5829],{"type":399,"value":768},{"type":393,"tag":428,"props":5831,"children":5832},{"style":440},[5833],{"type":399,"value":773},{"type":393,"tag":428,"props":5835,"children":5836},{"style":506},[5837],{"type":399,"value":996},{"type":393,"tag":428,"props":5839,"children":5840},{"style":517},[5841],{"type":399,"value":1001},{"type":393,"tag":428,"props":5843,"children":5844},{"style":506},[5845],{"type":399,"value":5846},"Product performance:\"",{"type":393,"tag":428,"props":5848,"children":5849},{"style":440},[5850],{"type":399,"value":783},{"type":393,"tag":428,"props":5852,"children":5853},{"class":430,"line":281},[5854,5858],{"type":393,"tag":428,"props":5855,"children":5856},{"style":517},[5857],{"type":399,"value":768},{"type":393,"tag":428,"props":5859,"children":5860},{"style":440},[5861],{"type":399,"value":5862},"(product_performance.head())\n",{"type":393,"tag":428,"props":5864,"children":5865},{"class":430,"line":290},[5866],{"type":393,"tag":428,"props":5867,"children":5868},{"emptyLinePlaceholder":12},[5869],{"type":399,"value":473},{"type":393,"tag":428,"props":5871,"children":5872},{"class":430,"line":299},[5873],{"type":393,"tag":428,"props":5874,"children":5875},{"style":479},[5876],{"type":399,"value":5877},"# Connect to business intelligence database\n",{"type":393,"tag":428,"props":5879,"children":5880},{"class":430,"line":308},[5881,5885,5889,5893,5898],{"type":393,"tag":428,"props":5882,"children":5883},{"style":440},[5884],{"type":399,"value":830},{"type":393,"tag":428,"props":5886,"children":5887},{"style":434},[5888],{"type":399,"value":495},{"type":393,"tag":428,"props":5890,"children":5891},{"style":440},[5892],{"type":399,"value":839},{"type":393,"tag":428,"props":5894,"children":5895},{"style":506},[5896],{"type":399,"value":5897},"'business_intelligence.db'",{"type":393,"tag":428,"props":5899,"children":5900},{"style":440},[5901],{"type":399,"value":783},{"type":393,"tag":428,"props":5903,"children":5904},{"class":430,"line":318},[5905],{"type":393,"tag":428,"props":5906,"children":5907},{"emptyLinePlaceholder":12},[5908],{"type":399,"value":473},{"type":393,"tag":428,"props":5910,"children":5911},{"class":430,"line":327},[5912],{"type":393,"tag":428,"props":5913,"children":5914},{"style":479},[5915],{"type":399,"value":5916},"# Export comprehensive business data\n",{"type":393,"tag":428,"props":5918,"children":5919},{"class":430,"line":336},[5920,5925,5930],{"type":393,"tag":428,"props":5921,"children":5922},{"style":440},[5923],{"type":399,"value":5924},"customer_metrics.to_sql(",{"type":393,"tag":428,"props":5926,"children":5927},{"style":506},[5928],{"type":399,"value":5929},"'customer_analytics'",{"type":393,"tag":428,"props":5931,"children":5932},{"style":440},[5933],{"type":399,"value":1858},{"type":393,"tag":428,"props":5935,"children":5936},{"class":430,"line":346},[5937],{"type":393,"tag":428,"props":5938,"children":5939},{"style":440},[5940],{"type":399,"value":5941},"                       conn, \n",{"type":393,"tag":428,"props":5943,"children":5944},{"class":430,"line":355},[5945,5950,5954,5958],{"type":393,"tag":428,"props":5946,"children":5947},{"style":884},[5948],{"type":399,"value":5949},"                       if_exists",{"type":393,"tag":428,"props":5951,"children":5952},{"style":434},[5953],{"type":399,"value":495},{"type":393,"tag":428,"props":5955,"children":5956},{"style":506},[5957],{"type":399,"value":896},{"type":393,"tag":428,"props":5959,"children":5960},{"style":440},[5961],{"type":399,"value":1858},{"type":393,"tag":428,"props":5963,"children":5964},{"class":430,"line":364},[5965,5970,5974,5978],{"type":393,"tag":428,"props":5966,"children":5967},{"style":884},[5968],{"type":399,"value":5969},"                       index",{"type":393,"tag":428,"props":5971,"children":5972},{"style":434},[5973],{"type":399,"value":495},{"type":393,"tag":428,"props":5975,"children":5976},{"style":517},[5977],{"type":399,"value":914},{"type":393,"tag":428,"props":5979,"children":5980},{"style":440},[5981],{"type":399,"value":783},{"type":393,"tag":428,"props":5983,"children":5984},{"class":430,"line":374},[5985],{"type":393,"tag":428,"props":5986,"children":5987},{"emptyLinePlaceholder":12},[5988],{"type":399,"value":473},{"type":393,"tag":428,"props":5990,"children":5991},{"class":430,"line":383},[5992,5997,6002],{"type":393,"tag":428,"props":5993,"children":5994},{"style":440},[5995],{"type":399,"value":5996},"product_performance.to_sql(",{"type":393,"tag":428,"props":5998,"children":5999},{"style":506},[6000],{"type":399,"value":6001},"'product_analytics'",{"type":393,"tag":428,"props":6003,"children":6004},{"style":440},[6005],{"type":399,"value":1858},{"type":393,"tag":428,"props":6007,"children":6008},{"class":430,"line":2893},[6009],{"type":393,"tag":428,"props":6010,"children":6011},{"style":440},[6012],{"type":399,"value":6013},"                          conn, \n",{"type":393,"tag":428,"props":6015,"children":6016},{"class":430,"line":2910},[6017,6022,6026,6030],{"type":393,"tag":428,"props":6018,"children":6019},{"style":884},[6020],{"type":399,"value":6021},"                          if_exists",{"type":393,"tag":428,"props":6023,"children":6024},{"style":434},[6025],{"type":399,"value":495},{"type":393,"tag":428,"props":6027,"children":6028},{"style":506},[6029],{"type":399,"value":896},{"type":393,"tag":428,"props":6031,"children":6032},{"style":440},[6033],{"type":399,"value":1858},{"type":393,"tag":428,"props":6035,"children":6036},{"class":430,"line":2939},[6037,6042,6046,6050],{"type":393,"tag":428,"props":6038,"children":6039},{"style":884},[6040],{"type":399,"value":6041},"                          index",{"type":393,"tag":428,"props":6043,"children":6044},{"style":434},[6045],{"type":399,"value":495},{"type":393,"tag":428,"props":6047,"children":6048},{"style":517},[6049],{"type":399,"value":914},{"type":393,"tag":428,"props":6051,"children":6052},{"style":440},[6053],{"type":399,"value":783},{"type":393,"tag":428,"props":6055,"children":6056},{"class":430,"line":2952},[6057],{"type":393,"tag":428,"props":6058,"children":6059},{"emptyLinePlaceholder":12},[6060],{"type":399,"value":473},{"type":393,"tag":428,"props":6062,"children":6063},{"class":430,"line":2960},[6064,6068,6072,6076,6080,6085],{"type":393,"tag":428,"props":6065,"children":6066},{"style":517},[6067],{"type":399,"value":768},{"type":393,"tag":428,"props":6069,"children":6070},{"style":440},[6071],{"type":399,"value":773},{"type":393,"tag":428,"props":6073,"children":6074},{"style":506},[6075],{"type":399,"value":996},{"type":393,"tag":428,"props":6077,"children":6078},{"style":517},[6079],{"type":399,"value":1001},{"type":393,"tag":428,"props":6081,"children":6082},{"style":506},[6083],{"type":399,"value":6084},"✅ Exported comprehensive business intelligence data\"",{"type":393,"tag":428,"props":6086,"children":6087},{"style":440},[6088],{"type":399,"value":783},{"type":393,"tag":428,"props":6090,"children":6092},{"class":430,"line":6091},46,[6093],{"type":393,"tag":428,"props":6094,"children":6095},{"emptyLinePlaceholder":12},[6096],{"type":399,"value":473},{"type":393,"tag":428,"props":6098,"children":6100},{"class":430,"line":6099},47,[6101],{"type":393,"tag":428,"props":6102,"children":6103},{"style":479},[6104],{"type":399,"value":6105},"# Create a business summary view with SQL\n",{"type":393,"tag":428,"props":6107,"children":6109},{"class":430,"line":6108},48,[6110,6115,6119],{"type":393,"tag":428,"props":6111,"children":6112},{"style":440},[6113],{"type":399,"value":6114},"summary_query ",{"type":393,"tag":428,"props":6116,"children":6117},{"style":434},[6118],{"type":399,"value":495},{"type":393,"tag":428,"props":6120,"children":6121},{"style":506},[6122],{"type":399,"value":2835},{"type":393,"tag":428,"props":6124,"children":6126},{"class":430,"line":6125},49,[6127],{"type":393,"tag":428,"props":6128,"children":6129},{"style":506},[6130],{"type":399,"value":6131},"SELECT \n",{"type":393,"tag":428,"props":6133,"children":6135},{"class":430,"line":6134},50,[6136],{"type":393,"tag":428,"props":6137,"children":6138},{"style":506},[6139],{"type":399,"value":6140},"    'Customer Metrics' as data_type,\n",{"type":393,"tag":428,"props":6142,"children":6144},{"class":430,"line":6143},51,[6145],{"type":393,"tag":428,"props":6146,"children":6147},{"style":506},[6148],{"type":399,"value":6149},"    COUNT(*) as record_count,\n",{"type":393,"tag":428,"props":6151,"children":6153},{"class":430,"line":6152},52,[6154],{"type":393,"tag":428,"props":6155,"children":6156},{"style":506},[6157],{"type":399,"value":6158},"    AVG(total_revenue) as avg_value\n",{"type":393,"tag":428,"props":6160,"children":6162},{"class":430,"line":6161},53,[6163],{"type":393,"tag":428,"props":6164,"children":6165},{"style":506},[6166],{"type":399,"value":6167},"FROM customer_analytics\n",{"type":393,"tag":428,"props":6169,"children":6171},{"class":430,"line":6170},54,[6172],{"type":393,"tag":428,"props":6173,"children":6174},{"style":506},[6175],{"type":399,"value":6176},"UNION ALL\n",{"type":393,"tag":428,"props":6178,"children":6180},{"class":430,"line":6179},55,[6181],{"type":393,"tag":428,"props":6182,"children":6183},{"style":506},[6184],{"type":399,"value":6131},{"type":393,"tag":428,"props":6186,"children":6188},{"class":430,"line":6187},56,[6189],{"type":393,"tag":428,"props":6190,"children":6191},{"style":506},[6192],{"type":399,"value":6193},"    'Product Performance' as data_type,\n",{"type":393,"tag":428,"props":6195,"children":6197},{"class":430,"line":6196},57,[6198],{"type":393,"tag":428,"props":6199,"children":6200},{"style":506},[6201],{"type":399,"value":6149},{"type":393,"tag":428,"props":6203,"children":6205},{"class":430,"line":6204},58,[6206],{"type":393,"tag":428,"props":6207,"children":6208},{"style":506},[6209],{"type":399,"value":6210},"    AVG(revenue_ytd) as avg_value\n",{"type":393,"tag":428,"props":6212,"children":6214},{"class":430,"line":6213},59,[6215],{"type":393,"tag":428,"props":6216,"children":6217},{"style":506},[6218],{"type":399,"value":6219},"FROM product_analytics\n",{"type":393,"tag":428,"props":6221,"children":6223},{"class":430,"line":6222},60,[6224],{"type":393,"tag":428,"props":6225,"children":6226},{"style":506},[6227],{"type":399,"value":2883},{"type":393,"tag":428,"props":6229,"children":6231},{"class":430,"line":6230},61,[6232],{"type":393,"tag":428,"props":6233,"children":6234},{"emptyLinePlaceholder":12},[6235],{"type":399,"value":473},{"type":393,"tag":428,"props":6237,"children":6239},{"class":430,"line":6238},62,[6240,6245,6249],{"type":393,"tag":428,"props":6241,"children":6242},{"style":440},[6243],{"type":399,"value":6244},"summary_stats ",{"type":393,"tag":428,"props":6246,"children":6247},{"style":434},[6248],{"type":399,"value":495},{"type":393,"tag":428,"props":6250,"children":6251},{"style":440},[6252],{"type":399,"value":6253}," pd.read_sql(summary_query, conn)\n",{"type":393,"tag":428,"props":6255,"children":6257},{"class":430,"line":6256},63,[6258,6262,6266,6270,6274,6279],{"type":393,"tag":428,"props":6259,"children":6260},{"style":517},[6261],{"type":399,"value":768},{"type":393,"tag":428,"props":6263,"children":6264},{"style":440},[6265],{"type":399,"value":773},{"type":393,"tag":428,"props":6267,"children":6268},{"style":506},[6269],{"type":399,"value":996},{"type":393,"tag":428,"props":6271,"children":6272},{"style":517},[6273],{"type":399,"value":1001},{"type":393,"tag":428,"props":6275,"children":6276},{"style":506},[6277],{"type":399,"value":6278},"Business intelligence summary:\"",{"type":393,"tag":428,"props":6280,"children":6281},{"style":440},[6282],{"type":399,"value":783},{"type":393,"tag":428,"props":6284,"children":6286},{"class":430,"line":6285},64,[6287,6291],{"type":393,"tag":428,"props":6288,"children":6289},{"style":517},[6290],{"type":399,"value":768},{"type":393,"tag":428,"props":6292,"children":6293},{"style":440},[6294],{"type":399,"value":6295},"(summary_stats)\n",{"type":393,"tag":428,"props":6297,"children":6299},{"class":430,"line":6298},65,[6300],{"type":393,"tag":428,"props":6301,"children":6302},{"emptyLinePlaceholder":12},[6303],{"type":399,"value":473},{"type":393,"tag":428,"props":6305,"children":6307},{"class":430,"line":6306},66,[6308],{"type":393,"tag":428,"props":6309,"children":6310},{"style":479},[6311],{"type":399,"value":6312},"# Export summary back to database for dashboards\n",{"type":393,"tag":428,"props":6314,"children":6316},{"class":430,"line":6315},67,[6317,6322,6327,6331,6335,6339,6343,6347,6351,6355,6359],{"type":393,"tag":428,"props":6318,"children":6319},{"style":440},[6320],{"type":399,"value":6321},"summary_stats.to_sql(",{"type":393,"tag":428,"props":6323,"children":6324},{"style":506},[6325],{"type":399,"value":6326},"'bi_summary'",{"type":393,"tag":428,"props":6328,"children":6329},{"style":440},[6330],{"type":399,"value":881},{"type":393,"tag":428,"props":6332,"children":6333},{"style":884},[6334],{"type":399,"value":887},{"type":393,"tag":428,"props":6336,"children":6337},{"style":434},[6338],{"type":399,"value":495},{"type":393,"tag":428,"props":6340,"children":6341},{"style":506},[6342],{"type":399,"value":896},{"type":393,"tag":428,"props":6344,"children":6345},{"style":440},[6346],{"type":399,"value":525},{"type":393,"tag":428,"props":6348,"children":6349},{"style":884},[6350],{"type":399,"value":905},{"type":393,"tag":428,"props":6352,"children":6353},{"style":434},[6354],{"type":399,"value":495},{"type":393,"tag":428,"props":6356,"children":6357},{"style":517},[6358],{"type":399,"value":914},{"type":393,"tag":428,"props":6360,"children":6361},{"style":440},[6362],{"type":399,"value":783},{"type":393,"tag":428,"props":6364,"children":6366},{"class":430,"line":6365},68,[6367,6371,6375,6379,6383,6388],{"type":393,"tag":428,"props":6368,"children":6369},{"style":517},[6370],{"type":399,"value":768},{"type":393,"tag":428,"props":6372,"children":6373},{"style":440},[6374],{"type":399,"value":773},{"type":393,"tag":428,"props":6376,"children":6377},{"style":506},[6378],{"type":399,"value":996},{"type":393,"tag":428,"props":6380,"children":6381},{"style":517},[6382],{"type":399,"value":1001},{"type":393,"tag":428,"props":6384,"children":6385},{"style":506},[6386],{"type":399,"value":6387},"✅ Created summary table for dashboard consumption\"",{"type":393,"tag":428,"props":6389,"children":6390},{"style":440},[6391],{"type":399,"value":783},{"type":393,"tag":428,"props":6393,"children":6395},{"class":430,"line":6394},69,[6396],{"type":393,"tag":428,"props":6397,"children":6398},{"emptyLinePlaceholder":12},[6399],{"type":399,"value":473},{"type":393,"tag":428,"props":6401,"children":6403},{"class":430,"line":6402},70,[6404],{"type":393,"tag":428,"props":6405,"children":6406},{"style":440},[6407],{"type":399,"value":1045},{"type":393,"tag":1047,"props":6409,"children":6411},{"id":6410},"️-security-and-best-practices",[6412],{"type":399,"value":6413},"🛡️ Security and Best Practices",{"type":393,"tag":402,"props":6415,"children":6416},{},[6417],{"type":399,"value":6418},"Essential practices for production database exports:",{"type":393,"tag":1059,"props":6420,"children":6424},{"emoji":6421,"title":6422,"type":6423},"🛡️","Security Best Practices","error",[6425,6433,6456,6464,6487,6495,6518,6525,6548,6556],{"type":393,"tag":402,"props":6426,"children":6427},{},[6428],{"type":393,"tag":1069,"props":6429,"children":6430},{},[6431],{"type":399,"value":6432},"Credential Management:",{"type":393,"tag":1075,"props":6434,"children":6435},{},[6436,6441,6446,6451],{"type":393,"tag":1079,"props":6437,"children":6438},{},[6439],{"type":399,"value":6440},"Never hardcode passwords in scripts",{"type":393,"tag":1079,"props":6442,"children":6443},{},[6444],{"type":399,"value":6445},"Use environment variables or config files",{"type":393,"tag":1079,"props":6447,"children":6448},{},[6449],{"type":399,"value":6450},"Implement proper access controls",{"type":393,"tag":1079,"props":6452,"children":6453},{},[6454],{"type":399,"value":6455},"Rotate credentials regularly",{"type":393,"tag":402,"props":6457,"children":6458},{},[6459],{"type":393,"tag":1069,"props":6460,"children":6461},{},[6462],{"type":399,"value":6463},"Data Validation:",{"type":393,"tag":1075,"props":6465,"children":6466},{},[6467,6472,6477,6482],{"type":393,"tag":1079,"props":6468,"children":6469},{},[6470],{"type":399,"value":6471},"Validate data before export",{"type":393,"tag":1079,"props":6473,"children":6474},{},[6475],{"type":399,"value":6476},"Check for appropriate data types",{"type":393,"tag":1079,"props":6478,"children":6479},{},[6480],{"type":399,"value":6481},"Verify required fields are present",{"type":393,"tag":1079,"props":6483,"children":6484},{},[6485],{"type":399,"value":6486},"Test with small datasets first",{"type":393,"tag":402,"props":6488,"children":6489},{},[6490],{"type":393,"tag":1069,"props":6491,"children":6492},{},[6493],{"type":399,"value":6494},"Error Handling:",{"type":393,"tag":1075,"props":6496,"children":6497},{},[6498,6503,6508,6513],{"type":393,"tag":1079,"props":6499,"children":6500},{},[6501],{"type":399,"value":6502},"Use try/except blocks for database operations",{"type":393,"tag":1079,"props":6504,"children":6505},{},[6506],{"type":399,"value":6507},"Log errors appropriately",{"type":393,"tag":1079,"props":6509,"children":6510},{},[6511],{"type":399,"value":6512},"Implement retry logic for transient failures",{"type":393,"tag":1079,"props":6514,"children":6515},{},[6516],{"type":399,"value":6517},"Always close database connections",{"type":393,"tag":402,"props":6519,"children":6520},{},[6521],{"type":393,"tag":1069,"props":6522,"children":6523},{},[6524],{"type":399,"value":1137},{"type":393,"tag":1075,"props":6526,"children":6527},{},[6528,6533,6538,6543],{"type":393,"tag":1079,"props":6529,"children":6530},{},[6531],{"type":399,"value":6532},"Use appropriate batch sizes for large datasets",{"type":393,"tag":1079,"props":6534,"children":6535},{},[6536],{"type":399,"value":6537},"Monitor database performance during exports",{"type":393,"tag":1079,"props":6539,"children":6540},{},[6541],{"type":399,"value":6542},"Consider off-peak hours for large operations",{"type":393,"tag":1079,"props":6544,"children":6545},{},[6546],{"type":399,"value":6547},"Index destination tables appropriately",{"type":393,"tag":402,"props":6549,"children":6550},{},[6551],{"type":393,"tag":1069,"props":6552,"children":6553},{},[6554],{"type":399,"value":6555},"Testing:",{"type":393,"tag":1075,"props":6557,"children":6558},{},[6559,6564,6569,6574],{"type":393,"tag":1079,"props":6560,"children":6561},{},[6562],{"type":399,"value":6563},"Test exports in development environment first",{"type":393,"tag":1079,"props":6565,"children":6566},{},[6567],{"type":399,"value":6568},"Verify data integrity after export",{"type":393,"tag":1079,"props":6570,"children":6571},{},[6572],{"type":399,"value":6573},"Check that applications can read exported data",{"type":393,"tag":1079,"props":6575,"children":6576},{},[6577],{"type":399,"value":6578},"Monitor database storage usage",{"type":393,"tag":1047,"props":6580,"children":6582},{"id":6581},"key-takeaways",[6583],{"type":399,"value":6584},"🎯 Key Takeaways",{"type":393,"tag":1059,"props":6586,"children":6589},{"emoji":6587,"title":6588,"type":1207},"📚","Database Export Summary",[6590,6598,6625,6633,6669,6677,6700,6707,6735,6743,6766],{"type":393,"tag":402,"props":6591,"children":6592},{},[6593],{"type":393,"tag":1069,"props":6594,"children":6595},{},[6596],{"type":399,"value":6597},"Export Methods:",{"type":393,"tag":1075,"props":6599,"children":6600},{},[6601,6610,6615,6620],{"type":393,"tag":1079,"props":6602,"children":6603},{},[6604],{"type":393,"tag":424,"props":6605,"children":6607},{"className":6606},[],[6608],{"type":399,"value":6609},"df.to_sql(table_name, connection, if_exists='replace', index=False)",{"type":393,"tag":1079,"props":6611,"children":6612},{},[6613],{"type":399,"value":6614},"SQLite for development and small applications",{"type":393,"tag":1079,"props":6616,"children":6617},{},[6618],{"type":399,"value":6619},"SQLAlchemy for production databases",{"type":393,"tag":1079,"props":6621,"children":6622},{},[6623],{"type":399,"value":6624},"Always specify data types when important",{"type":393,"tag":402,"props":6626,"children":6627},{},[6628],{"type":393,"tag":1069,"props":6629,"children":6630},{},[6631],{"type":399,"value":6632},"Update Strategies:",{"type":393,"tag":1075,"props":6634,"children":6635},{},[6636,6647,6658],{"type":393,"tag":1079,"props":6637,"children":6638},{},[6639,6645],{"type":393,"tag":424,"props":6640,"children":6642},{"className":6641},[],[6643],{"type":399,"value":6644},"if_exists='replace'",{"type":399,"value":6646}," - Complete refresh (use carefully)",{"type":393,"tag":1079,"props":6648,"children":6649},{},[6650,6656],{"type":393,"tag":424,"props":6651,"children":6653},{"className":6652},[],[6654],{"type":399,"value":6655},"if_exists='append'",{"type":399,"value":6657}," - Add new records",{"type":393,"tag":1079,"props":6659,"children":6660},{},[6661,6667],{"type":393,"tag":424,"props":6662,"children":6664},{"className":6663},[],[6665],{"type":399,"value":6666},"if_exists='fail'",{"type":399,"value":6668}," - Safe default, prevents accidents",{"type":393,"tag":402,"props":6670,"children":6671},{},[6672],{"type":393,"tag":1069,"props":6673,"children":6674},{},[6675],{"type":399,"value":6676},"Connection Management:",{"type":393,"tag":1075,"props":6678,"children":6679},{},[6680,6685,6690,6695],{"type":393,"tag":1079,"props":6681,"children":6682},{},[6683],{"type":399,"value":6684},"Import appropriate database library",{"type":393,"tag":1079,"props":6686,"children":6687},{},[6688],{"type":399,"value":6689},"Create connection before export",{"type":393,"tag":1079,"props":6691,"children":6692},{},[6693],{"type":399,"value":6694},"Always close connections after use",{"type":393,"tag":1079,"props":6696,"children":6697},{},[6698],{"type":399,"value":6699},"Use connection pooling for production",{"type":393,"tag":402,"props":6701,"children":6702},{},[6703],{"type":393,"tag":1069,"props":6704,"children":6705},{},[6706],{"type":399,"value":3904},{"type":393,"tag":1075,"props":6708,"children":6709},{},[6710,6715,6720,6725,6730],{"type":393,"tag":1079,"props":6711,"children":6712},{},[6713],{"type":399,"value":6714},"Test exports with small datasets first",{"type":393,"tag":1079,"props":6716,"children":6717},{},[6718],{"type":399,"value":6719},"Validate data integrity after export",{"type":393,"tag":1079,"props":6721,"children":6722},{},[6723],{"type":399,"value":6724},"Use environment variables for credentials",{"type":393,"tag":1079,"props":6726,"children":6727},{},[6728],{"type":399,"value":6729},"Monitor database performance",{"type":393,"tag":1079,"props":6731,"children":6732},{},[6733],{"type":399,"value":6734},"Implement proper error handling",{"type":393,"tag":402,"props":6736,"children":6737},{},[6738],{"type":393,"tag":1069,"props":6739,"children":6740},{},[6741],{"type":399,"value":6742},"Production Considerations:",{"type":393,"tag":1075,"props":6744,"children":6745},{},[6746,6751,6756,6761],{"type":393,"tag":1079,"props":6747,"children":6748},{},[6749],{"type":399,"value":6750},"Use SQLAlchemy for enterprise databases",{"type":393,"tag":1079,"props":6752,"children":6753},{},[6754],{"type":399,"value":6755},"Implement proper logging and monitoring",{"type":393,"tag":1079,"props":6757,"children":6758},{},[6759],{"type":399,"value":6760},"Consider transaction management",{"type":393,"tag":1079,"props":6762,"children":6763},{},[6764],{"type":399,"value":6765},"Plan for backup and recovery",{"type":393,"tag":402,"props":6767,"children":6768},{},[6769,6774],{"type":393,"tag":1069,"props":6770,"children":6771},{},[6772],{"type":399,"value":6773},"Remember:",{"type":399,"value":6775}," Database export enables powerful data integration and automation!",{"type":393,"tag":1047,"props":6777,"children":6779},{"id":6778},"congratulations",[6780],{"type":399,"value":6781},"🎉 Congratulations!",{"type":393,"tag":402,"props":6783,"children":6784},{},[6785],{"type":399,"value":6786},"You've completed the pandas tutorial series! You now have the skills to:",{"type":393,"tag":1075,"props":6788,"children":6789},{},[6790,6795,6800,6805,6810],{"type":393,"tag":1079,"props":6791,"children":6792},{},[6793],{"type":399,"value":6794},"✅ Load data from various sources",{"type":393,"tag":1079,"props":6796,"children":6797},{},[6798],{"type":399,"value":6799},"✅ Clean and transform your data",{"type":393,"tag":1079,"props":6801,"children":6802},{},[6803],{"type":399,"value":6804},"✅ Perform powerful analysis and grouping",{"type":393,"tag":1079,"props":6806,"children":6807},{},[6808],{"type":399,"value":6809},"✅ Work with dates and time series",{"type":393,"tag":1079,"props":6811,"children":6812},{},[6813],{"type":399,"value":6814},"✅ Export results to multiple formats",{"type":393,"tag":402,"props":6816,"children":6817},{},[6818],{"type":393,"tag":1069,"props":6819,"children":6820},{},[6821],{"type":399,"value":6822},"What's Next?",{"type":393,"tag":1075,"props":6824,"children":6825},{},[6826,6831,6836,6841],{"type":393,"tag":1079,"props":6827,"children":6828},{},[6829],{"type":399,"value":6830},"Practice with real datasets",{"type":393,"tag":1079,"props":6832,"children":6833},{},[6834],{"type":399,"value":6835},"Explore advanced pandas features",{"type":393,"tag":1079,"props":6837,"children":6838},{},[6839],{"type":399,"value":6840},"Learn data visualization with matplotlib/seaborn",{"type":393,"tag":1079,"props":6842,"children":6843},{},[6844],{"type":399,"value":6845},"Build data pipelines and automation",{"type":393,"tag":402,"props":6847,"children":6848},{},[6849],{"type":399,"value":6850},"Keep analyzing data! 🐼📊🎯",{"type":393,"tag":6852,"props":6853,"children":6854},"style",{},[6855],{"type":399,"value":6856},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":6,"searchDepth":36,"depth":36,"links":6858},[6859,6860,6861,6864,6867,6868,6869,6870,6871],{"id":1049,"depth":27,"text":1052},{"id":1194,"depth":27,"text":1197},{"id":1409,"depth":27,"text":1412,"children":6862},[6863],{"id":2066,"depth":36,"text":2069},{"id":2968,"depth":27,"text":2971,"children":6865},[6866],{"id":3104,"depth":36,"text":3107},{"id":3840,"depth":27,"text":3843},{"id":4841,"depth":27,"text":4844},{"id":6410,"depth":27,"text":6413},{"id":6581,"depth":27,"text":6584},{"id":6778,"depth":27,"text":6781},1782373727978]