# Base Tables

This topic covers information about base tables in dataengine.

## Content

[Base tables](/componentone/api/win/online-flexpivot/dotnet-standard-api/C1.DataEngine/C1.DataEngine.BaseTable.html) are simply data imported into DataEngine from external sources using connectors. Base tables act as input data for queries. Since a query or query result is also a table, you can distinguish between the two by the fact that base tables are not produced by queries. Every base table has a name (it must be unique in the workspace) and a collection of columns. When a workspace is initialized in code, some base tables can already exist (their data stored in the workspace's folder in memory-mapped files) and some can be added after workspace initialization.

A query is based on a table or on multiple tables if it's a join query. We will consider queries based on a single table first. A simple, non-join query is based on a base table or another query. Let us start with a simple case of a query over a base table first. To define query, you need to get hold of a base table first. This can be done using the syntax below.

#### Syntax

```vbnet
Dim workspace As C1.DataEngine.Workspace = C1.Win.FlexPivot.C1FlexPivotPanel.CreateWorkspace()
Dim od As Object = workspace.table("OrderDetails")
```

```csharp
C1.DataEngine.Workspace workspace = C1.Win.FlexPivot.C1FlexPivotPanel.CreateWorkspace();
dynamic od = workspace.table("OrderDetails");
```

This is an object representing a base table with the name "OrderDetails". Note that such table must already exist (i.e. must have been created earlier by importing data via a connector). This object is dynamic to make it easy (and type-safe) for you to reference table columns. For example, od.ProductID is the ProductID column, and od.Discount is the Discount column of the OrderDetails table

>type=note
> **Note**:
> In earlier versions, users could create Worskpace from the following code snippet:

```vbnet
Dim workspace As C1.DataEngine.Workspace = New C1.DataEngine.Workspace()
```

```csharp
C1.DataEngine.Workspace workspace = new C1.DataEngine.Workspace();
```

The [Workspace](/componentone/api/win/online-flexpivot/dotnet-standard-api/C1.DataEngine/C1.DataEngine.Workspace.html) class is provided in the [DataEngine](/componentone/api/win/online-flexpivot/dotnet-standard-api/C1.DataEngine/Assembly) namespace, so it uses a different license from that of WinForms. Now, we have added licensing at the FlexPivot-level so that the end-users don't have to worry about licensing the DataEngine library separately. You can simply use the WinForms license in the current version and easily create workspace with the new **CreateWorkspace()** method of [C1FlexPivotPanel](/componentone/api/win/online-flexpivot/dotnet-api/C1.Win.FlexPivot.10/C1.Win.FlexPivot.C1FlexPivotPanel.html) class of [C1.Win.FlexPivot](/componentone/api/win/online-flexpivot/dotnet-api/C1.Win.FlexPivot.10/C1.Win.FlexPivot.html) namespace.

```vbnet
Dim workspace As C1.DataEngine.Workspace = C1.Win.FlexPivot.C1FlexPivotPanel.CreateWorkspace()
```

```csharp
C1.DataEngine.Workspace workspace = C1.Win.FlexPivot.C1FlexPivotPanel.CreateWorkspace();
```