This book is about the recipes on PYODBC and SQLAlchemy to work with Microsoft SQL Server databases and its data in table. Here are various recipes covering almost all the activities that are required by a Data Engineer, Scientist, Analyst or Python Developer. The book is divided into two sections, PYODBC recipesSQLAlchemy recipiesThe topic starts with the heading or title and gives some context about the topic and the lists the complete code block of that topic.After that there may be one or more approaches or ways that we have implemented in that topic. The book covers the over the following topics and recipes, Introduction to Python, SQL, VS Code, Python extensions, pyodbc, sqlalchemy, odbc driverGuidance on installing python, VS code, pyodbc, sqlalchemy Setting up database, tables, and creating stored procedures used in this book. Then code recipes are divided into 2 parts, pyodbc recipessqlalchemy recipesBoth are covering the following topics, Multiple ways to prepare connection string and connecting SQL ServerPYODBC connection, cursor, commit, execute, objects & methodsCRUD Operations (insert, update, delete, and select/read data) with various approachesHandling parameters of parameterized SQL queries & USPsHandling SQL 'IN' operator parametersHandling multiple resultsets of USPHow to handle multiple parametersDifferent approaches to create and pass parametersCursor functions fetchall(), fetchone(), fetchval(), fetchmany(), rowcount etc.Accessing rows & columns of a result setWorking with row by row or batch of rowspandas methods read_sql(), read_sql_query(), read_table()Calling stored procedures with & without parametersWorking with multiple databases, and looping through list of databasesUsing 'with' statementSQLALCHEMY core data apiSQLALCHEMY engine url, engine, connection, execute, cursor etc.SQLALCHEMY exec_driver_sql(), raw_connection(), etc.Working with pandas dataframe to insert & update multiple records And many more important topics in pyodbc, and sqlalchemy
- | Author: Om Prakash Shakya
- | Publisher: Independently Published
- | Publication Date: May 03, 2024
- | Number of Pages: 100 pages
- | Binding: Paperback or Softback
- | ISBN-13: 9798324701413