SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
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); UPDATE Clients SET nomClient = 'Kabré' WHERE idClient = 4; DELETE FROM Clients WHERE idClient = 2; SELECT * FROM Clients JOIN Agences ON Clients.idAgence = Agences.idAgence WHERE nomClient LIKE '%a%' AND Agences.nomAgence = 'Agence 1' ORDER BY nomClient DESC LIMIT 1,18446744073709551615;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear