> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hydra.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Serverless Analytics on Postgres.

<Steps>
  <Step title="Deploy the server" icon="rocket" iconType="solid" />

  <Step title="Create a table" icon="table" iconType="solid" />

  <Step title="Insert sample data" icon="right-to-bracket" iconType="solid" />

  <Step title="Run example queries" icon="laptop" />
</Steps>

## 1.  Deploy the server

<Tip>
  Select the Scale plan for a 14-day free trial with a \$300 usage credit. A valid credit card is required to verify the account.
</Tip>

To deploy a cloud database, navigate to [https://platform.hydra.so/projects](https://platform.hydra.so/projects).

For a detailed walkthrough, check out the [Deploying Hydra Cloud](/guides/deploy_cloud) guide.

## 2. Create a table

We will connect to Hydra using psql, the terminal-based front-end to Postgres, but you can use any Postgres client you’d prefer and achieve the same result. We will start by creating our analytics schema with a table “analytics.rides” which we will populate with sample data from the New York Taxi data in step 3.

```sql theme={null}
CREATE SCHEMA analytics;
CREATE TABLE analytics.rides
(
	vendor_id text,
	pickup_datetime timestamp,
	dropoff_datetime timestamp,
	passenger_count int,
	trip_distance float,
	pickup_longitude float,
	pickup_latitude float,
	rate_code text,
	store_and_fwd_flag text,
	dropoff_longitude float,
	dropoff_latitude float,
	fare_amount float,
	surcharge float,
	mta_tax float,
	tip_amount float,
	tolls_amount float,
	total_amount float
);
```

## 3. Insert sample data

Let’s insert the New York Taxi data into our rides table in the analytics schema. Below we’ve written example queries you can copy / paste.

```sql theme={null}
INSERT INTO analytics.rides
SELECT 
    r['vendor_id']::text,
    r['pickup_datetime']::timestamp,
    r['dropoff_datetime']::timestamp,
    r['passenger_count']::int,
    r['trip_distance']::float,
    r['pickup_longitude']::float,
    r['pickup_latitude']::float,
    r['rate_code']::text,
    r['store_and_fwd_flag']::text,
    r['dropoff_longitude']::float,
    r['dropoff_latitude']::float,
    r['fare_amount']::float,
    r['surcharge']::float,
    r['mta_tax']::float,
    r['tip_amount']::float,
    r['tolls_amount']::float,
    r['total_amount']::float
FROM read_parquet('https://idl.uw.edu/mosaic-datasets/data/nyc-rides-2010.parquet') AS r;
```

## 4. Run example queries

<AccordionGroup>
  <Accordion title="Q0: SELECT COUNT(*)" defaultOpen="false">
    ```sql theme={null}
    SELECT count(*) FROM analytics.rides;
    ```

    SELECT COUNT(\*) … counts the number of rows in the analytics.rides table.
  </Accordion>

  <Accordion title="Q1: SELECT * FROM" defaultOpen="false">
    ```sql theme={null}
    SELECT * FROM analytics.rides LIMIT 10;
    ```

    SELECT \* FROM … retrieves up to 10 rows of data from the analytics.rides table.
  </Accordion>

  <Accordion title="Q2: SELECT vendor_id" defaultOpen="false">
    ```sql theme={null}
    SELECT
       vendor_id,
       count(*) AS count,
       sum(fare_amount) AS revenue
    FROM analytics.rides
    GROUP BY vendor_id
    ORDER BY count DESC
    LIMIT 10;
    ```

    SELECT vendor\_id … is list of the top 10 vendors, displaying the number of rides and total revenue for each, ordered by the greatest number of rides first.
  </Accordion>
</AccordionGroup>

<Tip>
  When using cloud hosted Hydra run each statement by clicking the green triangle next to each query in the SQL Editor.
</Tip>

## 5. Insert existing data

Now let’s test Hydra with your own data.

<Warning>
  It’s a good idea to drop the “analytics.rides” sample data that was inserted earlier before loading your own files from S3, PostgreSQL, Google Cloud Storage, or local files.
</Warning>

To delete the sample data:

```sql theme={null}
DROP TABLE analytics.rides;
```

*Note: Switch the codebox tabs for steps on S3, Postgres, and/or local data.*

<CodeGroup>
  ```sql AWS S3 theme={null}
  -- Connect bucket, Session token is optional
  INSERT INTO duckdb.secrets
   (type, key_id, secret, session_token, region)
   VALUES ('S3', 'access_key_id', 'secret_access_key', 'session_token', 'us-east-1');

  -- example: create a table in the analytics schema from a file in S3.
  CREATE TABLE analytics.your_table_name 
  USING duckdb
  AS
  SELECT *
  FROM read_parquet('s3://your_bucket_name/your_file_name.parquet') AS
  (
     -- specify columns and types here, e.g.:
     -- id int,
     -- name text, ...
  );
  ```

  ```sql Postgres theme={null}
  -- create a database dump
  PGPASSWORD=$PASSWORD pg_dump --clean --if-exists --quote-all-identifiers -h $HOST -U $USER -d $DATABASE -p $PORT --no-owner --no-privileges > dump.sql

  -- restore
  psql -d "$HYDRA_CONNECTION_STRING" -f dump.sql

  -- copy table into analytics schema
  CREATE TABLE analytics.your_table
  USING duckdb
  AS SELECT * FROM your_table;
  ```

  ```sql Local data theme={null}
  -- use psql’s \copy feature to copy CSV data from local disk
  postgres=# CREATE TABLE analytics.my_table USING duckdb (
    id integer,
    ...
  );
  postgres=# \copy analytics.my_table FROM 'file.csv' FORMAT 'csv';
  ```
</CodeGroup>

## What’s Next?

We recommend

* following the migration documentation from [Object Storage](/migration/data_lake) (S3, GCS), Amazon [RDS](/migration/rds), [Heroku](/migration/heroku), [Render](/migration/render), [Postgres](/migration/postgres).
* learning [about Hydra](/hydra/about), our team and partners behind the project
* scanning the Hydra [architecture ](/start/architecture)
