Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
CREATE TABLE Agences ( idAgence INT PRIMARY KEY, nomAgence VARCHAR(255) NOT NULL ); CREATE TABLE Clients ( idClient INT PRIMARY KEY, nomClient VARCHAR(255) NOT NULL, idAgence INT, FOREIGN KEY (idAgence) REFERENCES Agences(idAgence) ); Describe Agences; Describe Clients; INSERT INTO Agences (idAgence, nomAgence) VALUES (1, 'Agence 1'); INSERT INTO Agences (idAgence, nomAgence) VALUES (2, 'Agence 2'); INSERT INTO Clients (idClient, nomClient, idAgence) VALUES (1, 'Client 1', 1); INSERT INTO Clients (idClient, nomClient, idAgence) VALUES (2, 'Client 2', 1); INSERT INTO Clients (idClient, nomClient, idAgence) VALUES (3, 'Client 3', 2); INSERT INTO Clients (idClient, nomClient, idAgence) VALUES (4, 'Client 4', 2); INSERT INTO Clients (idClient, nomClient, idAgence) VALUES (5, 'Client 5', 2);

Stuck with a problem? Got Error? Ask AI support!

Copy Clear