Ravindra BagaleCourses & study guides मराठी Track your progress

4. Connecting to Databases: SQL Server, MySQL, DirectQuery and Live Connection

Friends, in a company most data lives in a database – SQL Server or MySQL. In this module we learn how to connect to a database, how to write native SQL, what query folding (handing the work to the source database) is, and the clear difference between Import, DirectQuery (data stays in the source and every click sends a live query) and Live connection. Interviewers ask this a lot, so read carefully.

What you will learn in this module

  • Database words every analyst must know: server, database, schema, table, view
  • Connecting to Microsoft SQL Server step by step: authentication, Navigator, native SQL queries
  • Query folding with databases and View Native Query
  • Connecting to MySQL, including the driver install and common errors
  • Import vs DirectQuery vs Live connection, explained clearly
  • The on-premises data gateway, data source settings and privacy levels

Live story: Orders live in SQL Server

Suppose we are on an Infosys client project for a grocery chain. Orders are not in Excel any more. They sit in a SQL Server database with 50 lakh rows. The client asks: "Import or DirectQuery? Which is faster and which is safer?" This chapter connects to SQL Server and MySQL and explains Import, DirectQuery and Live connection in simple words.

All numbers in this story are fictional practice data.

In real companies, quick-commerce orders are stored in databases, not Excel files. The store app writes each order into tables, and analysts connect Power BI to those tables. This module uses a fictional practice database called QuickCommerceDB, with the same tables as our sample data (Module 1.7).

Concepts in this chapter

  1. 4.1Database Terms in Simple Words
  2. 4.2Connecting to Microsoft SQL Server
  3. 4.3Advanced Options and Native SQL Queries
  4. 4.4Query Folding with Databases and View Native Query
  5. 4.5Connecting to MySQL
  6. 4.6DirectQuery in Practice
  7. 4.7Import vs DirectQuery vs Live Connection – Clearly Explained
  8. 4.8The On-premises Data Gateway
  9. 4.9Data Source Settings, Changing Sources and Privacy Levels
  10. 4.10Connecting to PostgreSQL
  11. 4.11Azure Sources
  12. 4.12SQL for Power BI: Views, Joins, CTEs and Where to Transform

The chapter recap is at the end of the last concept page.

Ravi Sir's Cards: 17 revision, interview and comparison cards for this chapter · मराठी cards