Databases, schemas and SQL context
User database creation, relational model definition and statement execution context.
Catalog and database context
CREATE DATABASE Atelier creates a user database. The notebook context or API database field determines the execution database; schema qualification does not change that context. The system database holds internal instance information. Application objects belong in user databases with schema-qualified names such as dbo.Ventes.
Create the database as administrator
In Studio Administration, create an Atelier database separate from production. Alternatively run CREATE DATABASE Atelier; as admin, then select Atelier. HTTP sends the database separately in database; do not simulate USE Atelier. The system database is reserved for Core.
Reference relational model
Execute the statements below individually in Atelier, using an account allowed to create and populate tables. Column names belong only to this fixture and impose no engine business schema. Running CREATE again on existing objects is an error. Key constraints and DEFAULT values are not implemented.
CREATE TABLE dbo.Clients (ClientId INT NOT NULL, Nom NVARCHAR(80));
CREATE TABLE dbo.Ventes (
Id BIGINT NOT NULL, ClientId INT, Pays NVARCHAR(40),
Montant DECIMAL(19,4), Jour DATE
);
INSERT INTO dbo.Clients VALUES (1, N'Alice'), (2, N'Bob');
INSERT INTO dbo.Ventes VALUES
(1, 1, N'France', 12.5000, CAST('2026-01-01' AS DATE)),
(2, 1, N'France', 7.5000, CAST('2026-01-02' AS DATE)),
(3, 2, N'Portugal', 30.0000, CAST('2026-01-02' AS DATE)),
(4, NULL, N'France', NULL, CAST('2026-01-03' AS DATE));Check the result and provision application access
Expect 4 rows, 3 non-NULL amounts and a 50.0000 total. Provision a user or key limited to the necessary objects. A read-only application needs neither admin credentials nor dbo rights. Run UPDATE, DELETE, TRUNCATE and DROP examples only in this development database.
SELECT COUNT(*) AS lignes, COUNT(Montant) AS montants, SUM(Montant) AS total
FROM dbo.Ventes;