-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `km_trenesanas_eksamenam_1`
--

-- --------------------------------------------------------

--
-- Structure for view `km_resultat_1`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`kaznovska_m`@`localhost` SQL SECURITY DEFINER VIEW `km_resultat_1`  AS SELECT `l`.`numurs` AS `ligums`, `ld`.`darba_nr` AS `darba_nr`, `ld`.`nosaukums` AS `darbs`, `t`.`daudzums` AS `daudzums`, `m`.`isais` AS `mervieniba`, `ld`.`ligumcena` AS `cena`, (`t`.`daudzums` * `ld`.`ligumcena`) AS `kopa`, date_format(`r`.`datums`,'%d.%m') AS `datums`, concat(`p`.`vards`,' ',`p`.`uzvards`) AS `persona`, `v`.`nosaukums` AS `vieta`, `dt`.`nosaukums` AS `darba_tips` FROM (((((((`tame` `t` join `liguma_darbi` `ld` on((`t`.`lig_darb_id` = `ld`.`id`))) join `ligums` `l` on((`ld`.`liguma_id` = `l`.`id`))) join `mervienibas` `m` on((`ld`.`merv_id` = `m`.`id`))) join `persona` `p` on((`t`.`pers_id` = `p`.`id`))) join `vieta` `v` on((`t`.`vieta_id` = `v`.`id`))) join `darba_tipi` `dt` on((`t`.`darba_tips_id` = `dt`.`id`))) join `rekins` `r` on((`r`.`tame_id` = `t`.`id`))) ORDER BY `r`.`datums` ASC, `v`.`nosaukums` ASC ;

--
-- VIEW `km_resultat_1`
-- Data: None
--

COMMIT;

