Question

I've been struggling with my database for a while now and my teacher is nearly impossible to get a hold of. My code is as follows:

INSERT INTO `database28`.`activity`
VALUES
("Stefan", 1.1.2.2, "Dator", "Mozilla" );

INSERT INTO `database28`.`activity`
VALUES
("Ulf", 1.1.3.3, "Mobil", "Safari" );

INSERT INTO `database28`.`activity`
VALUES
("Göran", 1.1.4.4, "surfplatta", "opera" );

INSERT INTO `database28`.`activity`
VALUES
("Berit", 1.1.5.5, "Dator", "Internet Explorer");

INSERT INTO `database28`.`activity`
VALUES
("Arne", 1.1.6.6, "Mobil", "Chrome");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas1", "Till", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Till", "Företag");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Till", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Från", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Från", "Företag");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas1", "Till", "Privat");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Success Audit");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("failure Audit");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Information");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Warning");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Error");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(1, 11:00, "Server 1", "Stefan", "Databas1", "System");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(2, 12:00, "Server 2", "Ulf", "Databas2", "exe");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(3, 13:00, "Server 1", "Mats", "Databas1", "System");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(2, 11:00, "Server 1", "Arne", "Databas1", "exe");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(3, 21:00, "Server 1", "Berit", "Databas1", "exe");

This however leaves me with several error messages, i dont get them all at once of course but when i try and change something i seem to be making it worse. Any ideas?

Was it helpful?

Solution

You forgot to put QUOTE Mark in Insert query of activity table and log table

Try this:

INSERT INTO `database28`.`activity`
VALUES
("Stefan", '1.1.2.2', "Dator", "Mozilla" );

INSERT INTO `database28`.`activity`
VALUES
("Ulf", '1.1.3.3', "Mobil", "Safari" );

INSERT INTO `database28`.`activity`
VALUES
("Göran", '1.1.4.4', "surfplatta", "opera" );

INSERT INTO `database28`.`activity`
VALUES
("Berit", '1.1.5.5', "Dator", "Internet Explorer");

INSERT INTO `database28`.`activity`
VALUES
("Arne", '1.1.6.6', "Mobil", "Chrome");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas1", "Till", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Till", "Företag");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Till", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Från", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Från", "Företag");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas1", "Till", "Privat");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Success Audit");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("failure Audit");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Information");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Warning");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Error");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(1, '11:00', "Server 1", "Stefan", "Databas1", "System");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(2, '12:00', "Server 2", "Ulf", "Databas2", "exe");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(3, '13:00', "Server 1", "Mats", "Databas1", "System");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(2, '11:00', "Server 1", "Arne", "Databas1", "exe");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(3, '21:00', "Server 1", "Berit", "Databas1", "exe");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top