DJDaveMark
Programmer
Hi all,
Being a Java Programmer it's the first time I've designed a database and the queries. I just wondered if the following was ANSI_SQL or if I've added mySQL specific stuff. A quick yes or no would suffice. Any links would be much appreciated.
using the following tables
Being a Java Programmer it's the first time I've designed a database and the queries. I just wondered if the following was ANSI_SQL or if I've added mySQL specific stuff. A quick yes or no would suffice. Any links would be much appreciated.
Code:
START TRANSACTION;
INSERT INTO `race` (
`time`
)VALUES(
100000
);
INSERT INTO `stats` (
`race_id`, `m_stat`, `t_stat`, `r_stat`
)VALUES(
@lastID:=LAST_INSERT_ID(), 1, 1.1, 14
),(
@lastID, 2, 1.2, 14
),(
@lastID, 3, 1.0, 13
),(
@lastID, 4, 1.1, 14
);
INSERT INTO `lineup` (
`race_id` , `person_id`
)VALUES(
@lastID, 1
);
COMMIT;
Code:
+-------+ +-----------+ +-----------+ +---------+
¦person ¦ ¦ lineup ¦ ¦ race ¦ ¦ stats ¦
+-------+ +-----------+ +-----------¦ +---------+
¦ id ¦ /¦ id ¦\ ¦ id ¦ /¦ id ¦
¦ fname ¦----¦ person_id ¦----¦ time ¦----¦ race_id ¦
¦ lname ¦ \¦ race_id ¦/ +-----------+ \¦ m_stat ¦
+-------+ +-----------+ ¦ t_stat ¦
¦ r_stat ¦
+---------+