SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE COMPANIES ( K_COMPANY int NOT NULL, NAME varchar(100) NOT NULL, CITY varchar(50) NULL CONSTRAINT PK_COMPANIES PRIMARY KEY CLUSTERED (K_COMPANY) ) GO CREATE TABLE CONTACTS ( K_CONTACT int NOT NULL, NAME varchar(50) NOT NULL, FIRSTNAME varchar(50) NULL CONSTRAINT PK_CONTACTS PRIMARY KEY CLUSTERED (K_CONTACT) ) GO CREATE TABLE CONT_COMP ( K_CONTACT int NOT NULL, K_COMPANY int NOT NULL CONSTRAINT PK_CONT_COMP PRIMARY KEY CLUSTERED (K_CONTACT, K_COMPANY) ) GO ALTER TABLE CONT_COMP WITH CHECK ADD CONSTRAINT FK_COMPANIES_CONT_COMP1 FOREIGN KEY(K_CONTACT) REFERENCES CONTACTS (K_CONTACT) ON DELETE CASCADE GO ALTER TABLE CONT_COMP WITH CHECK ADD CONSTRAINT FK_COMPANIES_CONT_COMP2 FOREIGN KEY(K_COMPANY) REFERENCES COMPANIES (K_COMPANY) ON DELETE CASCADE GO INSERT INTO COMPANIES (K_COMPANY, NAME, CITY) values (1, 'bitlab', 'Cairo'), (2, 'Bsoftware', 'Rome'), (3, 'CHIPCODE', 'Amsterdam'), (4, 'codeal', 'Kuala Lumpur'), (5, 'CODECA', 'Kuala Lumpur'), (6, 'CODECODE', 'New York'), (7, 'codecord', 'Tokyo'), (8, 'codector', 'Kuala Lumpur'), (9, 'CODEMO', 'Taipei'), (10, 'CODINGKEY', 'New York'), (11, 'compubotics.com', 'Bangkok'), (12, 'computer.ly', 'Bangkok'), ( 13, 'computerfluent.com', 'Milan' ), (14, 'computern', 'Bangkok'), ( 15, 'computersphere.com', 'Istanbul' ), (16, 'computezo.com', 'Singapore'), ( 17, 'computingkey.com', 'Bangkok' ), ( 18, 'computism.com', 'Johor Bahru' ), (19, 'cryptics', 'Miami'), (20, 'Csoftware', 'Athens'), (21, 'Digigent', 'Bangkok'), (22, 'digitar', 'Florence'), (23, 'dsoftware', 'Bangkok'), (24, 'EZSOFTWARE', 'Paris'), (25, 'FASTCITY', 'Paris'), (26, 'fastsoftware', 'Pattaya'), (27, 'gamerics', 'Orlando'), (28, 'hackern', 'New York'), (29, 'hackerse', 'Phuket'), (30, 'HACKERST', 'Kuala Lumpur'), (31, 'hackets', 'Cancún'), (32, 'HSOFTWARE', 'Paris'), (33, 'isoftware', 'Prague'), (34, 'kitric', 'Shanghai'), (35, 'kitrix', 'Bangkok'), (36, 'LOGICKET', 'Las Vegas'), (37, 'logybox', 'Paris'), (38, 'maching', 'Ha Long'), (39, 'machip', 'Brussels'), (40, 'MASTRIX', 'Singapore'), (41, 'METAVINE', 'Medina'), (42, 'msoftware', 'Osaka'), (43, 'Msoftware', 'Toronto'), (44, 'neubotics.com', 'Vienna'), (45, 'ONLINX', 'Jakarta'), (46, 'platech', 'Moscow'), (47, 'PLAYBOX', 'Mecca'), (48, 'PROCKET', 'London'), (49, 'rsoftware', 'Singapore'), (50, 'SOFTDATA', 'Hanoi'), (51, 'softruct', 'Johannesburg'), (52, 'softsoftware', 'Madrid'), (53, 'SOFTWAREB', 'Dublin'), (54, 'softwarebox', 'Munich'), ( 55, 'softwarebrains.com', 'Brussels' ), (56, 'softwarec', 'Jaipur'), (57, 'SOFTWARED', 'Paris'), (58, 'softwareG', 'London'), ( 59, 'softwaregear.com', 'Shenzhen' ), (60, 'softwaregiant.com', 'Delhi'), ( 61, 'softwaregoods.com', 'Los Angeles' ), (62, 'SOFTWAREH', 'London'), ( 63, 'softwarei', 'Ho Chi Minh City' ), (64, 'softwareM', 'Riyadh'), (65, 'Softwarem', 'Sydney'), (66, 'softwarep', 'Kuala Lumpur'), (67, 'softwarer', 'Barcelona'), ( 68, 'softwarerepair.com', 'Brussels' ), (69, 'SOFTWARES', 'Venice'), ( 70, 'softwaresilo.com', 'Chennai' ), ( 71, 'softwaresoup.com', 'Singapore' ), (72, 'softwarew', 'Seoul'), (73, 'softweb.io', 'Singapore'), (74, 'softwware.com', 'Bangkok'), (75, 'Ssoftware', 'Singapore'), (76, 'systemtech.io', 'Istanbul'), (77, 'systemy', 'Brussels'), (78, 'teachip', 'New York'), (79, 'techain', 'Kuala Lumpur'), (80, 'TECHANT', 'Agra'), (81, 'techart', 'Singapore'), (82, 'techcode', 'Bangkok'), (83, 'techicbit', 'London'), (84, 'TECHICS', 'Paris'), (85, 'TECHINE', 'Berlin'), (86, 'techines', 'Bangkok'), (87, 'TECHING', 'Beijing'), (88, 'techip', 'Denpasar'), (89, 'techite', 'London'), (90, 'TECHNICA', 'Kuala Lumpur'), (91, 'TECHPARA', 'Singapore'), (92, 'techret', 'New York'), (93, 'TECHRIA', 'Mumbai'), (94, 'techrian', 'Kuala Lumpur'), (95, 'techsist.com', 'Antalya'), (96, 'techvology.com', 'Bangkok'), (97, 'USERVICE', 'Paris'), (98, 'Webdork', 'Guangzhou'), (99, 'workcode', 'Kuala Lumpur'), (100, 'WSOFTWARE', 'Istanbul') GO INSERT INTO CONTACTS (K_CONTACT, NAME, FIRSTNAME) values (1, 'Nieuwenhuizen', 'Debra'), (2, 'Jacobse', 'Herjan'), (3, 'Houtenbos', 'Hanke'), (4, 'Nederveen', 'Raphaël'), (5, 'Appels', 'Lolita'), (6, 'van den Bulk', 'Sarita'), (7, 'Meilink', 'Marciano'), (8, 'Hovinga', 'Yorick'), (9, 'Honders', 'Naveen'), (10, 'Vogelezang', 'Precilla'), (11, 'Vreeling', 'Matthijn'), (12, 'Sikma', 'Soeraya'), (13, 'Kraan', 'Melwin'), (14, 'Eren', 'Rawi'), (15, 'de Veen', 'Hafssa'), (16, 'van Soeren', 'Mickael'), (17, 'Uljee', 'Ruthger'), (18, 'van Groeningen', 'Kishen'), (19, 'Chin', 'Annette'), (20, 'Pleijsier', 'Yonne'), (21, 'Ekkelenkamp', 'Yelena'), (22, 'van Kraaij', 'Pepijn'), (23, 'van der Staak', 'Marinde'), (24, 'Duijndam', 'Zara'), (25, 'Kosters', 'Philippine'), (26, 'van Abeelen', 'Gunnar'), (27, 'Reus', 'Dik'), (28, 'de Beurs', 'Driss'), (29, 'Rijneveld', 'Samira'), (30, 'Poortinga', 'Hakim'), (31, 'Golsteijn', 'Lenka'), (32, 'Witlox', 'Barend'), (33, 'Kooreman', 'Roby'), (34, 'van Donselaar', 'Volkert'), (35, 'Hondebrink', 'Preston'), (36, 'Gevers', 'Ale'), (37, 'van Rheenen', 'Jacobine'), ( 38, 'van der Smissen', 'Vasiliki' ), (39, 'Scholte', 'Keanu'), (40, 'Gielen', 'Indra'), (41, 'Hellemons', 'Erva'), (42, 'Henriquez', 'Lennon'), (43, 'Odink', 'Arslan'), (44, 'van Zeist', 'Luana'), (45, 'Ulijn', 'Isaac'), (46, 'Bruijn', 'Dorina'), (47, 'van Londen', 'Emmanuela'), (48, 'Roijakkers', 'Abdeljalil'), (49, 'Nies', 'Okan'), (50, 'Swaan', 'Reinard'), (51, 'Lautenbach', 'Jacomina'), (52, 'Schotman', 'Solange'), (53, 'van Uitert', 'Therèse'), (54, 'Lebens', 'Pharrell'), (55, 'Roetman', 'Diandra'), (56, 'Heemskerk', 'Charley'), (57, 'Mevissen', 'Marlouk'), (58, 'van Impelen', 'Eslem'), (59, 'van Dongen', 'Robby'), (60, 'Vestering', 'Taylor'), (61, 'van Megen', 'Al'), (62, 'Koornstra', 'Benedict'), (63, 'de Rooy', 'Rixt'), (64, 'van Scherpenzeel', 'Marjam'), (65, 'Buiter', 'Janne'), (66, 'Dooper', 'Nanne'), (67, 'Roefs', 'Omayra'), (68, 'Hereijgers', 'Joyca'), (69, 'Heuvel', 'Isadora'), (70, 'Brandt', 'Arvind'), (71, 'Bok', 'Badr'), (72, 'van Berkum', 'Marije'), (73, 'Speerstra', 'Amon'), (74, 'Wildenbeest', 'Mamadou'), (75, 'Broekema', 'Lenn'), (76, 'Tuijp', 'Liona'), (77, 'Potgieter', 'Davide'), (78, 'Hogendoorn', 'Feline'), (79, 'Duursma', 'Madelinde'), (80, 'Altun', 'Kariem') GO INSERT INTO CONT_COMP (K_CONTACT, K_COMPANY) values (1, 47), (2, 10), (3, 24), (4, 52), (5, 51), (6, 27), (7, 47), (8, 16), (9, 37), (10, 85), (11, 84), (12, 72), (13, 14), (14, 81), (15, 52), (16, 56), (17, 52), (18, 76), (19, 81), (20, 74), (21, 31), (22, 1), (23, 39), (24, 6), (25, 54), (26, 94), (27, 91), (28, 12), (29, 57), (30, 37), (31, 88), (32, 98), (33, 2), (34, 33), (35, 64), (36, 81), (37, 97), (38, 63), (39, 77), (40, 79), (41, 91), (42, 32), (43, 72), (44, 59), (45, 26), (46, 91), (47, 79), (48, 43), (49, 74), (50, 100), (51, 60), (52, 24), (53, 73), (54, 39), (55, 95), (56, 35), (57, 41), (58, 98), (59, 74), (60, 3), (61, 42), (62, 46), (63, 75), (64, 51), (65, 86), (66, 45), (67, 48), (68, 81), (69, 29) GO SELECT * FROM COMPANIES;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear