<commit_before>-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 03, 2015 at 02:06 PM
-- Server version: 5.5.44-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.11

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;

--
-- Database: `sleepover`
--

DELIMITER $$
--
-- Procedures
--
CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `check_login`(IN `username` VARCHAR(100), IN `password` VARCHAR(100))
    READS SQL DATA
SELECT t.team_id as uid, username, p.first_name, p.last_name
FROM podestrian p
JOIN team_member t ON t.podestrian = p.podestrian_id
WHERE t.username = username AND t.password = password$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_all_podestrians`()
    READS SQL DATA
    COMMENT 'gets all podestrians'
SELECT p.podestrian_id, p.pic, p.first_name, p.last_name, p.email, pt.podestrian_type, a.city, a.country, p.sex, p.facebook, p.twitter, p.instagram, p.birthday, p.how_found
FROM podestrian AS p
	JOIN podestrian_type AS pt
		ON p.podestrian_type_id = pt.podestrian_type_id
	JOIN address AS a
		ON p.address_id = a.address_id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_all_pods`()
    READS SQL DATA
SELECT p.pod_id, p.pod_name, pt.pod_type, l.location_name
FROM pod as p 
JOIN pod_type as pt ON p.pod_type = pt.pod_type_id
JOIN location as l ON p.location_id = l.location_id
ORDER BY l.location_name, p.pod_type, p.pod_name$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_all_team_members`()
    READS SQL DATA
SELECT t.team_id, p.first_name, p.last_name, t.username, r.role
FROM team_member as t
JOIN podestrian as p ON t.podestrian = p.podestrian_id
JOIN team_member_role as r ON t.role = r.role_id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_all_team_member_roles`()
    READS SQL DATA
SELECT * FROM team_member_role$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_bookings`()
    READS SQL DATA
SELECT 
b.booking_id,
ps.podestrian_id,
pd.pod_id,
CONCAT(ps.firstname,' ',ps.lastname) podestrian,
CONCAT(pd.pod_name,' - ',pt.pod_type) pod,
b.checkin_datetime,
b.checkout_date
FROM
booking b
JOIN podestrian ps ON b.podestrian = ps.podestrian_id
JOIN pod pd ON b.pod - pd.pod_id
JOIN pod_type pt ON pd.pod_type_id = pt.pod_type_id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_pod`(IN `id` INT(11))
    READS SQL DATA
SELECT id, pod_name, pod_type, location_id
FROM pod
WHERE pod_id = id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_team_member`(IN `team_id` INT(11))
    READS SQL DATA
SELECT team_id, t.username, t.role, p.first_name, p.last_name
FROM team_member as t
JOIN podestrian as p ON t.podestrian = p.podestrian_id
WHERE t.team_id = team_id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `update_pod`(IN `id` INT(11), IN `name` VARCHAR(50), IN `type` INT(11))
    MODIFIES SQL DATA
UPDATE pod
SET pod_name = name, pod_type = type
WHERE pod_id = id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `update_team_member`(IN `id` INT(11), IN `role_id` INT(11))
    MODIFIES SQL DATA
UPDATE team_member
SET role = role_id
WHERE team_id = id$$

DELIMITER ;

-- --------------------------------------------------------<commit_msg>fixed sp<commit_after>-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 03, 2015 at 02:09 PM
-- Server version: 5.5.44-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.11

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;

--
-- Database: `sleepover`
--

DELIMITER $$
--
-- Procedures
--
CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `check_login`(IN `username` VARCHAR(100), IN `password` VARCHAR(100))
    READS SQL DATA
SELECT t.team_id as uid, username, p.first_name, p.last_name
FROM podestrian p
JOIN team_member t ON t.podestrian = p.podestrian_id
WHERE t.username = username AND t.password = password$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_all_podestrians`()
    READS SQL DATA
    COMMENT 'gets all podestrians'
SELECT p.podestrian_id, p.pic, p.first_name, p.last_name, p.email, pt.podestrian_type, a.city, a.country, p.sex, p.facebook, p.twitter, p.instagram, p.birthday, p.how_found
FROM podestrian AS p
	JOIN podestrian_type AS pt
		ON p.podestrian_type_id = pt.podestrian_type_id
	JOIN address AS a
		ON p.address_id = a.address_id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_all_pods`()
    READS SQL DATA
SELECT p.pod_id, p.pod_name, pt.pod_type, l.location_name
FROM pod as p 
JOIN pod_type as pt ON p.pod_type = pt.pod_type_id
JOIN location as l ON p.location_id = l.location_id
ORDER BY l.location_name, p.pod_type, p.pod_name$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_all_team_members`()
    READS SQL DATA
SELECT t.team_id, p.first_name, p.last_name, t.username, r.role
FROM team_member as t
JOIN podestrian as p ON t.podestrian = p.podestrian_id
JOIN team_member_role as r ON t.role = r.role_id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_all_team_member_roles`()
    READS SQL DATA
SELECT * FROM team_member_role$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_bookings`()
    READS SQL DATA
SELECT 
b.booking_id,
ps.podestrian_id,
pd.pod_id,
CONCAT(ps.first_name,' ',ps.last_name) podestrian,
CONCAT(pd.pod_name,' - ',pt.pod_type) pod,
b.checkin_datetime,
b.checkout_date
FROM
booking b
JOIN podestrian ps ON b.podestrian = ps.podestrian_id
JOIN pod pd ON b.pod - pd.pod_id
JOIN pod_type pt ON pd.pod_type = pt.pod_type_id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_pod`(IN `id` INT(11))
    READS SQL DATA
SELECT id, pod_name, pod_type, location_id
FROM pod
WHERE pod_id = id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `get_team_member`(IN `team_id` INT(11))
    READS SQL DATA
SELECT team_id, t.username, t.role, p.first_name, p.last_name
FROM team_member as t
JOIN podestrian as p ON t.podestrian = p.podestrian_id
WHERE t.team_id = team_id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `update_pod`(IN `id` INT(11), IN `name` VARCHAR(50), IN `type` INT(11))
    MODIFIES SQL DATA
UPDATE pod
SET pod_name = name, pod_type = type
WHERE pod_id = id$$

CREATE DEFINER=`sleepover`@`localhost` PROCEDURE `update_team_member`(IN `id` INT(11), IN `role_id` INT(11))
    MODIFIES SQL DATA
UPDATE team_member
SET role = role_id
WHERE team_id = id$$

DELIMITER ;

-- --------------------------------------------------------
{'fraction_non_alphanumeric': 0.13479895863465433, 'fraction_numerical': 0.02256291582296789, 'mean_word_length': 4.523162939297125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1621954', 'n_tokens_mistral': 2798, 'n_tokens_neox': 2625, 'n_words': 669}