[{"data":1,"prerenderedAt":3754},["ShallowReactive",2],{"tutorials-pandas":3,"category-items-pandas":387,"content-/pandas/loading-from-databases":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",[87],{"_path":88,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":89,"description":90,"slug":91,"parentId":68,"order":92,"body":389,"_type":14,"_id":93,"_source":16,"_file":94,"_stem":95,"_extension":19},{"type":390,"children":391,"toc":3740},"root",[392,401,407,489,496,501,1039,1045,1050,1431,1437,1442,1769,1775,1780,1787,1868,2005,2011,2373,2465,2471,2476,2985,2991,3147,3153,3493,3499,3704,3710,3715,3729,3734],{"type":393,"tag":394,"props":395,"children":397},"element","h1",{"id":396},"️-loading-from-databases",[398],{"type":399,"value":400},"text","🗄️ Loading from Databases",{"type":393,"tag":402,"props":403,"children":404},"p",{},[405],{"type":399,"value":406},"Databases are incredibly powerful for data analysis! Instead of loading entire files into memory, you can query databases to get exactly the data you need. This makes working with large datasets much faster and more efficient.",{"type":393,"tag":408,"props":409,"children":413},"info-box",{"emoji":410,"title":411,"type":412},"⚡","Files vs Database Loading","info",[414,423,448,456,479],{"type":393,"tag":402,"props":415,"children":416},{},[417],{"type":393,"tag":418,"props":419,"children":420},"strong",{},[421],{"type":399,"value":422},"Loading from Files:",{"type":393,"tag":424,"props":425,"children":426},"ul",{},[427,433,438,443],{"type":393,"tag":428,"props":429,"children":430},"li",{},[431],{"type":399,"value":432},"Loads entire file into memory",{"type":393,"tag":428,"props":434,"children":435},{},[436],{"type":399,"value":437},"Can be slow with large files",{"type":393,"tag":428,"props":439,"children":440},{},[441],{"type":399,"value":442},"Limited filtering options",{"type":393,"tag":428,"props":444,"children":445},{},[446],{"type":399,"value":447},"Good for small to medium datasets",{"type":393,"tag":402,"props":449,"children":450},{},[451],{"type":393,"tag":418,"props":452,"children":453},{},[454],{"type":399,"value":455},"Loading from Database:",{"type":393,"tag":424,"props":457,"children":458},{},[459,464,469,474],{"type":393,"tag":428,"props":460,"children":461},{},[462],{"type":399,"value":463},"Load only the data you need",{"type":393,"tag":428,"props":465,"children":466},{},[467],{"type":399,"value":468},"Very fast, even with huge datasets",{"type":393,"tag":428,"props":470,"children":471},{},[472],{"type":399,"value":473},"Powerful filtering with SQL queries",{"type":393,"tag":428,"props":475,"children":476},{},[477],{"type":399,"value":478},"Perfect for big data and selective analysis",{"type":393,"tag":402,"props":480,"children":481},{},[482,487],{"type":393,"tag":418,"props":483,"children":484},{},[485],{"type":399,"value":486},"Best Practice:",{"type":399,"value":488}," Use databases for large data, SQL for filtering, then Pandas for analysis!",{"type":393,"tag":490,"props":491,"children":493},"h2",{"id":492},"️-basic-database-connection",[494],{"type":399,"value":495},"🛠️ Basic Database Connection",{"type":393,"tag":402,"props":497,"children":498},{},[499],{"type":399,"value":500},"First, let's create a simple SQLite database to practice with:",{"type":393,"tag":502,"props":503,"children":504},"code-try",{},[505],{"type":393,"tag":506,"props":507,"children":511},"pre",{"className":508,"code":509,"language":510,"meta":6,"style":6},"language-python shiki shiki-themes github-light github-dark","import pandas as pd\nimport sqlite3\n\n# Create a simple SQLite database\nconn = sqlite3.connect('sample.db')\n\n# Create sample data\nsample_data = pd.DataFrame({\n    'employee_id': [1, 2, 3, 4, 5],\n    'name': ['Alice', 'Bob', 'Charlie', 'Diana', 'Eve'],\n    'department': ['Sales', 'IT', 'Sales', 'HR', 'IT'],\n    'salary': [50000, 75000, 52000, 48000, 80000]\n})\n\n# Save DataFrame to database\nsample_data.to_sql('employees', conn, if_exists='replace', index=False)\n\nprint(\"✅ Created sample database with employees table\")\nprint(f\"Saved {len(sample_data)} records\")\n\n# Close connection\nconn.close()\n","python",[512],{"type":393,"tag":513,"props":514,"children":515},"code",{"__ignoreMap":6},[516,543,555,563,572,601,608,616,633,694,751,806,864,872,879,887,942,949,971,1016,1023,1031],{"type":393,"tag":517,"props":518,"children":520},"span",{"class":519,"line":11},"line",[521,527,533,538],{"type":393,"tag":517,"props":522,"children":524},{"style":523},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[525],{"type":399,"value":526},"import",{"type":393,"tag":517,"props":528,"children":530},{"style":529},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[531],{"type":399,"value":532}," pandas ",{"type":393,"tag":517,"props":534,"children":535},{"style":523},[536],{"type":399,"value":537},"as",{"type":393,"tag":517,"props":539,"children":540},{"style":529},[541],{"type":399,"value":542}," pd\n",{"type":393,"tag":517,"props":544,"children":545},{"class":519,"line":27},[546,550],{"type":393,"tag":517,"props":547,"children":548},{"style":523},[549],{"type":399,"value":526},{"type":393,"tag":517,"props":551,"children":552},{"style":529},[553],{"type":399,"value":554}," sqlite3\n",{"type":393,"tag":517,"props":556,"children":557},{"class":519,"line":36},[558],{"type":393,"tag":517,"props":559,"children":560},{"emptyLinePlaceholder":12},[561],{"type":399,"value":562},"\n",{"type":393,"tag":517,"props":564,"children":565},{"class":519,"line":45},[566],{"type":393,"tag":517,"props":567,"children":569},{"style":568},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[570],{"type":399,"value":571},"# Create a simple SQLite database\n",{"type":393,"tag":517,"props":573,"children":574},{"class":519,"line":54},[575,580,585,590,596],{"type":393,"tag":517,"props":576,"children":577},{"style":529},[578],{"type":399,"value":579},"conn ",{"type":393,"tag":517,"props":581,"children":582},{"style":523},[583],{"type":399,"value":584},"=",{"type":393,"tag":517,"props":586,"children":587},{"style":529},[588],{"type":399,"value":589}," sqlite3.connect(",{"type":393,"tag":517,"props":591,"children":593},{"style":592},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[594],{"type":399,"value":595},"'sample.db'",{"type":393,"tag":517,"props":597,"children":598},{"style":529},[599],{"type":399,"value":600},")\n",{"type":393,"tag":517,"props":602,"children":603},{"class":519,"line":63},[604],{"type":393,"tag":517,"props":605,"children":606},{"emptyLinePlaceholder":12},[607],{"type":399,"value":562},{"type":393,"tag":517,"props":609,"children":610},{"class":519,"line":72},[611],{"type":393,"tag":517,"props":612,"children":613},{"style":568},[614],{"type":399,"value":615},"# Create sample data\n",{"type":393,"tag":517,"props":617,"children":618},{"class":519,"line":83},[619,624,628],{"type":393,"tag":517,"props":620,"children":621},{"style":529},[622],{"type":399,"value":623},"sample_data ",{"type":393,"tag":517,"props":625,"children":626},{"style":523},[627],{"type":399,"value":584},{"type":393,"tag":517,"props":629,"children":630},{"style":529},[631],{"type":399,"value":632}," pd.DataFrame({\n",{"type":393,"tag":517,"props":634,"children":635},{"class":519,"line":92},[636,641,646,652,657,662,666,671,675,680,684,689],{"type":393,"tag":517,"props":637,"children":638},{"style":592},[639],{"type":399,"value":640},"    'employee_id'",{"type":393,"tag":517,"props":642,"children":643},{"style":529},[644],{"type":399,"value":645},": [",{"type":393,"tag":517,"props":647,"children":649},{"style":648},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[650],{"type":399,"value":651},"1",{"type":393,"tag":517,"props":653,"children":654},{"style":529},[655],{"type":399,"value":656},", ",{"type":393,"tag":517,"props":658,"children":659},{"style":648},[660],{"type":399,"value":661},"2",{"type":393,"tag":517,"props":663,"children":664},{"style":529},[665],{"type":399,"value":656},{"type":393,"tag":517,"props":667,"children":668},{"style":648},[669],{"type":399,"value":670},"3",{"type":393,"tag":517,"props":672,"children":673},{"style":529},[674],{"type":399,"value":656},{"type":393,"tag":517,"props":676,"children":677},{"style":648},[678],{"type":399,"value":679},"4",{"type":393,"tag":517,"props":681,"children":682},{"style":529},[683],{"type":399,"value":656},{"type":393,"tag":517,"props":685,"children":686},{"style":648},[687],{"type":399,"value":688},"5",{"type":393,"tag":517,"props":690,"children":691},{"style":529},[692],{"type":399,"value":693},"],\n",{"type":393,"tag":517,"props":695,"children":696},{"class":519,"line":101},[697,702,706,711,715,720,724,729,733,738,742,747],{"type":393,"tag":517,"props":698,"children":699},{"style":592},[700],{"type":399,"value":701},"    'name'",{"type":393,"tag":517,"props":703,"children":704},{"style":529},[705],{"type":399,"value":645},{"type":393,"tag":517,"props":707,"children":708},{"style":592},[709],{"type":399,"value":710},"'Alice'",{"type":393,"tag":517,"props":712,"children":713},{"style":529},[714],{"type":399,"value":656},{"type":393,"tag":517,"props":716,"children":717},{"style":592},[718],{"type":399,"value":719},"'Bob'",{"type":393,"tag":517,"props":721,"children":722},{"style":529},[723],{"type":399,"value":656},{"type":393,"tag":517,"props":725,"children":726},{"style":592},[727],{"type":399,"value":728},"'Charlie'",{"type":393,"tag":517,"props":730,"children":731},{"style":529},[732],{"type":399,"value":656},{"type":393,"tag":517,"props":734,"children":735},{"style":592},[736],{"type":399,"value":737},"'Diana'",{"type":393,"tag":517,"props":739,"children":740},{"style":529},[741],{"type":399,"value":656},{"type":393,"tag":517,"props":743,"children":744},{"style":592},[745],{"type":399,"value":746},"'Eve'",{"type":393,"tag":517,"props":748,"children":749},{"style":529},[750],{"type":399,"value":693},{"type":393,"tag":517,"props":752,"children":753},{"class":519,"line":110},[754,759,763,768,772,777,781,785,789,794,798,802],{"type":393,"tag":517,"props":755,"children":756},{"style":592},[757],{"type":399,"value":758},"    'department'",{"type":393,"tag":517,"props":760,"children":761},{"style":529},[762],{"type":399,"value":645},{"type":393,"tag":517,"props":764,"children":765},{"style":592},[766],{"type":399,"value":767},"'Sales'",{"type":393,"tag":517,"props":769,"children":770},{"style":529},[771],{"type":399,"value":656},{"type":393,"tag":517,"props":773,"children":774},{"style":592},[775],{"type":399,"value":776},"'IT'",{"type":393,"tag":517,"props":778,"children":779},{"style":529},[780],{"type":399,"value":656},{"type":393,"tag":517,"props":782,"children":783},{"style":592},[784],{"type":399,"value":767},{"type":393,"tag":517,"props":786,"children":787},{"style":529},[788],{"type":399,"value":656},{"type":393,"tag":517,"props":790,"children":791},{"style":592},[792],{"type":399,"value":793},"'HR'",{"type":393,"tag":517,"props":795,"children":796},{"style":529},[797],{"type":399,"value":656},{"type":393,"tag":517,"props":799,"children":800},{"style":592},[801],{"type":399,"value":776},{"type":393,"tag":517,"props":803,"children":804},{"style":529},[805],{"type":399,"value":693},{"type":393,"tag":517,"props":807,"children":808},{"class":519,"line":121},[809,814,818,823,827,832,836,841,845,850,854,859],{"type":393,"tag":517,"props":810,"children":811},{"style":592},[812],{"type":399,"value":813},"    'salary'",{"type":393,"tag":517,"props":815,"children":816},{"style":529},[817],{"type":399,"value":645},{"type":393,"tag":517,"props":819,"children":820},{"style":648},[821],{"type":399,"value":822},"50000",{"type":393,"tag":517,"props":824,"children":825},{"style":529},[826],{"type":399,"value":656},{"type":393,"tag":517,"props":828,"children":829},{"style":648},[830],{"type":399,"value":831},"75000",{"type":393,"tag":517,"props":833,"children":834},{"style":529},[835],{"type":399,"value":656},{"type":393,"tag":517,"props":837,"children":838},{"style":648},[839],{"type":399,"value":840},"52000",{"type":393,"tag":517,"props":842,"children":843},{"style":529},[844],{"type":399,"value":656},{"type":393,"tag":517,"props":846,"children":847},{"style":648},[848],{"type":399,"value":849},"48000",{"type":393,"tag":517,"props":851,"children":852},{"style":529},[853],{"type":399,"value":656},{"type":393,"tag":517,"props":855,"children":856},{"style":648},[857],{"type":399,"value":858},"80000",{"type":393,"tag":517,"props":860,"children":861},{"style":529},[862],{"type":399,"value":863},"]\n",{"type":393,"tag":517,"props":865,"children":866},{"class":519,"line":130},[867],{"type":393,"tag":517,"props":868,"children":869},{"style":529},[870],{"type":399,"value":871},"})\n",{"type":393,"tag":517,"props":873,"children":874},{"class":519,"line":139},[875],{"type":393,"tag":517,"props":876,"children":877},{"emptyLinePlaceholder":12},[878],{"type":399,"value":562},{"type":393,"tag":517,"props":880,"children":881},{"class":519,"line":148},[882],{"type":393,"tag":517,"props":883,"children":884},{"style":568},[885],{"type":399,"value":886},"# Save DataFrame to database\n",{"type":393,"tag":517,"props":888,"children":889},{"class":519,"line":159},[890,895,900,905,911,915,920,924,929,933,938],{"type":393,"tag":517,"props":891,"children":892},{"style":529},[893],{"type":399,"value":894},"sample_data.to_sql(",{"type":393,"tag":517,"props":896,"children":897},{"style":592},[898],{"type":399,"value":899},"'employees'",{"type":393,"tag":517,"props":901,"children":902},{"style":529},[903],{"type":399,"value":904},", conn, ",{"type":393,"tag":517,"props":906,"children":908},{"style":907},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[909],{"type":399,"value":910},"if_exists",{"type":393,"tag":517,"props":912,"children":913},{"style":523},[914],{"type":399,"value":584},{"type":393,"tag":517,"props":916,"children":917},{"style":592},[918],{"type":399,"value":919},"'replace'",{"type":393,"tag":517,"props":921,"children":922},{"style":529},[923],{"type":399,"value":656},{"type":393,"tag":517,"props":925,"children":926},{"style":907},[927],{"type":399,"value":928},"index",{"type":393,"tag":517,"props":930,"children":931},{"style":523},[932],{"type":399,"value":584},{"type":393,"tag":517,"props":934,"children":935},{"style":648},[936],{"type":399,"value":937},"False",{"type":393,"tag":517,"props":939,"children":940},{"style":529},[941],{"type":399,"value":600},{"type":393,"tag":517,"props":943,"children":944},{"class":519,"line":168},[945],{"type":393,"tag":517,"props":946,"children":947},{"emptyLinePlaceholder":12},[948],{"type":399,"value":562},{"type":393,"tag":517,"props":950,"children":951},{"class":519,"line":177},[952,957,962,967],{"type":393,"tag":517,"props":953,"children":954},{"style":648},[955],{"type":399,"value":956},"print",{"type":393,"tag":517,"props":958,"children":959},{"style":529},[960],{"type":399,"value":961},"(",{"type":393,"tag":517,"props":963,"children":964},{"style":592},[965],{"type":399,"value":966},"\"✅ Created sample database with employees table\"",{"type":393,"tag":517,"props":968,"children":969},{"style":529},[970],{"type":399,"value":600},{"type":393,"tag":517,"props":972,"children":973},{"class":519,"line":186},[974,978,982,987,992,997,1002,1007,1012],{"type":393,"tag":517,"props":975,"children":976},{"style":648},[977],{"type":399,"value":956},{"type":393,"tag":517,"props":979,"children":980},{"style":529},[981],{"type":399,"value":961},{"type":393,"tag":517,"props":983,"children":984},{"style":523},[985],{"type":399,"value":986},"f",{"type":393,"tag":517,"props":988,"children":989},{"style":592},[990],{"type":399,"value":991},"\"Saved ",{"type":393,"tag":517,"props":993,"children":994},{"style":648},[995],{"type":399,"value":996},"{len",{"type":393,"tag":517,"props":998,"children":999},{"style":529},[1000],{"type":399,"value":1001},"(sample_data)",{"type":393,"tag":517,"props":1003,"children":1004},{"style":648},[1005],{"type":399,"value":1006},"}",{"type":393,"tag":517,"props":1008,"children":1009},{"style":592},[1010],{"type":399,"value":1011}," records\"",{"type":393,"tag":517,"props":1013,"children":1014},{"style":529},[1015],{"type":399,"value":600},{"type":393,"tag":517,"props":1017,"children":1018},{"class":519,"line":197},[1019],{"type":393,"tag":517,"props":1020,"children":1021},{"emptyLinePlaceholder":12},[1022],{"type":399,"value":562},{"type":393,"tag":517,"props":1024,"children":1025},{"class":519,"line":206},[1026],{"type":393,"tag":517,"props":1027,"children":1028},{"style":568},[1029],{"type":399,"value":1030},"# Close connection\n",{"type":393,"tag":517,"props":1032,"children":1033},{"class":519,"line":215},[1034],{"type":393,"tag":517,"props":1035,"children":1036},{"style":529},[1037],{"type":399,"value":1038},"conn.close()\n",{"type":393,"tag":490,"props":1040,"children":1042},{"id":1041},"loading-data-from-database",[1043],{"type":399,"value":1044},"📊 Loading Data from Database",{"type":393,"tag":402,"props":1046,"children":1047},{},[1048],{"type":399,"value":1049},"Now let's load data from our database:",{"type":393,"tag":502,"props":1051,"children":1052},{},[1053],{"type":393,"tag":506,"props":1054,"children":1056},{"className":508,"code":1055,"language":510,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\n# Connect to database\nconn = sqlite3.connect('sample.db')\n\n# Load all data\ndf = pd.read_sql('SELECT * FROM employees', conn)\nprint(\"All employees:\")\nprint(df)\nprint()\n\n# Load specific data with WHERE clause\nsales_df = pd.read_sql('SELECT * FROM employees WHERE department = \"Sales\"', conn)\nprint(\"Sales department only:\")\nprint(sales_df)\nprint()\n\n# Load with calculations\nsummary = pd.read_sql(\"\"\"\n    SELECT department, \n           COUNT(*) as employee_count,\n           AVG(salary) as avg_salary\n    FROM employees \n    GROUP BY department\n\"\"\", conn)\nprint(\"Department summary:\")\nprint(summary)\n\nconn.close()\n",[1057],{"type":393,"tag":513,"props":1058,"children":1059},{"__ignoreMap":6},[1060,1079,1090,1097,1105,1128,1135,1143,1170,1190,1202,1214,1221,1229,1254,1274,1286,1297,1304,1312,1333,1341,1349,1357,1365,1373,1385,1405,1417,1424],{"type":393,"tag":517,"props":1061,"children":1062},{"class":519,"line":11},[1063,1067,1071,1075],{"type":393,"tag":517,"props":1064,"children":1065},{"style":523},[1066],{"type":399,"value":526},{"type":393,"tag":517,"props":1068,"children":1069},{"style":529},[1070],{"type":399,"value":532},{"type":393,"tag":517,"props":1072,"children":1073},{"style":523},[1074],{"type":399,"value":537},{"type":393,"tag":517,"props":1076,"children":1077},{"style":529},[1078],{"type":399,"value":542},{"type":393,"tag":517,"props":1080,"children":1081},{"class":519,"line":27},[1082,1086],{"type":393,"tag":517,"props":1083,"children":1084},{"style":523},[1085],{"type":399,"value":526},{"type":393,"tag":517,"props":1087,"children":1088},{"style":529},[1089],{"type":399,"value":554},{"type":393,"tag":517,"props":1091,"children":1092},{"class":519,"line":36},[1093],{"type":393,"tag":517,"props":1094,"children":1095},{"emptyLinePlaceholder":12},[1096],{"type":399,"value":562},{"type":393,"tag":517,"props":1098,"children":1099},{"class":519,"line":45},[1100],{"type":393,"tag":517,"props":1101,"children":1102},{"style":568},[1103],{"type":399,"value":1104},"# Connect to database\n",{"type":393,"tag":517,"props":1106,"children":1107},{"class":519,"line":54},[1108,1112,1116,1120,1124],{"type":393,"tag":517,"props":1109,"children":1110},{"style":529},[1111],{"type":399,"value":579},{"type":393,"tag":517,"props":1113,"children":1114},{"style":523},[1115],{"type":399,"value":584},{"type":393,"tag":517,"props":1117,"children":1118},{"style":529},[1119],{"type":399,"value":589},{"type":393,"tag":517,"props":1121,"children":1122},{"style":592},[1123],{"type":399,"value":595},{"type":393,"tag":517,"props":1125,"children":1126},{"style":529},[1127],{"type":399,"value":600},{"type":393,"tag":517,"props":1129,"children":1130},{"class":519,"line":63},[1131],{"type":393,"tag":517,"props":1132,"children":1133},{"emptyLinePlaceholder":12},[1134],{"type":399,"value":562},{"type":393,"tag":517,"props":1136,"children":1137},{"class":519,"line":72},[1138],{"type":393,"tag":517,"props":1139,"children":1140},{"style":568},[1141],{"type":399,"value":1142},"# Load all data\n",{"type":393,"tag":517,"props":1144,"children":1145},{"class":519,"line":83},[1146,1151,1155,1160,1165],{"type":393,"tag":517,"props":1147,"children":1148},{"style":529},[1149],{"type":399,"value":1150},"df ",{"type":393,"tag":517,"props":1152,"children":1153},{"style":523},[1154],{"type":399,"value":584},{"type":393,"tag":517,"props":1156,"children":1157},{"style":529},[1158],{"type":399,"value":1159}," pd.read_sql(",{"type":393,"tag":517,"props":1161,"children":1162},{"style":592},[1163],{"type":399,"value":1164},"'SELECT * FROM employees'",{"type":393,"tag":517,"props":1166,"children":1167},{"style":529},[1168],{"type":399,"value":1169},", conn)\n",{"type":393,"tag":517,"props":1171,"children":1172},{"class":519,"line":92},[1173,1177,1181,1186],{"type":393,"tag":517,"props":1174,"children":1175},{"style":648},[1176],{"type":399,"value":956},{"type":393,"tag":517,"props":1178,"children":1179},{"style":529},[1180],{"type":399,"value":961},{"type":393,"tag":517,"props":1182,"children":1183},{"style":592},[1184],{"type":399,"value":1185},"\"All employees:\"",{"type":393,"tag":517,"props":1187,"children":1188},{"style":529},[1189],{"type":399,"value":600},{"type":393,"tag":517,"props":1191,"children":1192},{"class":519,"line":101},[1193,1197],{"type":393,"tag":517,"props":1194,"children":1195},{"style":648},[1196],{"type":399,"value":956},{"type":393,"tag":517,"props":1198,"children":1199},{"style":529},[1200],{"type":399,"value":1201},"(df)\n",{"type":393,"tag":517,"props":1203,"children":1204},{"class":519,"line":110},[1205,1209],{"type":393,"tag":517,"props":1206,"children":1207},{"style":648},[1208],{"type":399,"value":956},{"type":393,"tag":517,"props":1210,"children":1211},{"style":529},[1212],{"type":399,"value":1213},"()\n",{"type":393,"tag":517,"props":1215,"children":1216},{"class":519,"line":121},[1217],{"type":393,"tag":517,"props":1218,"children":1219},{"emptyLinePlaceholder":12},[1220],{"type":399,"value":562},{"type":393,"tag":517,"props":1222,"children":1223},{"class":519,"line":130},[1224],{"type":393,"tag":517,"props":1225,"children":1226},{"style":568},[1227],{"type":399,"value":1228},"# Load specific data with WHERE clause\n",{"type":393,"tag":517,"props":1230,"children":1231},{"class":519,"line":139},[1232,1237,1241,1245,1250],{"type":393,"tag":517,"props":1233,"children":1234},{"style":529},[1235],{"type":399,"value":1236},"sales_df ",{"type":393,"tag":517,"props":1238,"children":1239},{"style":523},[1240],{"type":399,"value":584},{"type":393,"tag":517,"props":1242,"children":1243},{"style":529},[1244],{"type":399,"value":1159},{"type":393,"tag":517,"props":1246,"children":1247},{"style":592},[1248],{"type":399,"value":1249},"'SELECT * FROM employees WHERE department = \"Sales\"'",{"type":393,"tag":517,"props":1251,"children":1252},{"style":529},[1253],{"type":399,"value":1169},{"type":393,"tag":517,"props":1255,"children":1256},{"class":519,"line":148},[1257,1261,1265,1270],{"type":393,"tag":517,"props":1258,"children":1259},{"style":648},[1260],{"type":399,"value":956},{"type":393,"tag":517,"props":1262,"children":1263},{"style":529},[1264],{"type":399,"value":961},{"type":393,"tag":517,"props":1266,"children":1267},{"style":592},[1268],{"type":399,"value":1269},"\"Sales department only:\"",{"type":393,"tag":517,"props":1271,"children":1272},{"style":529},[1273],{"type":399,"value":600},{"type":393,"tag":517,"props":1275,"children":1276},{"class":519,"line":159},[1277,1281],{"type":393,"tag":517,"props":1278,"children":1279},{"style":648},[1280],{"type":399,"value":956},{"type":393,"tag":517,"props":1282,"children":1283},{"style":529},[1284],{"type":399,"value":1285},"(sales_df)\n",{"type":393,"tag":517,"props":1287,"children":1288},{"class":519,"line":168},[1289,1293],{"type":393,"tag":517,"props":1290,"children":1291},{"style":648},[1292],{"type":399,"value":956},{"type":393,"tag":517,"props":1294,"children":1295},{"style":529},[1296],{"type":399,"value":1213},{"type":393,"tag":517,"props":1298,"children":1299},{"class":519,"line":177},[1300],{"type":393,"tag":517,"props":1301,"children":1302},{"emptyLinePlaceholder":12},[1303],{"type":399,"value":562},{"type":393,"tag":517,"props":1305,"children":1306},{"class":519,"line":186},[1307],{"type":393,"tag":517,"props":1308,"children":1309},{"style":568},[1310],{"type":399,"value":1311},"# Load with calculations\n",{"type":393,"tag":517,"props":1313,"children":1314},{"class":519,"line":197},[1315,1320,1324,1328],{"type":393,"tag":517,"props":1316,"children":1317},{"style":529},[1318],{"type":399,"value":1319},"summary ",{"type":393,"tag":517,"props":1321,"children":1322},{"style":523},[1323],{"type":399,"value":584},{"type":393,"tag":517,"props":1325,"children":1326},{"style":529},[1327],{"type":399,"value":1159},{"type":393,"tag":517,"props":1329,"children":1330},{"style":592},[1331],{"type":399,"value":1332},"\"\"\"\n",{"type":393,"tag":517,"props":1334,"children":1335},{"class":519,"line":206},[1336],{"type":393,"tag":517,"props":1337,"children":1338},{"style":592},[1339],{"type":399,"value":1340},"    SELECT department, \n",{"type":393,"tag":517,"props":1342,"children":1343},{"class":519,"line":215},[1344],{"type":393,"tag":517,"props":1345,"children":1346},{"style":592},[1347],{"type":399,"value":1348},"           COUNT(*) as employee_count,\n",{"type":393,"tag":517,"props":1350,"children":1351},{"class":519,"line":224},[1352],{"type":393,"tag":517,"props":1353,"children":1354},{"style":592},[1355],{"type":399,"value":1356},"           AVG(salary) as avg_salary\n",{"type":393,"tag":517,"props":1358,"children":1359},{"class":519,"line":233},[1360],{"type":393,"tag":517,"props":1361,"children":1362},{"style":592},[1363],{"type":399,"value":1364},"    FROM employees \n",{"type":393,"tag":517,"props":1366,"children":1367},{"class":519,"line":244},[1368],{"type":393,"tag":517,"props":1369,"children":1370},{"style":592},[1371],{"type":399,"value":1372},"    GROUP BY department\n",{"type":393,"tag":517,"props":1374,"children":1375},{"class":519,"line":253},[1376,1381],{"type":393,"tag":517,"props":1377,"children":1378},{"style":592},[1379],{"type":399,"value":1380},"\"\"\"",{"type":393,"tag":517,"props":1382,"children":1383},{"style":529},[1384],{"type":399,"value":1169},{"type":393,"tag":517,"props":1386,"children":1387},{"class":519,"line":262},[1388,1392,1396,1401],{"type":393,"tag":517,"props":1389,"children":1390},{"style":648},[1391],{"type":399,"value":956},{"type":393,"tag":517,"props":1393,"children":1394},{"style":529},[1395],{"type":399,"value":961},{"type":393,"tag":517,"props":1397,"children":1398},{"style":592},[1399],{"type":399,"value":1400},"\"Department summary:\"",{"type":393,"tag":517,"props":1402,"children":1403},{"style":529},[1404],{"type":399,"value":600},{"type":393,"tag":517,"props":1406,"children":1407},{"class":519,"line":271},[1408,1412],{"type":393,"tag":517,"props":1409,"children":1410},{"style":648},[1411],{"type":399,"value":956},{"type":393,"tag":517,"props":1413,"children":1414},{"style":529},[1415],{"type":399,"value":1416},"(summary)\n",{"type":393,"tag":517,"props":1418,"children":1419},{"class":519,"line":281},[1420],{"type":393,"tag":517,"props":1421,"children":1422},{"emptyLinePlaceholder":12},[1423],{"type":399,"value":562},{"type":393,"tag":517,"props":1425,"children":1426},{"class":519,"line":290},[1427],{"type":393,"tag":517,"props":1428,"children":1429},{"style":529},[1430],{"type":399,"value":1038},{"type":393,"tag":490,"props":1432,"children":1434},{"id":1433},"different-types-of-queries",[1435],{"type":399,"value":1436},"🔍 Different Types of Queries",{"type":393,"tag":402,"props":1438,"children":1439},{},[1440],{"type":399,"value":1441},"You can use SQL to filter and process data before loading:",{"type":393,"tag":502,"props":1443,"children":1444},{},[1445],{"type":393,"tag":506,"props":1446,"children":1448},{"className":508,"code":1447,"language":510,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\n# Reconnect to our database\nconn = sqlite3.connect('sample.db')\n\n# Different query examples\nqueries = {\n    \"High earners\": \"SELECT * FROM employees WHERE salary > 60000\",\n    \"IT department\": \"SELECT name, salary FROM employees WHERE department = 'IT'\",\n    \"Sorted by salary\": \"SELECT * FROM employees ORDER BY salary DESC\",\n    \"Name and department\": \"SELECT name, department FROM employees\"\n}\n\nfor description, query in queries.items():\n    print(f\"📊 {description}:\")\n    df = pd.read_sql(query, conn)\n    print(df)\n    print()\n\nconn.close()\n",[1449],{"type":393,"tag":513,"props":1450,"children":1451},{"__ignoreMap":6},[1452,1471,1482,1489,1497,1520,1527,1535,1552,1575,1596,1617,1634,1642,1649,1672,1716,1733,1744,1755,1762],{"type":393,"tag":517,"props":1453,"children":1454},{"class":519,"line":11},[1455,1459,1463,1467],{"type":393,"tag":517,"props":1456,"children":1457},{"style":523},[1458],{"type":399,"value":526},{"type":393,"tag":517,"props":1460,"children":1461},{"style":529},[1462],{"type":399,"value":532},{"type":393,"tag":517,"props":1464,"children":1465},{"style":523},[1466],{"type":399,"value":537},{"type":393,"tag":517,"props":1468,"children":1469},{"style":529},[1470],{"type":399,"value":542},{"type":393,"tag":517,"props":1472,"children":1473},{"class":519,"line":27},[1474,1478],{"type":393,"tag":517,"props":1475,"children":1476},{"style":523},[1477],{"type":399,"value":526},{"type":393,"tag":517,"props":1479,"children":1480},{"style":529},[1481],{"type":399,"value":554},{"type":393,"tag":517,"props":1483,"children":1484},{"class":519,"line":36},[1485],{"type":393,"tag":517,"props":1486,"children":1487},{"emptyLinePlaceholder":12},[1488],{"type":399,"value":562},{"type":393,"tag":517,"props":1490,"children":1491},{"class":519,"line":45},[1492],{"type":393,"tag":517,"props":1493,"children":1494},{"style":568},[1495],{"type":399,"value":1496},"# Reconnect to our database\n",{"type":393,"tag":517,"props":1498,"children":1499},{"class":519,"line":54},[1500,1504,1508,1512,1516],{"type":393,"tag":517,"props":1501,"children":1502},{"style":529},[1503],{"type":399,"value":579},{"type":393,"tag":517,"props":1505,"children":1506},{"style":523},[1507],{"type":399,"value":584},{"type":393,"tag":517,"props":1509,"children":1510},{"style":529},[1511],{"type":399,"value":589},{"type":393,"tag":517,"props":1513,"children":1514},{"style":592},[1515],{"type":399,"value":595},{"type":393,"tag":517,"props":1517,"children":1518},{"style":529},[1519],{"type":399,"value":600},{"type":393,"tag":517,"props":1521,"children":1522},{"class":519,"line":63},[1523],{"type":393,"tag":517,"props":1524,"children":1525},{"emptyLinePlaceholder":12},[1526],{"type":399,"value":562},{"type":393,"tag":517,"props":1528,"children":1529},{"class":519,"line":72},[1530],{"type":393,"tag":517,"props":1531,"children":1532},{"style":568},[1533],{"type":399,"value":1534},"# Different query examples\n",{"type":393,"tag":517,"props":1536,"children":1537},{"class":519,"line":83},[1538,1543,1547],{"type":393,"tag":517,"props":1539,"children":1540},{"style":529},[1541],{"type":399,"value":1542},"queries ",{"type":393,"tag":517,"props":1544,"children":1545},{"style":523},[1546],{"type":399,"value":584},{"type":393,"tag":517,"props":1548,"children":1549},{"style":529},[1550],{"type":399,"value":1551}," {\n",{"type":393,"tag":517,"props":1553,"children":1554},{"class":519,"line":92},[1555,1560,1565,1570],{"type":393,"tag":517,"props":1556,"children":1557},{"style":592},[1558],{"type":399,"value":1559},"    \"High earners\"",{"type":393,"tag":517,"props":1561,"children":1562},{"style":529},[1563],{"type":399,"value":1564},": ",{"type":393,"tag":517,"props":1566,"children":1567},{"style":592},[1568],{"type":399,"value":1569},"\"SELECT * FROM employees WHERE salary > 60000\"",{"type":393,"tag":517,"props":1571,"children":1572},{"style":529},[1573],{"type":399,"value":1574},",\n",{"type":393,"tag":517,"props":1576,"children":1577},{"class":519,"line":101},[1578,1583,1587,1592],{"type":393,"tag":517,"props":1579,"children":1580},{"style":592},[1581],{"type":399,"value":1582},"    \"IT department\"",{"type":393,"tag":517,"props":1584,"children":1585},{"style":529},[1586],{"type":399,"value":1564},{"type":393,"tag":517,"props":1588,"children":1589},{"style":592},[1590],{"type":399,"value":1591},"\"SELECT name, salary FROM employees WHERE department = 'IT'\"",{"type":393,"tag":517,"props":1593,"children":1594},{"style":529},[1595],{"type":399,"value":1574},{"type":393,"tag":517,"props":1597,"children":1598},{"class":519,"line":110},[1599,1604,1608,1613],{"type":393,"tag":517,"props":1600,"children":1601},{"style":592},[1602],{"type":399,"value":1603},"    \"Sorted by salary\"",{"type":393,"tag":517,"props":1605,"children":1606},{"style":529},[1607],{"type":399,"value":1564},{"type":393,"tag":517,"props":1609,"children":1610},{"style":592},[1611],{"type":399,"value":1612},"\"SELECT * FROM employees ORDER BY salary DESC\"",{"type":393,"tag":517,"props":1614,"children":1615},{"style":529},[1616],{"type":399,"value":1574},{"type":393,"tag":517,"props":1618,"children":1619},{"class":519,"line":121},[1620,1625,1629],{"type":393,"tag":517,"props":1621,"children":1622},{"style":592},[1623],{"type":399,"value":1624},"    \"Name and department\"",{"type":393,"tag":517,"props":1626,"children":1627},{"style":529},[1628],{"type":399,"value":1564},{"type":393,"tag":517,"props":1630,"children":1631},{"style":592},[1632],{"type":399,"value":1633},"\"SELECT name, department FROM employees\"\n",{"type":393,"tag":517,"props":1635,"children":1636},{"class":519,"line":130},[1637],{"type":393,"tag":517,"props":1638,"children":1639},{"style":529},[1640],{"type":399,"value":1641},"}\n",{"type":393,"tag":517,"props":1643,"children":1644},{"class":519,"line":139},[1645],{"type":393,"tag":517,"props":1646,"children":1647},{"emptyLinePlaceholder":12},[1648],{"type":399,"value":562},{"type":393,"tag":517,"props":1650,"children":1651},{"class":519,"line":148},[1652,1657,1662,1667],{"type":393,"tag":517,"props":1653,"children":1654},{"style":523},[1655],{"type":399,"value":1656},"for",{"type":393,"tag":517,"props":1658,"children":1659},{"style":529},[1660],{"type":399,"value":1661}," description, query ",{"type":393,"tag":517,"props":1663,"children":1664},{"style":523},[1665],{"type":399,"value":1666},"in",{"type":393,"tag":517,"props":1668,"children":1669},{"style":529},[1670],{"type":399,"value":1671}," queries.items():\n",{"type":393,"tag":517,"props":1673,"children":1674},{"class":519,"line":159},[1675,1680,1684,1688,1693,1698,1703,1707,1712],{"type":393,"tag":517,"props":1676,"children":1677},{"style":648},[1678],{"type":399,"value":1679},"    print",{"type":393,"tag":517,"props":1681,"children":1682},{"style":529},[1683],{"type":399,"value":961},{"type":393,"tag":517,"props":1685,"children":1686},{"style":523},[1687],{"type":399,"value":986},{"type":393,"tag":517,"props":1689,"children":1690},{"style":592},[1691],{"type":399,"value":1692},"\"📊 ",{"type":393,"tag":517,"props":1694,"children":1695},{"style":648},[1696],{"type":399,"value":1697},"{",{"type":393,"tag":517,"props":1699,"children":1700},{"style":529},[1701],{"type":399,"value":1702},"description",{"type":393,"tag":517,"props":1704,"children":1705},{"style":648},[1706],{"type":399,"value":1006},{"type":393,"tag":517,"props":1708,"children":1709},{"style":592},[1710],{"type":399,"value":1711},":\"",{"type":393,"tag":517,"props":1713,"children":1714},{"style":529},[1715],{"type":399,"value":600},{"type":393,"tag":517,"props":1717,"children":1718},{"class":519,"line":168},[1719,1724,1728],{"type":393,"tag":517,"props":1720,"children":1721},{"style":529},[1722],{"type":399,"value":1723},"    df ",{"type":393,"tag":517,"props":1725,"children":1726},{"style":523},[1727],{"type":399,"value":584},{"type":393,"tag":517,"props":1729,"children":1730},{"style":529},[1731],{"type":399,"value":1732}," pd.read_sql(query, conn)\n",{"type":393,"tag":517,"props":1734,"children":1735},{"class":519,"line":177},[1736,1740],{"type":393,"tag":517,"props":1737,"children":1738},{"style":648},[1739],{"type":399,"value":1679},{"type":393,"tag":517,"props":1741,"children":1742},{"style":529},[1743],{"type":399,"value":1201},{"type":393,"tag":517,"props":1745,"children":1746},{"class":519,"line":186},[1747,1751],{"type":393,"tag":517,"props":1748,"children":1749},{"style":648},[1750],{"type":399,"value":1679},{"type":393,"tag":517,"props":1752,"children":1753},{"style":529},[1754],{"type":399,"value":1213},{"type":393,"tag":517,"props":1756,"children":1757},{"class":519,"line":197},[1758],{"type":393,"tag":517,"props":1759,"children":1760},{"emptyLinePlaceholder":12},[1761],{"type":399,"value":562},{"type":393,"tag":517,"props":1763,"children":1764},{"class":519,"line":206},[1765],{"type":393,"tag":517,"props":1766,"children":1767},{"style":529},[1768],{"type":399,"value":1038},{"type":393,"tag":490,"props":1770,"children":1772},{"id":1771},"connecting-to-different-databases",[1773],{"type":399,"value":1774},"🌐 Connecting to Different Databases",{"type":393,"tag":402,"props":1776,"children":1777},{},[1778],{"type":399,"value":1779},"Different databases need different connection methods:",{"type":393,"tag":1781,"props":1782,"children":1784},"h3",{"id":1783},"sqlite-file-based",[1785],{"type":399,"value":1786},"SQLite (File-based)",{"type":393,"tag":408,"props":1788,"children":1791},{"emoji":1789,"title":1790,"type":412},"🗃️","SQLite Connection Pattern",[1792,1800,1837,1845],{"type":393,"tag":402,"props":1793,"children":1794},{},[1795],{"type":393,"tag":418,"props":1796,"children":1797},{},[1798],{"type":399,"value":1799},"SQLite Steps:",{"type":393,"tag":1801,"props":1802,"children":1803},"ol",{},[1804,1815,1826],{"type":393,"tag":428,"props":1805,"children":1806},{},[1807,1813],{"type":393,"tag":513,"props":1808,"children":1810},{"className":1809},[],[1811],{"type":399,"value":1812},"sqlite3.connect('file.db')",{"type":399,"value":1814}," - Connect to database file",{"type":393,"tag":428,"props":1816,"children":1817},{},[1818,1824],{"type":393,"tag":513,"props":1819,"children":1821},{"className":1820},[],[1822],{"type":399,"value":1823},"pd.read_sql(query, connection)",{"type":399,"value":1825}," - Execute query and load data",{"type":393,"tag":428,"props":1827,"children":1828},{},[1829,1835],{"type":393,"tag":513,"props":1830,"children":1832},{"className":1831},[],[1833],{"type":399,"value":1834},"connection.close()",{"type":399,"value":1836}," - Always close connection",{"type":393,"tag":402,"props":1838,"children":1839},{},[1840],{"type":393,"tag":418,"props":1841,"children":1842},{},[1843],{"type":399,"value":1844},"Benefits:",{"type":393,"tag":424,"props":1846,"children":1847},{},[1848,1853,1858,1863],{"type":393,"tag":428,"props":1849,"children":1850},{},[1851],{"type":399,"value":1852},"No server setup required",{"type":393,"tag":428,"props":1854,"children":1855},{},[1856],{"type":399,"value":1857},"Perfect for development and small applications",{"type":393,"tag":428,"props":1859,"children":1860},{},[1861],{"type":399,"value":1862},"File-based, easy to share and backup",{"type":393,"tag":428,"props":1864,"children":1865},{},[1866],{"type":399,"value":1867},"Great for learning database concepts",{"type":393,"tag":502,"props":1869,"children":1870},{},[1871],{"type":393,"tag":506,"props":1872,"children":1874},{"className":508,"code":1873,"language":510,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\n# SQLite - simple file database\nconn = sqlite3.connect('database.db')\ndf = pd.read_sql('SELECT * FROM table_name', conn)\nconn.close()\n\nprint(\"✅ SQLite connection established and closed safely\")\n",[1875],{"type":393,"tag":513,"props":1876,"children":1877},{"__ignoreMap":6},[1878,1897,1908,1915,1923,1947,1971,1978,1985],{"type":393,"tag":517,"props":1879,"children":1880},{"class":519,"line":11},[1881,1885,1889,1893],{"type":393,"tag":517,"props":1882,"children":1883},{"style":523},[1884],{"type":399,"value":526},{"type":393,"tag":517,"props":1886,"children":1887},{"style":529},[1888],{"type":399,"value":532},{"type":393,"tag":517,"props":1890,"children":1891},{"style":523},[1892],{"type":399,"value":537},{"type":393,"tag":517,"props":1894,"children":1895},{"style":529},[1896],{"type":399,"value":542},{"type":393,"tag":517,"props":1898,"children":1899},{"class":519,"line":27},[1900,1904],{"type":393,"tag":517,"props":1901,"children":1902},{"style":523},[1903],{"type":399,"value":526},{"type":393,"tag":517,"props":1905,"children":1906},{"style":529},[1907],{"type":399,"value":554},{"type":393,"tag":517,"props":1909,"children":1910},{"class":519,"line":36},[1911],{"type":393,"tag":517,"props":1912,"children":1913},{"emptyLinePlaceholder":12},[1914],{"type":399,"value":562},{"type":393,"tag":517,"props":1916,"children":1917},{"class":519,"line":45},[1918],{"type":393,"tag":517,"props":1919,"children":1920},{"style":568},[1921],{"type":399,"value":1922},"# SQLite - simple file database\n",{"type":393,"tag":517,"props":1924,"children":1925},{"class":519,"line":54},[1926,1930,1934,1938,1943],{"type":393,"tag":517,"props":1927,"children":1928},{"style":529},[1929],{"type":399,"value":579},{"type":393,"tag":517,"props":1931,"children":1932},{"style":523},[1933],{"type":399,"value":584},{"type":393,"tag":517,"props":1935,"children":1936},{"style":529},[1937],{"type":399,"value":589},{"type":393,"tag":517,"props":1939,"children":1940},{"style":592},[1941],{"type":399,"value":1942},"'database.db'",{"type":393,"tag":517,"props":1944,"children":1945},{"style":529},[1946],{"type":399,"value":600},{"type":393,"tag":517,"props":1948,"children":1949},{"class":519,"line":63},[1950,1954,1958,1962,1967],{"type":393,"tag":517,"props":1951,"children":1952},{"style":529},[1953],{"type":399,"value":1150},{"type":393,"tag":517,"props":1955,"children":1956},{"style":523},[1957],{"type":399,"value":584},{"type":393,"tag":517,"props":1959,"children":1960},{"style":529},[1961],{"type":399,"value":1159},{"type":393,"tag":517,"props":1963,"children":1964},{"style":592},[1965],{"type":399,"value":1966},"'SELECT * FROM table_name'",{"type":393,"tag":517,"props":1968,"children":1969},{"style":529},[1970],{"type":399,"value":1169},{"type":393,"tag":517,"props":1972,"children":1973},{"class":519,"line":72},[1974],{"type":393,"tag":517,"props":1975,"children":1976},{"style":529},[1977],{"type":399,"value":1038},{"type":393,"tag":517,"props":1979,"children":1980},{"class":519,"line":83},[1981],{"type":393,"tag":517,"props":1982,"children":1983},{"emptyLinePlaceholder":12},[1984],{"type":399,"value":562},{"type":393,"tag":517,"props":1986,"children":1987},{"class":519,"line":92},[1988,1992,1996,2001],{"type":393,"tag":517,"props":1989,"children":1990},{"style":648},[1991],{"type":399,"value":956},{"type":393,"tag":517,"props":1993,"children":1994},{"style":529},[1995],{"type":399,"value":961},{"type":393,"tag":517,"props":1997,"children":1998},{"style":592},[1999],{"type":399,"value":2000},"\"✅ SQLite connection established and closed safely\"",{"type":393,"tag":517,"props":2002,"children":2003},{"style":529},[2004],{"type":399,"value":600},{"type":393,"tag":1781,"props":2006,"children":2008},{"id":2007},"postgresql-mysql-examples",[2009],{"type":399,"value":2010},"PostgreSQL / MySQL Examples",{"type":393,"tag":408,"props":2012,"children":2016},{"emoji":2013,"title":2014,"type":2015},"🌐","Production Database Connection Patterns","warning",[2017,2025,2178,2186,2330,2338,2363],{"type":393,"tag":402,"props":2018,"children":2019},{},[2020],{"type":393,"tag":418,"props":2021,"children":2022},{},[2023],{"type":399,"value":2024},"PostgreSQL Connection:",{"type":393,"tag":506,"props":2026,"children":2028},{"className":508,"code":2027,"language":510,"meta":6,"style":6},"import psycopg2\nconn = psycopg2.connect(\n    host='localhost',\n    database='mydb',\n    user='username',\n    password='password'\n)\ndf = pd.read_sql('SELECT * FROM table', conn)\nconn.close()\n",[2029],{"type":393,"tag":513,"props":2030,"children":2031},{"__ignoreMap":6},[2032,2044,2060,2081,2102,2123,2140,2147,2171],{"type":393,"tag":517,"props":2033,"children":2034},{"class":519,"line":11},[2035,2039],{"type":393,"tag":517,"props":2036,"children":2037},{"style":523},[2038],{"type":399,"value":526},{"type":393,"tag":517,"props":2040,"children":2041},{"style":529},[2042],{"type":399,"value":2043}," psycopg2\n",{"type":393,"tag":517,"props":2045,"children":2046},{"class":519,"line":27},[2047,2051,2055],{"type":393,"tag":517,"props":2048,"children":2049},{"style":529},[2050],{"type":399,"value":579},{"type":393,"tag":517,"props":2052,"children":2053},{"style":523},[2054],{"type":399,"value":584},{"type":393,"tag":517,"props":2056,"children":2057},{"style":529},[2058],{"type":399,"value":2059}," psycopg2.connect(\n",{"type":393,"tag":517,"props":2061,"children":2062},{"class":519,"line":36},[2063,2068,2072,2077],{"type":393,"tag":517,"props":2064,"children":2065},{"style":907},[2066],{"type":399,"value":2067},"    host",{"type":393,"tag":517,"props":2069,"children":2070},{"style":523},[2071],{"type":399,"value":584},{"type":393,"tag":517,"props":2073,"children":2074},{"style":592},[2075],{"type":399,"value":2076},"'localhost'",{"type":393,"tag":517,"props":2078,"children":2079},{"style":529},[2080],{"type":399,"value":1574},{"type":393,"tag":517,"props":2082,"children":2083},{"class":519,"line":45},[2084,2089,2093,2098],{"type":393,"tag":517,"props":2085,"children":2086},{"style":907},[2087],{"type":399,"value":2088},"    database",{"type":393,"tag":517,"props":2090,"children":2091},{"style":523},[2092],{"type":399,"value":584},{"type":393,"tag":517,"props":2094,"children":2095},{"style":592},[2096],{"type":399,"value":2097},"'mydb'",{"type":393,"tag":517,"props":2099,"children":2100},{"style":529},[2101],{"type":399,"value":1574},{"type":393,"tag":517,"props":2103,"children":2104},{"class":519,"line":54},[2105,2110,2114,2119],{"type":393,"tag":517,"props":2106,"children":2107},{"style":907},[2108],{"type":399,"value":2109},"    user",{"type":393,"tag":517,"props":2111,"children":2112},{"style":523},[2113],{"type":399,"value":584},{"type":393,"tag":517,"props":2115,"children":2116},{"style":592},[2117],{"type":399,"value":2118},"'username'",{"type":393,"tag":517,"props":2120,"children":2121},{"style":529},[2122],{"type":399,"value":1574},{"type":393,"tag":517,"props":2124,"children":2125},{"class":519,"line":63},[2126,2131,2135],{"type":393,"tag":517,"props":2127,"children":2128},{"style":907},[2129],{"type":399,"value":2130},"    password",{"type":393,"tag":517,"props":2132,"children":2133},{"style":523},[2134],{"type":399,"value":584},{"type":393,"tag":517,"props":2136,"children":2137},{"style":592},[2138],{"type":399,"value":2139},"'password'\n",{"type":393,"tag":517,"props":2141,"children":2142},{"class":519,"line":72},[2143],{"type":393,"tag":517,"props":2144,"children":2145},{"style":529},[2146],{"type":399,"value":600},{"type":393,"tag":517,"props":2148,"children":2149},{"class":519,"line":83},[2150,2154,2158,2162,2167],{"type":393,"tag":517,"props":2151,"children":2152},{"style":529},[2153],{"type":399,"value":1150},{"type":393,"tag":517,"props":2155,"children":2156},{"style":523},[2157],{"type":399,"value":584},{"type":393,"tag":517,"props":2159,"children":2160},{"style":529},[2161],{"type":399,"value":1159},{"type":393,"tag":517,"props":2163,"children":2164},{"style":592},[2165],{"type":399,"value":2166},"'SELECT * FROM table'",{"type":393,"tag":517,"props":2168,"children":2169},{"style":529},[2170],{"type":399,"value":1169},{"type":393,"tag":517,"props":2172,"children":2173},{"class":519,"line":92},[2174],{"type":393,"tag":517,"props":2175,"children":2176},{"style":529},[2177],{"type":399,"value":1038},{"type":393,"tag":402,"props":2179,"children":2180},{},[2181],{"type":393,"tag":418,"props":2182,"children":2183},{},[2184],{"type":399,"value":2185},"MySQL Connection:",{"type":393,"tag":506,"props":2187,"children":2189},{"className":508,"code":2188,"language":510,"meta":6,"style":6},"import mysql.connector\nconn = mysql.connector.connect(\n    host='localhost',\n    database='mydb',\n    user='username',\n    password='password'\n)\ndf = pd.read_sql('SELECT * FROM table', conn)\nconn.close()\n",[2190],{"type":393,"tag":513,"props":2191,"children":2192},{"__ignoreMap":6},[2193,2205,2221,2240,2259,2278,2293,2300,2323],{"type":393,"tag":517,"props":2194,"children":2195},{"class":519,"line":11},[2196,2200],{"type":393,"tag":517,"props":2197,"children":2198},{"style":523},[2199],{"type":399,"value":526},{"type":393,"tag":517,"props":2201,"children":2202},{"style":529},[2203],{"type":399,"value":2204}," mysql.connector\n",{"type":393,"tag":517,"props":2206,"children":2207},{"class":519,"line":27},[2208,2212,2216],{"type":393,"tag":517,"props":2209,"children":2210},{"style":529},[2211],{"type":399,"value":579},{"type":393,"tag":517,"props":2213,"children":2214},{"style":523},[2215],{"type":399,"value":584},{"type":393,"tag":517,"props":2217,"children":2218},{"style":529},[2219],{"type":399,"value":2220}," mysql.connector.connect(\n",{"type":393,"tag":517,"props":2222,"children":2223},{"class":519,"line":36},[2224,2228,2232,2236],{"type":393,"tag":517,"props":2225,"children":2226},{"style":907},[2227],{"type":399,"value":2067},{"type":393,"tag":517,"props":2229,"children":2230},{"style":523},[2231],{"type":399,"value":584},{"type":393,"tag":517,"props":2233,"children":2234},{"style":592},[2235],{"type":399,"value":2076},{"type":393,"tag":517,"props":2237,"children":2238},{"style":529},[2239],{"type":399,"value":1574},{"type":393,"tag":517,"props":2241,"children":2242},{"class":519,"line":45},[2243,2247,2251,2255],{"type":393,"tag":517,"props":2244,"children":2245},{"style":907},[2246],{"type":399,"value":2088},{"type":393,"tag":517,"props":2248,"children":2249},{"style":523},[2250],{"type":399,"value":584},{"type":393,"tag":517,"props":2252,"children":2253},{"style":592},[2254],{"type":399,"value":2097},{"type":393,"tag":517,"props":2256,"children":2257},{"style":529},[2258],{"type":399,"value":1574},{"type":393,"tag":517,"props":2260,"children":2261},{"class":519,"line":54},[2262,2266,2270,2274],{"type":393,"tag":517,"props":2263,"children":2264},{"style":907},[2265],{"type":399,"value":2109},{"type":393,"tag":517,"props":2267,"children":2268},{"style":523},[2269],{"type":399,"value":584},{"type":393,"tag":517,"props":2271,"children":2272},{"style":592},[2273],{"type":399,"value":2118},{"type":393,"tag":517,"props":2275,"children":2276},{"style":529},[2277],{"type":399,"value":1574},{"type":393,"tag":517,"props":2279,"children":2280},{"class":519,"line":63},[2281,2285,2289],{"type":393,"tag":517,"props":2282,"children":2283},{"style":907},[2284],{"type":399,"value":2130},{"type":393,"tag":517,"props":2286,"children":2287},{"style":523},[2288],{"type":399,"value":584},{"type":393,"tag":517,"props":2290,"children":2291},{"style":592},[2292],{"type":399,"value":2139},{"type":393,"tag":517,"props":2294,"children":2295},{"class":519,"line":72},[2296],{"type":393,"tag":517,"props":2297,"children":2298},{"style":529},[2299],{"type":399,"value":600},{"type":393,"tag":517,"props":2301,"children":2302},{"class":519,"line":83},[2303,2307,2311,2315,2319],{"type":393,"tag":517,"props":2304,"children":2305},{"style":529},[2306],{"type":399,"value":1150},{"type":393,"tag":517,"props":2308,"children":2309},{"style":523},[2310],{"type":399,"value":584},{"type":393,"tag":517,"props":2312,"children":2313},{"style":529},[2314],{"type":399,"value":1159},{"type":393,"tag":517,"props":2316,"children":2317},{"style":592},[2318],{"type":399,"value":2166},{"type":393,"tag":517,"props":2320,"children":2321},{"style":529},[2322],{"type":399,"value":1169},{"type":393,"tag":517,"props":2324,"children":2325},{"class":519,"line":92},[2326],{"type":393,"tag":517,"props":2327,"children":2328},{"style":529},[2329],{"type":399,"value":1038},{"type":393,"tag":402,"props":2331,"children":2332},{},[2333],{"type":393,"tag":418,"props":2334,"children":2335},{},[2336],{"type":399,"value":2337},"Required Packages:",{"type":393,"tag":424,"props":2339,"children":2340},{},[2341,2352],{"type":393,"tag":428,"props":2342,"children":2343},{},[2344,2346],{"type":399,"value":2345},"PostgreSQL: ",{"type":393,"tag":513,"props":2347,"children":2349},{"className":2348},[],[2350],{"type":399,"value":2351},"pip install psycopg2",{"type":393,"tag":428,"props":2353,"children":2354},{},[2355,2357],{"type":399,"value":2356},"MySQL: ",{"type":393,"tag":513,"props":2358,"children":2360},{"className":2359},[],[2361],{"type":399,"value":2362},"pip install mysql-connector-python",{"type":393,"tag":402,"props":2364,"children":2365},{},[2366,2371],{"type":393,"tag":418,"props":2367,"children":2368},{},[2369],{"type":399,"value":2370},"Security Note:",{"type":399,"value":2372}," Never hardcode credentials in production code!",{"type":393,"tag":502,"props":2374,"children":2375},{},[2376],{"type":393,"tag":506,"props":2377,"children":2379},{"className":508,"code":2378,"language":510,"meta":6,"style":6},"import pandas as pd\n# Note: These require additional packages\n\n# Example connection patterns (see InfoBox above for details)\nprint(\"Database connection patterns moved to InfoBox above\")\nprint(\"Remember to install required packages and use environment variables for credentials\")\n",[2380],{"type":393,"tag":513,"props":2381,"children":2382},{"__ignoreMap":6},[2383,2402,2410,2417,2425,2445],{"type":393,"tag":517,"props":2384,"children":2385},{"class":519,"line":11},[2386,2390,2394,2398],{"type":393,"tag":517,"props":2387,"children":2388},{"style":523},[2389],{"type":399,"value":526},{"type":393,"tag":517,"props":2391,"children":2392},{"style":529},[2393],{"type":399,"value":532},{"type":393,"tag":517,"props":2395,"children":2396},{"style":523},[2397],{"type":399,"value":537},{"type":393,"tag":517,"props":2399,"children":2400},{"style":529},[2401],{"type":399,"value":542},{"type":393,"tag":517,"props":2403,"children":2404},{"class":519,"line":27},[2405],{"type":393,"tag":517,"props":2406,"children":2407},{"style":568},[2408],{"type":399,"value":2409},"# Note: These require additional packages\n",{"type":393,"tag":517,"props":2411,"children":2412},{"class":519,"line":36},[2413],{"type":393,"tag":517,"props":2414,"children":2415},{"emptyLinePlaceholder":12},[2416],{"type":399,"value":562},{"type":393,"tag":517,"props":2418,"children":2419},{"class":519,"line":45},[2420],{"type":393,"tag":517,"props":2421,"children":2422},{"style":568},[2423],{"type":399,"value":2424},"# Example connection patterns (see InfoBox above for details)\n",{"type":393,"tag":517,"props":2426,"children":2427},{"class":519,"line":54},[2428,2432,2436,2441],{"type":393,"tag":517,"props":2429,"children":2430},{"style":648},[2431],{"type":399,"value":956},{"type":393,"tag":517,"props":2433,"children":2434},{"style":529},[2435],{"type":399,"value":961},{"type":393,"tag":517,"props":2437,"children":2438},{"style":592},[2439],{"type":399,"value":2440},"\"Database connection patterns moved to InfoBox above\"",{"type":393,"tag":517,"props":2442,"children":2443},{"style":529},[2444],{"type":399,"value":600},{"type":393,"tag":517,"props":2446,"children":2447},{"class":519,"line":63},[2448,2452,2456,2461],{"type":393,"tag":517,"props":2449,"children":2450},{"style":648},[2451],{"type":399,"value":956},{"type":393,"tag":517,"props":2453,"children":2454},{"style":529},[2455],{"type":399,"value":961},{"type":393,"tag":517,"props":2457,"children":2458},{"style":592},[2459],{"type":399,"value":2460},"\"Remember to install required packages and use environment variables for credentials\"",{"type":393,"tag":517,"props":2462,"children":2463},{"style":529},[2464],{"type":399,"value":600},{"type":393,"tag":490,"props":2466,"children":2468},{"id":2467},"safe-database-connections",[2469],{"type":399,"value":2470},"🔧 Safe Database Connections",{"type":393,"tag":402,"props":2472,"children":2473},{},[2474],{"type":399,"value":2475},"Always handle database connections safely:",{"type":393,"tag":502,"props":2477,"children":2478},{},[2479],{"type":393,"tag":506,"props":2480,"children":2482},{"className":508,"code":2481,"language":510,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\ndef safe_db_query(db_file, query):\n    \"\"\"Safely execute database query\"\"\"\n    try:\n        # Connect to database\n        conn = sqlite3.connect(db_file)\n        \n        # Execute query\n        df = pd.read_sql(query, conn)\n        \n        print(f\"✅ Query successful: {len(df)} rows returned\")\n        return df\n        \n    except sqlite3.Error as e:\n        print(f\"❌ Database error: {e}\")\n        return None\n    except Exception as e:\n        print(f\"❌ Error: {e}\")\n        return None\n    finally:\n        # Always close connection\n        if 'conn' in locals():\n            conn.close()\n\n# Test safe query\ndf = safe_db_query('sample.db', 'SELECT * FROM employees')\nif df is not None:\n    print(df.head())\n",[2483],{"type":393,"tag":513,"props":2484,"children":2485},{"__ignoreMap":6},[2486,2505,2516,2523,2542,2550,2563,2571,2588,2596,2604,2620,2627,2670,2683,2690,2712,2754,2766,2787,2827,2838,2850,2858,2886,2894,2901,2909,2941,2973],{"type":393,"tag":517,"props":2487,"children":2488},{"class":519,"line":11},[2489,2493,2497,2501],{"type":393,"tag":517,"props":2490,"children":2491},{"style":523},[2492],{"type":399,"value":526},{"type":393,"tag":517,"props":2494,"children":2495},{"style":529},[2496],{"type":399,"value":532},{"type":393,"tag":517,"props":2498,"children":2499},{"style":523},[2500],{"type":399,"value":537},{"type":393,"tag":517,"props":2502,"children":2503},{"style":529},[2504],{"type":399,"value":542},{"type":393,"tag":517,"props":2506,"children":2507},{"class":519,"line":27},[2508,2512],{"type":393,"tag":517,"props":2509,"children":2510},{"style":523},[2511],{"type":399,"value":526},{"type":393,"tag":517,"props":2513,"children":2514},{"style":529},[2515],{"type":399,"value":554},{"type":393,"tag":517,"props":2517,"children":2518},{"class":519,"line":36},[2519],{"type":393,"tag":517,"props":2520,"children":2521},{"emptyLinePlaceholder":12},[2522],{"type":399,"value":562},{"type":393,"tag":517,"props":2524,"children":2525},{"class":519,"line":45},[2526,2531,2537],{"type":393,"tag":517,"props":2527,"children":2528},{"style":523},[2529],{"type":399,"value":2530},"def",{"type":393,"tag":517,"props":2532,"children":2534},{"style":2533},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2535],{"type":399,"value":2536}," safe_db_query",{"type":393,"tag":517,"props":2538,"children":2539},{"style":529},[2540],{"type":399,"value":2541},"(db_file, query):\n",{"type":393,"tag":517,"props":2543,"children":2544},{"class":519,"line":54},[2545],{"type":393,"tag":517,"props":2546,"children":2547},{"style":592},[2548],{"type":399,"value":2549},"    \"\"\"Safely execute database query\"\"\"\n",{"type":393,"tag":517,"props":2551,"children":2552},{"class":519,"line":63},[2553,2558],{"type":393,"tag":517,"props":2554,"children":2555},{"style":523},[2556],{"type":399,"value":2557},"    try",{"type":393,"tag":517,"props":2559,"children":2560},{"style":529},[2561],{"type":399,"value":2562},":\n",{"type":393,"tag":517,"props":2564,"children":2565},{"class":519,"line":72},[2566],{"type":393,"tag":517,"props":2567,"children":2568},{"style":568},[2569],{"type":399,"value":2570},"        # Connect to database\n",{"type":393,"tag":517,"props":2572,"children":2573},{"class":519,"line":83},[2574,2579,2583],{"type":393,"tag":517,"props":2575,"children":2576},{"style":529},[2577],{"type":399,"value":2578},"        conn ",{"type":393,"tag":517,"props":2580,"children":2581},{"style":523},[2582],{"type":399,"value":584},{"type":393,"tag":517,"props":2584,"children":2585},{"style":529},[2586],{"type":399,"value":2587}," sqlite3.connect(db_file)\n",{"type":393,"tag":517,"props":2589,"children":2590},{"class":519,"line":92},[2591],{"type":393,"tag":517,"props":2592,"children":2593},{"style":529},[2594],{"type":399,"value":2595},"        \n",{"type":393,"tag":517,"props":2597,"children":2598},{"class":519,"line":101},[2599],{"type":393,"tag":517,"props":2600,"children":2601},{"style":568},[2602],{"type":399,"value":2603},"        # Execute query\n",{"type":393,"tag":517,"props":2605,"children":2606},{"class":519,"line":110},[2607,2612,2616],{"type":393,"tag":517,"props":2608,"children":2609},{"style":529},[2610],{"type":399,"value":2611},"        df ",{"type":393,"tag":517,"props":2613,"children":2614},{"style":523},[2615],{"type":399,"value":584},{"type":393,"tag":517,"props":2617,"children":2618},{"style":529},[2619],{"type":399,"value":1732},{"type":393,"tag":517,"props":2621,"children":2622},{"class":519,"line":121},[2623],{"type":393,"tag":517,"props":2624,"children":2625},{"style":529},[2626],{"type":399,"value":2595},{"type":393,"tag":517,"props":2628,"children":2629},{"class":519,"line":130},[2630,2635,2639,2643,2648,2652,2657,2661,2666],{"type":393,"tag":517,"props":2631,"children":2632},{"style":648},[2633],{"type":399,"value":2634},"        print",{"type":393,"tag":517,"props":2636,"children":2637},{"style":529},[2638],{"type":399,"value":961},{"type":393,"tag":517,"props":2640,"children":2641},{"style":523},[2642],{"type":399,"value":986},{"type":393,"tag":517,"props":2644,"children":2645},{"style":592},[2646],{"type":399,"value":2647},"\"✅ Query successful: ",{"type":393,"tag":517,"props":2649,"children":2650},{"style":648},[2651],{"type":399,"value":996},{"type":393,"tag":517,"props":2653,"children":2654},{"style":529},[2655],{"type":399,"value":2656},"(df)",{"type":393,"tag":517,"props":2658,"children":2659},{"style":648},[2660],{"type":399,"value":1006},{"type":393,"tag":517,"props":2662,"children":2663},{"style":592},[2664],{"type":399,"value":2665}," rows returned\"",{"type":393,"tag":517,"props":2667,"children":2668},{"style":529},[2669],{"type":399,"value":600},{"type":393,"tag":517,"props":2671,"children":2672},{"class":519,"line":139},[2673,2678],{"type":393,"tag":517,"props":2674,"children":2675},{"style":523},[2676],{"type":399,"value":2677},"        return",{"type":393,"tag":517,"props":2679,"children":2680},{"style":529},[2681],{"type":399,"value":2682}," df\n",{"type":393,"tag":517,"props":2684,"children":2685},{"class":519,"line":148},[2686],{"type":393,"tag":517,"props":2687,"children":2688},{"style":529},[2689],{"type":399,"value":2595},{"type":393,"tag":517,"props":2691,"children":2692},{"class":519,"line":159},[2693,2698,2703,2707],{"type":393,"tag":517,"props":2694,"children":2695},{"style":523},[2696],{"type":399,"value":2697},"    except",{"type":393,"tag":517,"props":2699,"children":2700},{"style":529},[2701],{"type":399,"value":2702}," sqlite3.Error ",{"type":393,"tag":517,"props":2704,"children":2705},{"style":523},[2706],{"type":399,"value":537},{"type":393,"tag":517,"props":2708,"children":2709},{"style":529},[2710],{"type":399,"value":2711}," e:\n",{"type":393,"tag":517,"props":2713,"children":2714},{"class":519,"line":168},[2715,2719,2723,2727,2732,2736,2741,2745,2750],{"type":393,"tag":517,"props":2716,"children":2717},{"style":648},[2718],{"type":399,"value":2634},{"type":393,"tag":517,"props":2720,"children":2721},{"style":529},[2722],{"type":399,"value":961},{"type":393,"tag":517,"props":2724,"children":2725},{"style":523},[2726],{"type":399,"value":986},{"type":393,"tag":517,"props":2728,"children":2729},{"style":592},[2730],{"type":399,"value":2731},"\"❌ Database error: ",{"type":393,"tag":517,"props":2733,"children":2734},{"style":648},[2735],{"type":399,"value":1697},{"type":393,"tag":517,"props":2737,"children":2738},{"style":529},[2739],{"type":399,"value":2740},"e",{"type":393,"tag":517,"props":2742,"children":2743},{"style":648},[2744],{"type":399,"value":1006},{"type":393,"tag":517,"props":2746,"children":2747},{"style":592},[2748],{"type":399,"value":2749},"\"",{"type":393,"tag":517,"props":2751,"children":2752},{"style":529},[2753],{"type":399,"value":600},{"type":393,"tag":517,"props":2755,"children":2756},{"class":519,"line":177},[2757,2761],{"type":393,"tag":517,"props":2758,"children":2759},{"style":523},[2760],{"type":399,"value":2677},{"type":393,"tag":517,"props":2762,"children":2763},{"style":648},[2764],{"type":399,"value":2765}," None\n",{"type":393,"tag":517,"props":2767,"children":2768},{"class":519,"line":186},[2769,2773,2778,2783],{"type":393,"tag":517,"props":2770,"children":2771},{"style":523},[2772],{"type":399,"value":2697},{"type":393,"tag":517,"props":2774,"children":2775},{"style":648},[2776],{"type":399,"value":2777}," Exception",{"type":393,"tag":517,"props":2779,"children":2780},{"style":523},[2781],{"type":399,"value":2782}," as",{"type":393,"tag":517,"props":2784,"children":2785},{"style":529},[2786],{"type":399,"value":2711},{"type":393,"tag":517,"props":2788,"children":2789},{"class":519,"line":197},[2790,2794,2798,2802,2807,2811,2815,2819,2823],{"type":393,"tag":517,"props":2791,"children":2792},{"style":648},[2793],{"type":399,"value":2634},{"type":393,"tag":517,"props":2795,"children":2796},{"style":529},[2797],{"type":399,"value":961},{"type":393,"tag":517,"props":2799,"children":2800},{"style":523},[2801],{"type":399,"value":986},{"type":393,"tag":517,"props":2803,"children":2804},{"style":592},[2805],{"type":399,"value":2806},"\"❌ Error: ",{"type":393,"tag":517,"props":2808,"children":2809},{"style":648},[2810],{"type":399,"value":1697},{"type":393,"tag":517,"props":2812,"children":2813},{"style":529},[2814],{"type":399,"value":2740},{"type":393,"tag":517,"props":2816,"children":2817},{"style":648},[2818],{"type":399,"value":1006},{"type":393,"tag":517,"props":2820,"children":2821},{"style":592},[2822],{"type":399,"value":2749},{"type":393,"tag":517,"props":2824,"children":2825},{"style":529},[2826],{"type":399,"value":600},{"type":393,"tag":517,"props":2828,"children":2829},{"class":519,"line":206},[2830,2834],{"type":393,"tag":517,"props":2831,"children":2832},{"style":523},[2833],{"type":399,"value":2677},{"type":393,"tag":517,"props":2835,"children":2836},{"style":648},[2837],{"type":399,"value":2765},{"type":393,"tag":517,"props":2839,"children":2840},{"class":519,"line":215},[2841,2846],{"type":393,"tag":517,"props":2842,"children":2843},{"style":523},[2844],{"type":399,"value":2845},"    finally",{"type":393,"tag":517,"props":2847,"children":2848},{"style":529},[2849],{"type":399,"value":2562},{"type":393,"tag":517,"props":2851,"children":2852},{"class":519,"line":224},[2853],{"type":393,"tag":517,"props":2854,"children":2855},{"style":568},[2856],{"type":399,"value":2857},"        # Always close connection\n",{"type":393,"tag":517,"props":2859,"children":2860},{"class":519,"line":233},[2861,2866,2871,2876,2881],{"type":393,"tag":517,"props":2862,"children":2863},{"style":523},[2864],{"type":399,"value":2865},"        if",{"type":393,"tag":517,"props":2867,"children":2868},{"style":592},[2869],{"type":399,"value":2870}," 'conn'",{"type":393,"tag":517,"props":2872,"children":2873},{"style":523},[2874],{"type":399,"value":2875}," in",{"type":393,"tag":517,"props":2877,"children":2878},{"style":648},[2879],{"type":399,"value":2880}," locals",{"type":393,"tag":517,"props":2882,"children":2883},{"style":529},[2884],{"type":399,"value":2885},"():\n",{"type":393,"tag":517,"props":2887,"children":2888},{"class":519,"line":244},[2889],{"type":393,"tag":517,"props":2890,"children":2891},{"style":529},[2892],{"type":399,"value":2893},"            conn.close()\n",{"type":393,"tag":517,"props":2895,"children":2896},{"class":519,"line":253},[2897],{"type":393,"tag":517,"props":2898,"children":2899},{"emptyLinePlaceholder":12},[2900],{"type":399,"value":562},{"type":393,"tag":517,"props":2902,"children":2903},{"class":519,"line":262},[2904],{"type":393,"tag":517,"props":2905,"children":2906},{"style":568},[2907],{"type":399,"value":2908},"# Test safe query\n",{"type":393,"tag":517,"props":2910,"children":2911},{"class":519,"line":271},[2912,2916,2920,2925,2929,2933,2937],{"type":393,"tag":517,"props":2913,"children":2914},{"style":529},[2915],{"type":399,"value":1150},{"type":393,"tag":517,"props":2917,"children":2918},{"style":523},[2919],{"type":399,"value":584},{"type":393,"tag":517,"props":2921,"children":2922},{"style":529},[2923],{"type":399,"value":2924}," safe_db_query(",{"type":393,"tag":517,"props":2926,"children":2927},{"style":592},[2928],{"type":399,"value":595},{"type":393,"tag":517,"props":2930,"children":2931},{"style":529},[2932],{"type":399,"value":656},{"type":393,"tag":517,"props":2934,"children":2935},{"style":592},[2936],{"type":399,"value":1164},{"type":393,"tag":517,"props":2938,"children":2939},{"style":529},[2940],{"type":399,"value":600},{"type":393,"tag":517,"props":2942,"children":2943},{"class":519,"line":281},[2944,2949,2954,2959,2964,2969],{"type":393,"tag":517,"props":2945,"children":2946},{"style":523},[2947],{"type":399,"value":2948},"if",{"type":393,"tag":517,"props":2950,"children":2951},{"style":529},[2952],{"type":399,"value":2953}," df ",{"type":393,"tag":517,"props":2955,"children":2956},{"style":523},[2957],{"type":399,"value":2958},"is",{"type":393,"tag":517,"props":2960,"children":2961},{"style":523},[2962],{"type":399,"value":2963}," not",{"type":393,"tag":517,"props":2965,"children":2966},{"style":648},[2967],{"type":399,"value":2968}," None",{"type":393,"tag":517,"props":2970,"children":2971},{"style":529},[2972],{"type":399,"value":2562},{"type":393,"tag":517,"props":2974,"children":2975},{"class":519,"line":290},[2976,2980],{"type":393,"tag":517,"props":2977,"children":2978},{"style":648},[2979],{"type":399,"value":1679},{"type":393,"tag":517,"props":2981,"children":2982},{"style":529},[2983],{"type":399,"value":2984},"(df.head())\n",{"type":393,"tag":490,"props":2986,"children":2988},{"id":2987},"database-loading-best-practices",[2989],{"type":399,"value":2990},"📋 Database Loading Best Practices",{"type":393,"tag":2992,"props":2993,"children":2994},"table",{},[2995,3019],{"type":393,"tag":2996,"props":2997,"children":2998},"thead",{},[2999],{"type":393,"tag":3000,"props":3001,"children":3002},"tr",{},[3003,3009,3014],{"type":393,"tag":3004,"props":3005,"children":3006},"th",{},[3007],{"type":399,"value":3008},"Practice",{"type":393,"tag":3004,"props":3010,"children":3011},{},[3012],{"type":399,"value":3013},"Why",{"type":393,"tag":3004,"props":3015,"children":3016},{},[3017],{"type":399,"value":3018},"Example",{"type":393,"tag":3020,"props":3021,"children":3022},"tbody",{},[3023,3049,3074,3099,3126],{"type":393,"tag":3000,"props":3024,"children":3025},{},[3026,3035,3040],{"type":393,"tag":3027,"props":3028,"children":3029},"td",{},[3030],{"type":393,"tag":418,"props":3031,"children":3032},{},[3033],{"type":399,"value":3034},"Use LIMIT",{"type":393,"tag":3027,"props":3036,"children":3037},{},[3038],{"type":399,"value":3039},"Don't load huge datasets",{"type":393,"tag":3027,"props":3041,"children":3042},{},[3043],{"type":393,"tag":513,"props":3044,"children":3046},{"className":3045},[],[3047],{"type":399,"value":3048},"SELECT * FROM table LIMIT 1000",{"type":393,"tag":3000,"props":3050,"children":3051},{},[3052,3060,3065],{"type":393,"tag":3027,"props":3053,"children":3054},{},[3055],{"type":393,"tag":418,"props":3056,"children":3057},{},[3058],{"type":399,"value":3059},"Filter with WHERE",{"type":393,"tag":3027,"props":3061,"children":3062},{},[3063],{"type":399,"value":3064},"Only get needed data",{"type":393,"tag":3027,"props":3066,"children":3067},{},[3068],{"type":393,"tag":513,"props":3069,"children":3071},{"className":3070},[],[3072],{"type":399,"value":3073},"WHERE date > '2023-01-01'",{"type":393,"tag":3000,"props":3075,"children":3076},{},[3077,3085,3090],{"type":393,"tag":3027,"props":3078,"children":3079},{},[3080],{"type":393,"tag":418,"props":3081,"children":3082},{},[3083],{"type":399,"value":3084},"Close connections",{"type":393,"tag":3027,"props":3086,"children":3087},{},[3088],{"type":399,"value":3089},"Prevent database locks",{"type":393,"tag":3027,"props":3091,"children":3092},{},[3093],{"type":393,"tag":513,"props":3094,"children":3096},{"className":3095},[],[3097],{"type":399,"value":3098},"conn.close()",{"type":393,"tag":3000,"props":3100,"children":3101},{},[3102,3110,3115],{"type":393,"tag":3027,"props":3103,"children":3104},{},[3105],{"type":393,"tag":418,"props":3106,"children":3107},{},[3108],{"type":399,"value":3109},"Handle errors",{"type":393,"tag":3027,"props":3111,"children":3112},{},[3113],{"type":399,"value":3114},"Graceful failure",{"type":393,"tag":3027,"props":3116,"children":3117},{},[3118,3124],{"type":393,"tag":513,"props":3119,"children":3121},{"className":3120},[],[3122],{"type":399,"value":3123},"try/except",{"type":399,"value":3125}," blocks",{"type":393,"tag":3000,"props":3127,"children":3128},{},[3129,3137,3142],{"type":393,"tag":3027,"props":3130,"children":3131},{},[3132],{"type":393,"tag":418,"props":3133,"children":3134},{},[3135],{"type":399,"value":3136},"Test queries first",{"type":393,"tag":3027,"props":3138,"children":3139},{},[3140],{"type":399,"value":3141},"Avoid long waits",{"type":393,"tag":3027,"props":3143,"children":3144},{},[3145],{"type":399,"value":3146},"Run in database tool first",{"type":393,"tag":490,"props":3148,"children":3150},{"id":3149},"common-sql-queries-for-analysis",[3151],{"type":399,"value":3152},"🎯 Common SQL Queries for Analysis",{"type":393,"tag":502,"props":3154,"children":3155},{},[3156],{"type":393,"tag":506,"props":3157,"children":3159},{"className":508,"code":3158,"language":510,"meta":6,"style":6},"import pandas as pd\nimport sqlite3\n\n# Useful SQL patterns for data analysis\nconn = sqlite3.connect('sample.db')\n\nqueries = [\n    # Get recent data\n    \"SELECT * FROM employees ORDER BY employee_id DESC LIMIT 5\",\n    \n    # Count by category\n    \"SELECT department, COUNT(*) as count FROM employees GROUP BY department\",\n    \n    # Basic statistics\n    \"SELECT AVG(salary) as avg_salary, MAX(salary) as max_salary FROM employees\",\n    \n    # Filter and sort\n    \"SELECT name, salary FROM employees WHERE salary > 50000 ORDER BY salary\"\n]\n\nfor i, query in enumerate(queries, 1):\n    print(f\"Query {i}:\")\n    df = pd.read_sql(query, conn)\n    print(df)\n    print()\n\nconn.close()\n",[3160],{"type":393,"tag":513,"props":3161,"children":3162},{"__ignoreMap":6},[3163,3182,3193,3200,3208,3231,3238,3254,3262,3274,3282,3290,3302,3309,3317,3329,3336,3344,3352,3359,3366,3401,3442,3457,3468,3479,3486],{"type":393,"tag":517,"props":3164,"children":3165},{"class":519,"line":11},[3166,3170,3174,3178],{"type":393,"tag":517,"props":3167,"children":3168},{"style":523},[3169],{"type":399,"value":526},{"type":393,"tag":517,"props":3171,"children":3172},{"style":529},[3173],{"type":399,"value":532},{"type":393,"tag":517,"props":3175,"children":3176},{"style":523},[3177],{"type":399,"value":537},{"type":393,"tag":517,"props":3179,"children":3180},{"style":529},[3181],{"type":399,"value":542},{"type":393,"tag":517,"props":3183,"children":3184},{"class":519,"line":27},[3185,3189],{"type":393,"tag":517,"props":3186,"children":3187},{"style":523},[3188],{"type":399,"value":526},{"type":393,"tag":517,"props":3190,"children":3191},{"style":529},[3192],{"type":399,"value":554},{"type":393,"tag":517,"props":3194,"children":3195},{"class":519,"line":36},[3196],{"type":393,"tag":517,"props":3197,"children":3198},{"emptyLinePlaceholder":12},[3199],{"type":399,"value":562},{"type":393,"tag":517,"props":3201,"children":3202},{"class":519,"line":45},[3203],{"type":393,"tag":517,"props":3204,"children":3205},{"style":568},[3206],{"type":399,"value":3207},"# Useful SQL patterns for data analysis\n",{"type":393,"tag":517,"props":3209,"children":3210},{"class":519,"line":54},[3211,3215,3219,3223,3227],{"type":393,"tag":517,"props":3212,"children":3213},{"style":529},[3214],{"type":399,"value":579},{"type":393,"tag":517,"props":3216,"children":3217},{"style":523},[3218],{"type":399,"value":584},{"type":393,"tag":517,"props":3220,"children":3221},{"style":529},[3222],{"type":399,"value":589},{"type":393,"tag":517,"props":3224,"children":3225},{"style":592},[3226],{"type":399,"value":595},{"type":393,"tag":517,"props":3228,"children":3229},{"style":529},[3230],{"type":399,"value":600},{"type":393,"tag":517,"props":3232,"children":3233},{"class":519,"line":63},[3234],{"type":393,"tag":517,"props":3235,"children":3236},{"emptyLinePlaceholder":12},[3237],{"type":399,"value":562},{"type":393,"tag":517,"props":3239,"children":3240},{"class":519,"line":72},[3241,3245,3249],{"type":393,"tag":517,"props":3242,"children":3243},{"style":529},[3244],{"type":399,"value":1542},{"type":393,"tag":517,"props":3246,"children":3247},{"style":523},[3248],{"type":399,"value":584},{"type":393,"tag":517,"props":3250,"children":3251},{"style":529},[3252],{"type":399,"value":3253}," [\n",{"type":393,"tag":517,"props":3255,"children":3256},{"class":519,"line":83},[3257],{"type":393,"tag":517,"props":3258,"children":3259},{"style":568},[3260],{"type":399,"value":3261},"    # Get recent data\n",{"type":393,"tag":517,"props":3263,"children":3264},{"class":519,"line":92},[3265,3270],{"type":393,"tag":517,"props":3266,"children":3267},{"style":592},[3268],{"type":399,"value":3269},"    \"SELECT * FROM employees ORDER BY employee_id DESC LIMIT 5\"",{"type":393,"tag":517,"props":3271,"children":3272},{"style":529},[3273],{"type":399,"value":1574},{"type":393,"tag":517,"props":3275,"children":3276},{"class":519,"line":101},[3277],{"type":393,"tag":517,"props":3278,"children":3279},{"style":529},[3280],{"type":399,"value":3281},"    \n",{"type":393,"tag":517,"props":3283,"children":3284},{"class":519,"line":110},[3285],{"type":393,"tag":517,"props":3286,"children":3287},{"style":568},[3288],{"type":399,"value":3289},"    # Count by category\n",{"type":393,"tag":517,"props":3291,"children":3292},{"class":519,"line":121},[3293,3298],{"type":393,"tag":517,"props":3294,"children":3295},{"style":592},[3296],{"type":399,"value":3297},"    \"SELECT department, COUNT(*) as count FROM employees GROUP BY department\"",{"type":393,"tag":517,"props":3299,"children":3300},{"style":529},[3301],{"type":399,"value":1574},{"type":393,"tag":517,"props":3303,"children":3304},{"class":519,"line":130},[3305],{"type":393,"tag":517,"props":3306,"children":3307},{"style":529},[3308],{"type":399,"value":3281},{"type":393,"tag":517,"props":3310,"children":3311},{"class":519,"line":139},[3312],{"type":393,"tag":517,"props":3313,"children":3314},{"style":568},[3315],{"type":399,"value":3316},"    # Basic statistics\n",{"type":393,"tag":517,"props":3318,"children":3319},{"class":519,"line":148},[3320,3325],{"type":393,"tag":517,"props":3321,"children":3322},{"style":592},[3323],{"type":399,"value":3324},"    \"SELECT AVG(salary) as avg_salary, MAX(salary) as max_salary FROM employees\"",{"type":393,"tag":517,"props":3326,"children":3327},{"style":529},[3328],{"type":399,"value":1574},{"type":393,"tag":517,"props":3330,"children":3331},{"class":519,"line":159},[3332],{"type":393,"tag":517,"props":3333,"children":3334},{"style":529},[3335],{"type":399,"value":3281},{"type":393,"tag":517,"props":3337,"children":3338},{"class":519,"line":168},[3339],{"type":393,"tag":517,"props":3340,"children":3341},{"style":568},[3342],{"type":399,"value":3343},"    # Filter and sort\n",{"type":393,"tag":517,"props":3345,"children":3346},{"class":519,"line":177},[3347],{"type":393,"tag":517,"props":3348,"children":3349},{"style":592},[3350],{"type":399,"value":3351},"    \"SELECT name, salary FROM employees WHERE salary > 50000 ORDER BY salary\"\n",{"type":393,"tag":517,"props":3353,"children":3354},{"class":519,"line":186},[3355],{"type":393,"tag":517,"props":3356,"children":3357},{"style":529},[3358],{"type":399,"value":863},{"type":393,"tag":517,"props":3360,"children":3361},{"class":519,"line":197},[3362],{"type":393,"tag":517,"props":3363,"children":3364},{"emptyLinePlaceholder":12},[3365],{"type":399,"value":562},{"type":393,"tag":517,"props":3367,"children":3368},{"class":519,"line":206},[3369,3373,3378,3382,3387,3392,3396],{"type":393,"tag":517,"props":3370,"children":3371},{"style":523},[3372],{"type":399,"value":1656},{"type":393,"tag":517,"props":3374,"children":3375},{"style":529},[3376],{"type":399,"value":3377}," i, query ",{"type":393,"tag":517,"props":3379,"children":3380},{"style":523},[3381],{"type":399,"value":1666},{"type":393,"tag":517,"props":3383,"children":3384},{"style":648},[3385],{"type":399,"value":3386}," enumerate",{"type":393,"tag":517,"props":3388,"children":3389},{"style":529},[3390],{"type":399,"value":3391},"(queries, ",{"type":393,"tag":517,"props":3393,"children":3394},{"style":648},[3395],{"type":399,"value":651},{"type":393,"tag":517,"props":3397,"children":3398},{"style":529},[3399],{"type":399,"value":3400},"):\n",{"type":393,"tag":517,"props":3402,"children":3403},{"class":519,"line":215},[3404,3408,3412,3416,3421,3425,3430,3434,3438],{"type":393,"tag":517,"props":3405,"children":3406},{"style":648},[3407],{"type":399,"value":1679},{"type":393,"tag":517,"props":3409,"children":3410},{"style":529},[3411],{"type":399,"value":961},{"type":393,"tag":517,"props":3413,"children":3414},{"style":523},[3415],{"type":399,"value":986},{"type":393,"tag":517,"props":3417,"children":3418},{"style":592},[3419],{"type":399,"value":3420},"\"Query ",{"type":393,"tag":517,"props":3422,"children":3423},{"style":648},[3424],{"type":399,"value":1697},{"type":393,"tag":517,"props":3426,"children":3427},{"style":529},[3428],{"type":399,"value":3429},"i",{"type":393,"tag":517,"props":3431,"children":3432},{"style":648},[3433],{"type":399,"value":1006},{"type":393,"tag":517,"props":3435,"children":3436},{"style":592},[3437],{"type":399,"value":1711},{"type":393,"tag":517,"props":3439,"children":3440},{"style":529},[3441],{"type":399,"value":600},{"type":393,"tag":517,"props":3443,"children":3444},{"class":519,"line":224},[3445,3449,3453],{"type":393,"tag":517,"props":3446,"children":3447},{"style":529},[3448],{"type":399,"value":1723},{"type":393,"tag":517,"props":3450,"children":3451},{"style":523},[3452],{"type":399,"value":584},{"type":393,"tag":517,"props":3454,"children":3455},{"style":529},[3456],{"type":399,"value":1732},{"type":393,"tag":517,"props":3458,"children":3459},{"class":519,"line":233},[3460,3464],{"type":393,"tag":517,"props":3461,"children":3462},{"style":648},[3463],{"type":399,"value":1679},{"type":393,"tag":517,"props":3465,"children":3466},{"style":529},[3467],{"type":399,"value":1201},{"type":393,"tag":517,"props":3469,"children":3470},{"class":519,"line":244},[3471,3475],{"type":393,"tag":517,"props":3472,"children":3473},{"style":648},[3474],{"type":399,"value":1679},{"type":393,"tag":517,"props":3476,"children":3477},{"style":529},[3478],{"type":399,"value":1213},{"type":393,"tag":517,"props":3480,"children":3481},{"class":519,"line":253},[3482],{"type":393,"tag":517,"props":3483,"children":3484},{"emptyLinePlaceholder":12},[3485],{"type":399,"value":562},{"type":393,"tag":517,"props":3487,"children":3488},{"class":519,"line":262},[3489],{"type":393,"tag":517,"props":3490,"children":3491},{"style":529},[3492],{"type":399,"value":1038},{"type":393,"tag":490,"props":3494,"children":3496},{"id":3495},"key-takeaways",[3497],{"type":399,"value":3498},"🎯 Key Takeaways",{"type":393,"tag":408,"props":3500,"children":3504},{"emoji":3501,"title":3502,"type":3503},"📚","Database Loading Essentials","success",[3505,3513,3584,3592,3614,3622,3650,3658,3694],{"type":393,"tag":402,"props":3506,"children":3507},{},[3508],{"type":393,"tag":418,"props":3509,"children":3510},{},[3511],{"type":399,"value":3512},"Basic Pattern:",{"type":393,"tag":506,"props":3514,"children":3516},{"className":508,"code":3515,"language":510,"meta":6,"style":6},"import sqlite3\nconn = sqlite3.connect('database.db')\ndf = pd.read_sql('SELECT * FROM table', conn)\nconn.close()\n",[3517],{"type":393,"tag":513,"props":3518,"children":3519},{"__ignoreMap":6},[3520,3531,3554,3577],{"type":393,"tag":517,"props":3521,"children":3522},{"class":519,"line":11},[3523,3527],{"type":393,"tag":517,"props":3524,"children":3525},{"style":523},[3526],{"type":399,"value":526},{"type":393,"tag":517,"props":3528,"children":3529},{"style":529},[3530],{"type":399,"value":554},{"type":393,"tag":517,"props":3532,"children":3533},{"class":519,"line":27},[3534,3538,3542,3546,3550],{"type":393,"tag":517,"props":3535,"children":3536},{"style":529},[3537],{"type":399,"value":579},{"type":393,"tag":517,"props":3539,"children":3540},{"style":523},[3541],{"type":399,"value":584},{"type":393,"tag":517,"props":3543,"children":3544},{"style":529},[3545],{"type":399,"value":589},{"type":393,"tag":517,"props":3547,"children":3548},{"style":592},[3549],{"type":399,"value":1942},{"type":393,"tag":517,"props":3551,"children":3552},{"style":529},[3553],{"type":399,"value":600},{"type":393,"tag":517,"props":3555,"children":3556},{"class":519,"line":36},[3557,3561,3565,3569,3573],{"type":393,"tag":517,"props":3558,"children":3559},{"style":529},[3560],{"type":399,"value":1150},{"type":393,"tag":517,"props":3562,"children":3563},{"style":523},[3564],{"type":399,"value":584},{"type":393,"tag":517,"props":3566,"children":3567},{"style":529},[3568],{"type":399,"value":1159},{"type":393,"tag":517,"props":3570,"children":3571},{"style":592},[3572],{"type":399,"value":2166},{"type":393,"tag":517,"props":3574,"children":3575},{"style":529},[3576],{"type":399,"value":1169},{"type":393,"tag":517,"props":3578,"children":3579},{"class":519,"line":45},[3580],{"type":393,"tag":517,"props":3581,"children":3582},{"style":529},[3583],{"type":399,"value":1038},{"type":393,"tag":402,"props":3585,"children":3586},{},[3587],{"type":393,"tag":418,"props":3588,"children":3589},{},[3590],{"type":399,"value":3591},"Key Benefits:",{"type":393,"tag":424,"props":3593,"children":3594},{},[3595,3599,3604,3609],{"type":393,"tag":428,"props":3596,"children":3597},{},[3598],{"type":399,"value":463},{"type":393,"tag":428,"props":3600,"children":3601},{},[3602],{"type":399,"value":3603},"Use SQL to filter before loading",{"type":393,"tag":428,"props":3605,"children":3606},{},[3607],{"type":399,"value":3608},"Handle massive datasets efficiently",{"type":393,"tag":428,"props":3610,"children":3611},{},[3612],{"type":399,"value":3613},"Real-time data access",{"type":393,"tag":402,"props":3615,"children":3616},{},[3617],{"type":393,"tag":418,"props":3618,"children":3619},{},[3620],{"type":399,"value":3621},"Best Practices:",{"type":393,"tag":424,"props":3623,"children":3624},{},[3625,3635,3640,3645],{"type":393,"tag":428,"props":3626,"children":3627},{},[3628,3630],{"type":399,"value":3629},"Always close connections: ",{"type":393,"tag":513,"props":3631,"children":3633},{"className":3632},[],[3634],{"type":399,"value":3098},{"type":393,"tag":428,"props":3636,"children":3637},{},[3638],{"type":399,"value":3639},"Use try/except for error handling",{"type":393,"tag":428,"props":3641,"children":3642},{},[3643],{"type":399,"value":3644},"Start with LIMIT to test queries",{"type":393,"tag":428,"props":3646,"children":3647},{},[3648],{"type":399,"value":3649},"Filter data with WHERE clauses",{"type":393,"tag":402,"props":3651,"children":3652},{},[3653],{"type":393,"tag":418,"props":3654,"children":3655},{},[3656],{"type":399,"value":3657},"Common Patterns:",{"type":393,"tag":424,"props":3659,"children":3660},{},[3661,3672,3683],{"type":393,"tag":428,"props":3662,"children":3663},{},[3664,3670],{"type":393,"tag":513,"props":3665,"children":3667},{"className":3666},[],[3668],{"type":399,"value":3669},"SELECT * FROM table LIMIT 100",{"type":399,"value":3671}," - Test query",{"type":393,"tag":428,"props":3673,"children":3674},{},[3675,3681],{"type":393,"tag":513,"props":3676,"children":3678},{"className":3677},[],[3679],{"type":399,"value":3680},"SELECT col1, col2 FROM table WHERE condition",{"type":399,"value":3682}," - Filtered data",{"type":393,"tag":428,"props":3684,"children":3685},{},[3686,3692],{"type":393,"tag":513,"props":3687,"children":3689},{"className":3688},[],[3690],{"type":399,"value":3691},"SELECT COUNT(*) FROM table GROUP BY category",{"type":399,"value":3693}," - Summaries",{"type":393,"tag":402,"props":3695,"children":3696},{},[3697,3702],{"type":393,"tag":418,"props":3698,"children":3699},{},[3700],{"type":399,"value":3701},"Remember:",{"type":399,"value":3703}," Query smart, not hard - let the database do the filtering!",{"type":393,"tag":490,"props":3705,"children":3707},{"id":3706},"whats-next",[3708],{"type":399,"value":3709},"🚀 What's Next?",{"type":393,"tag":402,"props":3711,"children":3712},{},[3713],{"type":399,"value":3714},"Great! You can now load data from databases. Next, let's learn how to handle common errors that occur when loading files and databases.",{"type":393,"tag":402,"props":3716,"children":3717},{},[3718,3723,3724],{"type":393,"tag":418,"props":3719,"children":3720},{},[3721],{"type":399,"value":3722},"Continue to",{"type":399,"value":1564},{"type":393,"tag":3725,"props":3726,"children":3727},"a",{"href":97},[3728],{"type":399,"value":98},{"type":393,"tag":402,"props":3730,"children":3731},{},[3732],{"type":399,"value":3733},"You're mastering data loading! 🗄️💪",{"type":393,"tag":3735,"props":3736,"children":3737},"style",{},[3738],{"type":399,"value":3739},"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":3741},[3742,3743,3744,3745,3749,3750,3751,3752,3753],{"id":492,"depth":27,"text":495},{"id":1041,"depth":27,"text":1044},{"id":1433,"depth":27,"text":1436},{"id":1771,"depth":27,"text":1774,"children":3746},[3747,3748],{"id":1783,"depth":36,"text":1786},{"id":2007,"depth":36,"text":2010},{"id":2467,"depth":27,"text":2470},{"id":2987,"depth":27,"text":2990},{"id":3149,"depth":27,"text":3152},{"id":3495,"depth":27,"text":3498},{"id":3706,"depth":27,"text":3709},1782373729079]