aboutsummaryrefslogtreecommitdiff
path: root/dbinit/views.sql
blob: a995ee6c7fe891bafaf3e539a425df4c1710652e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
CREATE 
VIEW `formula1`.`vwcalendar` AS
SELECT 
	`calendar`.`year` AS `year`,
	`racedate`.`week` AS `week`,
	`racedate`.`date` AS `date`,
	`circuit`.`name` AS `name`
FROM
	(((`calendar`
	JOIN `racedate` ON ((`calendar`.`ID` = `racedate`.`calendarID`)))
	JOIN `racedatecircuit` ON ((`racedate`.`ID` = `racedatecircuit`.`raceDateID`)))
	JOIN `circuit` ON ((`racedatecircuit`.`circuitID` = `circuit`.`ID`)));


CREATE 
VIEW `formula1`.`vwteamcoureurs` AS	
SELECT 
	`calendar`.`ID` AS `ID`,
	`teams`.`teamNumber` AS `teamNumber`,
	`teams`.`teamName` AS `teamName`,
	`member`.`firstName` AS `firstName`,
	`member`.`middleName` AS `middleName`,
	`member`.`lastName` AS `lastName`
FROM
	(((`calendar`
	JOIN `teams` ON ((`calendar`.`ID` = `teams`.`calendarID`)))
	JOIN `teamsmember` ON ((`teams`.`ID` = `teamsmember`.`teamsID`)))
	JOIN `member` ON ((`teamsmember`.`memberID` = `member`.`ID`)));