-- phpMyAdmin SQL Dump
-- version 5.1.1deb5ubuntu1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3308:3308
-- Generation Time: Mar 22, 2026 at 08:51 PM
-- Server version: 8.0.45-0ubuntu0.22.04.1
-- PHP Version: 8.1.2-1ubuntu2.23

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `ua_trenesanas_eksamenam_1`
--

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

--
-- Table structure for table `darbs`
--

CREATE TABLE `darbs` (
  `id` int NOT NULL COMMENT 'Unikāls identifikators',
  `izmaksu_pozicija_id` int NOT NULL COMMENT 'Saistītā pozīcija',
  `nosaukums` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Darba nosaukums',
  `specifikacija_id` int DEFAULT NULL COMMENT 'Saistītā specifikācija',
  `mervieniba_id` int DEFAULT NULL COMMENT 'Saistītā mērvienība',
  `daudzums` decimal(10,2) DEFAULT NULL COMMENT 'Darba daudzums'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Darbu saraksts';

--
-- Dumping data for table `darbs`
--

INSERT INTO `darbs` (`id`, `izmaksu_pozicija_id`, `nosaukums`, `specifikacija_id`, `mervieniba_id`, `daudzums`) VALUES
(1, 1, 'Kontrolieris VTC 2000', 1, 1, '1.00'),
(2, 2, 'Kontroliera skapis', 2, 1, '1.00'),
(3, 3, 'Elektro skapis LIS-A', 3, 1, '1.00'),
(4, 4, 'Luksoforu signālgalvas', 4, 1, '4.00'),
(5, 5, 'Gājēju signālgalvas', 5, 1, '4.00'),
(6, 6, 'Luksoforu stabi', 6, 1, '4.00'),
(7, 7, 'Izsaukuma pogas', 7, 1, '4.00'),
(8, 8, 'Kabelis MCMO 12x1.5', 8, 2, '80.00'),
(9, 9, 'Kabelis EKKJ 5x1.5', 9, 2, '20.00'),
(10, 10, 'Kabelis NYY 5x6', 10, 2, '365.00'),
(11, 11, 'Kabelis FTP 4x2x0.5', 11, 2, '365.00'),
(12, 12, 'Aizsargcaurule', 12, 2, '50.00'),
(13, 13, 'Signāllente', 13, 2, '50.00'),
(14, 14, 'Zemējums', 14, 1, '2.00'),
(15, 15, 'Tranšeja', 15, 2, '50.00'),
(16, 16, 'Pieslēgšana', 16, 1, '1.00'),
(17, 17, 'Ekrāni', 17, 1, '4.00'),
(18, 18, 'Montāža', 18, 1, '1.00'),
(19, 19, 'Signalpāns', 19, 1, '1.00'),
(20, 20, 'Tranšeja papildu', 20, 2, '25.00'),
(21, 21, 'Asfalts', 21, 3, '10.00'),
(22, 22, 'Betons demontāža', 22, 3, '16.00'),
(23, 23, 'Betons atjaunošana', 23, 3, '16.00'),
(24, 24, 'Skaņas signāli', 24, 1, '38.00'),
(25, 25, 'Sinhronizācija', 25, 1, '5.00'),
(26, 26, 'Kabelis skaņai', 26, 2, '100.00'),
(27, 27, 'Signalpāns pārstrāde', 27, 1, '5.00'),
(28, 28, 'Programmēšana', 28, 1, '5.00'),
(29, 29, 'OCIT plate', 29, 1, '5.00'),
(30, 30, 'OCIT pieslēgšana', 30, 1, '5.00'),
(31, 31, 'Ethernet kabelis', 31, 1, '5.00'),
(32, 32, 'Transīvers', 32, 1, '5.00'),
(33, 33, 'Barošana', 33, 1, '5.00'),
(34, 34, 'Pieslēgšana tīklam', 34, 1, '5.00');

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

--
-- Table structure for table `izmaksu_pozicija`
--

CREATE TABLE `izmaksu_pozicija` (
  `id` int NOT NULL COMMENT 'Unikāls identifikators',
  `kods` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Pozīcijas kods',
  `vecaka_pozicija_id` int DEFAULT NULL COMMENT 'Norāde uz citu pozīciju'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Luksaforu darbu izmaksu pozīcijas';

--
-- Dumping data for table `izmaksu_pozicija`
--

INSERT INTO `izmaksu_pozicija` (`id`, `kods`, `vecaka_pozicija_id`) VALUES
(1, '1', NULL),
(2, '1', 1),
(3, '1.1', 1),
(4, '1.2', 1),
(5, '1.3', 1),
(6, '1.4', 1),
(7, '1.5', 1),
(8, '1.6', 1),
(9, '1.7', 1),
(10, '1.8', 1),
(11, '1.9', 1),
(12, '1.10', 1),
(13, '1.11', 1),
(14, '1.12', 1),
(15, '1.13', 1),
(16, '1.14', 1),
(17, '1.15', 1),
(18, '1.16', 1),
(19, '1.17', 1),
(20, '1.18', 1),
(21, '1.19', 1),
(22, '1.20', 1),
(23, '1.21', 1),
(24, '1.22', 1),
(25, '1.23', 1),
(26, '1.24', 1),
(27, '1.25', 1),
(28, '1.26', 1),
(29, '1.27', 1),
(30, '1.28', 1),
(31, '1.29', 1),
(32, '1.30', 1),
(33, '1.31', 1),
(34, '1.32', 1);

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

--
-- Table structure for table `liguma_dati`
--

CREATE TABLE `liguma_dati` (
  `id` int NOT NULL COMMENT 'Unikāls identifikators',
  `darbs_id` int DEFAULT NULL COMMENT 'Saistītais darbs',
  `darbietilpiba` decimal(10,2) DEFAULT NULL COMMENT 'Darba apjoms',
  `darba_alga` decimal(10,2) DEFAULT NULL COMMENT 'Darba alga',
  `materiali` decimal(10,2) DEFAULT NULL COMMENT 'Materiālu izmaksas',
  `mehanismi` decimal(10,2) DEFAULT NULL COMMENT 'Mehānismu izmaksas',
  `summa` decimal(10,2) DEFAULT NULL COMMENT 'Kopējā summa'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Līguma dati';

--
-- Dumping data for table `liguma_dati`
--

INSERT INTO `liguma_dati` (`id`, `darbs_id`, `darbietilpiba`, `darba_alga`, `materiali`, `mehanismi`, `summa`) VALUES
(1, 1, NULL, NULL, '5000.00', NULL, NULL),
(2, 2, NULL, NULL, '250.00', NULL, NULL),
(3, 3, NULL, NULL, '360.00', NULL, NULL),
(4, 4, NULL, NULL, '1720.00', NULL, NULL),
(5, 5, NULL, NULL, '1320.00', NULL, NULL),
(6, 6, NULL, NULL, '1000.00', NULL, NULL),
(7, 7, NULL, NULL, '580.00', NULL, NULL),
(8, 8, NULL, NULL, '236.00', NULL, NULL),
(9, 9, NULL, NULL, '13.00', NULL, NULL),
(10, 10, NULL, NULL, '1350.50', NULL, NULL),
(11, 11, NULL, NULL, '620.50', NULL, NULL),
(12, 12, NULL, NULL, '45.00', NULL, NULL),
(13, 13, NULL, NULL, '7.50', NULL, NULL),
(14, 14, NULL, NULL, '29.70', NULL, NULL),
(15, 15, NULL, NULL, '132.50', NULL, NULL),
(16, 16, NULL, NULL, '450.00', NULL, NULL),
(17, 17, NULL, NULL, '240.00', NULL, NULL),
(18, 18, NULL, NULL, '250.00', NULL, NULL),
(19, 19, NULL, NULL, '400.00', NULL, NULL),
(20, 20, NULL, NULL, '87.50', NULL, NULL),
(21, 21, NULL, NULL, '400.00', NULL, NULL),
(22, 22, NULL, NULL, '0.00', NULL, NULL),
(23, 23, NULL, NULL, '0.00', NULL, NULL),
(24, 24, NULL, NULL, '18240.00', NULL, NULL),
(25, 25, NULL, NULL, '5000.00', NULL, NULL),
(26, 26, NULL, NULL, '65.00', NULL, NULL),
(27, 27, NULL, NULL, '2000.00', NULL, NULL),
(28, 28, NULL, NULL, '1500.00', NULL, NULL),
(29, 29, NULL, NULL, '7500.00', NULL, NULL),
(30, 30, NULL, NULL, '300.00', NULL, NULL),
(31, 31, NULL, NULL, '25.00', NULL, NULL),
(32, 32, NULL, NULL, '10000.00', NULL, NULL),
(33, 33, NULL, NULL, '150.00', NULL, NULL),
(34, 34, NULL, NULL, '75.00', NULL, NULL);

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

--
-- Table structure for table `mervieniba`
--

CREATE TABLE `mervieniba` (
  `id` int NOT NULL COMMENT 'Unikāls identifikators',
  `nosaukums` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Mērvienība (piemēram: m, kg, gab.)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Mērvienību saraksts';

--
-- Dumping data for table `mervieniba`
--

INSERT INTO `mervieniba` (`id`, `nosaukums`) VALUES
(1, 'Gab.'),
(2, 'm'),
(3, 'm2');

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

--
-- Table structure for table `specifikacija`
--

CREATE TABLE `specifikacija` (
  `id` int NOT NULL COMMENT 'Unikāls identifikators',
  `numurs` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Specifikācijas numurs'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Specifikāciju saraksts';

--
-- Dumping data for table `specifikacija`
--

INSERT INTO `specifikacija` (`id`, `numurs`) VALUES
(1, '1'),
(2, '2'),
(3, '3'),
(4, '4'),
(5, '5'),
(6, '6'),
(7, '7'),
(8, '8'),
(9, '9'),
(10, '10'),
(11, '11'),
(12, '12'),
(13, '13'),
(14, '14'),
(15, '15'),
(16, '16'),
(17, '17'),
(18, '18'),
(19, '19'),
(20, '20'),
(21, '21'),
(22, '22'),
(23, '23'),
(24, '24'),
(25, '25'),
(26, '26'),
(27, '27'),
(28, '28'),
(29, '29'),
(30, '30'),
(31, '31'),
(32, '32'),
(33, '33'),
(34, '34');

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

--
-- Table structure for table `vienibas_izmaksas`
--

CREATE TABLE `vienibas_izmaksas` (
  `id` int NOT NULL COMMENT 'Unikāls identifikators',
  `darbs_id` int DEFAULT NULL COMMENT 'Saistītais darbs',
  `laika_norma` decimal(10,2) DEFAULT NULL COMMENT 'Laiks vienam darbam',
  `likme` decimal(10,2) DEFAULT NULL COMMENT 'Darba likme',
  `darba_alga` decimal(10,2) DEFAULT NULL COMMENT 'Darba alga',
  `materiali` decimal(10,2) DEFAULT NULL COMMENT 'Materiālu izmaksas',
  `mehanismi` decimal(10,2) DEFAULT NULL COMMENT 'Mehānismu izmaksas',
  `kopa` decimal(10,2) DEFAULT NULL COMMENT 'Kopējās izmaksas'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Vienas darba vienības izmaksas';

--
-- Dumping data for table `vienibas_izmaksas`
--

INSERT INTO `vienibas_izmaksas` (`id`, `darbs_id`, `laika_norma`, `likme`, `darba_alga`, `materiali`, `mehanismi`, `kopa`) VALUES
(1, 1, NULL, NULL, NULL, '5000.00', NULL, '5000.00'),
(2, 2, NULL, NULL, NULL, '250.00', NULL, '250.00'),
(3, 3, NULL, NULL, NULL, '360.00', NULL, '360.00'),
(4, 4, NULL, NULL, NULL, '430.00', NULL, '1720.00'),
(5, 5, NULL, NULL, NULL, '330.00', NULL, '1320.00'),
(6, 6, NULL, NULL, NULL, '250.00', NULL, '1000.00'),
(7, 7, NULL, NULL, NULL, '145.00', NULL, '580.00'),
(8, 8, NULL, NULL, NULL, '2.95', NULL, '236.00'),
(9, 9, NULL, NULL, NULL, '0.65', NULL, '13.00'),
(10, 10, NULL, NULL, NULL, '3.70', NULL, '1350.50'),
(11, 11, NULL, NULL, NULL, '1.70', NULL, '620.50'),
(12, 12, NULL, NULL, NULL, '0.90', NULL, '45.00'),
(13, 13, NULL, NULL, NULL, '0.15', NULL, '7.50'),
(14, 14, NULL, NULL, NULL, '14.85', NULL, '29.70'),
(15, 15, NULL, NULL, NULL, '2.65', NULL, '132.50'),
(16, 16, NULL, NULL, NULL, '450.00', NULL, '450.00'),
(17, 17, NULL, NULL, NULL, '60.00', NULL, '240.00'),
(18, 18, NULL, NULL, NULL, '250.00', NULL, '250.00'),
(19, 19, NULL, NULL, NULL, '400.00', NULL, '400.00'),
(20, 20, NULL, NULL, NULL, '3.50', NULL, '87.50'),
(21, 21, NULL, NULL, NULL, '40.00', NULL, '400.00'),
(22, 22, NULL, NULL, NULL, '0.00', NULL, '0.00'),
(23, 23, NULL, NULL, NULL, '0.00', NULL, '0.00'),
(24, 24, NULL, NULL, NULL, '480.00', NULL, '18240.00'),
(25, 25, NULL, NULL, NULL, '1000.00', NULL, '5000.00'),
(26, 26, NULL, NULL, NULL, '0.65', NULL, '65.00'),
(27, 27, NULL, NULL, NULL, '400.00', NULL, '2000.00'),
(28, 28, NULL, NULL, NULL, '300.00', NULL, '1500.00'),
(29, 29, NULL, NULL, NULL, '1500.00', NULL, '7500.00'),
(30, 30, NULL, NULL, NULL, '60.00', NULL, '300.00'),
(31, 31, NULL, NULL, NULL, '5.00', NULL, '25.00'),
(32, 32, NULL, NULL, NULL, '2000.00', NULL, '10000.00'),
(33, 33, NULL, NULL, NULL, '30.00', NULL, '150.00'),
(34, 34, NULL, NULL, NULL, '15.00', NULL, '75.00');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `darbs`
--
ALTER TABLE `darbs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `izmaksu_pozicija_id` (`izmaksu_pozicija_id`),
  ADD KEY `specifikacija_id` (`specifikacija_id`),
  ADD KEY `mervieniba_id` (`mervieniba_id`);

--
-- Indexes for table `izmaksu_pozicija`
--
ALTER TABLE `izmaksu_pozicija`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vecaka_pozicija_id` (`vecaka_pozicija_id`);

--
-- Indexes for table `liguma_dati`
--
ALTER TABLE `liguma_dati`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `darbs_id` (`darbs_id`),
  ADD UNIQUE KEY `darbs_id_2` (`darbs_id`);

--
-- Indexes for table `mervieniba`
--
ALTER TABLE `mervieniba`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `specifikacija`
--
ALTER TABLE `specifikacija`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vienibas_izmaksas`
--
ALTER TABLE `vienibas_izmaksas`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `darbs_id` (`darbs_id`),
  ADD UNIQUE KEY `darbs_id_2` (`darbs_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `darbs`
--
ALTER TABLE `darbs`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'Unikāls identifikators', AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `izmaksu_pozicija`
--
ALTER TABLE `izmaksu_pozicija`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'Unikāls identifikators', AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `liguma_dati`
--
ALTER TABLE `liguma_dati`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'Unikāls identifikators', AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `mervieniba`
--
ALTER TABLE `mervieniba`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'Unikāls identifikators', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `specifikacija`
--
ALTER TABLE `specifikacija`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'Unikāls identifikators', AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `vienibas_izmaksas`
--
ALTER TABLE `vienibas_izmaksas`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'Unikāls identifikators', AUTO_INCREMENT=35;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `darbs`
--
ALTER TABLE `darbs`
  ADD CONSTRAINT `darbs_ibfk_1` FOREIGN KEY (`izmaksu_pozicija_id`) REFERENCES `izmaksu_pozicija` (`id`),
  ADD CONSTRAINT `darbs_ibfk_2` FOREIGN KEY (`specifikacija_id`) REFERENCES `specifikacija` (`id`),
  ADD CONSTRAINT `darbs_ibfk_3` FOREIGN KEY (`mervieniba_id`) REFERENCES `mervieniba` (`id`);

--
-- Constraints for table `izmaksu_pozicija`
--
ALTER TABLE `izmaksu_pozicija`
  ADD CONSTRAINT `izmaksu_pozicija_ibfk_1` FOREIGN KEY (`vecaka_pozicija_id`) REFERENCES `izmaksu_pozicija` (`id`);

--
-- Constraints for table `liguma_dati`
--
ALTER TABLE `liguma_dati`
  ADD CONSTRAINT `liguma_dati_ibfk_1` FOREIGN KEY (`darbs_id`) REFERENCES `darbs` (`id`);

--
-- Constraints for table `vienibas_izmaksas`
--
ALTER TABLE `vienibas_izmaksas`
  ADD CONSTRAINT `vienibas_izmaksas_ibfk_1` FOREIGN KEY (`darbs_id`) REFERENCES `darbs` (`id`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
