You are on page 1of 7

-- phpMyAdmin SQL Dump

-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 19, 2022 at 07:59 PM
-- Server version: 5.7.31
-- PHP Version: 7.3.21

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: `pop_festival`
--

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

--
-- Table structure for table `agent`
--

DROP TABLE IF EXISTS `agent`;


CREATE TABLE IF NOT EXISTS `agent` (
`id` int(11) NOT NULL,
`name` varchar(8) NOT NULL,
`photo` varchar(8) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Triggers `agent`
--
DROP TRIGGER IF EXISTS `onDeleteTrigger`;
DELIMITER $$
CREATE TRIGGER `onDeleteTrigger` AFTER DELETE ON `agent` FOR EACH ROW
UPDATE tblcountdelete SET tblcountdelete.countDelete =
tblcountdelete.countDelete + 1
$$
DELIMITER ;

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

--
-- Stand-in structure for view `agentjobs`
-- (See below for the actual view)
--
DROP VIEW IF EXISTS `agentjobs`;
CREATE TABLE IF NOT EXISTS `agentjobs` (
`id` int(11)
,`name` varchar(8)
,`photo` varchar(8)
);

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

--
-- Stand-in structure for view `agentjobsview`
-- (See below for the actual view)
--
DROP VIEW IF EXISTS `agentjobsview`;
CREATE TABLE IF NOT EXISTS `agentjobsview` (
`agent_id` int(11)
,`job` varchar(8)
);

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

--
-- Table structure for table `agent_jobs`
--

DROP TABLE IF EXISTS `agent_jobs`;


CREATE TABLE IF NOT EXISTS `agent_jobs` (
`agent_id` int(11) NOT NULL,
`job` varchar(8) NOT NULL,
PRIMARY KEY (`agent_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `agent_jobs`
--

INSERT INTO `agent_jobs` (`agent_id`, `job`) VALUES


(1, 'social'),
(2, 'direct');

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

--
-- Table structure for table `band`
--

DROP TABLE IF EXISTS `band`;


CREATE TABLE IF NOT EXISTS `band` (
`id` int(11) NOT NULL,
`name` varchar(8) NOT NULL,
`description` varchar(30) NOT NULL,
`fk1_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk1_band_to_agent` (`fk1_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `band`
--

INSERT INTO `band` (`id`, `name`, `description`, `fk1_id`) VALUES


(1, 'stoinzy', 'Very good croz', 1),
(2, 'slaves', 'Better than others', 2);

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

--
-- Table structure for table `band_perform_stage`
--

DROP TABLE IF EXISTS `band_perform_stage`;


CREATE TABLE IF NOT EXISTS `band_perform_stage` (
`s_id` int(11) NOT NULL,
`d_number` int(11) NOT NULL,
PRIMARY KEY (`s_id`,`d_number`),
KEY `d_number` (`d_number`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `band_perform_stage`
--

INSERT INTO `band_perform_stage` (`s_id`, `d_number`) VALUES


(1, 2),
(2, 3),
(3, 1);

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

--
-- Table structure for table `member`
--

DROP TABLE IF EXISTS `member`;


CREATE TABLE IF NOT EXISTS `member` (
`id` int(11) NOT NULL,
`object_type` varchar(20) NOT NULL,
`name` varchar(8) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `member`
--

INSERT INTO `member` (`id`, `object_type`, `name`) VALUES


(1, 'agent', 'riley'),
(2, 'security', 'Latiner');

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

--
-- Table structure for table `members`
--

DROP TABLE IF EXISTS `members`;


CREATE TABLE IF NOT EXISTS `members` (
`member_id` int(11) NOT NULL,
`band_id` int(11) NOT NULL,
`fk1_id` int(11) NOT NULL,
PRIMARY KEY (`member_id`),
KEY `fk1_members_to_band` (`fk1_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `members`
--

INSERT INTO `members` (`member_id`, `band_id`, `fk1_id`) VALUES


(1, 2, 1),
(2, 3, 2),
(3, 1, 3);

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

--
-- Table structure for table `musician`
--

DROP TABLE IF EXISTS `musician`;


CREATE TABLE IF NOT EXISTS `musician` (
`id` int(11) NOT NULL,
`name` varchar(8) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `musician`
--

INSERT INTO `musician` (`id`, `name`) VALUES


(1, 'Ali'),
(2, 'Haneen'),
(3, 'Leone'),
(4, 'Seify'),
(5, 'Jalik'),
(6, 'prest'),
(7, 'mest');

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

--
-- Table structure for table `musicians`
--

DROP TABLE IF EXISTS `musicians`;


CREATE TABLE IF NOT EXISTS `musicians` (
`musicians_id` int(11) NOT NULL,
`band_id` int(11) NOT NULL,
`fk1_id` int(11) NOT NULL,
PRIMARY KEY (`musicians_id`),
KEY `fk1_musicians_to_band` (`fk1_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `musicians`
--

INSERT INTO `musicians` (`musicians_id`, `band_id`, `fk1_id`) VALUES


(1, 1, 1),
(2, 2, 1),
(3, 3, 3),
(4, 2, 4),
(5, 4, 5),
(6, 3, 6),
(7, 2, 7),
(8, 4, 8),
(9, 3, 9),
(10, 1, 10);

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

--
-- Table structure for table `performance`
--

DROP TABLE IF EXISTS `performance`;


CREATE TABLE IF NOT EXISTS `performance` (
`id` int(11) NOT NULL,
`stage` varchar(8) NOT NULL,
`band` varchar(8) NOT NULL,
`date` date NOT NULL,
`time` time(6) NOT NULL,
`fk1_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk1_performance_to_band` (`fk1_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `performance`
--

INSERT INTO `performance` (`id`, `stage`, `band`, `date`, `time`,


`fk1_id`) VALUES
(1, '1', '1', '2022-12-08', '30:54:18.000000', 1),
(2, '1', '2', '2022-12-15', '31:33:22.000000', 2),
(3, '2', '3', '2022-09-22', '31:33:22.000000', 3),
(4, '3', '', '2022-12-13', '31:33:22.000000', 4),
(5, '4', '4', '2022-12-07', '31:33:22.000000', 5),
(6, '5', '2', '2022-08-10', '31:33:22.000000', 6),
(7, '3', '1', '2022-05-10', '31:33:22.000000', 7),
(8, '4', '3', '2022-07-12', '31:33:22.000000', 8);

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

--
-- Table structure for table `stage`
--

DROP TABLE IF EXISTS `stage`;


CREATE TABLE IF NOT EXISTS `stage` (
`number` int(11) NOT NULL,
`name` varchar(8) NOT NULL,
`capacity` int(11) NOT NULL,
PRIMARY KEY (`number`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `stage`
--

INSERT INTO `stage` (`number`, `name`, `capacity`) VALUES


(1, 'pyramid', 10),
(2, 'Hoist', 15),
(3, 'Jeimpeel', 32),
(4, 'Thepark', 22),
(5, 'Avalon', 21);

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

--
-- Table structure for table `tblcountdelete`
--

DROP TABLE IF EXISTS `tblcountdelete`;


CREATE TABLE IF NOT EXISTS `tblcountdelete` (
`countDelete` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblcountdelete`
--

INSERT INTO `tblcountdelete` (`countDelete`) VALUES


(1);

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

--
-- Structure for view `agentjobs`
--
DROP TABLE IF EXISTS `agentjobs`;

DROP VIEW IF EXISTS `agentjobs`;


CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY
DEFINER VIEW `agentjobs` AS select `agent`.`id` AS
`id`,`agent`.`name` AS `name`,`agent`.`photo` AS `photo` from
`agent` ;

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

--
-- Structure for view `agentjobsview`
--
DROP TABLE IF EXISTS `agentjobsview`;

DROP VIEW IF EXISTS `agentjobsview`;


CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY
DEFINER VIEW `agentjobsview` AS select `agent_jobs`.`agent_id` AS
`agent_id`,`agent_jobs`.`job` AS `job` from `agent_jobs` ;
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 */;

You might also like