---
title: "A step-by-step guide to connect your spreadsheets to a database in the cloud"
description: "A spreadsheet works well until several people need the same data, and then you end up with five copies of it and no idea which one is right."
url: https://sevalla.com/blog/cloud-spreadsheet-integration/
---

[Blog](https://sevalla.com/blog/)

# A step-by-step guide to connect your spreadsheets to a database in the cloud

A spreadsheet works well until several people need the same data, and then you end up with five copies of it and no idea which one is right.

Updated: Jun 1, 2026·by Jeremy Holcombe

Spreadsheets are a great way to start organizing data, especially small datasets with few relationships. A spreadsheet works well until several people need the same data, and then you end up with five copies of it and no idea which one is right.

As your data grows, a [cloud-hosted database](https://sevalla.com/database-hosting/) gives you one source of truth that applications, reports, and teammates can all use, with types and constraints that keep the data consistent. You don't have to give up spreadsheets, though. You can import your sheet into a database once, or connect the two so your team keeps working in the tools they know.

This article shows how to move spreadsheet data into MariaDB and PostgreSQL databases on Sevalla, and how to connect Google Sheets and [Microsoft Excel](https://kinsta.com/blog/data-visualization-tools/#1-microsoft-excel) to them. The SQL in this article was tested on MariaDB 12.3 and PostgreSQL 19 with the sample data below.

## Prerequisites

To follow along, you need:

- A spreadsheet to import. You can make a copy of our [sample sheet](https://docs.google.com/spreadsheets/d/1pS7snv3kDkoiXeZE3sejTASfeXctdNtgWxa6zQuYcPU/edit?usp=sharing), which has 768 rows of medical data in seven numeric columns.
- A Sevalla account to create the databases.
- For Google Sheets, the [Coefficient](https://coefficient.io/) add-on.
- For Excel, the [Devart Excel Add-in for MySQL](https://www.devart.com/excel-addins/mysql/), which also works with MariaDB, and the [Devart Excel Add-in for PostgreSQL](https://www.devart.com/excel-addins/postgresql/). Both are paid add-ins for Excel on Windows, with a 30-day free trial.

## Why connect spreadsheets to a database?

A managed database service hosts, runs, backs up, and updates the database server for you, so you can work with your data without buying or maintaining hardware. Popular relational databases include:

- **[PostgreSQL](https://kinsta.com/blog/what-is-postgresql/)**: An open-source relational database known for its reliability, standards compliance, and extensions. It's a common choice for new applications and analytics.
- **[MySQL](https://kinsta.com/blog/what-is-mysql/)**: The most widely used open-source relational database, especially for web applications.
- **[MariaDB](https://kinsta.com/blog/mariadb-vs-postgresql/)**: An open-source fork of MySQL, created by MySQL's original developers. It works with most MySQL tools and clients, which is why the MySQL connectors in this article also work with MariaDB.

Compared to a shared spreadsheet, a database gives you:

- **One source of truth** that every app, report, and person reads from.
- **Data types and constraints** that reject bad data, such as text in a number column or a missing required value.
- **Access control**, so people and apps get only the permissions they need.
- **Backups** and the ability to restore data after a mistake.
- **Scale**: databases handle millions of rows and many users at once, long after a spreadsheet slows down.

## Prepare your spreadsheet data

Spreadsheets are forgiving, and databases aren't. Before you import, clean up your data so it fits into a table:

- **Use one header row with clear column names.** Each column becomes a database column. Avoid spaces and special characters in names, and use one style, such as `BloodPressure` or `blood_pressure`.
- **Keep one type of data per column.** A column of numbers shouldn't contain text like "N/A" or "unknown", or the import fails or the value is lost.
- **Decide how to handle empty cells.** An empty cell usually becomes `NULL`, or an empty string, in the database, which fails if the column is `NOT NULL`. Fill in missing values, or allow `NULL` in that column. Keep real zeros as `0`, because `0` and "no value" mean different things.
- **Remove duplicates, merged cells, totals, and notes.** Only the data rows and the header row should be in the range you import.
- **Check numbers and dates.** Remove currency symbols and thousands separators from numbers, and use one date format, such as `2026-11-30`.

The sample sheet is already clean: it has one header row, seven numeric columns, and no empty cells.

## Create your databases on Sevalla

1. In the [Sevalla dashboard](https://app.sevalla.com/), click **Databases** in the sidebar, then create a MariaDB database. Repeat this step for PostgreSQL if you want to follow both parts of this guide. See [Create a database](https://docs.sevalla.com/databases/create) for every option.
2. To connect tools outside Sevalla, such as Coefficient and Excel, open the database's **Networking** tab, and under **External connection**, click **Enable**.
3. On the database's **Overview** tab, switch the **Connection** card to **External** to see the **Host**, **Port**, **Database**, **User**, and **Password**. You'll enter these details in each tool.

Anyone with these details can connect to your database, so keep them private. You can also limit which IP addresses can connect with [IP restrictions](https://docs.sevalla.com/databases/connect#restrict-access-by-ip-address). If you do, allow the addresses of the tools you connect, including Coefficient's servers, which connect on behalf of Google Sheets.

## The quickest way: import a CSV file

If you only need to move your data into a database once, you don't need any add-ins. Export your sheet as a CSV file, then import it with the SQL studio, the database client built into the Sevalla dashboard:

1. In Google Sheets, click **File** \> **Download** \> **Comma Separated Values (.csv)**. In Excel, click **File** \> **Save As** and choose **CSV UTF-8**.
2. Open your database in Sevalla, then open the **SQL studio** tab.
3. Click the plus icon at the top of the sidebar, then click **Import CSV**, and choose your file.
4. Choose **Create table** to create a new table from the file, or **Seed data** to insert the rows into an existing table with matching columns.
5. Check the separator, that **First row contains column names** is selected, and the column types in the preview. Then review the statements and run them.

The SQL studio can also export any table or query result to CSV or `.xlsx`, so you can move data back to a spreadsheet the same way. See the [database studio docs](https://docs.sevalla.com/databases/studio) for details.

To keep a sheet and a database connected, so you can send new rows to the database or edit database rows from a spreadsheet, use a connector, as shown in the rest of this article.

## How to connect spreadsheets to MariaDB

### Create the table in MariaDB

Coefficient and the Devart add-in write to an existing table, so create the table first. Open the **SQL studio** tab of your MariaDB database, click **SQL console**, and run the following statement. You can also run it in any MySQL-compatible client, such as [MySQL Workbench](https://www.mysql.com/products/workbench/).

```
CREATE TABLE diabetes_table (
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  Pregnancies SMALLINT NOT NULL,
  Glucose SMALLINT NOT NULL,
  BloodPressure SMALLINT NOT NULL,
  BMI DECIMAL(3,1) NOT NULL,
  DiabetesPedigreeFunction DECIMAL(4,3) NOT NULL,
  Age SMALLINT NOT NULL,
  Outcome TINYINT NOT NULL
);
```

The column names match the sheet's headers, and the types fit its values: whole numbers in `SMALLINT` columns, BMI values like `33.6` in `DECIMAL(3,1)`, and pedigree values like `0.627` in `DECIMAL(4,3)`. The `id` column numbers each row automatically, and as the primary key, it's already indexed and unique.

### Connect Google Sheets to MariaDB

1. Open your copy of the sample sheet in Google Sheets. It has seven columns, from **Pregnancies** to **Outcome**.  
![Google Sheets showing the diabetes data.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/diabetes-csv-file.webp)  
Google Sheets showing the diabetes data.
2. Click **Extensions** in the menu bar.  
![The Google Sheets menu bar.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/extensions-google-sheets.webp)  
The Google Sheets menu bar.
3. Go to **Coefficient: Salesforce, HubSpot Data Connector**, and then click **Launch**.  
![The Extensions menu.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/coefficient-salesforce.webp)  
The Extensions menu.  
This opens the Coefficient sidebar on the right side of your sheet, which lets you import data from the database and export data to it.
4. In Coefficient, click **Export to**, then click **MySQL**. Coefficient's MySQL connector works with MariaDB, because MariaDB uses the same protocol.
5. Enter the external connection details of your MariaDB database and click **Connect**.  
![Coefficient showing the details needed to connect to MariaDB.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/connect-db.webp)  
Coefficient showing the details needed to connect to MariaDB.
6. In the **Source Data** section, select **diabetes** from the **Tab** list and **Row 1** from the **Header row** list.  
![The Source Data section showing the Tab and Header row fields.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/source-data.webp)  
The Source Data section showing the Tab and Header row fields.
7. In the **Destination** section, select your database's **diabetes\_table** from the **Table** list, and select **Insert** from the **Action** list.  
![The Destination section showing the Table and Action lists.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/destination-data.webp)  
The Destination section showing the Table and Action lists.  
In the **Schemas** panel, you see the spreadsheet columns.  
![The Schemas panel showing the spreadsheet columns.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/shema-panel.webp)  
The Schemas panel showing the spreadsheet columns.
8. Map each spreadsheet column to the matching column of the MariaDB table and click **Save**. Leave `id` unmapped, so the database numbers the rows.  
![The Field Mappings panel with columns mapped to MariaDB table columns.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/field-mapping.webp)  
The Field Mappings panel with columns mapped to MariaDB table columns.
9. Select **Specific rows on sheet** and click **Next**.
10. Test the mapping by selecting a single row, such as row **12**, and click **Done selecting rows**.  
![Google Sheets with row 12 selected.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/selction-row.webp)  
Google Sheets with row 12 selected.
11. Confirm your selection by clicking **Insert 1 row in MySQL**. The spreadsheet now has a **Record ID** column, a **Result** column showing **OK**, and a **Timestamp** column showing the time of the export.  
![The selected row is exported successfully, with the result columns filled in.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/exported-row.webp)  
The selected row is exported successfully, with the result columns filled in.
12. Click **Done**.
13. Select more rows to export, click **Insert X rows in MySQL**, and then click **Done**.

On Coefficient's free plan, each export can send up to 100 rows, and exports run manually. To export the whole sheet at once, or to schedule exports, you need a paid plan. Otherwise, use the CSV import shown earlier for the first load.

To check the data, run this query in the SQL studio or another client:

```
SELECT * FROM diabetes_table;
```

Here's the result in MySQL Workbench:

![MySQL Workbench showing the imported data in the MariaDB table.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/mariadb-data.webp)

MySQL Workbench showing the imported data in the MariaDB table.

If you name the database in the query, as in `database_name.diabetes_table`, and the name contains a hyphen, such as `Sheets-db`, wrap it in backticks: `` SELECT * FROM `Sheets-db`.diabetes_table; ``. Without them, MariaDB reads the hyphen as a minus sign and returns a syntax error.

### Connect Excel to MariaDB

The Devart Excel Add-in for MySQL connects Excel to MariaDB, imports data into a worksheet, and writes your edits back to the database. Install it before you start.

1. Open a blank Excel workbook.
2. Click the **Devart** tab, which appears after you install the add-in.  
![Excel showing the Devart tab.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/devart-tab.webp)  
Excel showing the Devart tab.
3. Click **Get Data** to open the **Import Data Wizard**.  
![The Devart tab with the Get Data button on the left.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/get-data-devart.webp)  
The Devart tab with the Get Data button on the left.
4. Select **MySQL database** as the **Data Source** and enter your MariaDB external connection details.  
![The connection editor showing the fields needed to connect to MariaDB.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/import-data-wizard.webp)  
The connection editor showing the fields needed to connect to MariaDB.
5. Click **Test Connection**. A "Successfully connected" message appears.
6. Click **OK**, then click **Next**.
7. Use the **Visual Query Builder** or a custom SQL query to import the data from the diabetes table into the worksheet.  
![The Import Data Wizard showing a custom SQL query.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/custom-sql-query.webp)  
The Import Data Wizard showing a custom SQL query.
8. Click **Finish**. Your worksheet now has the data from the database.  
![Excel showing data from the cloud-hosted database.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/cloud-data-excel.webp)  
Excel showing data from the cloud-hosted database.
9. To edit the data and save your changes to the database, click **Edit Mode**. If you didn't save the password when you set up the connection, the add-in asks for it.  
![The Edit Mode button in the Edit Session group on the Devart tab.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/edit-mode-devart.webp)  
The Edit Mode button in the Edit Session group on the Devart tab.
10. Add two new records at the end of the table.  
![The Excel sheet with two new records highlighted in yellow.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/highlighted-records.webp)  
The Excel sheet with two new records highlighted in yellow.
11. Click **Commit**, then click **OK** to write the changes to the MariaDB database. To discard them instead, click **Rollback**.
12. Query the table again. It now has the two new records.  
![MySQL Workbench showing the two new records in MariaDB.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/new-records-mariadb.webp)  
MySQL Workbench showing the two new records in MariaDB.

If you only need to read data into Excel, not write it back, Excel for Windows can also import from MySQL and PostgreSQL databases with **Data** \> **Get Data** \> **From Database**, without an add-in.

## How to connect spreadsheets to PostgreSQL

The steps for PostgreSQL are similar. Use your PostgreSQL database's external connection details, and create the table first.

### Create the table in PostgreSQL

Open the **SQL studio** tab of your PostgreSQL database, click **SQL console**, and run:

```
CREATE TABLE diabetes_table (
  id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  "Pregnancies" SMALLINT NOT NULL,
  "Glucose" SMALLINT NOT NULL,
  "BloodPressure" SMALLINT NOT NULL,
  "BMI" NUMERIC(3,1) NOT NULL,
  "DiabetesPedigreeFunction" NUMERIC(4,3) NOT NULL,
  "Age" SMALLINT NOT NULL,
  "Outcome" SMALLINT NOT NULL
);
```

`GENERATED ALWAYS AS IDENTITY` numbers the rows automatically, so you don't need to create a sequence yourself. The column names are in double quotes to keep their capital letters, so they match the sheet's headers.

PostgreSQL converts unquoted names to lowercase, so you also need double quotes when you query these columns. `SELECT "Glucose" FROM diabetes_table;` works, but `SELECT Glucose FROM diabetes_table;` fails with `column "glucose" does not exist`. If you'd rather not quote names, use lowercase names, such as `blood_pressure`, in the table, and map the sheet's columns to them in Coefficient.

You can also use a desktop client such as [pgAdmin](https://www.pgadmin.org/download/). To connect it, right-click **Servers**, choose **Register** \> **Server**, and on the **Connection** tab, enter your database's external host, port, database name (as the **Maintenance database**), username, and password.

![The pgAdmin Register - Server dialog with the connection fields.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/server-dialog-box.webp)

The pgAdmin Register - Server dialog with the connection fields.

### Connect Google Sheets to PostgreSQL

1. Open your sheet, click **Extensions**, go to **Coefficient: Salesforce, HubSpot Data Connector**, and then click **Launch**.
2. Click **Export to**, then click **Connect** beside **PostgreSQL**.
3. Enter your PostgreSQL external connection details and click **Connect**.
4. Select **diabetes** from the **Tab** list and **Row 1** from the **Header row** list.  
![The Source Data section showing the Tab and Header row lists.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/source-data.webp)  
The Source Data section showing the Tab and Header row lists.
5. Select **public.diabetes\_table** from the **Table** list in the **Destination** section, and select **Insert** from the **Action** list.  
![The Destination section showing the public.diabetes_table table and the Insert action.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/source-data-info.webp)  
The Destination section showing the public.diabetes\_table table and the Insert action.
6. Map the sheet's columns to the columns of your PostgreSQL table, leaving `id` unmapped.
7. Select a single row and click **Done selecting rows**.
8. Confirm your selection by clicking **Insert 1 row in PostgreSQL**. As with MariaDB, the sheet gets **Record ID**, **Result**, and **Timestamp** columns.
9. Test your integration by exporting more rows.
10. Run a query to view the imported data:  
```  
SELECT * FROM diabetes_table;  
```

### Connect Excel to PostgreSQL

1. Open a blank Excel workbook and click the **Devart** tab.
2. Click **Get Data** to open the **Import Data Wizard**.
3. Select **PostgreSQL database** as the **Data Source**, and enter your PostgreSQL external connection details.
4. Click **Test Connection** to check the connection.
5. Select **diabetes\_table** as the object and choose its columns with the **Visual Query Builder**, or write a custom SQL query.
6. Click **Finish**. Your worksheet now has the data. To get the latest data from the database at any time, click **Refresh**, then click **Yes** to confirm.  
![The Refresh button in the Import group on the Devart tab.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/refresh-devart-tab.webp)  
The Refresh button in the Import group on the Devart tab.
7. Click **Edit Mode** to edit the sheet and the database.
8. Add a new record to the worksheet and click **Commit** to save it to the database.  
![The Edit Mode and Commit buttons in the Edit Session group on the Devart tab.](https://sevalla.com/images/blog/cloud-spreadsheet-integration/edit-info-devart.webp)  
The Edit Mode and Commit buttons in the Edit Session group on the Devart tab.
9. Query the table to see the new record in the database.

## Summary

Spreadsheets are a good place to start, but a database gives growing data one source of truth, with types, constraints, and backups. In this article, you prepared spreadsheet data for a database, imported a CSV file with Sevalla's SQL studio, and connected Google Sheets and Excel to MariaDB and PostgreSQL with Coefficient and the Devart add-ins, so you can send rows to the database and edit database rows from a spreadsheet.

With Sevalla's [Database Hosting](https://sevalla.com/database-hosting/), you can create managed PostgreSQL, MySQL, and MariaDB databases in minutes, connect your spreadsheet tools over the external connection, and browse, import, and export your data in the SQL studio without installing anything.

Share on:[Tweet](https://x.com/intent/post?text=I've just read this article "A step-by-step guide to connect your spreadsheets to a database in the cloud" on @sevalla%5Fhosting 's blog: https://sevalla.com/blog/cloud-spreadsheet-integration/ "x.com")[Reddit](https://www.reddit.com/submit?url=https://sevalla.com/blog/cloud-spreadsheet-integration&title=A step-by-step guide to connect your spreadsheets to a database in the cloud "Reddit")[HackerNews](https://news.ycombinator.com/submitlink?u=https://sevalla.com/blog/cloud-spreadsheet-integration&t=A step-by-step guide to connect your spreadsheets to a database in the cloud "HackerNews")

## Deep dive into the cloud!

Deploy your application, database, or static site in minutes.

[Get started](https://sevalla.com/signup/)
