text stringlengths 6 9.38M |
|---|
create table application_user (
id bigint not null auto_increment,
avatar longblob,
full_name varchar(128),
nick_name varchar(128),
password varchar(128),
user_name varchar(64),
primary key (id)) engine=MyISAM;
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 31-12-2020 a las 03:13:47
-- Versión del servidor: 10.4.10-MariaDB
-- Versión de PHP: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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 */;
--
-- Base de datos: `bd_productos`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `stock`
--
DROP TABLE IF EXISTS `stock`;
CREATE TABLE IF NOT EXISTS `stock` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`producto` varchar(30) COLLATE utf8_spanish_ci NOT NULL,
`precio` int(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `stock`
--
INSERT INTO `stock` (`id`, `producto`, `precio`) VALUES
(22, 'remachadora', 2000),
(21, 'hidrolavadora', 7000),
(19, 'amoladora', 4000),
(17, 'taladro atornillador', 7600),
(28, 'alicate', 1500),
(29, 'algo', 5000);
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 */;
|
SELECT type, date, shift FROM exceptions
WHERE emp_id = $1 |
CREATE TABLE `tbl_likes` (
`like_id` int(11) NOT NULL AUTO_INCREMENT,
`wish_id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`wish_like` int(11) DEFAULT '0',
PRIMARY KEY (`like_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `tbl_user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`user_name` varchar(45) DEFAULT NULL,
`user_username` varchar(45) DEFAULT NULL,
`user_password` varchar(300) DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `tbl_wish` (
`wish_id` int(11) NOT NULL AUTO_INCREMENT,
`wish_title` varchar(45) DEFAULT NULL,
`wish_description` varchar(5000) DEFAULT NULL,
`wish_user_id` int(11) DEFAULT NULL,
`wish_date` datetime DEFAULT NULL,
`wish_file_path` varchar(200) DEFAULT NULL,
`wish_accomplished` int(11) DEFAULT '0',
`wish_private` int(11) DEFAULT '0',
PRIMARY KEY (`wish_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
select
'net.squarelabs.sqorm.model.Customer' as classpath,
hex(c.`CustomerId`) as `CustomerId`,
c.name,
c.version
from `Customer` c
where c.`CustomerId`=unhex(@CustomerId)
;
select
'net.squarelabs.sqorm.model.Order' as classpath,
o.order_id,
hex(o.customer_id) as customer_id,
o.version
from `Customer` c
inner join `Orders` o
on o.customer_id=c.`CustomerId`
where c.`CustomerId`=unhex(@CustomerId)
;
select
'net.squarelabs.sqorm.model.OrderDetails' as classpath,
od.*
from `Customer` c
inner join `Orders` o
on o.customer_id=c.`CustomerId`
inner join `OrderDetails` od
on od.order_id=o.order_id
where c.`CustomerId`=unhex(@CustomerId)
;
|
DROP TABLE IF EXISTS articles;
CREATE TABLE articles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title STRING NOT NULL,
text STRING NOT NULL
);
|
# What's the most expensive listing? What else can you tell me about the listing?
# https://www.screencast.com/t/aBohwJadN
SELECT
*
FROM
listings
WHERE
listings.price = (SELECT MAX(listings.price) FROM listings)
# What neighborhoods seem to be the most popular?
# https://www.screencast.com/t/pmn37pC5XU
SELECT
listings.neighbourhood,
count(*)
FROM
listings
GROUP BY 1
ORDER BY 2 DESC
LIMIT 10
# What time of year is the cheapest time to go to your city? What about the busiest?
# cheapest
# https://www.screencast.com/t/X4EVPYzp4p
SELECT
strftime('%m', DATE(reviews.date)) Month,
AVG(listings.price) avg_listing_price
FROM
listings
JOIN
reviews
ON
listings.id = reviews.listing_id
GROUP BY 1
ORDER BY 2
# Busiest
# https://www.screencast.com/t/xLFdV1CnAAEJ
SELECT
strftime('%m', DATE(reviews.date)) Month,
count(*) number_of_reviews
FROM
reviews
GROUP BY 1
ORDER BY 2 DESC
|
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 02, 2019 at 03:41 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `comfort_mart`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`admin_id` int(11) NOT NULL,
`admin_email` varchar(50) NOT NULL,
`admin_password` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`admin_id`, `admin_email`, `admin_password`) VALUES
(1, 'comfortmart@gmail.com', 'admin123');
-- --------------------------------------------------------
--
-- Table structure for table `brands`
--
CREATE TABLE `brands` (
`brand_id` int(11) NOT NULL,
`brand_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `brands`
--
INSERT INTO `brands` (`brand_id`, `brand_name`) VALUES
(12, 'cocacola'),
(13, 'OREO'),
(14, 'CHOCO'),
(15, 'Pakola'),
(16, 'Tapal tea'),
(17, 'Dayfresh'),
(18, 'Nestle'),
(19, 'Olpers'),
(20, 'Pepsi'),
(22, 'Dayfresh');
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
CREATE TABLE `category` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`parent_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`id`, `name`, `parent_id`) VALUES
(6, 'Breakfast & Dairy', 0),
(7, 'Milk & Milk Products', 6),
(8, 'Breakfast Cereal & Mixes', 6),
(9, 'Bread & Eggs', 6),
(10, 'Butter & Cheese', 6),
(11, 'Jam Jelly Honey & Spreads', 6),
(12, 'Beverages', 0),
(13, 'Soft Drinks', 12),
(14, 'Juices & Concentrates', 12),
(15, 'Tea & Coffee', 12),
(16, 'Health & Energy Drinks', 12),
(17, 'Spring Water', 12),
(18, 'Cans', 13),
(19, 'Pet Bottles', 13),
(20, 'Juices', 14),
(21, 'Concentrates', 14),
(22, 'Squash & Sharbat', 14),
(23, 'Tea', 15),
(24, 'Green Tea', 0),
(25, 'Coffee', 15),
(26, 'Tea Bags & Others', 15),
(27, 'Chocolate Health Drinks', 16),
(28, 'Health Drinks', 16),
(29, 'Energy Drinks', 16),
(30, 'Pharmacy', 0),
(31, 'Frozen Foods', 0),
(32, 'Household Needs', 0),
(33, 'Baby & Kids', 0),
(34, 'Biscuits Snacks & Chocolates', 0),
(35, 'Grocery & Staples', 0),
(36, 'Home & Kitchen', 0),
(37, ' Furnishing & Home Needs', 0),
(38, 'Personal Care', 0),
(39, 'Pet Care', 0),
(40, 'Ice Creams', 0),
(41, 'Antiseptics', 30),
(42, 'Pain Relievers', 30),
(43, 'OTCs', 30),
(44, 'Health Supplements', 30),
(45, 'Hand & Foot Care', 30),
(46, 'Adult Diapers', 30),
(47, 'Noodles', 0),
(48, 'Instant Noodles', 47),
(49, 'Cup Noodles', 47),
(50, 'Vermicelli', 47),
(51, 'Laundry Detergents', 32),
(52, 'Dishwashers', 32),
(53, 'Cleaners', 32),
(54, 'Cleaning Tools & Brushes', 32),
(55, 'Tissues & Disposables', 32),
(56, 'Premium Home Care', 32),
(57, 'Detergent Powders', 51),
(58, 'Liquid Detergents', 51),
(59, 'Detergent Bars', 51),
(60, 'Dishwashing Bars', 52),
(61, 'Dishwashing Gels & Powder', 52),
(62, 'Toilet Cleaners', 53),
(63, 'Floor Cleaners', 53),
(64, 'Brooms & Mops', 54),
(65, 'Cleaning Accessories', 54),
(66, 'Dustbins', 54),
(67, 'Wipers', 54),
(68, 'Fresheners', 32),
(69, 'Kitchen & Dining Disposable Tissues', 55),
(70, 'Toilet & Other Disposable Tissues', 55),
(71, 'Fabric Care', 56),
(72, 'Wipes Cleaners & Others', 56),
(73, 'Shoe Care', 32),
(74, 'Baby Food', 33),
(75, 'Baby Diapers & Wipes', 33),
(76, 'Baby Skin & Hair Care', 33),
(77, 'Baby Accessories & More', 33),
(78, 'Yogurt', 6),
(79, 'Biscuits & Cookies', 34),
(80, 'Namkeen & Snacks', 34),
(81, 'Chips & Crisps', 34),
(82, 'Chocolates & Candies', 34),
(83, 'Atta & Other Flours', 35),
(84, 'Pulses', 35),
(85, 'Rice & Other Grains', 35),
(86, 'Dry Fruits & Nuts', 35),
(87, 'Cooking Oils', 35),
(88, 'Ghee & Banaspati', 35),
(89, 'Spices', 35),
(90, 'Salt & Sugar', 35),
(91, 'Vinegar & Dressings', 35),
(92, 'ronaldo', 0),
(93, 'CR7 Shoes', 92),
(96, 'Messi Collection', 95),
(97, 'Messi', 0);
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE `orders` (
`id` int(55) NOT NULL,
`userId` int(55) DEFAULT NULL,
`productId` varchar(255) DEFAULT NULL,
`productName` varchar(55) DEFAULT NULL,
`quantity` int(55) DEFAULT NULL,
`orderDate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`paymentMethod` varchar(50) DEFAULT NULL,
`orderStatus` varchar(50) DEFAULT NULL,
`user_address` varchar(255) NOT NULL,
`user_number` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `orders`
--
INSERT INTO `orders` (`id`, `userId`, `productId`, `productName`, `quantity`, `orderDate`, `paymentMethod`, `orderStatus`, `user_address`, `user_number`) VALUES
(33, 27, '18', NULL, 5, '2019-11-26 14:11:29', 'COD', 'Delivered', 'gulshan khi', '03363057355');
-- --------------------------------------------------------
--
-- Table structure for table `ordertrackhistory`
--
CREATE TABLE `ordertrackhistory` (
`id` int(11) NOT NULL,
`orderId` int(11) DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`remark` mediumtext NOT NULL,
`postingDate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `ordertrackhistory`
--
INSERT INTO `ordertrackhistory` (`id`, `orderId`, `status`, `remark`, `postingDate`) VALUES
(11, 33, 'in Process', 'will let you know then we deliver your order', '2019-11-25 21:24:05');
-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE `products` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`price` int(50) NOT NULL,
`description` varchar(255) NOT NULL,
`image` text NOT NULL,
`stock` varchar(255) NOT NULL,
`brands_id` int(11) NOT NULL,
`categorys_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `products`
--
INSERT INTO `products` (`id`, `name`, `price`, `description`, `image`, `stock`, `brands_id`, `categorys_id`) VALUES
(12, 'Dayfresh Milk Lactose', 40, 'Dayfresh Milk Lactose\r\n', 'dayfresh40.jpg', 'In Stock', 17, 7),
(14, 'Nestle Milkpak 250ml', 35, 'Nestle Milkpak 250ml', 'nestle milkpack 1ltr.jpg', 'In Stock', 18, 7),
(17, 'Nestle Milkpak Litre Pack', 1549, 'Nestle Milkpak UHT Milk\r\n1 Ltr x 12', 'milkpak.png', 'In Stock', 18, 7),
(18, 'Olpers Milk 1.5 Ltr', 185, 'Olpers Milk 1.5 Ltr', 'olpers1.5lrs.jpg', 'In Stock', 19, 7),
(19, 'Olpers Milk Carton', 1620, 'Olpers Milk Carton\r\n1 Ltr x 12', 'olpercarton1ltr.jpg', 'In Stock', 19, 7),
(20, 'Olpers Milk Carton', 1470, 'Olpers Milk Carton \r\n1.5 Ltr', 'olpercarton1ltr.jpg', 'In Stock', 19, 7),
(21, 'Nestle Milkpak Cream', 120, 'Nestle Milkpak Cream', '8961008212975.jpg', 'In Stock', 18, 7),
(22, 'Pepsi Pet Bottle', 130, 'Pepsi Pet Bottle\r\n2.25 Ltr', 'pepsi.jpg', 'In Stock', 20, 13),
(24, 'Pepsi Diet', 40, 'Pepsi Diet 300ML', 'pepsidiet.jpg', 'In Stock', 20, 18),
(25, 'Pepsi Can', 40, 'Pepsi Can 300ML', 'pepsican.jpg', 'In Stock', 20, 18),
(26, 'ice', 400, 'nice', '21.png', 'In Stock', 20, 18),
(29, 'Apple', 10, 'sweet And fresh', '11.png', 'In Stock', 17, 7),
(30, 'Spirit diet', 40, '500ml', '16.png', 'In Stock', 12, 7),
(31, 'Broccoli', 150, 'per unit', '12.png', 'In Stock', 17, 7);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`phone` int(15) NOT NULL,
`address` varchar(255) NOT NULL,
`password` varchar(50) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `name`, `email`, `phone`, `address`, `password`, `created_at`, `updated_at`) VALUES
(27, 'moid', 'moid@gmail.com', 2147483647, 'gulshan block 3 karachi', 'a38ba7d3409312235f420b8d305f9cf4', '2019-11-17 08:18:28', NULL),
(28, 'sadiq', 'sadiq@gmail.com', 2147483647, 'gulshan block 3 ', '9e57dc68e299b150b37c939ecb4e5a07', '2019-11-23 10:35:17', NULL),
(29, 'sultan', 'sultan@gmail.com', 2147483647, 'abbas town gulshan karachi', '9af82031d374b97c9e73132a413cbdf5', '2019-11-24 15:02:58', NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `brands`
--
ALTER TABLE `brands`
ADD PRIMARY KEY (`brand_id`);
--
-- Indexes for table `category`
--
ALTER TABLE `category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `userId` (`userId`),
ADD UNIQUE KEY `productId` (`productId`),
ADD UNIQUE KEY `productName` (`productName`);
--
-- Indexes for table `ordertrackhistory`
--
ALTER TABLE `ordertrackhistory`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `orderId` (`orderId`),
ADD UNIQUE KEY `status` (`status`);
--
-- Indexes for table `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`),
ADD KEY `categorys_id` (`categorys_id`),
ADD KEY `brands_id` (`brands_id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `brands`
--
ALTER TABLE `brands`
MODIFY `brand_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT for table `category`
--
ALTER TABLE `category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101;
--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
MODIFY `id` int(55) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;
--
-- AUTO_INCREMENT for table `ordertrackhistory`
--
ALTER TABLE `ordertrackhistory`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `products`
--
ALTER TABLE `products`
ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`brands_id`) REFERENCES `brands` (`brand_id`),
ADD CONSTRAINT `products_ibfk_2` FOREIGN KEY (`categorys_id`) REFERENCES `category` (`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 */;
|
SELECT ROUND(SUM([ORDER DETAILS].UnitPrice * [ORDER DETAILS].Quantity),2) AS Total,
Region.RegionDescription FROM Orders
INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
INNER JOIN Employees ON Orders.EmployeeID = Employees.EmployeeID
INNER JOIN EmployeeTerritories ON Employees.EmployeeID = EmployeeTerritories.EmployeeID
INNER JOIN Territories ON EmployeeTerritories.TerritoryID = Territories.TerritoryID
INNER JOIN Region ON Territories.RegionID = Region.RegionID
GROUP BY Region.RegionDescription HAVING SUM([ORDER DETAILS].UnitPrice * [ORDER DETAILS].Quantity) > 1000000 |
/* Formatted on 21/07/2014 18:38:19 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRE0_WEB_DATA_1
(
TODAY_FLG,
FLG_ACTIVE,
ID_DPER,
COD_ABI_ISTITUTO,
COD_ABI_CARTOLARIZZATO,
COD_NDG,
COD_SNDG,
COD_GRUPPO_ECONOMICO,
COD_GRUPPO_LEGAME,
FLG_GRUPPO_ECONOMICO,
FLG_GRUPPO_LEGAME,
FLG_SINGOLO,
FLG_CONDIVISO,
FLG_SOMMA,
FLG_OUTSOURCING,
COD_FILIALE,
COD_STRUTTURA_COMPETENTE,
COD_STATO,
DTA_DECORRENZA_STATO,
DTA_SCADENZA_STATO,
COD_STATO_PRECEDENTE,
DTA_DECORRENZA_STATO_PRE,
DTA_INTERCETTAMENTO,
COD_TIPO_INGRESSO,
COD_CAUSALE_INGRESSO,
COD_PERCORSO,
COD_PROCESSO,
DTA_PROCESSO,
COD_PROCESSO_PRE,
COD_MACROSTATO,
DTA_DEC_MACROSTATO,
COD_RAMO_CALCOLATO,
COD_COMPARTO_CALCOLATO,
COD_COMPARTO_CALCOLATO_PRE,
COD_GRUPPO_SUPER,
COD_GRUPPO_SUPER_OLD,
FLG_RIPORTAFOGLIATO,
DTA_LAST_RIPORTAF,
FLG_PROPOSTO_ASSEGNATO,
DTA_UTENTE_ASSEGNATO,
COD_COMPARTO_ASSEGNATO,
ID_UTENTE,
ID_UTENTE_PRE,
COD_SERVIZIO,
DTA_SERVIZIO,
ID_STATO_POSIZIONE,
COD_CLIENTE_ESTESO,
ID_CLIENTE_ESTESO,
DESC_ANAG_GESTORE_MKT,
COD_GESTORE_MKT,
COD_TIPO_PORTAFOGLIO,
FLG_GESTIONE_ESTERNA,
VAL_PERC_DECURTAZIONE,
COD_COMPARTO_HOST,
ID_TRANSIZIONE,
COD_RAMO_HOST,
COD_MATR_RISCHIO,
COD_UO_RISCHIO,
COD_DISP_RISCHIO,
DTA_INS,
DTA_UPD
)
AS
WITH --
gbav
AS --GB/AV
(SELECT *
FROM (SELECT a.*,
h.cod_comparto_proposto,
ROW_NUMBER ()
OVER (PARTITION BY a.cod_gruppo_super
ORDER BY h.dta_stato)
myrnk
FROM (SELECT cod_abi_cartolarizzato,
cod_ndg,
cod_comparto_proposto,
dta_stato
FROM t_mcre0_app_gb_gestione
WHERE flg_stato = 1
UNION
SELECT cod_abi_cartolarizzato,
cod_ndg,
cod_comparto_av,
dta_stato
FROM t_mcre0_app_av_gestione
WHERE flg_stato = 1) h,
t_mcre0_day_fg_mopl a
WHERE h.cod_abi_cartolarizzato =
a.cod_abi_cartolarizzato
AND h.cod_ndg = a.cod_ndg) h
WHERE h.myrnk = 1),
r
AS --controlli di riportafogliazione
(SELECT a.*,
CASE
WHEN NVL (a.cod_comparto_calcolato, -1) <> '011901'
AND (SELECT w.COD_COMPARTO_CALCOLATO_PRE
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND a.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND a.cod_ndg = w.cod_ndg) = '011901'
THEN
'1'
ELSE
'0'
END
flg_riportafogliato,
CASE
WHEN NVL (a.cod_comparto_calcolato, -1) <> '011901'
AND (SELECT w.COD_COMPARTO_CALCOLATO_PRE
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND a.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND a.cod_ndg = w.cod_ndg) = '011901'
THEN
SYSDATE
ELSE
(SELECT w.dta_last_riportaf
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND a.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND a.cod_ndg = w.cod_ndg)
END
dta_last_riportaf,
CASE
WHEN NVL (a.cod_comparto_calcolato, -1) <> '011901'
AND (SELECT w.COD_COMPARTO_CALCOLATO_PRE
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND a.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND a.cod_ndg = w.cod_ndg) = '011901'
THEN
(SELECT w.id_utente
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND a.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND a.cod_ndg = w.cod_ndg)
ELSE
(SELECT w.id_utente_pre
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND a.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND a.cod_ndg = w.cod_ndg)
END
id_utente_pre,
(SELECT w.cod_comparto_calcolato_pre
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND a.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND a.cod_ndg = w.cod_ndg)
cod_comparto_calcolato_pre
FROM gbav a),
a
AS -- individuo le sole posizioni che mi interessano, quelli con gli stati opportuni
(SELECT TO_CHAR (
NVL (
SUM (v.flg_web)
OVER (PARTITION BY r.cod_gruppo_super),
0))
flg_web,
r.*
FROM r, v_mcre0_posz_web v
WHERE v.cod_abi_cartolarizzato(+) = r.cod_abi_cartolarizzato
AND v.cod_ndg(+) = r.cod_ndg),
n
AS (SELECT a.*,
CASE
WHEN a.flg_riportafogliato = '1' THEN NULL
WHEN a.flg_web = '1' THEN dta_utente_assegnato
ELSE NULL
END
dta_utente_assegnato,
CASE
WHEN a.flg_riportafogliato = '1' THEN NULL
WHEN a.flg_web = '1' THEN cod_comparto_assegnato
ELSE cod_comparto_proposto
END
cod_comparto_assegnato,
CASE
WHEN a.flg_riportafogliato = '1' THEN -1
WHEN a.flg_web = '1' THEN id_utente
ELSE -1
END
id_utente,
TO_CHAR (
CASE
WHEN a.flg_riportafogliato = '1' THEN 0
WHEN a.flg_web = '1' THEN 0
ELSE 1
END)
flg_proposto_assegnato
FROM a,
(SELECT *
FROM ( --recupero la terna (dta_utente_assegnato,cod_comparto_assegnato,id_utente) dai dati dell'applicazione, prendo il record più vecchio e lo spalmo sul GS
SELECT cod_gruppo_super,
dta_utente_assegnato,
cod_comparto_assegnato,
id_utente,
ROW_NUMBER ()
OVER (PARTITION BY cod_gruppo_super
ORDER BY dta_utente_assegnato)
myrnk
FROM t_mcre0_web_data
WHERE flg_active = '1'
AND COD_GRUPPO_SUPER IS NOT NULL) b
WHERE b.myrnk = 1
-- esiste il caso con cod_comparto_assegnato=NULL ma id_utente/dta_utente_assegnato valorizzati, perché si visualizza come cmparto il default (che è il calcolato)
AND ( dta_utente_assegnato IS NOT NULL
OR cod_comparto_assegnato IS NOT NULL
OR id_utente IS NOT NULL)
AND COD_GRUPPO_SUPER IS NOT NULL) b
WHERE a.COD_GRUPPO_SUPER = b.COD_GRUPPO_SUPER(+)),
y
AS (SELECT n.*, -- se COD_COMPARTO_CALCOLATO = '011901' impongo il servizio e data relativi, nota: per costruzione non è un riportafogliato
CASE
WHEN cod_macrostato IN
('PT', 'RIO', 'IN', 'SC', 'RS', 'SO')
THEN
CASE
WHEN n.cod_comparto_calcolato = '011901'
THEN
(SELECT cod_servizio
FROM t_mcre0_app_comparti
WHERE cod_comparto =
NVL (n.cod_comparto_assegnato,
n.cod_comparto_calcolato))
ELSE
(SELECT w.cod_servizio
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND n.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND n.cod_ndg = cod_ndg)
END
ELSE
NULL
END
cod_servizio,
CASE
WHEN cod_macrostato IN
('PT', 'RIO', 'IN', 'SC', 'RS', 'SO')
THEN
CASE
WHEN n.cod_comparto_calcolato = '011901'
THEN
SYSDATE
ELSE
(SELECT CASE
WHEN w.cod_servizio IS NULL
THEN
NULL
ELSE
w.dta_servizio
END
dta_servizio
FROM t_mcre0_web_data w
WHERE w.flg_active = '1'
AND n.cod_abi_cartolarizzato =
w.cod_abi_cartolarizzato
AND n.cod_ndg = cod_ndg)
END
ELSE
NULL
END
dta_servizio
FROM n)
SELECT TODAY_FLG,
'1' flg_active,
ID_DPER,
COD_ABI_ISTITUTO,
COD_ABI_CARTOLARIZZATO,
COD_NDG,
COD_SNDG,
--
COD_GRUPPO_ECONOMICO,
COD_GRUPPO_LEGAME,
FLG_GRUPPO_ECONOMICO,
FLG_GRUPPO_LEGAME,
FLG_SINGOLO,
FLG_CONDIVISO,
FLG_SOMMA,
FLG_OUTSOURCING,
COD_FILIALE,
COD_STRUTTURA_COMPETENTE,
COD_STATO,
DTA_DECORRENZA_STATO,
DTA_SCADENZA_STATO,
COD_STATO_PRECEDENTE,
DTA_DECORRENZA_STATO_PRE,
DTA_INTERCETTAMENTO,
COD_TIPO_INGRESSO,
COD_CAUSALE_INGRESSO,
COD_PERCORSO,
COD_PROCESSO,
DTA_PROCESSO,
COD_PROCESSO_PRE,
COD_MACROSTATO,
DTA_DEC_MACROSTATO,
COD_RAMO_CALCOLATO,
COD_COMPARTO_CALCOLATO,
COD_COMPARTO_CALCOLATO_PRE,
--
COD_GRUPPO_SUPER,
COD_GRUPPO_SUPER_OLD,
--
FLG_RIPORTAFOGLIATO,
DTA_LAST_RIPORTAF,
--
flg_proposto_assegnato,
--
DTA_UTENTE_ASSEGNATO,
COD_COMPARTO_ASSEGNATO,
ID_UTENTE,
ID_UTENTE_PRE,
--
COD_SERVIZIO,
DTA_SERVIZIO,
ID_STATO_POSIZIONE,
COD_CLIENTE_ESTESO,
ID_CLIENTE_ESTESO,
DESC_ANAG_GESTORE_MKT,
COD_GESTORE_MKT,
COD_TIPO_PORTAFOGLIO,
FLG_GESTIONE_ESTERNA,
VAL_PERC_DECURTAZIONE,
COD_COMPARTO_HOST,
ID_TRANSIZIONE,
COD_RAMO_HOST,
COD_MATR_RISCHIO,
COD_UO_RISCHIO,
COD_DISP_RISCHIO,
DTA_INS,
DTA_UPD
FROM y;
|
-- phpMyAdmin SQL Dump
-- version 4.9.5deb2
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : ven. 04 juin 2021 à 15:42
-- Version du serveur : 8.0.25-0ubuntu0.20.04.1
-- Version de PHP : 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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 */;
--
-- Base de données : `csia_car_park`
--
-- --------------------------------------------------------
--
-- Structure de la table `brand`
--
CREATE TABLE `brand` (
`id` int NOT NULL,
`name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `car`
--
CREATE TABLE `car` (
`id` int NOT NULL,
`kilometer` int NOT NULL,
`consumption` float NOT NULL,
`color` varchar(255) NOT NULL,
`isReserved` tinyint(1) NOT NULL,
`releaseDate` date NOT NULL,
`idPlacement` int DEFAULT NULL,
`idMotor` int NOT NULL,
`idModel` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `customer`
--
CREATE TABLE `customer` (
`id` int NOT NULL,
`firstname` varchar(50) NOT NULL,
`lastname` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`phone` varchar(10) NOT NULL,
`gender` varchar(1) NOT NULL,
`address` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `fuel`
--
CREATE TABLE `fuel` (
`id` int NOT NULL,
`label` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `model`
--
CREATE TABLE `model` (
`id` int NOT NULL,
`label` int NOT NULL,
`idBrand` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `motor`
--
CREATE TABLE `motor` (
`id` int NOT NULL,
`name` varchar(255) NOT NULL,
`cylinder` float NOT NULL,
`horsePower` int NOT NULL,
`newtonMeter` int NOT NULL,
`numberCylinder` int NOT NULL,
`idFuel` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `optionCar`
--
CREATE TABLE `optionCar` (
`id` int NOT NULL,
`label` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `optionCarList`
--
CREATE TABLE `optionCarList` (
`id` int NOT NULL,
`idCar` int NOT NULL,
`idOptionCar` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `placement`
--
CREATE TABLE `placement` (
`id` int NOT NULL,
`label` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `seller`
--
CREATE TABLE `seller` (
`id` int NOT NULL,
`lastname` varchar(50) NOT NULL,
`firstname` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
-- --------------------------------------------------------
--
-- Structure de la table `transaction`
--
CREATE TABLE `transaction` (
`id` int NOT NULL,
`sellDate` date DEFAULT NULL,
`idCar` int NOT NULL,
`idSeller` int NOT NULL,
`idCustomer` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `brand`
--
ALTER TABLE `brand`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `car`
--
ALTER TABLE `car`
ADD PRIMARY KEY (`id`),
ADD KEY `idPlacement` (`idPlacement`,`idMotor`,`idModel`),
ADD KEY `idMotor` (`idMotor`),
ADD KEY `idModel` (`idModel`);
--
-- Index pour la table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `fuel`
--
ALTER TABLE `fuel`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `model`
--
ALTER TABLE `model`
ADD PRIMARY KEY (`id`),
ADD KEY `idBrand` (`idBrand`);
--
-- Index pour la table `motor`
--
ALTER TABLE `motor`
ADD PRIMARY KEY (`id`),
ADD KEY `idFuel` (`idFuel`);
--
-- Index pour la table `optionCar`
--
ALTER TABLE `optionCar`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `optionCarList`
--
ALTER TABLE `optionCarList`
ADD PRIMARY KEY (`id`),
ADD KEY `idCar` (`idCar`,`idOptionCar`),
ADD KEY `idOptionCar` (`idOptionCar`);
--
-- Index pour la table `placement`
--
ALTER TABLE `placement`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `seller`
--
ALTER TABLE `seller`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `transaction`
--
ALTER TABLE `transaction`
ADD PRIMARY KEY (`id`),
ADD KEY `idCar` (`idCar`,`idSeller`,`idCustomer`),
ADD KEY `idSeller` (`idSeller`),
ADD KEY `idCustomer` (`idCustomer`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `brand`
--
ALTER TABLE `brand`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `car`
--
ALTER TABLE `car`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `customer`
--
ALTER TABLE `customer`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `fuel`
--
ALTER TABLE `fuel`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `model`
--
ALTER TABLE `model`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `motor`
--
ALTER TABLE `motor`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `optionCar`
--
ALTER TABLE `optionCar`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `optionCarList`
--
ALTER TABLE `optionCarList`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `placement`
--
ALTER TABLE `placement`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `seller`
--
ALTER TABLE `seller`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `transaction`
--
ALTER TABLE `transaction`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `brand`
--
ALTER TABLE `brand`
ADD CONSTRAINT `brand_ibfk_1` FOREIGN KEY (`id`) REFERENCES `model` (`idBrand`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Contraintes pour la table `car`
--
ALTER TABLE `car`
ADD CONSTRAINT `car_ibfk_1` FOREIGN KEY (`idMotor`) REFERENCES `motor` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `car_ibfk_2` FOREIGN KEY (`idModel`) REFERENCES `model` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `car_ibfk_3` FOREIGN KEY (`id`) REFERENCES `transaction` (`idCar`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Contraintes pour la table `motor`
--
ALTER TABLE `motor`
ADD CONSTRAINT `motor_ibfk_1` FOREIGN KEY (`idFuel`) REFERENCES `fuel` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Contraintes pour la table `optionCarList`
--
ALTER TABLE `optionCarList`
ADD CONSTRAINT `optionCarList_ibfk_1` FOREIGN KEY (`idCar`) REFERENCES `car` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `optionCarList_ibfk_2` FOREIGN KEY (`idOptionCar`) REFERENCES `optionCar` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Contraintes pour la table `placement`
--
ALTER TABLE `placement`
ADD CONSTRAINT `placement_ibfk_1` FOREIGN KEY (`id`) REFERENCES `car` (`idPlacement`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Contraintes pour la table `transaction`
--
ALTER TABLE `transaction`
ADD CONSTRAINT `transaction_ibfk_1` FOREIGN KEY (`idSeller`) REFERENCES `seller` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `transaction_ibfk_2` FOREIGN KEY (`idCustomer`) REFERENCES `customer` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
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 */;
|
/*
Navicat Premium Data Transfer
Source Server : piggynote_mysql
Source Server Type : MySQL
Source Server Version : 50148
Source Host : bdm-018.hichina.com
Source Database : bdm0180543_db
Target Server Type : MySQL
Target Server Version : 50148
File Encoding : utf-8
Date: 07/17/2014 15:02:02 PM
*/
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `piggynote_authorised_users`
-- ----------------------------
DROP TABLE IF EXISTS `piggynote_authorised_users`;
CREATE TABLE `piggynote_authorised_users` (
`username` varchar(20) NOT NULL DEFAULT '',
`password` varchar(40) DEFAULT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(100) DEFAULT NULL,
`LastAutoTaskExecuteTime` datetime DEFAULT NULL,
PRIMARY KEY (`id`,`username`)
) ENGINE=MyISAM AUTO_INCREMENT=48 DEFAULT CHARSET=gbk;
SET FOREIGN_KEY_CHECKS = 1;
|
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 20, 2021 at 10:57 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.34
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: `twistcode_query1`
--
-- --------------------------------------------------------
--
-- Table structure for table `detail_transaksis`
--
CREATE TABLE `detail_transaksis` (
`id` bigint(20) UNSIGNED NOT NULL,
`id_transaksi` int(11) NOT NULL,
`harga` int(11) NOT NULL,
`jumlah` int(11) NOT NULL,
`subtotal` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `detail_transaksis`
--
INSERT INTO `detail_transaksis` (`id`, `id_transaksi`, `harga`, `jumlah`, `subtotal`) VALUES
(1, 175226001, 687723522, 514, 725),
(2, 676031080, 727702978, 218, 829),
(3, 119378668, 908519065, 143, 878),
(4, 798463825, 749057440, 159, 313),
(5, 671250422, 420834498, 300, 847),
(6, 630673927, 251416631, 778, 825),
(7, 262156893, 970766438, 507, 231),
(8, 182561223, 445332473, 920, 168),
(9, 652171233, 362354779, 768, 504),
(10, 687885883, 838142606, 320, 140),
(11, 254226981, 349262624, 746, 650),
(12, 396480945, 739807073, 404, 625),
(13, 521915991, 988386710, 658, 796),
(14, 710659310, 696409289, 26, 146),
(15, 414537929, 543128363, 86, 613),
(16, 638981724, 45032994, 674, 70),
(17, 192332387, 846291417, 734, 162),
(18, 52698315, 83483037, 879, 194),
(19, 128033885, 641847498, 804, 92),
(20, 640063895, 817498927, 275, 526),
(21, 370417139, 152008393, 223, 480),
(22, 352070124, 376662494, 459, 143),
(23, 840406677, 168029286, 587, 210),
(24, 36028728, 744171305, 598, 673),
(25, 817332564, 657959057, 717, 401),
(26, 661063664, 631388393, 587, 732),
(27, 481295539, 86286020, 869, 341),
(28, 664531572, 691187966, 127, 595),
(29, 584177758, 215176333, 963, 87),
(30, 808052356, 702492788, 746, 491),
(31, 819899456, 600629036, 280, 702),
(32, 406838964, 576146536, 833, 586),
(33, 398817798, 331701642, 173, 685),
(34, 655623258, 263057260, 875, 965),
(35, 93509181, 707515466, 529, 217),
(36, 818005112, 712069945, 49, 319),
(37, 667854244, 560315863, 464, 948),
(38, 31582421, 966001848, 567, 87),
(39, 206648136, 764662332, 696, 353),
(40, 82802745, 910677824, 846, 455),
(41, 200128525, 8458546, 631, 409),
(42, 330350795, 60582995, 208, 396),
(43, 350610762, 887017983, 941, 655),
(44, 214269746, 559930619, 111, 930),
(45, 566816698, 677477417, 23, 254),
(46, 614619357, 859230354, 450, 496),
(47, 19408588, 830976658, 27, 94),
(48, 578295882, 679122460, 61, 672),
(49, 798438832, 751185433, 92, 664),
(50, 806409396, 412659313, 543, 765);
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2021_07_20_071413_create_transaksis_table', 1),
(5, '2021_07_20_081446_create_detail_transaksis_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `transaksis`
--
CREATE TABLE `transaksis` (
`id` bigint(20) UNSIGNED NOT NULL,
`tanggal_order` date NOT NULL,
`status_pelunasan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`tanggal_pembayaran` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `transaksis`
--
INSERT INTO `transaksis` (`id`, `tanggal_order`, `status_pelunasan`, `tanggal_pembayaran`) VALUES
(1, '2021-01-08', 'Lunas', '2021-04-01'),
(2, '2021-06-06', 'Lunas', '2021-04-03'),
(3, '2021-07-17', 'Lunas', '2021-05-17'),
(4, '2021-02-07', 'Pending', '2021-05-19'),
(5, '2021-01-28', 'Lunas', '2021-04-28'),
(6, '2021-03-01', 'Lunas', '2021-04-04'),
(7, '2021-07-02', 'Lunas', '2021-02-26'),
(8, '2021-05-19', 'Lunas', '2021-06-22'),
(9, '2021-05-04', 'Lunas', '2021-06-29'),
(10, '2021-04-21', 'Pending', '2021-07-07'),
(11, '2021-01-04', 'Lunas', '2021-01-08'),
(12, '2021-06-04', 'Lunas', '2021-04-09'),
(13, '2021-06-25', 'Lunas', '2021-04-21'),
(14, '2021-01-21', 'Pending', '2021-05-02'),
(15, '2021-02-07', 'Lunas', '2021-01-05'),
(16, '2021-07-05', 'Pending', '2021-05-07'),
(17, '2021-02-22', 'Lunas', '2021-05-25'),
(18, '2021-02-03', 'Pending', '2021-01-13'),
(19, '2021-02-05', 'Lunas', '2021-06-13'),
(20, '2021-03-11', 'Pending', '2021-01-19'),
(21, '2021-06-07', 'Lunas', '2021-04-11'),
(22, '2021-02-10', 'Lunas', '2021-05-03'),
(23, '2021-06-25', 'Lunas', '2021-03-20'),
(24, '2021-04-28', 'Lunas', '2021-05-24'),
(25, '2021-01-01', 'Lunas', '2021-03-25'),
(26, '2021-06-08', 'Pending', '2021-06-09'),
(27, '2021-05-29', 'Lunas', '2021-07-17'),
(28, '2021-04-21', 'Pending', '2021-06-07'),
(29, '2021-03-31', 'Lunas', '2021-03-03'),
(30, '2021-03-09', 'Lunas', '2021-05-15'),
(31, '2021-06-21', 'Lunas', '2021-04-26'),
(32, '2021-05-20', 'Pending', '2021-03-07'),
(33, '2021-02-03', 'Lunas', '2021-01-23'),
(34, '2021-03-05', 'Pending', '2021-04-04'),
(35, '2021-02-16', 'Lunas', '2021-06-26'),
(36, '2021-05-26', 'Pending', '2021-05-16'),
(37, '2021-04-19', 'Lunas', '2021-05-08'),
(38, '2021-05-07', 'Pending', '2021-07-08'),
(39, '2021-04-19', 'Lunas', '2021-03-28'),
(40, '2021-03-15', 'Lunas', '2021-03-13'),
(41, '2021-03-30', 'Lunas', '2021-05-30'),
(42, '2021-07-16', 'Lunas', '2021-06-30'),
(43, '2021-02-05', 'Lunas', '2021-05-17'),
(44, '2021-06-27', 'Lunas', '2021-04-28'),
(45, '2021-05-27', 'Lunas', '2021-05-20'),
(46, '2021-07-16', 'Pending', '2021-06-08'),
(47, '2021-02-22', 'Lunas', '2021-01-09'),
(48, '2021-06-14', 'Pending', '2021-01-03'),
(49, '2021-01-17', 'Lunas', '2021-02-26'),
(50, '2021-05-23', 'Lunas', '2021-04-26');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `detail_transaksis`
--
ALTER TABLE `detail_transaksis`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `transaksis`
--
ALTER TABLE `transaksis`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `detail_transaksis`
--
ALTER TABLE `detail_transaksis`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `transaksis`
--
ALTER TABLE `transaksis`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
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 */;
|
DROP TABLE IF EXISTS `#__actions`;
DROP TABLE IF EXISTS `#__painters`;
DROP TABLE IF EXISTS `#__exhibitions`;
DROP TABLE IF EXISTS `#__annexes`; |
-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: ssddb.ck6ywww2iqip.sa-east-1.rds.amazonaws.com Database: DataWarehouse
-- ------------------------------------------------------
-- Server version 5.7.23-log
/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;
SET @@SESSION.SQL_LOG_BIN= 0;
--
-- GTID state at the beginning of the backup
--
SET @@GLOBAL.GTID_PURGED='';
--
-- Dumping data for table `dim_pais`
--
LOCK TABLES `dim_pais` WRITE;
/*!40000 ALTER TABLE `dim_pais` DISABLE KEYS */;
INSERT INTO `dim_pais` VALUES (1,'Alemania'),(2,'Argentina'),(3,'Australia'),(4,'Austria'),(5,'Bélgica'),(6,'Brasil'),(7,'Canadá'),(8,'Dinamarca'),(9,'España'),(10,'Estados Unidos'),(11,'Finlandia'),(12,'Francia'),(13,'Holanda'),(14,'Irlanda'),(15,'Italia'),(16,'Japón'),(17,'México'),(18,'Noruega'),(19,'Polonia'),(20,'Portugal'),(21,'Reino Unido'),(22,'Singapur'),(23,'Suecia'),(24,'Suiza'),(25,'Venezuela');
/*!40000 ALTER TABLE `dim_pais` ENABLE KEYS */;
UNLOCK TABLES;
SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-11-13 21:33:51
|
/*
* Weekly report for the year of the count of some column for PostgreSQL
* Replace `date_added` with column name, `ratings` with table name
* and `2015` with the year you want the report for
*/
SELECT extract(week FROM date_added) :: bigint AS week, count(*)
FROM ratings
WHERE extract(YEAR FROM date_added) = '2016'
GROUP BY extract(week FROM date_added)
ORDER BY week |
delete from "UserType";
/* Data for the 'public.UserType' table (Records 1 - 5) */
INSERT INTO public."UserType" ("UserTypeID", "Name", "Description", "IsActive", "IsDeleted", "IsGlobal", "IsPrincipal", "IsSecondary")
VALUES (E'9e8ca436-2139-11e4-a37d-8771a20de3d2', E'User', E'User', True, False, True, True, True);
INSERT INTO public."UserType" ("UserTypeID", "Name", "Description", "IsActive", "IsDeleted", "IsGlobal", "IsPrincipal", "IsSecondary")
VALUES (E'9e8d195c-2139-11e4-a4cd-2b35a008ab65', E'Administrator', E'Administrator', True, False, True, True, False);
INSERT INTO public."UserType" ("UserTypeID", "Name", "Description", "IsActive", "IsDeleted", "IsGlobal", "IsPrincipal", "IsSecondary")
VALUES (E'9e8d4076-2139-11e4-8474-3ff6242f5224', E'Compliance Officer', E'Compliance Officer', True, False, True, True, False);
INSERT INTO public."UserType" ("UserTypeID", "Name", "Description", "IsActive", "IsDeleted", "IsGlobal", "IsPrincipal", "IsSecondary")
VALUES (E'9e8d6786-2139-11e4-9216-972bcf724500', E'Temporary', E'Temporary User', True, False, True, True, False);
INSERT INTO public."UserType" ("UserTypeID", "Name", "Description", "IsActive", "IsDeleted", "IsGlobal", "IsPrincipal", "IsSecondary")
VALUES (E'ff3a49be-3ce1-11e4-be94-a761c0833a3a', E'Branch Administrator', E'Branch Administrator', True, False, True, True, True);
INSERT INTO public."UserType" ("UserTypeID", "Name", "Description", "IsActive", "IsDeleted", "IsGlobal", "IsPrincipal", "IsSecondary")
VALUES (E'6d42f49e-59e1-11e4-91a3-bf83562fceb7', E'Financial Controller (COFER)', E'Financial Controller (COFER)', True, False, True, True, True); |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Client : localhost:3306
-- Généré le : Ven 07 Décembre 2018 à 16:01
-- Version du serveur : 5.7.24-0ubuntu0.18.04.1
-- Version de PHP : 7.2.10-0ubuntu0.18.04.1
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 utf8mb4 */;
--
-- Base de données : `Meme_R`
--
-- --------------------------------------------------------
--
-- Structure de la table `images_brutes`
--
CREATE TABLE `images_brutes` (
`ID_imgbrutes` int(11) NOT NULL,
`Url_imgbrutes` varchar(1000) DEFAULT NULL,
`nom_imgbrutes` varchar(255) DEFAULT NULL,
`chemin_img` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Contenu de la table `images_brutes`
--
INSERT INTO `images_brutes` (`ID_imgbrutes`, `Url_imgbrutes`, `nom_imgbrutes`, `chemin_img`) VALUES
(1, 'https://ophelied.promo-24.codeur.online/images/bigbigfaill.jpg', 'photo26.jpg', 'Images/photo26.jpg'),
(2, 'https://ophelied.promo-24.codeur.online/images/bigfall.jpg', 'photo27.jpg', 'Images/photo27.jpg'),
(3, 'https://ophelied.promo-24.codeur.online/images/cat.jpg', 'photo28.jpg', 'Images/photo28.jpg'),
(4, 'https://ophelied.promo-24.codeur.online/images/cat2.jpg', 'photo29.jpg', 'Images/photo29.jpg'),
(5, 'https://ophelied.promo-24.codeur.online/images/coffee.jpg', 'photo30.jpg', 'Images/photo30.jpg'),
(6, 'https://ophelied.promo-24.codeur.online/images/coworker.jpg', 'photo31.jpg', 'Images/photo31.jpg'),
(7, 'https://ophelied.promo-24.codeur.online/images/dog.jpg', 'photo32.jpg', 'Images/photo32.jpg'),
(8, 'https://ophelied.promo-24.codeur.online/images/fall.jpg', 'photo33.jpg', 'Images/photo33.jpg'),
(9, 'https://ophelied.promo-24.codeur.online/images/man.jpg', 'photo34.jpg', 'Images/photo34.jpg'),
(10, 'https://ophelied.promo-24.codeur.online/images/mug.jpg', 'photo35.jpg', 'Images/photo35.jpg'),
(11, 'https://ophelied.promo-24.codeur.online/images/people.jpg', 'photo36.jpg', 'Images/photo36.jpg'),
(12, 'https://ophelied.promo-24.codeur.online/images/scary.jpg', 'photo37.jpg', 'Images/photo37.jpg'),
(13, 'https://ophelied.promo-24.codeur.online/images/sheet.jpg', 'photo38.jpg', 'Images/photo38.jpg'),
(14, 'https://ophelied.promo-24.codeur.online/images/smatch.jpg', 'photo39.jpg', 'Images/photo39.jpg'),
(15, 'https://ophelied.promo-24.codeur.online/images/toy.jpg', 'photo40.jpg', 'Images/photo40.jpg'),
(16, 'https://ophelied.promo-24.codeur.online/images/volontaries.jpg', 'photo41.jpg', 'Images/photo41.jpg'),
(17, 'https://ophelied.promo-24.codeur.online/images/weird.jpg', 'photo43.jpg', 'Images/photo43.jpg'),
(18, 'https://ophelied.promo-24.codeur.online/images/worker.jpg', 'photo42.jpg', 'Images/photo42.jpg'),
(19, 'https://ophelied.promo-24.codeur.online/images/1.jpg', 'photo43.jpg', 'Images/photo43.jpg'),
(20, 'https://ophelied.promo-24.codeur.online/images/2.jpg', 'photo44.jpg', 'Images/photo44.jpg'),
(21, 'https://ophelied.promo-24.codeur.online/images/3.jpg', 'photo45.jpg', 'Images/photo45.jpg'),
(22, 'https://ophelied.promo-24.codeur.online/images/4.jpg', 'photo47.jpg', 'Images/photo47.jpg'),
(23, 'https://ophelied.promo-24.codeur.online/images/5.jpg', 'photo46.jpg', 'Images/photo46.jpg'),
(24, 'https://ophelied.promo-24.codeur.online/images/6.jpg', 'photo48.jpg', 'Images/photo48.jpg'),
(25, 'https://ophelied.promo-24.codeur.online/images/7.jpg', 'photo49.jpg', 'Images/photo49.jpg'),
(28, 'https://ophelied.promo-24.codeur.online/images/8.jpg', 'photo8.jpg', 'Images/photo8.jpg'),
(29, 'https://ophelied.promo-24.codeur.online/images/9.jpg', 'photo9.jpg', 'Images/photo9.jpg'),
(30, 'https://ophelied.promo-24.codeur.online/images/10.jpg', 'photo10.jpg', 'Images/photo10.jpg'),
(31, 'https://ophelied.promo-24.codeur.online/images/11.jpg', 'photo11.jpg', 'Images/photo11.jpg'),
(32, 'https://ophelied.promo-24.codeur.online/images/12.jpg', 'photo12.jpg', 'Images/photo12.jpg'),
(33, 'https://ophelied.promo-24.codeur.online/images/15.jpg', 'photo15.jpg', 'Images/photo15.jpg'),
(34, 'https://ophelied.promo-24.codeur.online/images/16.jpg', 'photo16.jpg', 'Images/photo16.jpg'),
(35, 'https://ophelied.promo-24.codeur.online/images/17.jpg', 'photo17.jpg', 'Image/photo17.jpg'),
(36, 'https://ophelied.promo-24.codeur.online/images/18.jpg', 'photo18.jpg', 'Images/photo18.jpg'),
(37, 'https://ophelied.promo-24.codeur.online/images/19.jpg', 'photo19.jpg', 'Images/photo19.jpg'),
(38, 'https://ophelied.promo-24.codeur.online/images/20.jpg', 'photo20.jpg', 'Images/photo20.jpg'),
(39, 'https://ophelied.promo-24.codeur.online/images/21.jpg', 'photo21.jpg', 'Images/photo21.jpg'),
(40, 'https://ophelied.promo-24.codeur.online/images/22.jpg', 'photo22.jpg', 'Images/photo22.jpg'),
(41, 'https://ophelied.promo-24.codeur.online/images/23.jpg', 'photo23.jpg', 'Images/photo23.jpg'),
(42, 'https://ophelied.promo-24.codeur.online/images/24.jpg', 'photo24.jpg', 'Images/photo24.jpg'),
(43, 'https://ophelied.promo-24.codeur.online/images/25.jpg', 'photo25.jpg', 'Images/photo25.jpg');
-- --------------------------------------------------------
--
-- Structure de la table `memes`
--
CREATE TABLE `memes` (
`Id_memes` int(11) NOT NULL,
`url_memes` varchar(1000) DEFAULT NULL,
`titre` varchar(255) DEFAULT NULL,
`cheminlocal` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Index pour les tables exportées
--
--
-- Index pour la table `images_brutes`
--
ALTER TABLE `images_brutes`
ADD PRIMARY KEY (`ID_imgbrutes`);
--
-- Index pour la table `memes`
--
ALTER TABLE `memes`
ADD PRIMARY KEY (`Id_memes`);
--
-- AUTO_INCREMENT pour les tables exportées
--
--
-- AUTO_INCREMENT pour la table `images_brutes`
--
ALTER TABLE `images_brutes`
MODIFY `ID_imgbrutes` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;
--
-- AUTO_INCREMENT pour la table `memes`
--
ALTER TABLE `memes`
MODIFY `Id_memes` int(11) NOT NULL AUTO_INCREMENT;
/*!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 */;
|
create database msis;
USE msis;
DROP TABLE IF EXISTS Comments;
CREATE TABLE Comments (
id int PRIMARY KEY AUTO_INCREMENT,
commentText text not NULL
);
INSERT INTO Comments (commentText) VALUES
("I have something important to say"),
("I have no idea what is going on"),
("D&S is hard");
select * from Comments;
|
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Gegenereerd op: 13 jan 2017 om 20:36
-- Serverversie: 5.6.17
-- PHP-versie: 5.6.12
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 utf8mb4 */;
--
-- Database: `webdevperiod2`
--
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `categories`
--
CREATE TABLE IF NOT EXISTS `categories` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`pluralName` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`whitePhoto` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`colorPhoto` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `categories`
--
INSERT INTO `categories` (`id`, `name`, `pluralName`, `whitePhoto`, `colorPhoto`, `url`, `created_at`, `updated_at`) VALUES
(1, 'Dog', 'Dogs', 'white_dog.png', 'dog.png', 'dog', NULL, NULL),
(2, 'Cat', 'Cats', 'white_cat.png', 'cat.png', 'cat', NULL, NULL),
(3, 'Bird', 'Birds', 'white_bird.png', 'bird.png', 'bird', NULL, NULL),
(4, 'Fish', 'Fish', 'white_fish.png', 'fish.png', 'fish', NULL, NULL),
(5, 'Small animals', 'Small animals', 'white_hamster.png', 'hamster.png', 'smallanimals', NULL, NULL),
(6, 'Other', 'Other', 'other.png', 'other.png', 'other', NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `colors`
--
CREATE TABLE IF NOT EXISTS `colors` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`hexa` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `colors`
--
INSERT INTO `colors` (`id`, `name`, `hexa`, `created_at`, `updated_at`) VALUES
(1, 'red', '#FF0000', NULL, NULL),
(2, 'green', '#008000', NULL, NULL),
(3, 'blue', '#0000FF', NULL, NULL),
(4, 'orange', '#FFA500', NULL, NULL),
(5, 'black', '#000000', NULL, NULL),
(6, 'white', '#FFFFFF', NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `color_product`
--
CREATE TABLE IF NOT EXISTS `color_product` (
`id` int(10) unsigned NOT NULL,
`product_id` int(11) NOT NULL,
`color_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `color_product`
--
INSERT INTO `color_product` (`id`, `product_id`, `color_id`, `created_at`, `updated_at`) VALUES
(1, 1, 4, NULL, NULL),
(2, 1, 5, NULL, NULL),
(3, 1, 6, NULL, NULL),
(4, 2, 1, NULL, NULL),
(5, 2, 2, NULL, NULL),
(6, 2, 6, NULL, NULL),
(7, 3, 3, NULL, NULL),
(8, 5, 2, NULL, NULL),
(9, 5, 4, NULL, NULL),
(10, 4, 2, NULL, NULL),
(11, 4, 3, NULL, NULL),
(12, 4, 5, NULL, NULL),
(13, 6, 1, NULL, NULL),
(14, 6, 6, NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `faqs`
--
CREATE TABLE IF NOT EXISTS `faqs` (
`id` int(10) unsigned NOT NULL,
`question` text COLLATE utf8_unicode_ci NOT NULL,
`answer` text COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `faqs`
--
INSERT INTO `faqs` (`id`, `question`, `answer`, `created_at`, `updated_at`) VALUES
(1, 'Dit is een vraag 1', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', NULL, NULL),
(2, 'Dit is een vraag 2', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', NULL, NULL),
(3, 'Dit is een vraag 3', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', NULL, NULL),
(4, 'Dit is een vraag 4', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', NULL, NULL),
(5, 'Dit is een vraag 5', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', NULL, NULL),
(6, 'Dit is een vraag 6', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', NULL, NULL),
(7, 'Dit is een vraag 7', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `faq_product`
--
CREATE TABLE IF NOT EXISTS `faq_product` (
`id` int(10) unsigned NOT NULL,
`faq_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `faq_product`
--
INSERT INTO `faq_product` (`id`, `faq_id`, `product_id`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NULL, NULL),
(2, 1, 3, NULL, NULL),
(3, 2, 1, NULL, NULL),
(4, 2, 5, NULL, NULL),
(5, 3, 2, NULL, NULL),
(6, 4, 3, NULL, NULL),
(7, 5, 4, NULL, NULL),
(8, 5, 1, NULL, NULL),
(9, 6, 5, NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `hot_items`
--
CREATE TABLE IF NOT EXISTS `hot_items` (
`id` int(10) unsigned NOT NULL,
`product_id` int(11) NOT NULL,
`place` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `hot_items`
--
INSERT INTO `hot_items` (`id`, `product_id`, `place`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NULL, NULL),
(2, 2, 2, NULL, NULL),
(3, 3, 3, NULL, NULL),
(4, 5, 4, NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `migrations`
--
CREATE TABLE IF NOT EXISTS `migrations` (
`id` int(10) unsigned NOT NULL,
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=536 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(524, '2014_10_12_000000_create_users_table', 1),
(525, '2014_10_12_100000_create_password_resets_table', 1),
(526, '2016_12_14_140150_create_categories_table', 1),
(527, '2016_12_20_215807_create_subscribers_table', 1),
(528, '2016_12_21_231824_create_faqs_table', 1),
(529, '2016_12_21_231848_create_products_table', 1),
(530, '2016_12_25_162120_create_hot_items_table', 1),
(531, '2016_12_26_173838_create_tags_table', 1),
(532, '2016_12_26_211443_create_faqs_products_table', 1),
(533, '2016_12_27_141730_create_photos_table', 1),
(534, '2017_01_11_171035_create_colors_table', 1),
(535, '2017_01_11_171643_create_colors_products_table', 1);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `password_resets`
--
CREATE TABLE IF NOT EXISTS `password_resets` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `photos`
--
CREATE TABLE IF NOT EXISTS `photos` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`product_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `photos`
--
INSERT INTO `photos` (`id`, `name`, `product_id`, `created_at`, `updated_at`) VALUES
(1, 'article1.jpg', 1, NULL, NULL),
(2, 'article2.png', 2, NULL, NULL),
(3, 'article3.1.jpg', 3, NULL, NULL),
(4, 'article3.2.jpg', 3, NULL, NULL),
(5, 'article4.1.jpg', 4, NULL, NULL),
(6, 'article4.2.jpg', 4, NULL, NULL),
(7, 'article5.1.jpg', 5, NULL, NULL),
(8, 'article5.2.jpg', 5, NULL, NULL),
(9, 'article6.jpg', 6, NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `products`
--
CREATE TABLE IF NOT EXISTS `products` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`price` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci NOT NULL,
`technicalText` text COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`category_id` int(11) NOT NULL,
`tag_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `products`
--
INSERT INTO `products` (`id`, `name`, `price`, `description`, `technicalText`, `url`, `category_id`, `tag_id`, `created_at`, `updated_at`) VALUES
(1, 'Vogelkooi', '19.99', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Vogelkooi', 3, 3, NULL, NULL),
(2, 'Cooling mat', '14.99', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Cooling-mat', 1, 2, NULL, NULL),
(3, 'Voerbak hond', '9.99', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Voerbak-hond', 1, 5, NULL, NULL),
(4, 'Voerbak kat', '9.99', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Voerbak-kat', 2, 5, NULL, NULL),
(5, 'Halsband', '14.99', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Halsband', 1, 3, NULL, NULL),
(6, 'Aquarium', '24.99', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Aquarium', 4, 1, NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `subscribers`
--
CREATE TABLE IF NOT EXISTS `subscribers` (
`id` int(10) unsigned NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `tags`
--
CREATE TABLE IF NOT EXISTS `tags` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`displayName` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `tags`
--
INSERT INTO `tags` (`id`, `name`, `displayName`, `created_at`, `updated_at`) VALUES
(1, 'splashnfun', 'Splash ''n Fun', NULL, NULL),
(2, 'luxury', 'Luxury', NULL, NULL),
(3, 'new', 'New', NULL, NULL),
(4, 'onsale', 'On Sale', NULL, NULL),
(5, 'other', 'Other', NULL, NULL);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`admin` tinyint(1) NOT NULL,
`remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Gegevens worden geëxporteerd voor tabel `users`
--
INSERT INTO `users` (`id`, `name`, `password`, `admin`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'admin', '$2y$10$inm61gb0Rc0A648rhSDc6eza4RhuylWDB0HKgWej3Inze6baJJbr.', 1, NULL, NULL, NULL);
--
-- Indexen voor geëxporteerde tabellen
--
--
-- Indexen voor tabel `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `colors`
--
ALTER TABLE `colors`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `color_product`
--
ALTER TABLE `color_product`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `faqs`
--
ALTER TABLE `faqs`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `faq_product`
--
ALTER TABLE `faq_product`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `hot_items`
--
ALTER TABLE `hot_items`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`),
ADD KEY `password_resets_token_index` (`token`);
--
-- Indexen voor tabel `photos`
--
ALTER TABLE `photos`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `subscribers`
--
ALTER TABLE `subscribers`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `subscribers_email_unique` (`email`);
--
-- Indexen voor tabel `tags`
--
ALTER TABLE `tags`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT voor geëxporteerde tabellen
--
--
-- AUTO_INCREMENT voor een tabel `categories`
--
ALTER TABLE `categories`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT voor een tabel `colors`
--
ALTER TABLE `colors`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT voor een tabel `color_product`
--
ALTER TABLE `color_product`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT voor een tabel `faqs`
--
ALTER TABLE `faqs`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT voor een tabel `faq_product`
--
ALTER TABLE `faq_product`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT voor een tabel `hot_items`
--
ALTER TABLE `hot_items`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT voor een tabel `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=536;
--
-- AUTO_INCREMENT voor een tabel `photos`
--
ALTER TABLE `photos`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT voor een tabel `products`
--
ALTER TABLE `products`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT voor een tabel `subscribers`
--
ALTER TABLE `subscribers`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT voor een tabel `tags`
--
ALTER TABLE `tags`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT voor een tabel `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
/*!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 */;
|
SELECT country,count(*)
FROM customer c, address a,city cty,country ct
WHERE c.address_id = a.address_id AND
a.city_id = cty.city_id AND
cty.country_id = ct.country_id
GROUP BY country
HAVING count(*) > 10 AND count(*) < 20
ORDER BY count(*) DESC; |
/*
Created: 05.03.2016
Modified: 22.05.2016
Model: PostgreSQL 9.2
Database: PostgreSQL 9.2
*/
-- Create tables section -------------------------------------------------
-- Table poll
CREATE TABLE "poll"(
"id" BigSerial NOT NULL,
"name" Varchar NOT NULL,
"description" Varchar,
"istest" Boolean DEFAULT true NOT NULL
)
;
-- Add keys for table poll
ALTER TABLE "poll" ADD CONSTRAINT "pk_poll_id" PRIMARY KEY ("id")
;
ALTER TABLE "poll" ADD CONSTRAINT "poll_id" UNIQUE ("id")
;
-- Table respondent
CREATE TABLE "respondent"(
"id" BigSerial NOT NULL,
"name" Varchar NOT NULL,
"ipaddress" Varchar NOT NULL
)
;
-- Add keys for table respondent
ALTER TABLE "respondent" ADD CONSTRAINT "pk_respondent_id" PRIMARY KEY ("id")
;
ALTER TABLE "respondent" ADD CONSTRAINT "respondent_id" UNIQUE ("id")
;
-- Table poll_respondent
CREATE TABLE "poll_respondent"(
"pollid" Bigint NOT NULL,
"respondentid" Bigint NOT NULL
)
;
-- Add keys for table poll_respondent
ALTER TABLE "poll_respondent" ADD CONSTRAINT "pk_poll_respondent" PRIMARY KEY ("pollid","respondentid")
;
-- Table question
CREATE TABLE "question"(
"id" BigSerial NOT NULL,
"name" Varchar NOT NULL,
"pollid" Bigint,
"ismultioptional" Boolean DEFAULT false NOT NULL
)
;
-- Create indexes for table question
CREATE INDEX "IX_Relationship4" ON "question" ("pollid")
;
-- Add keys for table question
ALTER TABLE "question" ADD CONSTRAINT "pk_question_id" PRIMARY KEY ("id")
;
ALTER TABLE "question" ADD CONSTRAINT "id" UNIQUE ("id")
;
-- Table option
CREATE TABLE "option"(
"id" BigSerial NOT NULL,
"content" Varchar NOT NULL,
"isright" Boolean DEFAULT false NOT NULL,
"questionid" Bigint
)
;
-- Create indexes for table option
CREATE INDEX "IX_Relationship5" ON "option" ("questionid")
;
-- Add keys for table option
ALTER TABLE "option" ADD CONSTRAINT "pk_option_id" PRIMARY KEY ("id")
;
ALTER TABLE "option" ADD CONSTRAINT "option_id" UNIQUE ("id")
;
-- Table respondent_option
CREATE TABLE "respondent_option"(
"respondentid" Bigint NOT NULL,
"optionid" Bigint NOT NULL
)
;
-- Add keys for table respondent_option
ALTER TABLE "respondent_option" ADD CONSTRAINT "pk_respondent_option" PRIMARY KEY ("respondentid","optionid")
;
-- Create relationships section -------------------------------------------------
ALTER TABLE "poll_respondent" ADD CONSTRAINT "fk_poll_respondent" FOREIGN KEY ("pollid") REFERENCES "poll" ("id") ON DELETE CASCADE ON UPDATE CASCADE
;
ALTER TABLE "poll_respondent" ADD CONSTRAINT "fk_respondent_poll" FOREIGN KEY ("respondentid") REFERENCES "respondent" ("id") ON DELETE CASCADE ON UPDATE CASCADE
;
ALTER TABLE "question" ADD CONSTRAINT "fk_poll_question" FOREIGN KEY ("pollid") REFERENCES "poll" ("id") ON DELETE CASCADE ON UPDATE CASCADE
;
ALTER TABLE "option" ADD CONSTRAINT "fk_question_option" FOREIGN KEY ("questionid") REFERENCES "question" ("id") ON DELETE CASCADE ON UPDATE CASCADE
;
ALTER TABLE "respondent_option" ADD CONSTRAINT "fk_respondent_option" FOREIGN KEY ("respondentid") REFERENCES "respondent" ("id") ON DELETE CASCADE ON UPDATE CASCADE
;
ALTER TABLE "respondent_option" ADD CONSTRAINT "fk_option_respondent" FOREIGN KEY ("optionid") REFERENCES "option" ("id") ON DELETE CASCADE ON UPDATE CASCADE
; |
-- t_face_server_dep
DROP TABLE IF EXISTS t_face_server_dep;
CREATE TABLE t_face_server_dep
(
id bigint NOT NULL AUTO_INCREMENT,
server_id bigint NOT NULL COMMENT '服务器id',
department_id char(36) NOT NULL COMMENT '部门id',
add_time timestamp NOT NULL default CURRENT_TIMESTAMP,
update_time timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT pk_t_face_server_dep PRIMARY KEY (id),
CONSTRAINT uk_t_face_server_dep UNIQUE (server_id, department_id),
CONSTRAINT fk_t_face_server_dep_server_id FOREIGN KEY (server_id)
REFERENCES t_face_server (id)
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT fk_t_face_server_dep_department_id FOREIGN KEY (department_id)
REFERENCES t_department (id)
ON UPDATE CASCADE ON DELETE CASCADE
)COMMENT= '人脸服务器小区表'; |
create table user (
id int auto_increment,
password varchar(50),
email varchar(50),
creation datetime,
active bit ,
wronglogin int ,
constraint PK_user
primary key (id)
);
create table place (
id int auto_increment,
creation datetime,
code varchar(250),
estateagency varchar(250),
description varchar(250),
address varchar(250),
value int,
acceptpets bit,
acceptkids bit,
hasbackyard bit,
backyardapart bit,
lightapart bit,
waterapart bit,
discarded bit not null,
user_id int not null,
constraint PK_place
primary key (id),
constraint FK_place_user
foreign key (user_id)
references user (id);
);
|
insert into usr(username, password, active, name, surname, avatar, email)
values('admin', 'admin', true, 'Тома', 'Рокмин', 'defaultAvatar.jpg', 'tomarokmin@yandex.ru');
insert into user_role (user_id, roles)
values (1, 'USER'), (1, 'ADMIN'); |
drop table Users
create sequence pp
start with 1
increment by 1
delete from SETUP where type='Standard'
select * from SETUP
update SETUP set type = 'Standard' where type ='Standard';
select * from inventory
update USERS s set s.U_TYPE = 'Admin'
select * from INVENTORY;
insert into INVENTORY values (44,'HD',1017,10009,31,21,'assignedtoretailer',17);
insert into INVENTORY values (45,'HD+',1018,10010,32,22,'assignedtoretailer',18);
insert into INVENTORY values (46,'Standard',1011,10003,25,15,'assignedtoretailer',17);
insert into INVENTORY values (47,'IPTV',1012,10004,26,16,'assignedtoretailer',18);
insert into INVENTORY values (48,'HD+',1013,10005,27,17,'assignedtoretailer',17);
insert into INVENTORY values (49,'IPTV',1014,10006,28,18,'assignedtoretailer',18);
insert into INVENTORY values (50,'HD',1015,10007,29,19,'assignedtoretailer',17);
insert into INVENTORY values (51,'HD',1016,10008,30,20,'assignedtoretailer',18);
delete from INVENTORY where retailerid = 3;
delete from SETUP where SETUPID > 8
update INVENTORY set status='assignedtoretailer'
select * from retailer;
select * from users;
update users s set s.password='excellence' where s.U_ID = 29
insert into users values(41,'Customer','manoj143');
insert into users values(42,'Customer','tcs123');
insert into users values(44,'Customer','raji12')
insert into users values(43,'Customer','hari123')
insert into users values(45,'Customer','lokesh123')
insert into users values(46,'Customer','nitish123')
select * from bil;
delete from CUSTOMER c where c.CustId=3;
delete from RETAILER where retailerId = 3;
drop table customer;
drop table price2
drop table price;
drop table setup ;
drop table retailer;
drop table inventory;
drop table Customer_Package_P
select * from bil
drop TABLE bil
drop table datepre;
select * from pre
drop table packlist
select * from Package_Gpacklist
select * from PACKAGE_G;
select * from CHANNEL_G;
select * from package_channel_G
insert into table CHANNEL_E values(1,'maatv')
insert into table Package_F values(100,'Telugu1');
create table STBPACKAGE_G (serialNo number(10),packageName varchar2(10),Type number(10),packageId number(10))
insert into STBPACKAGE_G values(1,'Y',1,100);
insert into STBPACKAGE_G values(33,'Y',1,103);
insert into STBPACKAGE_G values(2,'N',1,101);
insert into STBPACKAGE_G values(17,'N',1,1000);
insert into STBPACKAGE_G values(3,'Y',2,100);
insert into STBPACKAGE_G values(4,'N',2,101);
insert into STBPACKAGE_G values(18,'N',2,1000);
insert into STBPACKAGE_G values(34,'Y',2,103);
insert into STBPACKAGE_G values(5,'Y',3,100);
insert into STBPACKAGE_G values(6,'N',3,101);
insert into STBPACKAGE_G values(19,'N',3,1000);
insert into STBPACKAGE_G values(35,'Y',3,103);
insert into STBPACKAGE_G values(7,'Y',4,100);
insert into STBPACKAGE_G values(8,'N',4,101);
insert into STBPACKAGE_G values(20,'N',4,1000);
insert into STBPACKAGE_G values(36,'Y',4,103);
insert into STBPACKAGE_G values(9,'Y',5,100);
insert into STBPACKAGE_G values(10,'N',5,101);
insert into STBPACKAGE_G values(21,'N',5,1000);
insert into STBPACKAGE_G values(37,'Y',5,103);
insert into STBPACKAGE_G values(11,'Y',6,100);
insert into STBPACKAGE_G values(12,'N',6,101);
insert into STBPACKAGE_G values(22,'N',6,1000);
insert into STBPACKAGE_G values(38,'Y',6,103);
insert into STBPACKAGE_G values(13,'Y',7,100);
insert into STBPACKAGE_G values(14,'N',7,101);
insert into STBPACKAGE_G values(23,'N',7,1000);
insert into STBPACKAGE_G values(39,'Y',7,103);
insert into STBPACKAGE_G values(15,'Y',8,100);
insert into STBPACKAGE_G values(16,'N',8,101);
insert into STBPACKAGE_G values(24,'N',8,1000);
insert into STBPACKAGE_G values(40,'Y',8,103);
select * from customer ;
select * from Bil
select * from Bil_datecol
select * from packlist1
SELECT * FROM pres
drop table Bil_datecol
drop table packlist1 |
--
-- PostgreSQL database dump
--
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: event; Type: TABLE; Schema: public; Owner: cuba; Tablespace:
--
CREATE TABLE event (
event_id integer NOT NULL,
date_begin date DEFAULT now() NOT NULL,
date_end date DEFAULT now() NOT NULL,
name character varying(300) NOT NULL,
description text DEFAULT ''::text NOT NULL,
time_begin time without time zone DEFAULT '00:00:00'::time without time zone NOT NULL,
time_end time without time zone DEFAULT '24:00:00'::time without time zone NOT NULL,
max_participants integer DEFAULT 0 NOT NULL,
visible visibility DEFAULT ('PUBLIC'::character varying)::visibility NOT NULL,
content_id integer NOT NULL,
repeat_annual boolean DEFAULT false,
repeat_weekly integer,
repeat_monthly integer,
repeat_monthly_day integer
);
ALTER TABLE public.event OWNER TO cuba;
--
-- Name: event_id_seq; Type: SEQUENCE; Schema: public; Owner: cuba
--
CREATE SEQUENCE event_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.event_id_seq OWNER TO cuba;
--
-- PostgreSQL database dump complete
--
|
# ';' 을 잊지말자
SELECT S.NAME, G.GRADE, S.MARKS
FROM STUDENTS S, GRADES G
WHERE S.MARKS >= G.MIN_MARK AND S.MARKS <= G.MAX_MARK AND G.GRADE >= 8
ORDER BY G.GRADE DESC, S.NAME;
SELECT NULL,G.GRADE,S.MARKS
FROM STUDENTS S, GRADES G
WHERE S.MARKS >= G.MIN_MARK AND S.MARKS <= G.MAX_MARK AND G.GRADE < 8
ORDER BY G.GRADE DESC, S.MARKS |
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
#-----------------------------------------------------------------------------
#-- sf_tag
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `sf_tag`;
CREATE TABLE `sf_tag`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100),
`is_triple` TINYINT,
`triple_namespace` VARCHAR(100),
`triple_key` VARCHAR(100),
`triple_value` VARCHAR(100),
`slug` VARCHAR(255),
PRIMARY KEY (`id`),
UNIQUE KEY `sf_tag_U_1` (`slug`),
KEY `name`(`name`),
KEY `triple1`(`triple_namespace`),
KEY `triple2`(`triple_key`),
KEY `triple3`(`triple_value`)
)Type=InnoDB;
#-----------------------------------------------------------------------------
#-- sf_tagging
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `sf_tagging`;
CREATE TABLE `sf_tagging`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`tag_id` INTEGER NOT NULL,
`taggable_model` VARCHAR(30),
`taggable_id` INTEGER,
PRIMARY KEY (`id`),
KEY `tag`(`tag_id`),
KEY `taggable`(`taggable_model`, `taggable_id`),
CONSTRAINT `sf_tagging_FK_1`
FOREIGN KEY (`tag_id`)
REFERENCES `sf_tag` (`id`)
ON DELETE CASCADE
)Type=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
|
alter table project add media text[];
alter table project add image text NOT NULL;
alter table project add map geometry;
alter table project drop photos;
comment
on column project.media is 'List of project video/image urls';
comment
on column project.image is 'Main project image url (presented on project list)';
comment
on column project.map is 'Project GIS data, at least boundary';
|
DELETE
FROM info.unit_patron_discounts
WHERE unit_patron_uid IN (SELECT
unit_x_patrons.id
FROM info.unit_x_patrons
JOIN setup.units ON unit_x_patrons.unit_uid = units.id
JOIN patrons.clone_patrons ON clone_patrons.id = unit_x_patrons.patron_uid
WHERE venue_uid = 310 AND patron_uid IN (84810, 84811, 84812, 84813, 84814, 84815, 84816));
DELETE
FROM info.unit_patron_gratuities
WHERE unit_patron_uid IN (SELECT
unit_x_patrons.id
FROM info.unit_x_patrons
JOIN setup.units ON unit_x_patrons.unit_uid = units.id
JOIN patrons.clone_patrons ON clone_patrons.id = unit_x_patrons.patron_uid
WHERE venue_uid = 310 AND patron_uid IN (84810, 84811, 84812, 84813, 84814, 84815, 84816));
DELETE
FROM info.unit_patron_info
WHERE unit_patron_uid IN (SELECT
unit_x_patrons.id
FROM info.unit_x_patrons
JOIN setup.units ON unit_x_patrons.unit_uid = units.id
JOIN patrons.clone_patrons ON clone_patrons.id = unit_x_patrons.patron_uid
WHERE venue_uid = 310 AND patron_uid IN (84810, 84811, 84812, 84813, 84814, 84815, 84816));
DELETE
FROM info.unit_patron_notes
WHERE unit_patron_uid IN (SELECT
unit_x_patrons.id
FROM info.unit_x_patrons
JOIN setup.units ON unit_x_patrons.unit_uid = units.id
JOIN patrons.clone_patrons ON clone_patrons.id = unit_x_patrons.patron_uid
WHERE venue_uid = 310 AND patron_uid IN (84810, 84811, 84812, 84813, 84814, 84815, 84816));
DELETE
FROM info.unit_patron_pars
WHERE unit_patron_uid IN (SELECT
unit_x_patrons.id
FROM info.unit_x_patrons
JOIN setup.units ON unit_x_patrons.unit_uid = units.id
JOIN patrons.clone_patrons ON clone_patrons.id = unit_x_patrons.patron_uid
WHERE venue_uid = 310 AND patron_uid IN (84810, 84811, 84812, 84813, 84814, 84815, 84816)); |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 01-12-2019 a las 14:11:32
-- Versión del servidor: 10.1.35-MariaDB
-- Versión de PHP: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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 */;
--
-- Base de datos: `ener`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `almacenes`
--
CREATE TABLE `almacenes` (
`almacen_id` int(11) NOT NULL,
`almacen_descripcion` varchar(60) DEFAULT NULL,
`almacen_direccion` varchar(80) DEFAULT NULL,
`id_sede` int(11) DEFAULT NULL,
`almacen_estado` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `almacenes`
--
INSERT INTO `almacenes` (`almacen_id`, `almacen_descripcion`, `almacen_direccion`, `id_sede`, `almacen_estado`) VALUES
(3, 'Principal1', 'jr. orellana 244', 1, 1),
(4, 'almacen 1', NULL, 1, 0),
(5, 'prueba23244', NULL, 1, 0),
(6, 'probando12', NULL, 1, 0),
(7, 'probando1', NULL, 1, 0),
(8, 'prueba45', NULL, 1, 0),
(9, 'numero2', NULL, 1, 0);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `asistencia`
--
CREATE TABLE `asistencia` (
`asistencia_id` int(11) NOT NULL,
`cliente_id` int(11) DEFAULT NULL,
`asistencia_fecha_hora` datetime DEFAULT NULL,
`asistencia_fecha` date DEFAULT NULL,
`asistencia_estado` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `asistencia`
--
INSERT INTO `asistencia` (`asistencia_id`, `cliente_id`, `asistencia_fecha_hora`, `asistencia_fecha`, `asistencia_estado`) VALUES
(5, 9, '2019-07-12 22:49:07', '2019-07-12', 1),
(6, 10, '2019-07-14 19:19:29', '2019-07-14', 1),
(7, 9, '2019-07-15 09:21:58', '2019-07-15', 1),
(8, 10, '2019-07-15 10:11:06', '2019-07-15', 1),
(10, 14, '2019-11-02 23:27:57', '2019-11-02', 1),
(11, 14, '2019-11-08 23:36:13', '2019-11-08', 1),
(16, 15, '2019-11-18 17:38:44', '2019-11-18', 1),
(17, 15, '2019-11-19 08:06:02', '2019-11-19', 1),
(18, 14, '2019-11-24 20:56:08', '2019-11-24', 1),
(19, 15, '2019-11-26 07:33:28', '2019-11-26', 1),
(21, 14, '2019-11-26 20:12:15', '2019-11-26', 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `categoria_producto`
--
CREATE TABLE `categoria_producto` (
`categoria_producto_id` int(11) NOT NULL,
`categoria_producto_descripcion` varchar(255) DEFAULT NULL,
`categoria_producto_estado` int(11) DEFAULT '1',
`id_sede` int(11) DEFAULT NULL,
`categoria_imagen` blob
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `categoria_producto`
--
INSERT INTO `categoria_producto` (`categoria_producto_id`, `categoria_producto_descripcion`, `categoria_producto_estado`, `id_sede`, `categoria_imagen`) VALUES
(1, 'Agua Mineral ', 1, 1, NULL),
(4, '', 0, 1, NULL),
(5, '', 0, 1, NULL),
(6, 'Proteínas', 1, 1, NULL),
(7, 'Sporade', 0, 1, NULL),
(8, 'prueba23', 0, 1, NULL),
(9, 'prueba31', 0, 1, NULL),
(10, 'prueba31', 0, 1, NULL),
(11, 'prueba31', 0, 1, NULL),
(12, 'prueba31', 0, 1, NULL),
(13, 'preba21', 0, 1, NULL),
(14, 'pre', 0, 1, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `cliente`
--
CREATE TABLE `cliente` (
`cliente_id` int(11) NOT NULL,
`cliente_nombre_completo` varchar(255) DEFAULT NULL,
`cliente_documento_numero` varchar(20) DEFAULT NULL,
`tipo_documento_cliente_id` int(11) DEFAULT NULL,
`cliente_sexo` varchar(255) DEFAULT NULL,
`cliente_correo` varchar(255) DEFAULT NULL,
`cliente_telefono` varchar(255) DEFAULT NULL,
`cliente_direccion` varchar(255) DEFAULT NULL,
`cliente_telefono_referencia` varchar(255) DEFAULT NULL,
`cliente_estado` int(11) DEFAULT '1',
`tipo_documento_cliente_tam` int(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `cliente`
--
INSERT INTO `cliente` (`cliente_id`, `cliente_nombre_completo`, `cliente_documento_numero`, `tipo_documento_cliente_id`, `cliente_sexo`, `cliente_correo`, `cliente_telefono`, `cliente_direccion`, `cliente_telefono_referencia`, `cliente_estado`, `tipo_documento_cliente_tam`) VALUES
(1, 'Maria Rojas Garcia', '75270586', 1, 'Femenino', 'maria12@gmail.com', '984638576', 'psje. humberto pinedo 130', '933345643', 0, 8),
(2, 'julymarth panduro aching', '70275866', 1, 'Masculino', 'jimmycarbajalsanchez@gmail.com', '933122626', 'psje. humberto pinedo 130', '912226244', 0, 8),
(7, 'Ronald Adrian Hilario Tafur', '71044092', 1, 'Masculino', 'josmar08.31059@gmail.com', '984638576', 'Nicolas De Pierola 351', '5555', 0, 8),
(8, 'andy hilario tafur', '71087964', 1, 'Masculino', 'dsdksdk', '99999999', 'jr lima', '8855666', 0, 8),
(9, 'Merly Monsalve Vásque', '75953763', 1, 'Femenino', 'merly@gmail.co', '324323425', 'Jr Sáenz Peña cdra 2 ', '344536535', 0, 8),
(10, 'Genry Trigozo Cutipa', '73990362', 1, 'Masculino', 'genry@gmail.com', ' jr.progreso #550', ' jr.progreso #550', '', 0, 8),
(11, 'Yadira Chingay Mego', '70808493', 1, 'Femenino', 'Yadira@gmail.com', '914 952 3', 'Pasaje Humberto Pinedo SN', '', 0, 8),
(12, 'Whylds Rodríguez Reategui', '76419563', 1, 'Masculino', 'whylds@gmail.com', '936 864 4', 'Av circunvalación cumbaza c2', '', 0, 8),
(13, 'CCVFB<DGNBDGN', '73996455', 1, 'Masculino', 'FHFGG75555CCC', '888888888', 'YTYYTNTYHT', '888888888', 0, 8),
(14, 'Jhonny Eintens Shapiama Alvarado', '65785950', 1, 'Masculino', 'jhony@gmail.com', '234576835', '9 de abril', '', 1, NULL),
(15, 'Jose Max Hilario Arroyo', '70992778', 1, 'Masculino', 'jose@gmail.com', '956746356', 'Nicolás De Pierola 351', '', 1, NULL),
(16, 'juan perez', '32323232', 1, 'Masculino', 'juan@gmail.com', '987356483', 'aribba 334', '', 1, NULL),
(17, 'maria vargas', '34354565', 1, 'Femenino', 'maria@gmail.com', '345765378', 'alfonso ugarte', '', 1, NULL),
(18, 'Ronald adrian', '76767676', 1, 'Masculino', 'adrian@gmail.com', '987897876', 'Nicolás De Pierola 351', '', 1, NULL),
(19, 'Mario Vargas Llosa', '34576893', 1, 'Masculino', 'llosa@gmail.com', '935745211', 'españa 357', '', 1, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalle_doc_sede`
--
CREATE TABLE `detalle_doc_sede` (
`detalle_id_sede` int(11) DEFAULT NULL,
`detalle_id_documento` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalle_venta`
--
CREATE TABLE `detalle_venta` (
`id` int(11) NOT NULL,
`producto_id` int(11) DEFAULT NULL,
`venta_id` int(11) NOT NULL,
`precio` varchar(100) NOT NULL,
`cantidad` varchar(100) NOT NULL,
`importe` varchar(100) NOT NULL,
`tipo_membresia` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `detalle_venta`
--
INSERT INTO `detalle_venta` (`id`, `producto_id`, `venta_id`, `precio`, `cantidad`, `importe`, `tipo_membresia`) VALUES
(36, NULL, 29, '180', '1', '180', 6),
(37, NULL, 30, '180', '1', '180', 6),
(38, NULL, 31, '71', '1', '71', 1),
(39, 8, 32, '390.60', '1', '390.60', NULL),
(40, 10, 33, '390.60', '1', '390.60', NULL),
(41, 10, 34, '390.60', '1', '390.60', NULL),
(42, NULL, 35, '180', '1', '180', 6),
(43, 8, 36, '390.60', '2', '781.20', NULL),
(44, 8, 37, '390.60', '1', '390.60', NULL),
(45, NULL, 38, '70', '1', '70', 6),
(46, 10, 39, '390.60', '1', '390.60', NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `documento`
--
CREATE TABLE `documento` (
`id_documento` int(1) NOT NULL,
`doc_serie` char(4) DEFAULT NULL,
`estado` char(1) DEFAULT '1',
`doc_correlativo` int(11) DEFAULT NULL,
`id_empresa` varchar(11) DEFAULT NULL,
`id_tipodocumento` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `empleados`
--
CREATE TABLE `empleados` (
`empleado_id` int(11) NOT NULL,
`empleado_nombres` varchar(100) NOT NULL,
`empleado_apellidos` varchar(100) DEFAULT NULL,
`empleado_dni` varchar(8) DEFAULT NULL,
`empleado_direccion` varchar(50) DEFAULT NULL,
`empleado_email` varchar(50) DEFAULT NULL,
`empleado_telefono` varchar(30) DEFAULT NULL,
`perfil_id` int(11) DEFAULT NULL,
`empleado_usuario` varchar(50) DEFAULT NULL,
`empleado_clave` varchar(200) DEFAULT NULL,
`estado` int(1) DEFAULT '1',
`empresa_ruc` varchar(255) DEFAULT NULL,
`empresa_sede` int(11) DEFAULT NULL,
`empleado_nombre_completo` varchar(255) DEFAULT NULL,
`empleado_foto_perfil` text,
`empleado_fecha_nacimiento` date DEFAULT NULL,
`empleado_huella` longtext,
`empleado_sexo` char(1) DEFAULT 'm',
`empleado_horario_entrada_man` time DEFAULT NULL,
`empleado_horario_salida_man` time DEFAULT NULL,
`empleado_horario_entrada_tar` time DEFAULT NULL,
`empleado_horario_salida_tar` time DEFAULT NULL,
`empleado_foto` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `empleados`
--
INSERT INTO `empleados` (`empleado_id`, `empleado_nombres`, `empleado_apellidos`, `empleado_dni`, `empleado_direccion`, `empleado_email`, `empleado_telefono`, `perfil_id`, `empleado_usuario`, `empleado_clave`, `estado`, `empresa_ruc`, `empresa_sede`, `empleado_nombre_completo`, `empleado_foto_perfil`, `empleado_fecha_nacimiento`, `empleado_huella`, `empleado_sexo`, `empleado_horario_entrada_man`, `empleado_horario_salida_man`, `empleado_horario_entrada_tar`, `empleado_horario_salida_tar`, `empleado_foto`) VALUES
(1, 'Andy Brayan Hilario Tafur', 'Tafur', '', 'Nicolás De Pierola 351', 'andyyadrian12@gmail.com', '', 8, 'admin', '123', 1, '20709965293', 1, 'Andy Brayan Hilario Tafur Tafur', '34178536_10212571822916029_4983929343618056192_n.jpg', '0000-00-00', NULL, 'M', NULL, NULL, NULL, NULL, 'be39746ebf53d200f58929071a585d08.jpg'),
(2, 'Victor', 'Campos', '78965412', '', '', '987654321', 14, 'victor', '123', 1, '20709965293', 1, 'Victor Campos', NULL, '0000-00-00', NULL, 'F', NULL, NULL, NULL, NULL, 'd21c40c6f2c2974cd91e0aa137043550.jpg'),
(3, 'Clientes', '', '', '', '', '', 15, 'cliente', '123', 0, '20709965293', 1, 'Clientes ', NULL, '0000-00-00', NULL, 'F', NULL, NULL, NULL, NULL, 'da6c99ffee293ea576fef8c001495d85.png'),
(7, 'carlos', 'saavedra', '32132131', '10 de agosto', 'chu@gmail.com', '987654378', 14, 'carlos', '123', 1, '20709965293', 1, NULL, NULL, NULL, NULL, 'M', NULL, NULL, NULL, NULL, NULL),
(8, 'liam', 'goana', '32312312', 'Nicolás De Pierola 351', 'liam12@gmail.com', '987245631', 14, 'liam', '123', 0, '20709965293', 1, NULL, NULL, NULL, NULL, 'M', NULL, NULL, NULL, NULL, NULL),
(9, 'adrian', 'hilario', '74385632', 'Nicolás De Pierola 351', 'adrian@gmail.com', '987345234', 14, 'adrian', '123', 1, '20709965293', 1, NULL, NULL, NULL, NULL, 'M', NULL, NULL, NULL, NULL, NULL),
(10, 'rafael ', 'hernandez', '70996529', 'ASDHH', 'andyfjslfjdlf@gmail.com', '987985856', 8, 'rafel', '123', 0, '20709965293', 1, NULL, NULL, NULL, NULL, 'M', NULL, NULL, NULL, NULL, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `empresa`
--
CREATE TABLE `empresa` (
`empresa_ruc` varchar(11) NOT NULL,
`empresa_razon_social` varchar(255) DEFAULT NULL,
`empresa_direccion` varchar(255) DEFAULT NULL,
`empresa_telefono` varchar(255) DEFAULT NULL,
`empresa_correo` varchar(255) DEFAULT NULL,
`empresa_estado` int(11) DEFAULT '1',
`empresa_icono` text,
`empresa_abreviatura` varchar(255) DEFAULT NULL,
`empresa_nombre_comercial` varchar(255) DEFAULT NULL,
`empresa_culqi_publico` text,
`empresa_culqi_privado` text,
`empresa_usuario_sol` varchar(255) DEFAULT NULL,
`empresa_clave_sol` varchar(255) DEFAULT NULL,
`empreasa_firma_digital` text,
`empresa_estado_activo` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `empresa`
--
INSERT INTO `empresa` (`empresa_ruc`, `empresa_razon_social`, `empresa_direccion`, `empresa_telefono`, `empresa_correo`, `empresa_estado`, `empresa_icono`, `empresa_abreviatura`, `empresa_nombre_comercial`, `empresa_culqi_publico`, `empresa_culqi_privado`, `empresa_usuario_sol`, `empresa_clave_sol`, `empreasa_firma_digital`, `empresa_estado_activo`) VALUES
('20709965293', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `marca`
--
CREATE TABLE `marca` (
`id_marca` int(11) NOT NULL,
`marca_descripcion` varchar(100) DEFAULT NULL,
`marca_estado` char(1) DEFAULT NULL,
`id_sede` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `marca`
--
INSERT INTO `marca` (`id_marca`, `marca_descripcion`, `marca_estado`, `id_sede`) VALUES
(1, 'Inca Kola', '1', 1),
(2, 'Duromas', '1', 1),
(3, 'Cielo1', '0', 1),
(4, 'orueba12', '0', 1),
(5, 'prueba14', '0', 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `membresia`
--
CREATE TABLE `membresia` (
`membresia_id` int(11) NOT NULL,
`tipo_membresia_id` int(11) DEFAULT NULL,
`cliente_id` int(11) DEFAULT NULL,
`membresia_fecha_inicio` date DEFAULT NULL,
`membresia_fecha_fin` date DEFAULT NULL,
`membresia_precio_mes` decimal(20,2) DEFAULT NULL,
`membresia_meses` int(11) DEFAULT NULL,
`membresia_estado` int(11) DEFAULT '1',
`membresia_precio_total` decimal(20,2) DEFAULT NULL,
`membresia_fecha_registro` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `membresia`
--
INSERT INTO `membresia` (`membresia_id`, `tipo_membresia_id`, `cliente_id`, `membresia_fecha_inicio`, `membresia_fecha_fin`, `membresia_precio_mes`, `membresia_meses`, `membresia_estado`, `membresia_precio_total`, `membresia_fecha_registro`) VALUES
(18, 6, 14, '2019-11-24', '2019-11-28', '180.00', 1, 1, '180.00', '2019-11-24'),
(19, 6, 15, '2019-11-24', '2019-12-24', '180.00', 1, 1, '180.00', '2019-11-24'),
(20, 1, 16, '2019-11-24', '2019-12-24', '35.50', 1, 1, '35.50', '2019-11-24'),
(21, 1, 17, '2019-11-24', '2019-12-24', '35.50', 1, 1, '35.50', '2019-11-24'),
(22, 6, 18, '2019-11-25', '2019-12-25', '180.00', 1, 1, '180.00', '2019-11-25'),
(23, 6, 19, '2019-11-26', '2019-12-26', '70.00', 1, 1, '70.00', '2019-11-26');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `modulos`
--
CREATE TABLE `modulos` (
`modulo_id` int(11) NOT NULL,
`modulo_nombre` varchar(50) DEFAULT NULL,
`modulo_icono` varchar(50) DEFAULT NULL,
`modulo_url` varchar(50) DEFAULT NULL,
`modulo_padre` int(11) DEFAULT NULL,
`estado` int(1) DEFAULT '1',
`modulo_orden` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `modulos`
--
INSERT INTO `modulos` (`modulo_id`, `modulo_nombre`, `modulo_icono`, `modulo_url`, `modulo_padre`, `estado`, `modulo_orden`) VALUES
(1, 'MODULO PADRE', '#', '#', 1, 1, 1),
(2, 'Administracion', 'mdi mdi-key', '#', 1, 1, 6),
(3, 'Permisos', ' ', 'Permisos', 2, 1, NULL),
(4, 'Perfil', ' ', 'Perfiles', 2, 1, 4),
(5, 'Modulos', ' ', 'Modulo', 2, 1, 6),
(6, 'Empresa', '.', 'empresa', 2, 0, NULL),
(7, 'Almacen', 'mdi mdi-medical-bag', '#', 1, 1, NULL),
(8, 'R. de Almacen', ' ', 'Almacen', 7, 1, NULL),
(9, 'Mantenimiento', 'mdi mdi-svg', '#', 1, 1, NULL),
(10, 'Categoria Producto', ' ', 'C_producto', 9, 1, NULL),
(11, 'Marca Producto', ' ', 'Marca_producto', 9, 1, NULL),
(15, 'Compras', 'mdi mdi-cart-outline', '#', 1, 1, NULL),
(16, 'Registrar Producto', ' ', 'R_producto', 7, 1, NULL),
(17, 'Membresia', 'mdi mdi-account-multiple', '#', 1, 1, NULL),
(18, 'Cliente', '.', 'ClientesP', 1, 1, NULL),
(19, 'Tipo Membresia', '.', 'Tipo_membresia', 17, 1, NULL),
(20, 'Asistencia', '.', 'Asistencia', 17, 1, NULL),
(21, 'Modulo Prueba', 'sdsd', '#', 1, 1, NULL),
(22, 'Reporte', 'mdi mdi-file-pdf', '#', 1, 1, NULL),
(23, 'Reporte Clientes', ' ', 'Clientesr', 22, 1, NULL),
(24, 'Reporte Asistencia', ' ', 'RAsistencia', 22, 1, NULL),
(25, 'Ventas', ' mdi mdi-clipboard', '#', 1, 1, NULL),
(26, 'Visualizar Venta Producto', ' ', 'Ventaproducto', 25, 1, NULL),
(27, 'Visualizar Venta Servicio', ' ', 'Ventaservicio', 25, 1, NULL),
(28, 'Usuario', ' ', 'Usuario', 2, 1, NULL),
(29, 'Clientes', ' ', 'Cliente', 17, 1, NULL),
(30, 'Venta Producto', 'dsadsa', 'Rventa_producto', 22, 1, NULL),
(31, 'Venta Servicio', 'dsadsa', 'Rventa_servicio', 22, 1, NULL),
(32, 'Registrar Venta Producto', ' ', 'VentaProducto/nuevo', 25, 1, NULL),
(33, 'Registrar Venta Servicio', ' ', 'VentaServicio/nuevo', 25, 1, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `monedas`
--
CREATE TABLE `monedas` (
`moneda_id` int(11) NOT NULL,
`moneda_descripcion` varchar(20) DEFAULT NULL,
`moneda_simbolo` varchar(5) DEFAULT NULL,
`moneda_estado` char(1) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `monedas`
--
INSERT INTO `monedas` (`moneda_id`, `moneda_descripcion`, `moneda_simbolo`, `moneda_estado`) VALUES
(1, 'Soles ', 'S/', '1'),
(2, 'Dolares', '$', '1');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `perfiles`
--
CREATE TABLE `perfiles` (
`perfil_id` int(11) NOT NULL,
`perfil_descripcion` varchar(50) DEFAULT NULL,
`estado` int(1) DEFAULT '1',
`perfil_url` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `perfiles`
--
INSERT INTO `perfiles` (`perfil_id`, `perfil_descripcion`, `estado`, `perfil_url`) VALUES
(1, 'ADMINISTRADOR1', 0, ''),
(5, 'CAJERO', 0, 'Pedido'),
(8, 'ADMINISTRADOR DE EMPRESA', 1, 'control'),
(12, 'ADMINISTRADOR DE SEDE', 0, 'control'),
(13, 'sdsdsds', 0, NULL),
(14, 'CAJERO', 1, NULL),
(15, 'CLIENTE', 1, NULL),
(16, 'pureba1', 0, NULL),
(17, 'paraborrar', 0, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `permisos_sede`
--
CREATE TABLE `permisos_sede` (
`persed_id_perfil` int(11) DEFAULT NULL,
`persed_id_modulo` int(11) DEFAULT NULL,
`persed_id_sede` int(11) DEFAULT NULL,
`persed_id_rubro` varchar(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `permisos_sede`
--
INSERT INTO `permisos_sede` (`persed_id_perfil`, `persed_id_modulo`, `persed_id_sede`, `persed_id_rubro`) VALUES
(1, 10, 1, NULL),
(15, 20, 1, NULL),
(14, 16, 1, NULL),
(14, 10, 1, NULL),
(14, 11, 1, NULL),
(14, 18, 1, NULL),
(14, 20, 1, NULL),
(14, 23, 1, NULL),
(14, 24, 1, NULL),
(14, 26, 1, NULL),
(14, 27, 1, NULL),
(8, 3, 1, NULL),
(8, 4, 1, NULL),
(8, 5, 1, NULL),
(8, 28, 1, NULL),
(8, 8, 1, NULL),
(8, 16, 1, NULL),
(8, 10, 1, NULL),
(8, 11, 1, NULL),
(8, 19, 1, NULL),
(8, 20, 1, NULL),
(8, 29, 1, NULL),
(8, 23, 1, NULL),
(8, 24, 1, NULL),
(8, 30, 1, NULL),
(8, 31, 1, NULL),
(8, 26, 1, NULL),
(8, 27, 1, NULL),
(8, 32, 1, NULL),
(8, 33, 1, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `producto`
--
CREATE TABLE `producto` (
`producto_id` int(11) NOT NULL,
`producto_descripcion_` varchar(255) DEFAULT NULL,
`producto_precio` decimal(10,2) DEFAULT NULL,
`producto_stock` int(11) DEFAULT '0',
`producto_minimo` int(11) DEFAULT '0',
`producto_feche_vencimiento` date DEFAULT NULL,
`producto_observacion` varchar(255) DEFAULT NULL,
`id_sede` int(11) DEFAULT NULL,
`producto_estado` int(11) DEFAULT '1',
`producto_imagen` varchar(250) DEFAULT NULL,
`categoria_producto_id` int(11) DEFAULT NULL,
`producto_codigobarra` varchar(100) DEFAULT NULL,
`unidad_medida_id` int(11) DEFAULT NULL,
`tipo_unidad_medida_id` int(11) DEFAULT NULL,
`producto_preciocompra` decimal(10,2) DEFAULT NULL,
`producto_stock_temporal` int(11) UNSIGNED ZEROFILL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `producto`
--
INSERT INTO `producto` (`producto_id`, `producto_descripcion_`, `producto_precio`, `producto_stock`, `producto_minimo`, `producto_feche_vencimiento`, `producto_observacion`, `id_sede`, `producto_estado`, `producto_imagen`, `categoria_producto_id`, `producto_codigobarra`, `unidad_medida_id`, `tipo_unidad_medida_id`, `producto_preciocompra`, `producto_stock_temporal`) VALUES
(8, 'ISO WHEY 5KG', '390.60', 9999999, 0, NULL, NULL, NULL, 1, 'isowhey.jpg', 6, 'WHEY10000', 25, 14, NULL, NULL),
(10, 'ISO WHEY 10KG', '390.60', 9999999, 0, NULL, NULL, NULL, 1, 'isowhey10.jpg', 6, 'WHEY999', 25, 14, NULL, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `sede`
--
CREATE TABLE `sede` (
`id_sede` int(11) NOT NULL,
`empresa_ruc` varchar(255) DEFAULT NULL,
`sede_direccion` varchar(255) DEFAULT NULL,
`sede_telefono` int(11) DEFAULT NULL,
`sede_observacion` varchar(255) DEFAULT NULL,
`sede_horario_m_i` time DEFAULT NULL,
`sede_horario_m` time DEFAULT NULL,
`sede_horario_t_i` time DEFAULT NULL,
`sede_horario_t` time DEFAULT NULL,
`id_distrito` int(11) DEFAULT NULL,
`sede_descripcion` varchar(255) DEFAULT NULL,
`id_provincia` int(11) DEFAULT NULL,
`id_departamento` int(11) DEFAULT NULL,
`sede_estado` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `sede`
--
INSERT INTO `sede` (`id_sede`, `empresa_ruc`, `sede_direccion`, `sede_telefono`, `sede_observacion`, `sede_horario_m_i`, `sede_horario_m`, `sede_horario_t_i`, `sede_horario_t`, `id_distrito`, `sede_descripcion`, `id_provincia`, `id_departamento`, `sede_estado`) VALUES
(1, '20709965293', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipo_documento`
--
CREATE TABLE `tipo_documento` (
`tipodoc_id` int(11) NOT NULL,
`tipodoc_descripcion` varchar(60) DEFAULT NULL,
`tipodoc_abreviacion` varchar(7) DEFAULT NULL,
`tipodoc_estado` char(1) DEFAULT '1',
`serie` varchar(3) DEFAULT NULL,
`correlativo` int(12) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `tipo_documento`
--
INSERT INTO `tipo_documento` (`tipodoc_id`, `tipodoc_descripcion`, `tipodoc_abreviacion`, `tipodoc_estado`, `serie`, `correlativo`) VALUES
(1, 'BOLETA ', 'BOLETA', '1', '001', 31),
(2, 'FACTURA ', 'FACTURA', '1', '001', 10),
(3, 'TICKET BOLETA', 'TICKET', '1', '001', 1),
(4, 'TICKET FACTURA.', 'TICKET', '1', '001', 1),
(11, 'NOTA DE CREDITO ', 'N. CRED', '0', '001', 1),
(12, 'NOTA DE DEBITO ', 'N. DEB.', '0', '001', 1),
(13, 'SIN DOCUMENTO', 'SIN DOC', '1', '001', 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipo_documento_cliente`
--
CREATE TABLE `tipo_documento_cliente` (
`tipo_documento_cliente_id` int(11) NOT NULL,
`tipo_documento_cliente_descripcion` varchar(255) DEFAULT NULL,
`tipo_documento_cliente_tam` int(11) DEFAULT NULL,
`tipo_documento_cliente_estado` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `tipo_documento_cliente`
--
INSERT INTO `tipo_documento_cliente` (`tipo_documento_cliente_id`, `tipo_documento_cliente_descripcion`, `tipo_documento_cliente_tam`, `tipo_documento_cliente_estado`) VALUES
(1, 'DNI', 8, 1),
(2, 'RUC', 11, 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipo_membresia`
--
CREATE TABLE `tipo_membresia` (
`tipo_membresia_id` int(11) NOT NULL,
`tipo_membresia_descripcion` varchar(255) DEFAULT NULL,
`tipo_membresia_mes` int(11) DEFAULT NULL,
`tipo_membresia_precio_mes` decimal(50,0) DEFAULT NULL,
`tiempo_duracion` date DEFAULT NULL,
`tipo_duracion` int(11) DEFAULT NULL,
`tipo_membresia_estado` int(11) DEFAULT '1',
`tipo_membresia_fecha_registro` date DEFAULT NULL,
`estado_asistencia` int(1) DEFAULT '0',
`cantidad_personas` int(11) DEFAULT '1',
`tipo_tiempo` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `tipo_membresia`
--
INSERT INTO `tipo_membresia` (`tipo_membresia_id`, `tipo_membresia_descripcion`, `tipo_membresia_mes`, `tipo_membresia_precio_mes`, `tiempo_duracion`, `tipo_duracion`, `tipo_membresia_estado`, `tipo_membresia_fecha_registro`, `estado_asistencia`, `cantidad_personas`, `tipo_tiempo`) VALUES
(1, 'Paquete 2 x 1', 1, '150', '2019-11-26', 0, 1, '2019-11-26', 1, 2, NULL),
(2, 'estudiante', 1, '40', '2019-04-09', 1, 0, '2019-04-08', 0, 1, NULL),
(3, 'estudiante', 1, '45', '2019-07-12', 0, 0, '2019-07-12', 0, 1, NULL),
(4, 'paquete 2 x 1', 1, '100', '2019-07-12', 1, 0, '2019-07-12', 0, 1, NULL),
(5, 'duo', 1, '120', '2019-10-30', 1, 0, '2019-10-30', 0, 1, NULL),
(6, 'Estándar', 1, '70', '2019-12-30', 0, 1, '2019-11-26', 0, 1, NULL),
(7, 'solo amigos', 1, '50', '2019-10-30', 1, 0, '2019-10-30', 0, 1, NULL),
(8, 'cuarteto', 1, '150', '2019-11-02', 1, 0, '2019-11-02', 0, 1, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipo_unidad_medida`
--
CREATE TABLE `tipo_unidad_medida` (
`id_tipo_unidad_medida` int(11) NOT NULL,
`tipo_unidad_medida_descripcion` varchar(255) DEFAULT NULL,
`tipo_unidad_medida_estado` char(1) NOT NULL DEFAULT '1',
`cu_tabla` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `tipo_unidad_medida`
--
INSERT INTO `tipo_unidad_medida` (`id_tipo_unidad_medida`, `tipo_unidad_medida_descripcion`, `tipo_unidad_medida_estado`, `cu_tabla`) VALUES
(1, 'Masa', '1', '20542322412'),
(2, 'Capacidad', '0', '20542322412'),
(3, 'Densidad', '0', '20542322412'),
(4, 'Energía', '0', '20542322412'),
(5, 'Fuerza', '0', '20542322412'),
(6, 'Longitud', '0', '20542322412'),
(7, 'Potencia', '0', '20542322412'),
(8, 'Temperatura', '0', '20542322412'),
(9, 'Tiempo', '0', '20542322412'),
(10, 'Velocidad', '0', '20542322412'),
(11, 'Volumen', '1', '20542322412'),
(12, 'Eléctricas', '0', '20542322412'),
(13, 'Depresacion', '0', '20542322412'),
(14, 'Unidad', '1', '20542322412');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `unidad_medida`
--
CREATE TABLE `unidad_medida` (
`id_unidad_medida` int(11) NOT NULL,
`unidad_medida_descripcion` varchar(255) DEFAULT NULL,
`unidad_medida_estado` int(11) DEFAULT '1',
`id_tipo_unidad_medida` int(11) DEFAULT NULL,
`valor_unidad_medida` float(10,2) DEFAULT NULL,
`unidad_medida_abreviatura` varchar(255) DEFAULT NULL,
`codigo_sunat` varchar(255) DEFAULT NULL,
`descripcion_sunat` varchar(255) DEFAULT NULL,
`cu_tabla` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Volcado de datos para la tabla `unidad_medida`
--
INSERT INTO `unidad_medida` (`id_unidad_medida`, `unidad_medida_descripcion`, `unidad_medida_estado`, `id_tipo_unidad_medida`, `valor_unidad_medida`, `unidad_medida_abreviatura`, `codigo_sunat`, `descripcion_sunat`, `cu_tabla`) VALUES
(1, 'Kilogramos', 1, 1, NULL, 'kg', '01', 'KILOGRAMOS', '20542322412'),
(2, 'Gramos', 1, 1, NULL, 'g', '06', 'GRAMOS', '20542322412'),
(3, 'Toneladas', 1, 1, NULL, 'T', '04', 'TONELADAS MÉTRICAS', '20542322412'),
(4, 'miligramos', 1, 1, NULL, 'mg', NULL, NULL, '20542322412'),
(5, 'Mensual', 1, 9, 30.00, NULL, NULL, NULL, '20542322412'),
(6, 'Quincenal', 1, 9, 15.00, NULL, NULL, NULL, '20542322412'),
(7, 'Semanal', 1, 9, 7.00, NULL, NULL, NULL, '20542322412'),
(8, 'Diario', 1, 9, 1.00, NULL, NULL, NULL, '20542322412'),
(9, 'Anual', 1, 9, 360.00, NULL, NULL, NULL, '20542322412'),
(10, '(25%)Ganado de trabajo y reproducción; redes de pesca.', 1, 13, 0.25, NULL, NULL, NULL, '20542322412'),
(11, '(20%) Vehículos de transporte terrestre (excepto ferrocarriles); hornos en general.', 1, 13, 0.20, NULL, NULL, NULL, '20542322412'),
(12, '(20%) Maquinaria y equipo utilizados por las actividades minera, petrolera y de construcción; excepto muebles, enseres y equipos de oficina', 1, 13, 0.20, NULL, NULL, NULL, '20542322412'),
(13, '(25%) Equipos de procesamiento de datos', 1, 13, 0.25, NULL, NULL, NULL, '20542322412'),
(14, '(10%) Maquinaria y equipo adquirido a partir del 1.1.91. 1', 1, 13, 0.10, NULL, NULL, NULL, '20542322412'),
(15, '(10%) Otros bienes del activo fijo 10', 1, 13, 0.10, NULL, NULL, NULL, '20542322412'),
(16, 'Litros', 1, 11, NULL, 'l', '08', 'LITROS', '20542322412'),
(17, 'Mililitros', 1, 11, NULL, 'ml', NULL, NULL, '20542322412'),
(18, 'Metro cubicos', 1, 11, NULL, 'm3', '14', 'METROS CÚBICOS', '20542322412'),
(19, 'Centimetros Cubicos', 1, 11, NULL, 'cm3', NULL, NULL, '20542322412'),
(20, 'b', NULL, 2, 0.00, NULL, NULL, NULL, '20542322412'),
(21, 'den1', NULL, 3, 0.00, NULL, NULL, NULL, '20542322412'),
(22, 'den2', NULL, 3, 0.00, NULL, NULL, NULL, '20542322412'),
(25, 'Unidad', 1, 14, 0.00, 'unid.', '07', 'UNIDADES', '20542322412'),
(26, 'Caja', 1, 14, 0.00, NULL, '12', 'CAJAS', '20542322412');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `ventas`
--
CREATE TABLE `ventas` (
`id` int(11) NOT NULL,
`fecha` date NOT NULL,
`subtotal` decimal(11,2) NOT NULL,
`igv` decimal(11,2) NOT NULL,
`descuento` decimal(11,2) NOT NULL,
`total` decimal(11,2) NOT NULL,
`tipo_comprobante` int(11) NOT NULL,
`nro_comprobante` varchar(100) NOT NULL,
`serie` varchar(100) NOT NULL,
`estado` char(1) NOT NULL DEFAULT '1',
`monto_entregado` decimal(11,2) DEFAULT NULL,
`vuelto` decimal(11,2) DEFAULT NULL,
`id_cliente` int(11) DEFAULT NULL,
`venta_estado_consumo` int(11) DEFAULT '0',
`id_vendedor` int(11) DEFAULT NULL,
`tipo_venta` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `ventas`
--
INSERT INTO `ventas` (`id`, `fecha`, `subtotal`, `igv`, `descuento`, `total`, `tipo_comprobante`, `nro_comprobante`, `serie`, `estado`, `monto_entregado`, `vuelto`, `id_cliente`, `venta_estado_consumo`, `id_vendedor`, `tipo_venta`) VALUES
(29, '2019-11-24', '180.00', '0.00', '0.00', '180.00', 1, '20', '001', '1', '180.00', '0.00', 14, 0, 1, 2),
(30, '2019-11-24', '180.00', '0.00', '0.00', '180.00', 1, '21', '001', '1', '180.00', '0.00', 15, 0, 1, 2),
(31, '2019-11-24', '71.00', '0.00', '0.00', '71.00', 1, '22', '001', '1', '80.00', '9.00', 16, 0, 1, 2),
(32, '2019-11-24', '390.60', '0.00', '0.00', '390.60', 1, '23', '001', '1', '390.60', '0.00', 16, 0, 1, 1),
(33, '2019-11-25', '390.60', '0.00', '0.00', '390.60', 1, '24', '001', '1', '400.00', '9.40', 17, 0, 1, 1),
(34, '2019-11-25', '390.60', '0.00', '0.00', '390.60', 1, '25', '001', '1', '400.00', '9.40', 15, 0, 1, 1),
(35, '2019-11-25', '180.00', '0.00', '0.00', '180.00', 1, '26', '001', '1', '180.00', '0.00', 18, 0, 1, 2),
(36, '2019-11-26', '781.20', '0.00', '0.00', '781.20', 1, '27', '001', '1', '800.00', '18.80', 18, 0, 1, 1),
(37, '2019-11-26', '390.60', '0.00', '0.00', '390.60', 1, '28', '001', '1', '400.00', '9.40', 15, 0, 1, 1),
(38, '2019-11-26', '70.00', '0.00', '0.00', '70.00', 1, '29', '001', '1', '100.00', '30.00', 19, 0, 1, 2),
(39, '2019-11-26', '390.60', '0.00', '0.00', '390.60', 1, '30', '001', '1', '400.00', '9.40', 15, 0, 1, 1);
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `almacenes`
--
ALTER TABLE `almacenes`
ADD PRIMARY KEY (`almacen_id`) USING BTREE,
ADD KEY `id_sede` (`id_sede`) USING BTREE;
--
-- Indices de la tabla `asistencia`
--
ALTER TABLE `asistencia`
ADD PRIMARY KEY (`asistencia_id`) USING BTREE,
ADD KEY `cliente_id` (`cliente_id`) USING BTREE;
--
-- Indices de la tabla `categoria_producto`
--
ALTER TABLE `categoria_producto`
ADD PRIMARY KEY (`categoria_producto_id`) USING BTREE,
ADD KEY `id_sede` (`id_sede`) USING BTREE;
--
-- Indices de la tabla `cliente`
--
ALTER TABLE `cliente`
ADD PRIMARY KEY (`cliente_id`) USING BTREE,
ADD KEY `tipo_documento_cliente_id` (`tipo_documento_cliente_id`) USING BTREE;
--
-- Indices de la tabla `detalle_doc_sede`
--
ALTER TABLE `detalle_doc_sede`
ADD KEY `fk_doc_det` (`detalle_id_documento`) USING BTREE,
ADD KEY `fk_sed_det` (`detalle_id_sede`) USING BTREE;
--
-- Indices de la tabla `detalle_venta`
--
ALTER TABLE `detalle_venta`
ADD PRIMARY KEY (`id`),
ADD KEY `venta_id` (`venta_id`),
ADD KEY `producto_id` (`producto_id`),
ADD KEY `tipo_membresia` (`tipo_membresia`);
--
-- Indices de la tabla `documento`
--
ALTER TABLE `documento`
ADD PRIMARY KEY (`id_documento`) USING BTREE,
ADD KEY `fk_tipodoc` (`id_tipodocumento`) USING BTREE;
--
-- Indices de la tabla `empleados`
--
ALTER TABLE `empleados`
ADD PRIMARY KEY (`empleado_id`) USING BTREE,
ADD KEY `fk_perfil_empleado` (`perfil_id`) USING BTREE,
ADD KEY `empresa_ruc` (`empresa_ruc`) USING BTREE,
ADD KEY `empresa_sede` (`empresa_sede`) USING BTREE;
--
-- Indices de la tabla `empresa`
--
ALTER TABLE `empresa`
ADD PRIMARY KEY (`empresa_ruc`) USING BTREE;
--
-- Indices de la tabla `marca`
--
ALTER TABLE `marca`
ADD PRIMARY KEY (`id_marca`) USING BTREE,
ADD KEY `marca_producto_ibfk_1` (`id_sede`) USING BTREE;
--
-- Indices de la tabla `membresia`
--
ALTER TABLE `membresia`
ADD PRIMARY KEY (`membresia_id`) USING BTREE,
ADD KEY `tipo_membresia_id` (`tipo_membresia_id`) USING BTREE,
ADD KEY `cliente_id` (`cliente_id`) USING BTREE;
--
-- Indices de la tabla `modulos`
--
ALTER TABLE `modulos`
ADD PRIMARY KEY (`modulo_id`) USING BTREE;
--
-- Indices de la tabla `monedas`
--
ALTER TABLE `monedas`
ADD PRIMARY KEY (`moneda_id`) USING BTREE;
--
-- Indices de la tabla `perfiles`
--
ALTER TABLE `perfiles`
ADD PRIMARY KEY (`perfil_id`) USING BTREE;
--
-- Indices de la tabla `permisos_sede`
--
ALTER TABLE `permisos_sede`
ADD KEY `fk_detalle_sed` (`persed_id_sede`) USING BTREE,
ADD KEY `fk_detalle_per` (`persed_id_perfil`) USING BTREE,
ADD KEY `fk_detalle_mod` (`persed_id_modulo`) USING BTREE;
--
-- Indices de la tabla `producto`
--
ALTER TABLE `producto`
ADD PRIMARY KEY (`producto_id`) USING BTREE,
ADD KEY `categoria_producto_id` (`categoria_producto_id`) USING BTREE,
ADD KEY `producto_ibfk_3` (`unidad_medida_id`) USING BTREE,
ADD KEY `producto_ibfk_4` (`tipo_unidad_medida_id`) USING BTREE;
--
-- Indices de la tabla `sede`
--
ALTER TABLE `sede`
ADD PRIMARY KEY (`id_sede`) USING BTREE,
ADD KEY `empresa_ruc` (`empresa_ruc`) USING BTREE,
ADD KEY `id_distrito` (`id_distrito`) USING BTREE;
--
-- Indices de la tabla `tipo_documento`
--
ALTER TABLE `tipo_documento`
ADD PRIMARY KEY (`tipodoc_id`) USING BTREE;
--
-- Indices de la tabla `tipo_documento_cliente`
--
ALTER TABLE `tipo_documento_cliente`
ADD PRIMARY KEY (`tipo_documento_cliente_id`) USING BTREE;
--
-- Indices de la tabla `tipo_membresia`
--
ALTER TABLE `tipo_membresia`
ADD PRIMARY KEY (`tipo_membresia_id`) USING BTREE;
--
-- Indices de la tabla `tipo_unidad_medida`
--
ALTER TABLE `tipo_unidad_medida`
ADD PRIMARY KEY (`id_tipo_unidad_medida`) USING BTREE;
--
-- Indices de la tabla `unidad_medida`
--
ALTER TABLE `unidad_medida`
ADD PRIMARY KEY (`id_unidad_medida`) USING BTREE,
ADD KEY `id_tipo_unidad_medida` (`id_tipo_unidad_medida`) USING BTREE;
--
-- Indices de la tabla `ventas`
--
ALTER TABLE `ventas`
ADD PRIMARY KEY (`id`),
ADD KEY `id_cliente` (`id_cliente`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `almacenes`
--
ALTER TABLE `almacenes`
MODIFY `almacen_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT de la tabla `asistencia`
--
ALTER TABLE `asistencia`
MODIFY `asistencia_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT de la tabla `categoria_producto`
--
ALTER TABLE `categoria_producto`
MODIFY `categoria_producto_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT de la tabla `cliente`
--
ALTER TABLE `cliente`
MODIFY `cliente_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT de la tabla `detalle_venta`
--
ALTER TABLE `detalle_venta`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;
--
-- AUTO_INCREMENT de la tabla `documento`
--
ALTER TABLE `documento`
MODIFY `id_documento` int(1) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `empleados`
--
ALTER TABLE `empleados`
MODIFY `empleado_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT de la tabla `marca`
--
ALTER TABLE `marca`
MODIFY `id_marca` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT de la tabla `membresia`
--
ALTER TABLE `membresia`
MODIFY `membresia_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT de la tabla `modulos`
--
ALTER TABLE `modulos`
MODIFY `modulo_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- AUTO_INCREMENT de la tabla `monedas`
--
ALTER TABLE `monedas`
MODIFY `moneda_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `perfiles`
--
ALTER TABLE `perfiles`
MODIFY `perfil_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT de la tabla `producto`
--
ALTER TABLE `producto`
MODIFY `producto_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT de la tabla `sede`
--
ALTER TABLE `sede`
MODIFY `id_sede` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `tipo_documento`
--
ALTER TABLE `tipo_documento`
MODIFY `tipodoc_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT de la tabla `tipo_documento_cliente`
--
ALTER TABLE `tipo_documento_cliente`
MODIFY `tipo_documento_cliente_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `tipo_membresia`
--
ALTER TABLE `tipo_membresia`
MODIFY `tipo_membresia_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT de la tabla `tipo_unidad_medida`
--
ALTER TABLE `tipo_unidad_medida`
MODIFY `id_tipo_unidad_medida` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT de la tabla `unidad_medida`
--
ALTER TABLE `unidad_medida`
MODIFY `id_unidad_medida` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
--
-- AUTO_INCREMENT de la tabla `ventas`
--
ALTER TABLE `ventas`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `almacenes`
--
ALTER TABLE `almacenes`
ADD CONSTRAINT `almacenes_ibfk_1` FOREIGN KEY (`id_sede`) REFERENCES `sede` (`id_sede`);
--
-- Filtros para la tabla `asistencia`
--
ALTER TABLE `asistencia`
ADD CONSTRAINT `asistencia_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `cliente` (`cliente_id`);
--
-- Filtros para la tabla `categoria_producto`
--
ALTER TABLE `categoria_producto`
ADD CONSTRAINT `categoria_producto_ibfk_1` FOREIGN KEY (`id_sede`) REFERENCES `sede` (`id_sede`);
--
-- Filtros para la tabla `cliente`
--
ALTER TABLE `cliente`
ADD CONSTRAINT `cliente_ibfk_1` FOREIGN KEY (`tipo_documento_cliente_id`) REFERENCES `tipo_documento_cliente` (`tipo_documento_cliente_id`);
--
-- Filtros para la tabla `detalle_doc_sede`
--
ALTER TABLE `detalle_doc_sede`
ADD CONSTRAINT `detalle_doc_sede_ibfk_1` FOREIGN KEY (`detalle_id_documento`) REFERENCES `documento` (`id_documento`),
ADD CONSTRAINT `detalle_doc_sede_ibfk_2` FOREIGN KEY (`detalle_id_sede`) REFERENCES `sede` (`id_sede`);
--
-- Filtros para la tabla `detalle_venta`
--
ALTER TABLE `detalle_venta`
ADD CONSTRAINT `detalle_venta_ibfk_1` FOREIGN KEY (`venta_id`) REFERENCES `ventas` (`id`),
ADD CONSTRAINT `detalle_venta_ibfk_2` FOREIGN KEY (`producto_id`) REFERENCES `producto` (`producto_id`),
ADD CONSTRAINT `detalle_venta_ibfk_3` FOREIGN KEY (`tipo_membresia`) REFERENCES `tipo_membresia` (`tipo_membresia_id`);
--
-- Filtros para la tabla `documento`
--
ALTER TABLE `documento`
ADD CONSTRAINT `documento_ibfk_1` FOREIGN KEY (`id_tipodocumento`) REFERENCES `tipo_documento` (`tipodoc_id`);
--
-- Filtros para la tabla `empleados`
--
ALTER TABLE `empleados`
ADD CONSTRAINT `empleados_ibfk_1` FOREIGN KEY (`perfil_id`) REFERENCES `perfiles` (`perfil_id`),
ADD CONSTRAINT `empleados_ibfk_2` FOREIGN KEY (`empresa_ruc`) REFERENCES `empresa` (`empresa_ruc`),
ADD CONSTRAINT `empleados_ibfk_3` FOREIGN KEY (`empresa_sede`) REFERENCES `sede` (`id_sede`);
--
-- Filtros para la tabla `marca`
--
ALTER TABLE `marca`
ADD CONSTRAINT `marca_producto_ibfk_1` FOREIGN KEY (`id_sede`) REFERENCES `sede` (`id_sede`);
--
-- Filtros para la tabla `membresia`
--
ALTER TABLE `membresia`
ADD CONSTRAINT `membresia_ibfk_1` FOREIGN KEY (`tipo_membresia_id`) REFERENCES `tipo_membresia` (`tipo_membresia_id`),
ADD CONSTRAINT `membresia_ibfk_2` FOREIGN KEY (`cliente_id`) REFERENCES `cliente` (`cliente_id`);
--
-- Filtros para la tabla `permisos_sede`
--
ALTER TABLE `permisos_sede`
ADD CONSTRAINT `permisos_sede_ibfk_1` FOREIGN KEY (`persed_id_modulo`) REFERENCES `modulos` (`modulo_id`),
ADD CONSTRAINT `permisos_sede_ibfk_2` FOREIGN KEY (`persed_id_perfil`) REFERENCES `perfiles` (`perfil_id`),
ADD CONSTRAINT `permisos_sede_ibfk_3` FOREIGN KEY (`persed_id_sede`) REFERENCES `sede` (`id_sede`);
--
-- Filtros para la tabla `producto`
--
ALTER TABLE `producto`
ADD CONSTRAINT `producto_ibfk_1` FOREIGN KEY (`categoria_producto_id`) REFERENCES `categoria_producto` (`categoria_producto_id`),
ADD CONSTRAINT `producto_ibfk_3` FOREIGN KEY (`unidad_medida_id`) REFERENCES `unidad_medida` (`id_unidad_medida`),
ADD CONSTRAINT `producto_ibfk_4` FOREIGN KEY (`tipo_unidad_medida_id`) REFERENCES `tipo_unidad_medida` (`id_tipo_unidad_medida`);
--
-- Filtros para la tabla `unidad_medida`
--
ALTER TABLE `unidad_medida`
ADD CONSTRAINT `unidad_medida_ibfk_1` FOREIGN KEY (`id_tipo_unidad_medida`) REFERENCES `tipo_unidad_medida` (`id_tipo_unidad_medida`);
--
-- Filtros para la tabla `ventas`
--
ALTER TABLE `ventas`
ADD CONSTRAINT `ventas_ibfk_1` FOREIGN KEY (`id_cliente`) REFERENCES `cliente` (`cliente_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 */;
|
CREATE TABLE [wms].[productos_unidades] (
[nivel] INT NOT NULL,
[alto] DECIMAL (12, 4) NOT NULL,
[ancho] DECIMAL (12, 4) NOT NULL,
[factor_conversion] INT NOT NULL,
[habilitada_en_ordenes_de_ingreso] BIT NOT NULL,
[habilitada_en_ordenes_de_salida] BIT NOT NULL,
[largo] DECIMAL (12, 4) NOT NULL,
[peso_bruto] DECIMAL (12, 4) NOT NULL,
[predeterminada_en_ordenes_de_ingreso] BIT NOT NULL,
[predeterminada_en_ordenes_de_salida] BIT NOT NULL,
[unidad_base] BIT NOT NULL,
[valor_aproximado] INT NULL,
[id_unidad] INT NOT NULL,
[id_producto] INT NOT NULL,
CONSTRAINT [PK_productos_unidades] PRIMARY KEY CLUSTERED ([nivel] ASC, [id_unidad] ASC, [id_producto] ASC) WITH (FILLFACTOR = 80),
CONSTRAINT [FK_productos_unidades_01] FOREIGN KEY ([id_producto]) REFERENCES [wms].[productos] ([id_producto]),
CONSTRAINT [FK_productos_unidades_02] FOREIGN KEY ([id_unidad]) REFERENCES [wms].[unidades] ([id_unidad])
);
|
UPDATE MEDICO_TB
SET TELEFONE_COM = NULL, TELEFONE_CEL = '94712-2344'
WHERE ID = 3
DELETE MEDICO_TB WHERE ID = 2
SELECT * FROM MEDICO_TB
|
ALTER TABLE `users_sessions` CHANGE COLUMN `cIP` `cIP` INT NULL DEFAULT '0' AFTER `cReason`; |
CREATE DATABASE chat;
USE chat;
CREATE TABLE usernames (
id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(250) NOT NULL,
UNIQUE (username)
);
CREATE TABLE rooms (
id INT PRIMARY KEY AUTO_INCREMENT,
room VARCHAR(250) NOT NULL,
UNIQUE (room)
);
CREATE TABLE messages (
id INT PRIMARY KEY AUTO_INCREMENT,
message TEXT NOT NULL,
username INT NOT NULL,
FOREIGN KEY(username) REFERENCES usernames(id),
room INT NOT NULL,
FOREIGN KEY(room) REFERENCES rooms(id),
createdAt TIMESTAMP NOT NULL
);
/* Execute this file from the command line by typing:
* mysql -u root < server/schema.sql
* to create the database and the tables.*/
|
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `author` (
`aut_id` varchar(8) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`aut_name` varchar(50) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`country` varchar(25) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`home_city` varchar(25) COLLATE latin1_general_ci NOT NULL DEFAULT '',
PRIMARY KEY (`aut_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : ven. 05 juin 2020 à 09:16
-- Version du serveur : 5.7.17
-- Version de PHP : 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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 */;
--
-- Base de données : `easychef`
--
-- --------------------------------------------------------
--
-- Structure de la table `ingredient`
--
CREATE TABLE `ingredient` (
`idIngredient` int(11) NOT NULL,
`idRecipe` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`quantity` int(11) NOT NULL,
`unity` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `ingredient`
--
INSERT INTO `ingredient` (`idIngredient`, `idRecipe`, `name`, `quantity`, `unity`) VALUES
(1, 1, 'Banane', 12, ''),
(2, 1, 'Beurre', 160, 'grammes'),
(3, 1, 'Oeufs', 4, ''),
(4, 1, 'Sucre', 200, ''),
(5, 1, 'Farine', 250, 'grammes'),
(6, 1, 'Levure chimique', 1, 'sachet'),
(7, 1, 'Sucre vanillé', 1, 'grammes'),
(9, 7, 'Oeufs', 3, ''),
(10, 7, 'Farine', 100, 'grammes'),
(11, 7, 'Levure', 1, 'sachet'),
(12, 7, 'Lait', 10, 'cl'),
(13, 7, 'Huile', 10, 'cl'),
(14, 7, 'Gruyère râpé', 100, 'grammes'),
(15, 7, 'Tomates séchée', 150, 'grammes'),
(16, 7, 'Poulet rôti', 150, 'grammes'),
(17, 7, 'oignons', 1, ''),
(18, 7, 'poivre', 1, 'pincée'),
(19, 7, 'sel', 1, 'pincée');
-- --------------------------------------------------------
--
-- Structure de la table `picture`
--
CREATE TABLE `picture` (
`idPicture` int(11) NOT NULL,
`idRecipe` int(11) NOT NULL,
`path` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `picture`
--
INSERT INTO `picture` (`idPicture`, `idRecipe`, `path`) VALUES
(1, 1, 'pictureN1.jpg'),
(3, 7, 'pictureN7.jpg');
-- --------------------------------------------------------
--
-- Structure de la table `rate`
--
CREATE TABLE `rate` (
`idRate` int(11) NOT NULL,
`idUser` int(11) NOT NULL,
`idRecipe` int(11) NOT NULL,
`rating` int(11) NOT NULL,
`description` text NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `rate`
--
INSERT INTO `rate` (`idRate`, `idUser`, `idRecipe`, `rating`, `description`, `date`) VALUES
(2, 7, 1, 4, 'Un très bon cake', '2020-05-26 09:12:56'),
(3, 8, 1, 5, 'La description de la perfection', '2020-05-26 09:21:00'),
(8, 6, 7, 1, 'Update', '2020-06-04 23:03:31'),
(10, 6, 7, 5, 'deuxieme msg', '2020-06-04 23:00:56'),
(11, 6, 7, 3, 'troisième msg', '2020-06-04 23:02:57');
-- --------------------------------------------------------
--
-- Structure de la table `recipe`
--
CREATE TABLE `recipe` (
`idRecipe` int(11) NOT NULL,
`idUser` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`description` text NOT NULL,
`timeRequired` int(11) NOT NULL,
`isValid` tinyint(1) NOT NULL DEFAULT '0',
`lastChangeDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `recipe`
--
INSERT INTO `recipe` (`idRecipe`, `idUser`, `title`, `description`, `timeRequired`, `isValid`, `lastChangeDate`) VALUES
(1, 6, 'Gâteau à la banane', '1) Écraser les bananes avec une fourchette dans une assiette et les laisser de côté.\r\n2) Bien mélanger les oeufs avec le sucre.\r\n3) Rajouter la farine, le beurre, la levure et le sucre vanillé.\r\n4) Incorporer la purée de bananes à la préparation.\r\nPour finir\r\nMettre au four pendant 35 minutes sur (thermostat 3-4).', 45, 0, '2020-06-04 14:42:41'),
(7, 9, 'Cake tomates séchées et poulet rôti', '1) Préchauffer le four à 180°C (thermostat 6).\r\n2) Faire revenir l'oignon émincé à feu doux.\r\n3) Dans un récipient, mélanger farine et levure.\r\n4) Creuser un puits et ajouter les oeufs, le lait et l'huile.\r\n5) Saler, poivrer.\r\n6) Bien mélanger pour obtenir une pâte lisse.\r\n7) Ajouter le gruyère râpé, mélanger.\r\n8) Couper les tomates séchées et le poulet rôti en petits morceaux et les ajouter au mélange.\r\n9) Quand l'oignon a bien fondu, l'incorporer au mélange.\r\n10) Huiler un moule à cake et y verser le mélange\r\n11) Enfourner pendant 40 minutes.', 55, 1, '2020-06-03 10:28:02'),
(20, 6, 'tracteur scott', 'caca', 3, 0, '2020-06-04 23:45:27');
-- --------------------------------------------------------
--
-- Structure de la table `user`
--
CREATE TABLE `user` (
`idUser` int(11) NOT NULL,
`pseudo` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`admin` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
--
-- Déchargement des données de la table `user`
--
INSERT INTO `user` (`idUser`, `pseudo`, `email`, `password`, `admin`) VALUES
(6, 'admin', 'admin@admin.admin', 'dd94709528bb1c83d08f3088d4043f4742891f4f', 1),
(7, 'Leandro', 'leandro.rsstti@gmail.com', '5fb9558e1f5db0205710e789125923e1fbd37200', 0),
(8, 'David', 'david@gmail.com', '340892a69186ab0467490a4a60c14b9a21b60044', 0),
(9, 'Tracteur', 'tracteur@gmail.com', '3ee9863a42737f6d778130ecf4367486e265abcc', 0),
(10, 'Test', 'test@gmail.com', 'a010b72dac9727ba7e60c4fda46694262df561a2', 0);
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `ingredient`
--
ALTER TABLE `ingredient`
ADD PRIMARY KEY (`idIngredient`),
ADD KEY `idRecipe` (`idRecipe`);
--
-- Index pour la table `picture`
--
ALTER TABLE `picture`
ADD PRIMARY KEY (`idPicture`),
ADD KEY `idRecipe` (`idRecipe`);
--
-- Index pour la table `rate`
--
ALTER TABLE `rate`
ADD PRIMARY KEY (`idRate`),
ADD KEY `idUser` (`idUser`,`idRecipe`),
ADD KEY `idRecipe` (`idRecipe`);
--
-- Index pour la table `recipe`
--
ALTER TABLE `recipe`
ADD PRIMARY KEY (`idRecipe`),
ADD KEY `idUser` (`idUser`);
--
-- Index pour la table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`idUser`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `ingredient`
--
ALTER TABLE `ingredient`
MODIFY `idIngredient` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT pour la table `picture`
--
ALTER TABLE `picture`
MODIFY `idPicture` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT pour la table `rate`
--
ALTER TABLE `rate`
MODIFY `idRate` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT pour la table `recipe`
--
ALTER TABLE `recipe`
MODIFY `idRecipe` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT pour la table `user`
--
ALTER TABLE `user`
MODIFY `idUser` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `ingredient`
--
ALTER TABLE `ingredient`
ADD CONSTRAINT `ingredient_ibfk_1` FOREIGN KEY (`idRecipe`) REFERENCES `recipe` (`idRecipe`);
--
-- Contraintes pour la table `picture`
--
ALTER TABLE `picture`
ADD CONSTRAINT `picture_ibfk_1` FOREIGN KEY (`idRecipe`) REFERENCES `recipe` (`idRecipe`);
--
-- Contraintes pour la table `rate`
--
ALTER TABLE `rate`
ADD CONSTRAINT `rate_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`idUser`),
ADD CONSTRAINT `rate_ibfk_2` FOREIGN KEY (`idRecipe`) REFERENCES `recipe` (`idRecipe`);
--
-- Contraintes pour la table `recipe`
--
ALTER TABLE `recipe`
ADD CONSTRAINT `recipe_ibfk_2` FOREIGN KEY (`idUser`) REFERENCES `user` (`idUser`);
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 */;
|
/*创建ahub数据库*/
CREATE DATABASE ahub;
/*使用ahub数据库*/
USE ahub;
/*组织表*/
DROP TABLE IF EXISTS `org_organization`;
CREATE TABLE `org_organization` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`name` VARCHAR(64) NOT NULL COMMENT '组织名',
`address` VARCHAR(100) DEFAULT NULL COMMENT '地址',
`code` VARCHAR(64) NOT NULL COMMENT '编号',
`icon` VARCHAR(32) DEFAULT NULL COMMENT '图标',
`parent_id` BIGINT(20) NOT NULL COMMENT '父级主键',
`seq` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '排序',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='组织表';
INSERT INTO `org_organization` VALUES ('1', '2018-07-24 15:56:37','2018-07-24 15:56:37','总经办', '余杭区', '10001', 'fi-social-windows', NULL, '0');
INSERT INTO `org_organization` VALUES ('3', '2018-07-24 15:56:37','2018-07-24 15:56:37','技术部', '余杭区', '10002', 'fi-social-github', NULL, '1');
INSERT INTO `org_organization` VALUES ('5', '2018-07-24 15:56:37','2018-07-24 15:56:37','产品部', '余杭区', '10003', 'fi-social-apple', NULL, '2');
INSERT INTO `org_organization` VALUES ('6', '2018-07-24 15:56:37','2018-07-24 15:56:37','测试组', '余杭区', '10004', 'fi-social-snapchat', '3', '0');
/*资源表*/
DROP TABLE IF EXISTS `res_resource`;
CREATE TABLE `res_resource` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`name` VARCHAR(64) NOT NULL COMMENT '资源名称',
`url` VARCHAR(100) DEFAULT NULL COMMENT '资源路径',
`open_mode` VARCHAR(32) DEFAULT NULL COMMENT '打开方式 ajax,iframe',
`description` VARCHAR(255) DEFAULT NULL COMMENT '资源介绍',
`icon` VARCHAR(32) DEFAULT NULL COMMENT '资源图标',
`parent_id` BIGINT(20) DEFAULT NULL COMMENT '父级资源id',
`seq` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '排序',
`status` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '状态',
`resource_type` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '资源类别',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源表';
INSERT INTO `res_resource` VALUES ('1', '2018-07-24 15:56:37','2018-07-24 15:56:37','权限管理', '', NULL, '系统管理', 'fi-folder', NULL, '0', '0', '0');
INSERT INTO `res_resource` VALUES ('11', '2018-07-24 15:56:37','2018-07-24 15:56:37','资源管理', '/resource/manager', 'ajax', '资源管理', 'fi-database', '1', '1', '0', '0');
INSERT INTO `res_resource` VALUES ('12', '2018-07-24 15:56:37','2018-07-24 15:56:37','角色管理', '/role/manager', 'ajax', '角色管理', 'fi-torso-business', '1', '2', '0', '0');
INSERT INTO `res_resource` VALUES ('13', '2018-07-24 15:56:37','2018-07-24 15:56:37','用户管理', '/user/manager', 'ajax', '用户管理', 'fi-torsos-all', '1', '3', '0', '0');
INSERT INTO `res_resource` VALUES ('14', '2018-07-24 15:56:37','2018-07-24 15:56:37','部门管理', '/organization/manager', 'ajax', '部门管理', 'fi-results-demographics', '1', '4', '0', '0');
INSERT INTO `res_resource` VALUES ('111', '2018-07-24 15:56:37','2018-07-24 15:56:37','列表', '/resource/treeGrid', 'ajax', '资源列表', 'fi-list', '11', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('112', '2018-07-24 15:56:37','2018-07-24 15:56:37','添加', '/resource/add', 'ajax', '资源添加', 'fi-page-add', '11', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('113', '2018-07-24 15:56:37','2018-07-24 15:56:37','编辑', '/resource/edit', 'ajax', '资源编辑', 'fi-page-edit', '11', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('114', '2018-07-24 15:56:37','2018-07-24 15:56:37','删除', '/resource/delete', 'ajax', '资源删除', 'fi-page-delete', '11', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('121', '2018-07-24 15:56:37','2018-07-24 15:56:37','列表', '/role/dataGrid', 'ajax', '角色列表', 'fi-list', '12', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('122', '2018-07-24 15:56:37','2018-07-24 15:56:37','添加', '/role/add', 'ajax', '角色添加', 'fi-page-add', '12', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('123', '2018-07-24 15:56:37','2018-07-24 15:56:37','编辑', '/role/edit', 'ajax', '角色编辑', 'fi-page-edit', '12', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('124', '2018-07-24 15:56:37','2018-07-24 15:56:37','删除', '/role/delete', 'ajax', '角色删除', 'fi-page-delete', '12', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('125', '2018-07-24 15:56:37','2018-07-24 15:56:37','授权', '/role/grant', 'ajax', '角色授权', 'fi-check', '12', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('131', '2018-07-24 15:56:37','2018-07-24 15:56:37','列表', '/user/dataGrid', 'ajax', '用户列表', 'fi-list', '13', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('132', '2018-07-24 15:56:37','2018-07-24 15:56:37','添加', '/user/add', 'ajax', '用户添加', 'fi-page-add', '13', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('133', '2018-07-24 15:56:37','2018-07-24 15:56:37','编辑', '/user/edit', 'ajax', '用户编辑', 'fi-page-edit', '13', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('134', '2018-07-24 15:56:37','2018-07-24 15:56:37','删除', '/user/delete', 'ajax', '用户删除', 'fi-page-delete', '13', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('141', '2018-07-24 15:56:37','2018-07-24 15:56:37','列表', '/organization/treeGrid', 'ajax', '用户列表', 'fi-list', '14', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('142', '2018-07-24 15:56:37','2018-07-24 15:56:37','添加', '/organization/add', 'ajax', '部门添加', 'fi-page-add', '14', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('143', '2018-07-24 15:56:37','2018-07-24 15:56:37','编辑', '/organization/edit', 'ajax', '部门编辑', 'fi-page-edit', '14', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('144', '2018-07-24 15:56:37','2018-07-24 15:56:37','删除', '/organization/delete', 'ajax', '部门删除', 'fi-page-delete', '14', '0', '0', '1');
INSERT INTO `res_resource` VALUES ('221', '2018-07-24 15:56:37','2018-07-24 15:56:37','日志监控', '', NULL, NULL, 'fi-folder', NULL, '2', '0', '0');
INSERT INTO `res_resource` VALUES ('222', '2018-07-24 15:56:37','2018-07-24 15:56:37','视频教程', '', NULL, NULL, 'fi-folder', NULL, '1', '0', '0');
INSERT INTO `res_resource` VALUES ('223', '2018-07-24 15:56:37','2018-07-24 15:56:37','官方网站', 'http://www.dreamlu.net/', 'iframe', NULL, 'fi-home', '222', '0', '0', '0');
INSERT INTO `res_resource` VALUES ('224', '2018-07-24 15:56:37','2018-07-24 15:56:37','jfinal视频', 'http://blog.dreamlu.net/blog/79', 'iframe', NULL, 'fi-video', '222', '1', '0', '0');
INSERT INTO `res_resource` VALUES ('226', '2018-07-24 15:56:37','2018-07-24 15:56:37','修改密码', '/user/editPwdPage', 'ajax', NULL, 'fi-unlock', NULL, '3', '0', '1');
INSERT INTO `res_resource` VALUES ('227', '2018-07-24 15:56:37','2018-07-24 15:56:37','登录日志', '/sysLog/manager', 'ajax', NULL, 'fi-info', '221', '0', '0', '0');
INSERT INTO `res_resource` VALUES ('228', '2018-07-24 15:56:37','2018-07-24 15:56:37','Druid监控', '/druid', 'iframe', NULL, 'fi-monitor', '221', '0', '0', '0');
INSERT INTO `res_resource` VALUES ('229', '2018-07-24 15:56:37','2018-07-24 15:56:37','系统图标', '/icons.html', 'ajax', NULL, 'fi-photo', '221', '0', '0', '0');
/*角色表*/
DROP TABLE IF EXISTS `acc_role`;
CREATE TABLE `acc_role` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`name` VARCHAR(64) NOT NULL COMMENT '角色名',
`seq` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '排序号',
`description` VARCHAR(255) DEFAULT NULL COMMENT '简介',
`status` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色表';
INSERT INTO `acc_role` VALUES ('1', '2018-07-24 15:56:37','2018-07-24 15:56:37','admin', '0', '超级管理员', '0');
INSERT INTO `acc_role` VALUES ('2', '2018-07-24 15:56:37','2018-07-24 15:56:37','de', '0', '技术部经理', '0');
INSERT INTO `acc_role` VALUES ('7', '2018-07-24 15:56:37','2018-07-24 15:56:37','pm', '0', '产品部经理', '0');
INSERT INTO `acc_role` VALUES ('8', '2018-07-24 15:56:37','2018-07-24 15:56:37','test', '0', '测试账户', '0');
/*角色资源表*/
DROP TABLE IF EXISTS `acc_role_resource`;
CREATE TABLE `acc_role_resource` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`role_id` BIGINT(20) NOT NULL COMMENT '角色id',
`resource_id` BIGINT(20) NOT NULL COMMENT '资源id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色资源表';
-- ----------------------------
-- Records of acc_role_resource
-- ----------------------------
INSERT INTO `acc_role_resource` VALUES ('158','2018-07-24 15:56:37','2018-07-24 15:56:37', '3', '1');
INSERT INTO `acc_role_resource` VALUES ('159','2018-07-24 15:56:37','2018-07-24 15:56:37', '3', '11');
INSERT INTO `acc_role_resource` VALUES ('160', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '111');
INSERT INTO `acc_role_resource` VALUES ('161', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '112');
INSERT INTO `acc_role_resource` VALUES ('162', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '113');
INSERT INTO `acc_role_resource` VALUES ('163', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '114');
INSERT INTO `acc_role_resource` VALUES ('164', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '12');
INSERT INTO `acc_role_resource` VALUES ('165', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '121');
INSERT INTO `acc_role_resource` VALUES ('166', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '122');
INSERT INTO `acc_role_resource` VALUES ('167', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '123');
INSERT INTO `acc_role_resource` VALUES ('168', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '124');
INSERT INTO `acc_role_resource` VALUES ('169', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '125');
INSERT INTO `acc_role_resource` VALUES ('170', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '13');
INSERT INTO `acc_role_resource` VALUES ('171', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '131');
INSERT INTO `acc_role_resource` VALUES ('172', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '132');
INSERT INTO `acc_role_resource` VALUES ('173', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '133');
INSERT INTO `acc_role_resource` VALUES ('174', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '134');
INSERT INTO `acc_role_resource` VALUES ('175', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '14');
INSERT INTO `acc_role_resource` VALUES ('176', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '141');
INSERT INTO `acc_role_resource` VALUES ('177', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '142');
INSERT INTO `acc_role_resource` VALUES ('178', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '143');
INSERT INTO `acc_role_resource` VALUES ('179', '2018-07-24 15:56:37','2018-07-24 15:56:37','3', '144');
INSERT INTO `acc_role_resource` VALUES ('359', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '1');
INSERT INTO `acc_role_resource` VALUES ('360', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '14');
INSERT INTO `acc_role_resource` VALUES ('361', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '141');
INSERT INTO `acc_role_resource` VALUES ('362', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '142');
INSERT INTO `acc_role_resource` VALUES ('363', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '143');
INSERT INTO `acc_role_resource` VALUES ('364', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '222');
INSERT INTO `acc_role_resource` VALUES ('365', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '223');
INSERT INTO `acc_role_resource` VALUES ('366', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '224');
INSERT INTO `acc_role_resource` VALUES ('367', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '221');
INSERT INTO `acc_role_resource` VALUES ('368', '2018-07-24 15:56:37','2018-07-24 15:56:37','7', '226');
INSERT INTO `acc_role_resource` VALUES ('409', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '1');
INSERT INTO `acc_role_resource` VALUES ('410', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '11');
INSERT INTO `acc_role_resource` VALUES ('411', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '111');
INSERT INTO `acc_role_resource` VALUES ('412', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '112');
INSERT INTO `acc_role_resource` VALUES ('413', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '113');
INSERT INTO `acc_role_resource` VALUES ('414', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '114');
INSERT INTO `acc_role_resource` VALUES ('415', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '12');
INSERT INTO `acc_role_resource` VALUES ('416', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '121');
INSERT INTO `acc_role_resource` VALUES ('417', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '122');
INSERT INTO `acc_role_resource` VALUES ('418', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '123');
INSERT INTO `acc_role_resource` VALUES ('419', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '124');
INSERT INTO `acc_role_resource` VALUES ('420', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '125');
INSERT INTO `acc_role_resource` VALUES ('421', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '13');
INSERT INTO `acc_role_resource` VALUES ('422', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '131');
INSERT INTO `acc_role_resource` VALUES ('423', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '132');
INSERT INTO `acc_role_resource` VALUES ('424', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '133');
INSERT INTO `acc_role_resource` VALUES ('425', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '134');
INSERT INTO `acc_role_resource` VALUES ('426', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '14');
INSERT INTO `acc_role_resource` VALUES ('427', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '141');
INSERT INTO `acc_role_resource` VALUES ('428', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '142');
INSERT INTO `acc_role_resource` VALUES ('429', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '143');
INSERT INTO `acc_role_resource` VALUES ('430', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '144');
INSERT INTO `acc_role_resource` VALUES ('431', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '222');
INSERT INTO `acc_role_resource` VALUES ('432', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '223');
INSERT INTO `acc_role_resource` VALUES ('433', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '224');
INSERT INTO `acc_role_resource` VALUES ('434', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '221');
INSERT INTO `acc_role_resource` VALUES ('435', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '227');
INSERT INTO `acc_role_resource` VALUES ('436', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '228');
INSERT INTO `acc_role_resource` VALUES ('437', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '1');
INSERT INTO `acc_role_resource` VALUES ('438', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '13');
INSERT INTO `acc_role_resource` VALUES ('439', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '131');
INSERT INTO `acc_role_resource` VALUES ('440', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '132');
INSERT INTO `acc_role_resource` VALUES ('441', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '133');
INSERT INTO `acc_role_resource` VALUES ('442', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '222');
INSERT INTO `acc_role_resource` VALUES ('443', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '223');
INSERT INTO `acc_role_resource` VALUES ('444', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '224');
INSERT INTO `acc_role_resource` VALUES ('445', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '221');
INSERT INTO `acc_role_resource` VALUES ('446', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '227');
INSERT INTO `acc_role_resource` VALUES ('447', '2018-07-24 15:56:37','2018-07-24 15:56:37','2', '228');
INSERT INTO `acc_role_resource` VALUES ('448', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '1');
INSERT INTO `acc_role_resource` VALUES ('449', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '11');
INSERT INTO `acc_role_resource` VALUES ('450', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '111');
INSERT INTO `acc_role_resource` VALUES ('451', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '12');
INSERT INTO `acc_role_resource` VALUES ('452', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '121');
INSERT INTO `acc_role_resource` VALUES ('453', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '13');
INSERT INTO `acc_role_resource` VALUES ('454', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '131');
INSERT INTO `acc_role_resource` VALUES ('455', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '14');
INSERT INTO `acc_role_resource` VALUES ('456', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '141');
INSERT INTO `acc_role_resource` VALUES ('457', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '222');
INSERT INTO `acc_role_resource` VALUES ('458', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '223');
INSERT INTO `acc_role_resource` VALUES ('459', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '224');
INSERT INTO `acc_role_resource` VALUES ('460', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '221');
INSERT INTO `acc_role_resource` VALUES ('461', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '227');
INSERT INTO `acc_role_resource` VALUES ('462', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '228');
INSERT INTO `acc_role_resource` VALUES ('478', '2018-07-24 15:56:37','2018-07-24 15:56:37','8', '229');
/*系统日志表*/
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`user_id` BIGINT(20) DEFAULT NULL COMMENT '操作用户id',
`opt_desc` VARCHAR(1024) DEFAULT NULL COMMENT '操作内容',
`ip` VARCHAR(255) DEFAULT NULL COMMENT '客户端ip',
`url` VARCHAR(128) NOT NULL COMMENT '请求路径'
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统日志表';
/*用户表*/
DROP TABLE IF EXISTS `acc_user`;
CREATE TABLE `acc_user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`account` VARCHAR(64) NOT NULL COMMENT '登陆名',
`name` VARCHAR(64) NOT NULL COMMENT '用户名',
-- `salt` varchar(32) NOT NULL COMMENT '加盐',
`password` VARCHAR(64) NOT NULL COMMENT '密码',
`sex` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '性别',
`age` TINYINT(2) DEFAULT '0' COMMENT '年龄',
`phone` VARCHAR(20) DEFAULT NULL COMMENT '手机号',
`user_type` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '用户类别',
`status` TINYINT(2) NOT NULL DEFAULT '0' COMMENT '用户状态',
`organization_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属机构',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表';
INSERT INTO `acc_user` VALUES ('1', '2018-07-24 15:56:37','2018-07-24 15:56:37','admin', 'admin','098f6bcd4621d373cade4e832627b4f6', '0', '25', '18707173376', '0', '0', '1');
INSERT INTO `acc_user` VALUES ('13', '2018-07-24 15:56:37','2018-07-24 15:56:37','snoopy', 'snoopy','098f6bcd4621d373cade4e832627b4f6', '0', '25', '18707173376', '1', '0', '3');
INSERT INTO `acc_user` VALUES ('14', '2018-07-24 15:56:37','2018-07-24 15:56:37','lisi', 'lisi','098f6bcd4621d373cade4e832627b4f6', '0', '25', '18707173376', '1', '0', '5');
INSERT INTO `acc_user` VALUES ('15', '2018-07-24 15:56:37','2018-07-24 15:56:37','test', 'test','098f6bcd4621d373cade4e832627b4f6', '0', '25', '18707173376', '1', '0', '6');
/*用户角色表*/
DROP TABLE IF EXISTS `acc_user_role`;
CREATE TABLE `acc_user_role` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`user_id` bigint(20) NOT NULL COMMENT '用户id',
`role_id` bigint(20) NOT NULL COMMENT '角色id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色表';
INSERT INTO `acc_user_role` VALUES ('53', '2018-07-24 15:56:37','2018-07-24 15:56:37','15', '8');
INSERT INTO `acc_user_role` VALUES ('60', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '1');
INSERT INTO `acc_user_role` VALUES ('61', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '2');
INSERT INTO `acc_user_role` VALUES ('62', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '7');
INSERT INTO `acc_user_role` VALUES ('63', '2018-07-24 15:56:37','2018-07-24 15:56:37','13', '2');
INSERT INTO `acc_user_role` VALUES ('64', '2018-07-24 15:56:37','2018-07-24 15:56:37','14', '7');
INSERT INTO `acc_user_role` VALUES ('65', '2018-07-24 15:56:37','2018-07-24 15:56:37','1', '8'); |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Värd: 127.0.0.1
-- Tid vid skapande: 19 mars 2015 kl 08:31
-- Serverversion: 5.5.23
-- PHP-version: 5.5.12
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 */;
--
-- Databas: `guest-app`
--
-- --------------------------------------------------------
--
-- Tabellstruktur `events`
--
CREATE TABLE IF NOT EXISTS `events` (
`eventID` int(11) NOT NULL AUTO_INCREMENT,
`eventName` varchar(45) DEFAULT NULL,
PRIMARY KEY (`eventID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumpning av Data i tabell `events`
--
INSERT INTO `events` (`eventID`, `eventName`) VALUES
(1, 'BBQ'),
(2, 'AKA - 4/3');
-- --------------------------------------------------------
--
-- Tabellstruktur `event_guest`
--
CREATE TABLE IF NOT EXISTS `event_guest` (
`eventID` int(11) NOT NULL,
`guestID` int(11) NOT NULL,
PRIMARY KEY (`eventID`,`guestID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumpning av Data i tabell `event_guest`
--
INSERT INTO `event_guest` (`eventID`, `guestID`) VALUES
(1, 1),
(1, 2),
(1, 3),
(1, 24),
(2, 7),
(2, 8),
(2, 21),
(2, 22);
-- --------------------------------------------------------
--
-- Tabellstruktur `guests`
--
CREATE TABLE IF NOT EXISTS `guests` (
`guestID` int(11) NOT NULL AUTO_INCREMENT,
`forename` varchar(45) DEFAULT NULL,
`surname` varchar(45) DEFAULT NULL,
`checkedIn` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`guestID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;
--
-- Dumpning av Data i tabell `guests`
--
INSERT INTO `guests` (`guestID`, `forename`, `surname`, `checkedIn`) VALUES
(1, 'Anton', 'Furuholm', 1),
(2, 'David', 'Fransson', 0),
(3, 'Daniel', 'Fasth', 1),
(7, 'Johan', 'Kohlin', 0),
(8, 'Anders', 'Bagge', 1),
(21, 'Hasse', 'Nilsson', 0),
(22, 'Gunnar', 'Abrahamsson', 1),
(23, 'Sven-olof', 'Dickhagen', 1);
-- --------------------------------------------------------
--
-- Tabellstruktur `hj-students`
--
CREATE TABLE IF NOT EXISTS `hj-students` (
`studentID` int(11) NOT NULL AUTO_INCREMENT,
`studentName` varchar(45) DEFAULT NULL,
PRIMARY KEY (`studentID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Tabellstruktur `hj-student_guest`
--
CREATE TABLE IF NOT EXISTS `hj-student_guest` (
`studentID` int(11) NOT NULL,
`guestID` int(11) NOT NULL,
PRIMARY KEY (`studentID`,`guestID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Tabellstruktur `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`userID` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(45) DEFAULT NULL,
`email` varchar(65) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`admin` tinyint(1) DEFAULT NULL,
`lastname` varchar(45) DEFAULT NULL,
PRIMARY KEY (`userID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumpning av Data i tabell `users`
--
INSERT INTO `users` (`userID`, `firstname`, `email`, `password`, `admin`, `lastname`) VALUES
(2, 'Anton', 'anton@gmail.com', '$2y$11$9f298fd85b65f559d6b08ufLlGavM5sOCmYiejjz8rS3R8SeHQYOO', 1, 'Furuholm'),
(3, 'David', 'david@gmail.com', '$2y$11$a37cf185224b46bd34e21eSF65joNpPOVTGF6p.lWCP4KQUR5W.1O', 0, 'Fransson'),
(4, 'Daniel', 'daniel@gmail.com', '$2y$11$468c5ee14557516af4d9fOSTTRjR2VBFztVmo8Rc6dSbqOwBMDPlG', 0, 'Fasth');
/*!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 */;
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 25 Jan 2021 pada 08.26
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `choise`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_admin`
--
CREATE TABLE `tb_admin` (
`id_admin` int(5) NOT NULL,
`id_level` int(5) NOT NULL,
`nama_admin` varchar(100) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_admin`
--
INSERT INTO `tb_admin` (`id_admin`, `id_level`, `nama_admin`, `username`, `password`) VALUES
(1, 1, 'Administrator', 'test', 'cc03e747a6afbbcbf8be7668acfebee5'),
(2, 2, 'Dian', 'dian', '750f48161355ac52ad11c48ef5be70b6');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_apply`
--
CREATE TABLE `tb_apply` (
`id_apply` int(5) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`id_lowongan` int(5) NOT NULL,
`id_perusahaan` int(5) NOT NULL,
`status_lamaran` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_apply`
--
INSERT INTO `tb_apply` (`id_apply`, `id_pelamar`, `id_lowongan`, `id_perusahaan`, `status_lamaran`) VALUES
(7, 1, 1, 2, 'Diterima'),
(8, 16, 1, 2, 'Tidak lolos'),
(9, 29, 2, 1, 'Diterima'),
(10, 31, 2, 1, 'Diterima'),
(11, 30, 2, 1, 'Diterima');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_berkas`
--
CREATE TABLE `tb_berkas` (
`id_berkas` int(5) NOT NULL,
`id_pelamar` int(5) NOT NULL,
`berkas` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_berkas`
--
INSERT INTO `tb_berkas` (`id_berkas`, `id_pelamar`, `berkas`) VALUES
(1, 1, 'berkas_Salmon.pdf'),
(2, 16, 'berkas_Dhiki_Sekti_Wibawa1.pdf'),
(3, 29, 'berkas_Vivid_Amalia_Khusna.pdf'),
(4, 30, ''),
(5, 31, 'berkas_Firda_Elfinda_Nurhidayah.pdf');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_data_diri`
--
CREATE TABLE `tb_data_diri` (
`nik` varchar(20) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`nama_pelamar` varchar(150) NOT NULL,
`alamat` text NOT NULL,
`alamat_ktp` text NOT NULL,
`status_perkawinan` varchar(20) NOT NULL,
`agama` varchar(20) NOT NULL,
`anak_ke` varchar(10) NOT NULL,
`dari_x_sdr` varchar(10) NOT NULL,
`tempat_lahir` varchar(100) NOT NULL,
`tanggal_lahir` date NOT NULL,
`jenis_kelamin` enum('L','P') NOT NULL,
`no_hp` varchar(13) NOT NULL,
`facebook` varchar(100) NOT NULL,
`instagram` varchar(100) NOT NULL,
`twitter` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_data_diri`
--
INSERT INTO `tb_data_diri` (`nik`, `id_pelamar`, `nama_pelamar`, `alamat`, `alamat_ktp`, `status_perkawinan`, `agama`, `anak_ke`, `dari_x_sdr`, `tempat_lahir`, `tanggal_lahir`, `jenis_kelamin`, `no_hp`, `facebook`, `instagram`, `twitter`) VALUES
('0', 30, 'R', 'O', 'E', 'Belum Menikah', 'Islam', '2', '5', '-', '2002-11-05', 'P', '8', 'A', 'E', 'I'),
('1212132442131', 3, 'Fulanah', 'Gempol', '', '', '', '', '', 'Malang', '2020-07-05', 'P', '323212121', '-', '-', '-'),
('123456789101112', 1, 'Salmon', 'hehe', 'hehehe', 'Sudah Menikah', 'Kong Hu Cu', '2', '4', 'test', '1998-05-11', 'P', '085707236937', 'hahas', '-', '-'),
('1298192819', 4, 'Test 123', 'hahah', '', '', '', '', '', 'Pasuruan', '2020-08-30', 'P', '-', 'skajsj', 'jkasjk', 'jkj'),
('351', 16, 'Dhiki Sekti Wibawa', 'Sidoarjo', 'Sidoarjo', 'Belum Menikah', 'Islam', '1', '3', 'Sidoarjo', '1998-02-18', 'L', '0895384959837', '-', 'dhikiwibawa', '-'),
('3516086503980002', 29, 'Vivid Amalia Khusna', 'Jl. Karangmenjangan VI No. 8D', 'Dsn. Lontar RT. 23 RW. 06 Ds. Kebondalem Kec. Mojosari Kab. Mojokerto', 'Belum Menikah', 'Islam', '3', '3', 'Mojokerto', '1998-03-25', 'P', '085790927663', '-', 'vmaliaa', '-'),
('3523114106990004', 31, 'Firda Elfinda Nurhidayah', 'Sumurcinde Rt.004 Rw.004, Soko,Tuban', 'Sumurcinde Rt.004 Rw.004, Soko,Tuban', 'Belum Menikah', 'Islam', '1', '1', 'Tuban', '1999-06-01', 'P', '085606714331', 'Firda Elfinda Nurhidayah', '@firdaelfinda_n', '@_firdaelfinda'),
('78675654536879', 2, 'Fulan', 'Tak diketahui', '', '', '', '', '', 'Malang', '2019-06-10', 'L', '0887867656', '-', '-', '-');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_data_jawaban_cfit`
--
CREATE TABLE `tb_data_jawaban_cfit` (
`id_jawaban_cfit` int(11) NOT NULL,
`id_pelamar` int(5) NOT NULL,
`id_lowongan` int(5) NOT NULL,
`nomor_soal` int(5) NOT NULL,
`id_ujian` int(5) NOT NULL,
`subtes` varchar(5) NOT NULL,
`jawaban` varchar(5) NOT NULL,
`jawaban2` varchar(5) NOT NULL,
`jawaban_kunci` varchar(3) NOT NULL,
`jawaban_kunci2` varchar(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_data_jawaban_holland`
--
CREATE TABLE `tb_data_jawaban_holland` (
`id_jawaban_holland` int(11) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`id_lowongan` int(11) NOT NULL,
`id_ujian` int(11) NOT NULL,
`nilai_r` int(11) NOT NULL,
`nilai_i` int(11) NOT NULL,
`nilai_a` int(11) NOT NULL,
`nilai_s` int(11) NOT NULL,
`nilai_e` int(11) NOT NULL,
`nilai_k` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_data_jawaban_holland`
--
INSERT INTO `tb_data_jawaban_holland` (`id_jawaban_holland`, `id_pelamar`, `id_lowongan`, `id_ujian`, `nilai_r`, `nilai_i`, `nilai_a`, `nilai_s`, `nilai_e`, `nilai_k`) VALUES
(1, 1, 1, 1, 10, 7, 15, 7, 19, 10);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_data_jawaban_papi`
--
CREATE TABLE `tb_data_jawaban_papi` (
`id_jawaban_papi` int(11) NOT NULL,
`id_pelamar` int(5) NOT NULL,
`id_lowongan` int(5) NOT NULL,
`id_ujian` int(5) NOT NULL,
`no_soal` int(5) NOT NULL,
`jawaban` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_data_jawaban_papi`
--
INSERT INTO `tb_data_jawaban_papi` (`id_jawaban_papi`, `id_pelamar`, `id_lowongan`, `id_ujian`, `no_soal`, `jawaban`) VALUES
(1, 1, 1, 1, 1, 'G'),
(2, 1, 1, 1, 2, 'N'),
(3, 1, 1, 1, 3, 'P'),
(4, 1, 1, 1, 4, 'P'),
(5, 1, 1, 1, 90, 'X');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_data_keluarga`
--
CREATE TABLE `tb_data_keluarga` (
`id_keluarga` int(5) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`nama_ayah` varchar(50) NOT NULL,
`pekerjaan_ayah` varchar(50) NOT NULL,
`nama_ibu` varchar(50) NOT NULL,
`pekerjaan_ibu` varchar(50) NOT NULL,
`nama_pasangan` varchar(50) NOT NULL,
`pekerjaan_pasangan` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_data_keluarga`
--
INSERT INTO `tb_data_keluarga` (`id_keluarga`, `id_pelamar`, `nama_ayah`, `pekerjaan_ayah`, `nama_ibu`, `pekerjaan_ibu`, `nama_pasangan`, `pekerjaan_pasangan`) VALUES
(1, 1, 'Joko', 'Swasta', 'Siadah', 'Ibu rumah tangga', 'kang oleh', 'penjual odading'),
(2, 2, 'Daniel', 'PNS', 'Nur', 'Guru', '', ''),
(3, 4, 'hehe', 'swasta', 'huhu', 'dagang', '', ''),
(4, 16, 'LP', 'W', 'DNW', 'B', '', ''),
(5, 29, 'asdsd', 'aa', 'asd', 'ss', '-', 'dd'),
(6, 30, 'A', 'C', 'B', 'D', '', ''),
(7, 31, 'Kastum Wibowo', 'Wiraswasta', 'Susanti', 'Ibu Rumah Tangga', '', '');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_data_pendidikan`
--
CREATE TABLE `tb_data_pendidikan` (
`id_pendidikan` int(5) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`jenjang_pendidikan` varchar(10) NOT NULL,
`nama_institusi` varchar(100) NOT NULL,
`jurusan` varchar(100) NOT NULL,
`tahun_masuk` varchar(4) NOT NULL,
`tahun_keluar` varchar(4) NOT NULL,
`nilai_akhir` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_data_pendidikan`
--
INSERT INTO `tb_data_pendidikan` (`id_pendidikan`, `id_pelamar`, `jenjang_pendidikan`, `nama_institusi`, `jurusan`, `tahun_masuk`, `tahun_keluar`, `nilai_akhir`) VALUES
(1, 1, 'SMA/SMK', 'SMKN 10 Magelang', 'Akuntansi', '2017', '2020', '70'),
(2, 2, 'S1', 'Univ Sendiri', 'Hukum', '2014', '2018', '4'),
(3, 3, 'SMP', 'SMP Maju Putra', '-', '2009', '2012', '90'),
(4, 16, 'D4/S1', 'UB', 'SI', '2016', '2020', '3.64'),
(6, 29, 'D4/S1', 'Universitas Airlangga', 'Ekonomi Pembangunan', '2016', '2020', '3'),
(7, 30, 'S3', 'WAGENINGEN UNIVERSITY, EDINBURGH', 'Ekonomi Pembangunan', '1998', '2020', '5'),
(8, 31, 'SMA/SMK', 'SMKN 1 BOJONEGORO', 'Administrasi Perkantoran', '2014', '2017', '6975');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_data_pendidikan_nonformal`
--
CREATE TABLE `tb_data_pendidikan_nonformal` (
`id_pendidikan_nonformal` int(5) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`nama_pendidikan_nonformal` varchar(100) NOT NULL,
`tujuan_pendidikan_nonformal` varchar(300) NOT NULL,
`tahun_pendidikan_nonformal` varchar(4) NOT NULL,
`nomor_sertifikat` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_data_pendidikan_nonformal`
--
INSERT INTO `tb_data_pendidikan_nonformal` (`id_pendidikan_nonformal`, `id_pelamar`, `nama_pendidikan_nonformal`, `tujuan_pendidikan_nonformal`, `tahun_pendidikan_nonformal`, `nomor_sertifikat`) VALUES
(2, 29, 'aa', 'sd', '2020', 'fs'),
(3, 30, 'CALISTUNG', 'MEMBACA, MENULIS, BERHITUNG', '2003', '000');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_data_pengalaman_kerja`
--
CREATE TABLE `tb_data_pengalaman_kerja` (
`id_pengalaman` int(5) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`nama_perusahaan` varchar(100) NOT NULL,
`periode` varchar(10) NOT NULL,
`jabatan_akhir` varchar(100) NOT NULL,
`alasan_keluar` varchar(100) NOT NULL,
`nama_referensi` varchar(300) NOT NULL,
`no_hp_referensi` varchar(13) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_data_pengalaman_kerja`
--
INSERT INTO `tb_data_pengalaman_kerja` (`id_pengalaman`, `id_pelamar`, `nama_perusahaan`, `periode`, `jabatan_akhir`, `alasan_keluar`, `nama_referensi`, `no_hp_referensi`) VALUES
(1, 1, 'CV Palugada', '2016', 'Marketing', 'Kontrak Berakhir', '-', '-'),
(2, 2, 'PT Mencari Berkah', '2018', 'Staff programmer', 'pekerjaan tidak sesuai dengan jobdesk', '-', '-'),
(5, 30, 'BAKSO NARIZ', '7', 'ASISTEN', 'KELELAHAN', '-', '0');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_jadwal`
--
CREATE TABLE `tb_jadwal` (
`id_jadwal` int(5) NOT NULL,
`id_lowongan` int(5) NOT NULL,
`id_perusahaan` int(5) NOT NULL,
`tes_tulis` date NOT NULL,
`tes_wawancara` date NOT NULL,
`test_fgd` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_jenis_motlet`
--
CREATE TABLE `tb_jenis_motlet` (
`id_jenis_motlet` int(5) NOT NULL,
`jenis_motlet` enum('Lowongan Kerja','Kenaikan Jabatan') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_jenis_motlet`
--
INSERT INTO `tb_jenis_motlet` (`id_jenis_motlet`, `jenis_motlet`) VALUES
(1, 'Lowongan Kerja'),
(2, 'Kenaikan Jabatan');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_level`
--
CREATE TABLE `tb_level` (
`id_level` int(5) NOT NULL,
`nama_level` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_level`
--
INSERT INTO `tb_level` (`id_level`, `nama_level`) VALUES
(1, 'Administrator'),
(2, 'Admin Sdm'),
(3, 'Perusahaan'),
(4, 'Psikolog'),
(5, 'Pelamar');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_lowongan`
--
CREATE TABLE `tb_lowongan` (
`id_lowongan` int(5) NOT NULL,
`id_perusahaan` int(5) NOT NULL,
`id_jenis_motlet` int(5) NOT NULL,
`nama_jabatan` varchar(100) NOT NULL,
`jadwal_seleksi` date NOT NULL,
`kota_penempatan` varchar(100) NOT NULL,
`persyaratan` text NOT NULL,
`gaji` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_lowongan`
--
INSERT INTO `tb_lowongan` (`id_lowongan`, `id_perusahaan`, `id_jenis_motlet`, `nama_jabatan`, `jadwal_seleksi`, `kota_penempatan`, `persyaratan`, `gaji`) VALUES
(1, 2, 1, 'Kepala Bagian (Kabag) HRD & GA', '2020-10-23', 'Sidoarjo - Jawa Timur', '<p> </p><ul><li>Berusia 27-35 tahun</li><li>Pendidikan Min. S1 Manajemen SDM / Psikologi Industri & Organisasi / Teknik Industri / Ilmu Hukum</li><li>Menguasai UU Ketenagakerjaan dan Hubungan Internasional</li><li>Memiliki Jiwa Kepemimpinan</li><li>Mampu Berkomunikasi Secara Efektif</li></ul>', '-'),
(2, 1, 1, 'Freelance Surveyor', '2020-11-17', 'Surabaya', '<p>-</p>', '-');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_motivation_letter`
--
CREATE TABLE `tb_motivation_letter` (
`id_motivasi` int(5) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`id_soal` int(5) NOT NULL,
`jawaban_soal` text NOT NULL,
`jawaban_soal2` text NOT NULL,
`jawaban_soal3` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_motivation_letter`
--
INSERT INTO `tb_motivation_letter` (`id_motivasi`, `id_pelamar`, `id_soal`, `jawaban_soal`, `jawaban_soal2`, `jawaban_soal3`) VALUES
(3, 2, 1, 'aqwertyujnfdsazxc', '', ''),
(4, 2, 5, 'az nm,nhgfdxcg', '', ''),
(5, 3, 1, 'zd vhijolkjfc', '', ''),
(6, 3, 5, 'mnbvfyukmnhdgh', '', ''),
(18, 1, 0, 'test124', '1223433q3', ''),
(21, 1, 0, 'test124', '1223433q3', ''),
(22, 16, 0, 'Mencoba', 'Mencoba', ''),
(23, 29, 0, '-', '-', ''),
(24, 31, 0, 'fddfd', 'gfgfgf\r\n', ''),
(25, 30, 0, 'impian saya, saya ingin liburan, 1 hari tidur sepuasnya', 'menurut saya tidur adalah impian semua orang', '');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_nilai`
--
CREATE TABLE `tb_nilai` (
`id_nilai` int(5) NOT NULL,
`id_pelamar` int(11) NOT NULL,
`id_lowongan` int(5) NOT NULL,
`id_perusahaan` int(5) NOT NULL,
`nilai_iq` int(10) NOT NULL,
`gambaran_kepribadian` text NOT NULL,
`nilai_pwb` int(10) NOT NULL,
`nilai_holand_r` int(10) NOT NULL,
`nilai_holand_i` int(10) NOT NULL,
`nilai_holand_a` int(10) NOT NULL,
`nilai_holand_s` int(10) NOT NULL,
`nilai_holand_e` int(10) NOT NULL,
`nilai_holand_c` int(10) NOT NULL,
`nilai_papiskotik` int(10) NOT NULL,
`nilai_msdt` int(10) NOT NULL,
`nilai_cfit` int(10) NOT NULL,
`nilai_kemampuan_bidang` int(10) NOT NULL,
`nilai_studi_kasus` int(10) NOT NULL,
`nilai_perhitungan` int(10) NOT NULL,
`nilai_wawancara` int(10) NOT NULL,
`nilai_fgd` int(10) NOT NULL,
`kesimpulan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_nilai`
--
INSERT INTO `tb_nilai` (`id_nilai`, `id_pelamar`, `id_lowongan`, `id_perusahaan`, `nilai_iq`, `gambaran_kepribadian`, `nilai_pwb`, `nilai_holand_r`, `nilai_holand_i`, `nilai_holand_a`, `nilai_holand_s`, `nilai_holand_e`, `nilai_holand_c`, `nilai_papiskotik`, `nilai_msdt`, `nilai_cfit`, `nilai_kemampuan_bidang`, `nilai_studi_kasus`, `nilai_perhitungan`, `nilai_wawancara`, `nilai_fgd`, `kesimpulan`) VALUES
(2, 2, 3, 1, 130, 'Mantap dong Cuy!!', 120, 130, 124, 121, 100, 120, 140, 140, 150, 80, 90, 150, 200, 110, 90, 'LOLOSKAN'),
(3, 1, 3, 1, 190, 'Joos Gandos kotos kotos', 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 100, 100, 'Mantap'),
(4, 3, 1, 2, 118, 'Hahaha', 29829, 9898, 9898, 9898, 898, 9, 17, 9, 787, 80, 8989, 12, 90, 120, 1230, 'Hihi');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_nilai_cfit`
--
CREATE TABLE `tb_nilai_cfit` (
`id_nilai_cfit` int(5) NOT NULL,
`id_pelamar` int(5) NOT NULL,
`id_lowongan` int(5) NOT NULL,
`nilai_cfit` int(15) NOT NULL,
`iq` int(15) NOT NULL,
`kategori` varchar(50) NOT NULL,
`gambaran_kepribadian` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_nilai_cfit`
--
INSERT INTO `tb_nilai_cfit` (`id_nilai_cfit`, `id_pelamar`, `id_lowongan`, `nilai_cfit`, `iq`, `kategori`, `gambaran_kepribadian`) VALUES
(1, 29, 2, 0, 38, 'Intellectual deficient', ''),
(2, 1, 1, 0, 38, 'Intellectual deficient', '');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_nilai_pwb`
--
CREATE TABLE `tb_nilai_pwb` (
`id_nilai_pwb` int(5) NOT NULL,
`id_pelamar` int(5) NOT NULL,
`id_lowongan` int(5) NOT NULL,
`id_perusahaan` int(5) NOT NULL,
`nilai_pwb` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_pelamar`
--
CREATE TABLE `tb_pelamar` (
`id_pelamar` int(11) NOT NULL,
`id_level` int(5) NOT NULL,
`username` varchar(50) NOT NULL,
`email` varchar(130) NOT NULL,
`password` varchar(500) NOT NULL,
`confirm_password` varchar(500) NOT NULL,
`foto` varchar(100) NOT NULL,
`encrypt_email` varchar(50) NOT NULL,
`status` int(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_pelamar`
--
INSERT INTO `tb_pelamar` (`id_pelamar`, `id_level`, `username`, `email`, `password`, `confirm_password`, `foto`, `encrypt_email`, `status`) VALUES
(1, 5, 'pelamar1', 'abdulhhabibie44@gmail.com', '86117feed185c63bed6d19f272e34e12', 'pelamar1', 'pelamar_c4ca4238a0b923820dcc509a6f75849b4.jpg', '', 1),
(2, 5, 'hahaha', 'candaanaja@gmail.com', '064d8682f9420f2286f2fe5d3889ffb2', 'pelamar2', '', '', 1),
(3, 5, 'guyonbae', 'guyonbae@gmail.com', 'f33fe70bcf7f48e8f107c5d18cdef5e4', 'pelamar3', '', '', 1),
(4, 5, 'test', 'test@gmail.com', '098f6bcd4621d373cade4e832627b4f6', 'test', '', '', 1),
(7, 5, 'testing123', 'testing123@gmail.com', '7f2ababa423061c509f4923dd04b6cf1', 'testing123', '', '', 1),
(13, 5, 'edwin', 'hunter_freaks@hotmail.com', 'e10adc3949ba59abbe56e057f20f883e', '123456', '', '1987817f7b8bd5208dac87465928a751', 1),
(15, 5, 'Dik-Dik', 'Arkep0701@gmail.com', 'fcea920f7412b5da7be0cf42b8c93759', '1234567', '', 'a3d6f6523e4f912dc18f5477e6f5b7e2', 1),
(16, 5, 'dhiki', 'dhikiwibawa@gmail.com', '47e9d84838ef62310de676ab919c59b1', 'dhiki', 'pelamar_c74d97b01eae257e44aa9d5bade97baf.jpg', 'a1cf9ad536d537788810069896268ff8', 1),
(18, 5, 'Dik-Dik', 'Arkep0701@gmail.com', 'fcea920f7412b5da7be0cf42b8c93759', '1234567', '', 'a3d6f6523e4f912dc18f5477e6f5b7e2', 1),
(29, 5, 'Vivid Amalia', 'vividamalia@gmail.com', 'd40730d2823108fab9f861de39413ffb', 'vivid25', '', '8c867cb162897d45bba77051fad39710', 1),
(30, 5, 'rizqatus', 'rizqatuss@gmail.com', '8afb51706f980c5795df957faf9375d1', '123456789OK', '', '997276b9ae1e4084c8f01ea5cffd19c4', 1),
(31, 5, 'Firda Elfinda Nurhidayah', 'firdaelfinda@gmail.com', '5ed291923179b73cbc6ef968b35361ff', 'firda', '', '91f4faf8110624159f87829faf02171a', 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_perusahaan`
--
CREATE TABLE `tb_perusahaan` (
`id_perusahaan` int(5) NOT NULL,
`id_level` int(5) NOT NULL,
`nama_perusahaan` varchar(100) NOT NULL,
`jenis_usaha` varchar(100) NOT NULL,
`alamat` text NOT NULL,
`email` varchar(130) NOT NULL,
`logo_perusahaan` varchar(100) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(500) NOT NULL,
`website` varchar(100) NOT NULL,
`facebook` varchar(100) NOT NULL,
`instagram` varchar(100) NOT NULL,
`twitter` varchar(100) NOT NULL,
`no_hp` varchar(13) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_perusahaan`
--
INSERT INTO `tb_perusahaan` (`id_perusahaan`, `id_level`, `nama_perusahaan`, `jenis_usaha`, `alamat`, `email`, `logo_perusahaan`, `username`, `password`, `website`, `facebook`, `instagram`, `twitter`, `no_hp`) VALUES
(1, 3, 'Chaakraconsulting', 'Konsultan Bisnis', 'Virto Office lt 3', 'adm@chaakraconsulting.com', 'Logo200921_1.png', 'chaakra', 'e572a8f3b6c1d24036ff76ac16eb08b0', 'chaakraconsulting.com', '', '', '', '0872676289002'),
(2, 3, 'PT Eka Ormed Indonesia', 'Bidang Kesehatan', 'Komplek Industri & Pergudangan Meiko Abadi I, Blk. B No.2, Wedi, Kec. Gedangan, Kabupaten Sidoarjo, Jawa Timur 61254', '-', 'Logo201008_.png', 'ekaormedindonesia', 'bd9dd885dfb6f61145824294180d7df0', '-', '-', '-', '-', '-');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_pesan`
--
CREATE TABLE `tb_pesan` (
`id_pesan` int(11) NOT NULL,
`isi_pesan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_pesan`
--
INSERT INTO `tb_pesan` (`id_pesan`, `isi_pesan`) VALUES
(1, '<p>*Selamat* sore, silahkan kunjungi http://choise.chaakraconsulting.com/Login_pelamar</p>');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_psikolog`
--
CREATE TABLE `tb_psikolog` (
`id_psikolog` int(5) NOT NULL,
`id_level` varchar(5) NOT NULL,
`nama_psikolog` varchar(100) NOT NULL,
`no_hp` varchar(13) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_psikolog`
--
INSERT INTO `tb_psikolog` (`id_psikolog`, `id_level`, `nama_psikolog`, `no_hp`, `username`, `password`) VALUES
(1, '4', 'Psikolog Chaakra', '08291213223', 'psikolog', 'c015e9ad489a46fc9f16d449682eb454');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_soal_cfit`
--
CREATE TABLE `tb_soal_cfit` (
`id_soal` int(11) NOT NULL,
`nomor_soal` int(5) NOT NULL,
`soal` varchar(255) NOT NULL,
`opsi_a` varchar(255) NOT NULL,
`opsi_b` varchar(255) NOT NULL,
`opsi_c` varchar(255) NOT NULL,
`opsi_d` varchar(255) NOT NULL,
`opsi_e` varchar(255) NOT NULL,
`opsi_f` varchar(255) NOT NULL,
`jawaban` varchar(5) NOT NULL,
`jawaban2` varchar(5) NOT NULL,
`type_soal` enum('Contoh','Ujian') NOT NULL,
`subtes` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_soal_cfit`
--
INSERT INTO `tb_soal_cfit` (`id_soal`, `nomor_soal`, `soal`, `opsi_a`, `opsi_b`, `opsi_c`, `opsi_d`, `opsi_e`, `opsi_f`, `jawaban`, `jawaban2`, `type_soal`, `subtes`) VALUES
(1, 1, 'soal1.jpg', '1a.jpg', '1b.jpg', '1c.jpg', '1d.jpg', '1e.jpg', '1f.jpg', 'B', '', 'Ujian', '1'),
(2, 2, 'soal2.jpg', '2a.jpg', '2b.jpg', '2c.jpg', '2d.jpg', '2e.jpg', '2f.jpg', 'C', '', 'Ujian', '1'),
(3, 3, 'soal3.jpg', '3a.jpg', '3b.jpg', '3c.jpg', '3d.jpg', '3e.jpg', '3f.jpg', 'B', '', 'Ujian', '1'),
(4, 4, 'soal4.jpg', '4a.jpg', '4b.jpg', '4c.jpg', '4d.jpg', '4e.jpg', '4f.jpg', 'D', '', 'Ujian', '1'),
(5, 5, 'soal5.jpg', '5a.jpg', '5b.jpg', '5c.jpg', '5d.jpg', '5e.jpg', '5f.jpg', 'E', '', 'Ujian', '1'),
(6, 6, 'soal6.jpg', '6a.jpg', '6b.jpg', '6c.jpg', '6d.jpg', '6e.jpg', '6f.jpg', 'B', '', 'Ujian', '1'),
(7, 7, 'soal7.jpg', '7a.jpg', '7b.jpg', '7c.jpg', '7d.jpg', '7e.jpg', '7f.jpg', 'D', '', 'Ujian', '1'),
(8, 8, 'soal8.jpg', '8a.jpg', '8b.jpg', '8c.jpg', '8d.jpg', '8e.jpg', '8f.jpg', 'B', '', 'Ujian', '1'),
(9, 9, 'soal9.jpg', '9a.jpg', '9b.jpg', '9c.jpg', '9d.jpg', '9e.jpg', '9f.jpg', 'F', '', 'Ujian', '1'),
(10, 10, 'soal10.jpg', '10a.jpg', '10b.jpg', '10c.jpg', '10d.jpg', '10e.jpg', '10f.jpg', 'C', '', 'Ujian', '1'),
(11, 11, 'soal11.jpg', '11a.jpg', '11b.jpg', '11c.jpg', '11d.jpg', '11e.jpg', '11f.jpg', 'B', '', 'Ujian', '1'),
(12, 12, 'soal12.jpg', '12a.jpg', '12b.jpg', '12c.jpg', '12d.jpg', '12e.jpg', '12f.jpg', 'B', '', 'Ujian', '1'),
(13, 13, 'soal13.jpg', '13a.jpg', '13b.jpg', '13c.jpg', '13d.jpg', '13e.jpg', '13f.jpg', 'E', '', 'Ujian', '1'),
(14, 14, 'contoh1.jpg', '1a1.jpg', '1b1.jpg', '1c1.jpg', '1d1.jpg', '1e1.jpg', '1f1.jpg', 'C', '', 'Contoh', '1'),
(15, 15, 'contoh2.jpg', '2a1.jpg', '2b1.jpg', '2c1.jpg', '2d1.jpg', '2e1.jpg', '2f1.jpg', 'E', '', 'Contoh', '1'),
(16, 16, 'contoh3.jpg', '3a1.jpg', '3b1.jpg', '3c1.jpg', '3d1.jpg', '3e1.jpg', '3f1.jpg', 'E', '', 'Contoh', '1'),
(17, 17, '', 'contoh_2a.jpg', 'contoh_2b.jpg', 'contoh_2c.jpg', 'contoh_2d.jpg', 'contoh_2e.jpg', '', 'B', 'D', 'Contoh', '2'),
(18, 18, '', 'contoh_22a.jpg', 'contoh_22b.jpg', 'contoh_22c.jpg', 'contoh_22d.jpg', 'contoh_22e.jpg', '', 'C', 'E', 'Contoh', '2'),
(19, 1, '', '2_1a.png', '2_1b.png', '2_1c.png', '2_1d.png', '2_1e.png', '', 'B', 'E', 'Ujian', '2'),
(20, 2, '', '2_2a.png', '2_2b.png', '2_2c.png', '2_2d.png', '2_2e.png', '', 'A', 'E', 'Ujian', '2'),
(21, 3, '', '2_3a.png', '2_3b.png', '2_3c.png', '2_3d.png', '2_3e.png', '', 'A', 'D', 'Ujian', '2'),
(22, 4, '', '2_4a.png', '2_4b.png', '2_4c.png', '2_4d.png', '2_4e.png', '', 'C', 'E', 'Ujian', '2'),
(23, 5, '', '2_5a.png', '2_5b.png', '2_5c.png', '2_5d.png', '2_5e.png', '', 'B', 'E', 'Ujian', '2'),
(24, 6, '', '2_6a.png', '2_6b.png', '2_6c.png', '2_6d.png', '2_6e.png', '', 'A', 'D', 'Ujian', '2'),
(25, 7, '', '2_7a.png', '2_7b.png', '2_7c.png', '2_7d.png', '2_7e.png', '', 'B', 'E', 'Ujian', '2'),
(26, 8, '', '2_8a.png', '2_8b.png', '2_8c.png', '2_8d.png', '2_8e.png', '', 'B', 'E', 'Ujian', '2'),
(27, 9, '', '2_9a.png', '2_9b.png', '2_9c.png', '2_9d.png', '2_9e.png', '', 'A', 'D', 'Ujian', '2'),
(28, 10, '', '2_10a.png', '2_10b.png', '2_10c.png', '2_10d.png', '2_10e.png', '', 'B', 'D', 'Ujian', '2'),
(29, 11, '', '2_11a.png', '2_11b.png', '2_11c.png', '2_11d.png', '2_11e.png', '', 'A', 'E', 'Ujian', '2'),
(30, 12, '', '2_12a.png', '2_12b.png', '2_12c.png', '2_12d.png', '2_12e.png', '', 'C', 'D', 'Ujian', '2'),
(31, 13, '', '2_13a.png', '2_13b.png', '2_13c.png', '2_13d.png', '2_13e.png', '', 'B', 'C', 'Ujian', '2'),
(32, 14, '', '2_14a.png', '2_14b.png', '2_14c.png', '2_14d.png', '2_14e.png', '', 'A', 'B', 'Ujian', '2'),
(33, 1, 'soal14.jpg', '1a2.jpg', '1b2.jpg', '1c2.jpg', '1d2.jpg', '1e2.jpg', '1f2.jpg', 'E', '', 'Ujian', '3'),
(34, 2, 'soal.jpg', '2a2.jpg', '2b2.jpg', '2c2.jpg', '2d2.jpg', '2e2.jpg', '2f2.jpg', 'E', '', 'Ujian', '3'),
(35, 3, 'soal15.jpg', '3a2.jpg', '3b2.jpg', '3c2.jpg', '3d2.jpg', '3e2.jpg', '3f2.jpg', 'E', '', 'Ujian', '3'),
(36, 4, 'soal16.jpg', '4a1.jpg', '4b1.jpg', '4c1.jpg', '4d1.jpg', '4e1.jpg', '4f1.jpg', 'B', '', 'Ujian', '3'),
(37, 5, 'soal17.jpg', '5a1.jpg', '5b1.jpg', '5c1.jpg', '5d1.jpg', '5e1.jpg', '5f1.jpg', 'C', '', 'Ujian', '3'),
(38, 6, 'soal18.jpg', '6a1.jpg', '6b1.jpg', '6c1.jpg', '6d1.jpg', '6e1.jpg', '6f1.jpg', 'D', '', 'Ujian', '3'),
(39, 7, 'soal19.jpg', '7a1.jpg', '7b1.jpg', '7c1.jpg', '7d1.jpg', '7e1.jpg', '7f1.jpg', 'E', '', 'Ujian', '3'),
(40, 8, 'soal20.jpg', '8a1.jpg', '8b1.jpg', '8c1.jpg', '8d1.jpg', '8e1.jpg', '8f1.jpg', 'E', '', 'Ujian', '3'),
(41, 9, 'soal21.jpg', '9a1.jpg', '9b1.jpg', '9c1.jpg', '9d1.jpg', '9e1.jpg', '9f1.jpg', 'A', '', 'Ujian', '3'),
(42, 10, 'soal22.jpg', '10a1.jpg', '10b1.jpg', '10c1.jpg', '10d1.jpg', '10e1.jpg', '10f1.jpg', 'A', '', 'Ujian', '3'),
(44, 11, 'soal23.jpg', '11a1.jpg', '11b1.jpg', '11c1.jpg', '11d1.jpg', '11e1.jpg', '11f1.jpg', 'F', '', 'Ujian', '3'),
(45, 12, 'soal24.jpg', '12a1.jpg', '12b1.jpg', '12c1.jpg', '12d1.jpg', '12e2.jpg', '12f1.jpg', 'C', '', 'Ujian', '3'),
(46, 13, 'soal25.jpg', '13a1.jpg', '13b1.jpg', '13c1.jpg', '13d1.jpg', '13e1.jpg', '13f1.jpg', 'C', '', 'Ujian', '3'),
(47, 46, 'contoh11.jpg', '1a3.jpg', '1b3.jpg', '1c3.jpg', '1d3.jpg', '1e3.jpg', '1f3.jpg', 'B', '', 'Contoh', '3'),
(48, 47, 'contoh21.jpg', '2a3.jpg', '2b3.jpg', '2c3.jpg', '2d3.jpg', '2e3.jpg', '2f3.jpg', 'C', '', 'Contoh', '3'),
(49, 48, 'contoh31.jpg', '3a3.jpg', '3b3.jpg', '3c3.jpg', '3d3.jpg', '3e3.jpg', '3f3.jpg', 'F', '', 'Contoh', '3'),
(50, 49, 'contoh12.jpg', '1a4.jpg', '1b4.jpg', '1c4.jpg', '1d4.jpg', '1e4.jpg', '', 'C', '', 'Contoh', '4'),
(51, 50, 'contoh22.jpg', '2a4.jpg', '2b4.jpg', '2c4.jpg', '2d4.jpg', '2e4.jpg', '', 'D', '', 'Contoh', '4'),
(52, 51, 'contoh32.jpg', '3a4.jpg', '3b4.jpg', '3c4.jpg', '3d4.jpg', '3e4.jpg', '', 'B', '', 'Contoh', '4'),
(53, 1, '4_1.jpg', '4_1a.jpg', '4_1b.jpg', '4_1c.jpg', '4_1d.jpg', '4_1e.jpg', '', 'B', '', 'Ujian', '4'),
(54, 2, '4_2.jpg', '4_2a.jpg', '4_2b.jpg', '4_2c.jpg', '4_2d.jpg', '4_2e.jpg', '', 'A', '', 'Ujian', '4'),
(55, 3, '4_3.jpg', '4_3a.jpg', '4_3b.jpg', '4_3c.jpg', '4_3d.jpg', '4_3e.jpg', '', 'D', '', 'Ujian', '4'),
(56, 5, '4_5.jpg', '4_5a.jpg', '4_5b.jpg', '4_5c.jpg', '4_5d.jpg', '4_5e.jpg', '', 'A', '', 'Ujian', '4'),
(57, 6, '4_6.jpg', '4_6a.jpg', '4_6b.jpg', '4_6c.jpg', '4_6d.jpg', '4_6e.jpg', '', 'B', '', 'Ujian', '4'),
(58, 7, '4_7.jpg', '4_7a.jpg', '4_7b.jpg', '4_7c.jpg', '4_7d.jpg', '4_7e.jpg', '', 'C', '', 'Ujian', '4'),
(59, 8, '4_8.jpg', '4_8a.jpg', '4_8b.jpg', '4_8c.jpg', '4_8d.jpg', '4_8e.jpg', '', 'D', '', 'Ujian', '4'),
(60, 9, '4_9.jpg', '4_9a.jpg', '4_9b.jpg', '4_9c.jpg', '4_9d.jpg', '4_9e.jpg', '', 'A', '', 'Ujian', '4'),
(61, 10, '4_10.jpg', '4_10a.jpg', '4_10b.jpg', '4_10c.jpg', '4_10d.jpg', '4_10e.jpg', '', 'D', '', 'Ujian', '4'),
(62, 4, '4_4.jpg', '4_4a.jpg', '4_4b.jpg', '4_4c.jpg', '4_4d.jpg', '4_4e.jpg', '', 'D', '', 'Ujian', '4');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_soal_ist`
--
CREATE TABLE `tb_soal_ist` (
`id_soal_ist` int(11) NOT NULL,
`no_soal` int(5) NOT NULL,
`soal_ist` varchar(255) NOT NULL,
`opsi_a` varchar(255) NOT NULL,
`opsi_b` varchar(255) NOT NULL,
`opsi_c` varchar(255) NOT NULL,
`opsi_d` varchar(255) NOT NULL,
`opsi_e` varchar(255) NOT NULL,
`jawaban` varchar(100) NOT NULL,
`subtes` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_soal_ist`
--
INSERT INTO `tb_soal_ist` (`id_soal_ist`, `no_soal`, `soal_ist`, `opsi_a`, `opsi_b`, `opsi_c`, `opsi_d`, `opsi_e`, `jawaban`, `subtes`) VALUES
(1, 1, 'Pengaruh seseorang terhadap orang lain seharusnya bergantung pada ...', 'kekuasaan', 'bujukan', 'kekayaan', 'keberanian', 'kewibawaan', 'D', '1'),
(3, 2, 'Lawannya \"hemat\" adalah ...', 'murah', 'kikir', 'boros', 'bernilai', 'kaya', 'C', '1'),
(4, 3, '.... tidak termasuk cuaca', 'angin puyuh', 'halilintar', 'salju', 'gempa bumi', 'kabut', 'D', '1'),
(5, 4, 'Lawannya \"setia\" adalah ...', 'cinta', 'benci', 'persahabatan', 'khianat', 'permusuhan', 'D', '1'),
(6, 5, 'Seekor kuda selalu memiliki ...', 'kandang', 'ladam', 'pelana', 'kuku', 'surai', 'D', '1'),
(7, 6, 'Seorang paman ..... lebih tua daripada keponakannya', 'jarang', 'biasanya', 'selalu', 'tak pernah', 'kadang-kadng', 'B', '1'),
(8, 7, 'Pada jumlah yang sama, nilai kalori yang tertinggi terdapat pada ...', 'ikan', 'daging', 'lemak', 'tahu', 'sayuran', 'C', '1'),
(9, 8, 'Pada suatu pertandingan selalu terdapat ...', 'lawan', 'wasit', 'penonton', 'sorak', 'kemenangan', 'A', '1'),
(10, 9, 'Suatu pernyataan yang belum dapat dipastikan dikatakan sebagai pernyataan yang ...', 'paradoks', 'tergesa-gesa', 'mempunyai arti rangkap', 'menyesatkan', 'hipotesis', 'E', '1'),
(11, 10, 'Pada sepatu kulit terdapat ...', 'kulit', 'sol', 'tali sepatu', 'gesper', 'lidah', 'B', '1'),
(12, 11, 'Suatu ... tidak menyangkut persoalan pencegahan kecelakaan', 'lampu lalu lintas', 'kacamata pelindung', 'kotak P3K', 'tanda peringatan', 'palang kereta api', 'C', '1'),
(13, 12, 'Mata uang dari Rp. 500 garis tengahnya adalah .... mm', '17', '29', '25', '24', '15', 'D', '1'),
(14, 13, 'Seseorang yang bersikap menyangsikan setiap kemajuan ialah seorang yang ...', 'demokratis', 'radikal', 'liberal', 'konservatif', 'anarkis', 'D', '1'),
(15, 14, 'Lawannya \"tidak pernah\" ialah ....', 'sering', 'kadang-kadang', 'jarang', 'kerapkali', 'selalu', 'E', '1'),
(16, 15, 'Jarak antara Jakarta-Surabaya ialah kira-kira ... km', '650', '1000', '800', '600', '950', 'C', '1'),
(17, 16, 'Untuk dapat membuat nada yang terendah dan mendalam, kita memerlukan banyak ....', 'kekuatan', 'peranan', 'ayunan', 'berat', 'suara', 'A', '1'),
(18, 17, 'Ayah ... lebih berpengalaman daripada anaknya ...', 'selalu', 'biasanya', 'jauh', 'jarang', 'pada dasarnya', 'B', '1'),
(19, 18, 'Di antara kota-kota berikut ini, maka kota ... letaknya paling selatan', 'Jakarta', 'Bandung', 'Cirebon', 'Semarang', 'Surabaya', 'B', '1'),
(20, 19, 'Jika kita mengetahui jumlah persentase nomor-nomor lotre yang tidak menang, maka kita dapat menghitung ....', 'jumlah nomor yang menang', 'pajak lotre', 'kemungkinan menang', 'jumlah pengikut', 'tinggi keuntungan', 'C', '1'),
(21, 20, 'Seorang anak yang berumur 10 tahun tingginya rata-rata .... cm', '150', '130', '110', '105', '115', 'A', '1'),
(22, 21, '', 'lingkaran', 'panah', 'elips', 'busur', 'lengkungan', 'B', '2'),
(23, 22, '', 'mengetuk', 'memaku', 'menjahit', 'menggergaji', 'memukul', 'B', '2'),
(24, 23, '', 'lebar', 'keliling', 'luas', 'isi', 'panjang', 'D', '2'),
(25, 24, '', 'mengikat', 'menyatukan', 'melepaskan', 'mengaitkan', 'meletakkan', 'C', '2'),
(26, 25, '', 'arah', 'timur', 'perjalanan', 'tujuan', 'selatan', 'C', '2'),
(27, 26, '', 'jarak', 'perpisahan', 'tugas', 'batas', 'perceraian', 'C', '2'),
(28, 27, '', 'saringan', 'kelambu', 'payung', 'tapisan', 'jala', 'C', '2'),
(29, 28, '', 'putih', 'pucat', 'buram', 'kasar', 'berkilauan', 'D', '2'),
(30, 29, '', 'otobis', 'pesawat terbang', 'sepeda motor', 'sepeda', 'kapal api', 'D', '2'),
(31, 30, '', 'biola', 'seruling', 'clarinet', 'terompet', 'saxophone', 'A', '2'),
(32, 31, '', 'bergelombang', 'kasar', 'berduri', 'licin', 'lurus', 'E', '2'),
(33, 32, '', 'jam', 'kompas', 'penunjuk jalan', 'bintang pari', 'arah', 'A', '2'),
(34, 33, '', 'kebijaksanaan', 'pendidikan', 'perencanaan', 'penempatan', 'pengerahan', 'A', '2'),
(35, 34, '', 'bermotor', 'berjalan', 'berlayar', 'bersepeda', 'berkuda', 'B', '2'),
(36, 35, '', 'gambar', 'lukisan', 'potret', 'patung', 'ukiran', 'C', '2'),
(37, 36, '', 'panjang', 'lonjong', 'runcing', 'bulat', 'bersudut', 'A', '2'),
(38, 37, '', 'kunci', 'palang pintu', 'grendel', 'gunting', 'obeng', 'D', '2'),
(39, 38, '', 'jembatan', 'batas', 'perkawinan', 'pagar', 'masyarakat', 'E', '2'),
(40, 39, '', 'mengetam', 'memahat', 'mengasah', 'melicinkan', 'menggosok', 'B', '2'),
(41, 40, '', 'batu', 'baja', 'bulu', 'karet', 'kayu', 'C', '2'),
(42, 41, 'menemukan : menghilangkan = meningat : ?', 'menghafal', 'mengenai', 'melupakan', 'berpikir', 'memimpikan', 'C', '3'),
(43, 42, 'bunga : jambangan = burung : ?', 'sarang', 'langit', 'pagar', 'pohon', 'sangkar', 'E', '3'),
(44, 33, 'kereta api : rel = otobis : ?', 'roda', 'poros', 'ban', 'jalan raya', 'kecepatan', 'D', '3'),
(45, 44, 'perak : emas = cincin : ?', 'arloji', 'berlian ', 'permata', 'gelang', 'platina', 'D', '3'),
(46, 45, 'lingkaran : bola = bujursangkar : ?', 'bentuk', 'gambar', 'segiempat', 'kubus', 'piramida', 'D', '3'),
(47, 46, 'saran : keputusan = merundingkan : ?', 'menawarkan', 'menentukan', 'menilai', 'menimbang ', 'merenungkan', 'B', '3'),
(48, 47, 'lidah : asam = hidung : ?', 'mencium', 'bernafas', 'mengecap', 'tengik', 'asin', 'D', '3'),
(49, 48, 'darah : pembuluh = air : ?', 'pintu air', 'sungai', 'talang', 'hujan', 'ember', 'B', '3'),
(50, 49, 'saraf : penyalur = pupil : ?', 'penyinaran', 'mata', 'melihat', 'cahaya', 'pelindung', 'E', '3'),
(51, 50, 'pengantar surat : pengantar telegram = pandai besi : ?', 'palu godam', 'pedangan besi', 'api', 'tukang emas', 'besi tempa', 'D', '3'),
(52, 51, 'buta : warna = tuli : ?', 'pendengaran', 'mendengar', 'nada', 'kata', 'telinga', 'C', '3'),
(53, 52, 'makanan : bumbu = ceramah : ?', 'penghinaan', 'pidato', 'kelakar', 'kesan', 'ayat', 'C', '3'),
(54, 53, 'marah : emosi = duka cita : ?', 'suka cita', 'sakit hati', 'suasana hati', 'sedih', 'rindu', 'C', '3'),
(55, 54, 'mantel : jubah = wool : ?', 'bahan sandang', 'domba', 'sutera', 'jas', 'tekstil', 'C', '3'),
(56, 55, 'ketinggian puncak : tekanan udara = ketinggian nada : ?', 'garpu penala', 'sopran', 'nyanyian', 'penjang senar', 'suara', 'E', '3'),
(57, 56, 'negara : revolusi = hidup : ?', 'biologi', 'keturunan ', 'mutasi', 'seleksi', 'ilmu hewan', 'C', '3'),
(58, 57, 'kekurangan : penemuan = panas : ?', 'haus', 'khatulistiwa', 'es', 'matahari', 'dingin', 'C', '3'),
(59, 58, 'kayu : diketam = besi : ?', 'dipalu', 'digergaji', 'dituang', 'dikikir', 'ditempa', 'E', '3'),
(60, 59, 'olahragawan : lembing = cendekiawan : ?', 'perpustakaan', 'penelitian ', 'karya', 'studi', 'mikroskop', 'E', '3'),
(61, 60, 'keledai : kuda pacuan = pembakaran : ?', 'pemadam api', 'obor', 'letupan', 'korek api', 'lautan api', 'E', '3');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_soal_motlet`
--
CREATE TABLE `tb_soal_motlet` (
`id_soal` int(5) NOT NULL,
`id_perusahaan` int(5) NOT NULL,
`id_jenis_motlet` int(5) NOT NULL,
`soal_motlet` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_soal_motlet`
--
INSERT INTO `tb_soal_motlet` (`id_soal`, `id_perusahaan`, `id_jenis_motlet`, `soal_motlet`) VALUES
(1, 2, 1, '<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>'),
(3, 1, 2, '<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod<br />tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,<br />quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo<br />consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse<br />cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non<br />proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>'),
(5, 2, 1, '<p>tes12324</p>');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_soal_papi`
--
CREATE TABLE `tb_soal_papi` (
`id_soal` int(11) NOT NULL,
`no_soal` int(2) NOT NULL,
`pernyataan1` varchar(150) NOT NULL,
`pernyataan2` varchar(150) NOT NULL,
`aspek` varchar(2) NOT NULL,
`aspek2` varchar(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_soal_papi`
--
INSERT INTO `tb_soal_papi` (`id_soal`, `no_soal`, `pernyataan1`, `pernyataan2`, `aspek`, `aspek2`) VALUES
(1, 1, 'Saya seorang pekerja keras', 'Saya bukan seorang pemurung', 'G', 'E'),
(2, 2, 'Saya suka bekerja lebih baik dari yang lain', 'Saya suka menekuni pekerjaan yang saya lakukan sampai selesai', 'A', 'N'),
(3, 3, 'Saya suka memberi petunjuk kepada orang bagaimana melakukan sesuatu', 'Saya ingin berbuat semaksimal mungkin', 'P', 'A'),
(4, 4, 'Saya suka melakukan hal-hal lucu', 'Saya suka memberitahukan orang apa yang harus dikerjakannya', 'X', 'P'),
(5, 5, 'Saya suka bergabung dalam kelompok', 'Saya suka jika diperhatikan orang', 'B', 'X'),
(6, 6, 'Saya suka membuat teman pribadi yang dekat', 'Saya suka berteman dengan suatu kelompok', 'O', 'B'),
(7, 7, 'Saya cepat berubah jika saya rasa diperlukan', 'Saya berusaha membuat teman-teman menjadi dekat', 'Z', 'O'),
(8, 8, 'Saya suka membalas jika saya disakiti', 'Saya suka melakukan hal-hal yang baru dan berbeda', 'K', 'Z'),
(9, 9, 'Saya ingin agar atasan menyukai saya', 'Saya suka memberitahukan orang jika mereka salah', 'F', 'K'),
(10, 10, 'Saya suka mengikuti petunjuk-petunjuk yang diberikan kepada saya', 'Saya suka mendukung pendapat atasan saya', 'X', 'F'),
(11, 11, 'Saya berusaha sangat keras', 'Saya seorang yang teratur. Saya menaruh semua barang pada tempatnya', 'G', 'B'),
(12, 12, 'Saya dapat membuat orang melakukan apa yang saya inginkan', 'Saya tidak mudah marah', 'L', 'B'),
(13, 13, 'Saya suka memberitahukan kepada kelompok apa yang harus mereka kerjakan', 'Saya selalu menekuni suatu pekerjaan sampai selesai', 'P', 'N'),
(14, 14, 'Saya ingin tampil menarik dan mendebarkan', 'Saya ingin menjadi orang yang sangat berhasil', 'X', 'A'),
(15, 15, 'Saya ingin sesuai dan diterima dalam kelompok', 'Saya suka membantu orang dalam mengambil keputusan', 'B', 'P'),
(16, 16, 'Saya cemas bila seseorang tidak menyukai saya', 'Saya suka orang memperhatikan saya', 'O', 'X'),
(17, 17, 'Saya suka mencoba hal-hal baru', 'Saya lebih suka bekerja bersama orang lain daripada sendiri', 'Z', 'B'),
(18, 18, 'Saya kadang-kadang menyalahkan orang lain jika terjadi kesalahan', 'Saya merasa terganggu jika ada yang tidak menyukai saya', 'K', 'B'),
(19, 19, 'Saya suka mendukung pendapat atasan saya', 'Saya suka mencoba pekerjaan-pekerjaan yang baru dan berbeda', 'F', 'Z'),
(20, 20, 'Saya menyukai petunjuk-petunjuk terperinci dalam menyelesaikan pekerjaan', 'Bila saya terganggu oleh siapapun, saya akan memberitahukannya', 'X', 'K'),
(21, 21, 'Saya suka melaksanakan tugas setiap langkah dengan hati-hati', 'Saya selalu berusaha keras', 'G', 'D'),
(22, 22, 'Saya benar-benar pemimpin yang baik', 'Saya dapat mengorganisir suatu pekerjaan dengan baik', 'L', 'C'),
(23, 23, 'Saya mudah tersinggung', 'Saya lambat mengambil keputusan', 'I', 'E'),
(24, 24, 'Bila saya berada dalam satu kelompok, saya suka berdiam diri', 'Saya suka mengerjakan beberapa pekerjaan sekaligus', 'X', 'N'),
(25, 25, 'Saya sangat suka bila saya diundang', 'Saya ingin lebih baik dari yang lain dalam mengerjakan sesuatu', 'B', 'A'),
(26, 26, 'Saya suka membuat teman-teman pribadi yang dekat', 'Saya suka menasehati orang lain', 'O', 'P'),
(27, 27, 'Saya suka melakukan hal-hal yang baru dan berbeda', 'Saya suka menceritakan bagaimana saya berhasil dalam melakukan sesuatu', 'Z', 'P'),
(28, 28, 'Bila saya betul, saya suka mempertahankannya', 'Saya ingin diterima dan diakui dalam suatu kelompok', 'K', 'B'),
(29, 29, 'Saya menghindar menjadi seorang yang berbeda', 'Saya berusaha menjadi sangat dekat dengan seseorang', 'F', 'O'),
(30, 30, 'Saya senang diberitahukan bagaimana saya melakukan sesuatu pekerjaan', 'Saya mudah bosan', 'X', 'Z'),
(31, 31, 'Saya bekerja keras', 'Saya banyak berpikir dan menerima', 'G', 'R'),
(32, 32, 'Saya memimpin kelompok', 'Detail (hal-hal kecil) menarik bagi saya', 'L', 'D'),
(33, 33, 'Saya dapat mengambil keputusan secara mudah dan tepat', 'Saya menyimpan barang-barang saya secara rapi dan teratur', 'I', 'C'),
(34, 34, 'Saya cepat dalam melaksanakan suatu pekerjaan', 'Saya tidak sering marah atau sedih', 'T', 'C'),
(35, 35, 'Saya ingin menjadi bagian dari kelompok', 'Saya hanya ingin melakukan satu pekerjaan pada satu saat', 'B', 'N'),
(36, 36, 'Saya berusaha membuat teman dekat', 'Saya suka bertanggung jawab untuk kepentingan orang lain', 'O', 'A'),
(37, 37, 'Saya suka mode terbaru untuk pakaian atau mobil', 'Saya suka bertanggung jawab untuk kepentingan orang lain', 'Z', 'P'),
(38, 38, 'Saya menyukai perdebatan', 'Saya suka mendapat pekerjaan', 'K', 'X'),
(39, 39, 'Saya suka mendukung orang-orang yang menjadi atasan saya', 'Saya tertarik menjadi bagian kelompok', 'F', 'B'),
(40, 40, 'Saya suka mengikuti peraturan dengan hati-hati', 'Saya suka orang mengenal saya dengan baik', 'X', 'O'),
(41, 41, 'Saya benar-benar pekerja keras', 'Saya mempunyai sifat bersahabat', 'G', 'R'),
(42, 42, 'Orang berpendapat bahwa saya benar-benar seorang pemimpin yang baik', 'Saya berpikir panjang dan berhati-hati', 'L', 'R'),
(43, 43, 'Saya sering mengambil kesempatan', 'Saya senang mengurus hal-hal kecil', 'I', 'D'),
(44, 44, 'Orang berpendapat bahwa saya bekerja cepat', 'Orang berpendapat bahwa saya rapi dan teratur', 'T', 'C'),
(45, 45, 'Saya seanang berolah raga', 'Saya mempunyai pribadi yang menyenangkan', 'V', 'E'),
(46, 46, 'Saya senang jika orang dekat dan bersahabat dengan saya', 'Saya selalu berusaha untuk menyelesaikan sesuatu yang telah saya mulai', 'O', 'N'),
(47, 47, 'Saya senang bereksperimen dan mencoba hal-hal baru', 'Saya suka melaksanakan suatu pekerjaan sulit dengan baik', 'Z', 'A'),
(48, 48, 'Saya suka diperlakukan secara adil', 'Saya suka memberitahu orang lain bagaimana melaksanakan sesuatu', 'K', 'P'),
(49, 49, 'Saya suka melakukan apa yang diharapkan dari saya', 'Saya suka memperoleh perhatian', 'F', 'X'),
(50, 50, 'Saya suka petunjuk-petunjuk terperinci dalam melaksanakan suatu pekerjaan', 'Saya suka berada diantara orang-orang banyak', 'X', 'B'),
(51, 51, 'Saya selalu berusaha menyelesaikan pekerjaan secara sempurna', 'Orang mengatakan bahwa saya tidak mengenal lelah', 'G', 'V'),
(52, 52, 'Saya tipe pemimpin', 'Saya mudah berteman', 'L', 'S'),
(53, 53, 'Saya selalu berspekulasi', 'Saya banyak sekali berpikr', 'I', 'R'),
(54, 54, 'Saya bekerja dengan kecepatan teratur', 'Saya senang bekerja dengan hal-hal kecil/terperinci', 'T', 'D'),
(55, 55, 'Saya mempunyai banyak tenaga untuk berolah raga', 'Saya menyimpan barang-barang saya secara rapi dan teratur', 'V', 'C'),
(56, 56, 'Saya dapat bergaul dengan baik terhadap semua orang', 'Saya seorang mempunyai pembawaan yang tenang (even tempered)', 'S', 'E'),
(57, 57, 'Saya ingin bertemu dengan orang-orang baru dan melakukan hal yang baru', 'Saya selalu ingin menyelesaikan pekerjaan yang telah saya mulai', 'Z', 'N'),
(58, 58, 'Saya biasanya mempertahankan pendapat yang saya yakini', 'Saya biasanya suka bekerja keras', 'K', 'A'),
(59, 59, 'Saya suka saran-saran dari orang-orang yang saya kagumi', 'Saya suka melayani orang-orang berwenang terhadap saya', 'R', 'P'),
(60, 60, 'Saya berusaha bekerja keras', 'Saya suka mendapat perhatian', 'X', 'X'),
(61, 61, 'Saya berusaha bekerja keras', 'Saya mengerjakan sesuatu dengan cepat', 'G', 'T'),
(62, 62, 'Apabila saya bicara, kelompok mendengarkan', 'Saya terampil dengan perkakas (alat-alat)', 'L', 'V'),
(63, 63, 'Saya lambat dalam mendapatkan teman', 'Saya lambat dalam mengambil keputus', 'I', 'S'),
(64, 64, 'Saya biasanya makan secara cepat', 'Saya suka membaca', 'T', 'R'),
(65, 65, 'Saya suka pekerjaan dimana saya bergerak', 'Saya suka pekerjaan yang harus dilaksanakan secara hati-hati', 'V', 'D'),
(66, 66, 'Saya membuat sebanyak mungkin teman', 'Apa yang telah saya simpan, akan mudah saya temukan kembali', 'S', 'C'),
(67, 67, 'Saya merencakan jauh-jauh sebelumnya', 'Saya selalu menyenangkan', 'R', 'E'),
(68, 68, 'Saya mempertahankan dengan bangga nama baik saya', 'Saya terus menekuni suatu masalah sampai selesai', 'K', 'N'),
(69, 69, 'Saya suka mendukung orang-orang yang saya kagumi', 'Saya ingin sukses', 'F', 'A'),
(70, 70, 'Saya suka orang lain yang membuat keputusan-keputusan untuk kelompok', 'Saya suka membuat keputusan-keputusan untuk kelompok', 'X', 'P'),
(71, 71, 'Saya selalu berusaha keras', 'Saya membuat keputusan dengan cepat dan tepat', 'G', 'I'),
(72, 72, 'Kelompok biasanya melakukan apa yang saya inginkan', 'Saya biasa terburu-buru', 'L', 'T'),
(73, 73, 'Saya sering merasa lelah', 'Sya lamban mengambil keputusan', 'I', 'V'),
(74, 74, 'Saya bekerja cepat', 'Saya mudah berteman', 'T', 'S'),
(75, 75, 'Saya biasanya punya gairah dan tenaga', 'Saya banyak menghabiskan waktu dengan berpikir', 'V', 'R'),
(76, 76, 'Saya sangat ramah terhadap orang', 'Saya suka dengan pekerjaan yang memerlukan ketelitian', 'S', 'D'),
(77, 77, 'Saya banyak berpikir dan berencana', 'Saya menyimpan segala sesuatu pada tempatnya', 'R', 'C'),
(78, 78, 'Saya suka pekerjaan yang menuntut hal-hal yang terperinci', 'Saya tidak mudah marah', 'D', 'E'),
(79, 79, 'Saya suka mengikuti orang yang saya kagumi', 'Saya selalu menyelesaikan pekerjaan yang telah saya mulai', 'R', 'N'),
(80, 80, 'Saya suka petunjuk yang jelas', 'Saya suka bekerja keras', 'X', 'A'),
(81, 81, 'Saya mengejar apa yang saya inginkan', 'Saya seorang pemimpin tang baik', 'G', 'L'),
(82, 82, 'Saya membuat orang lain bekerja sesuai dengan yang saya inginkan', 'Saya seorang yang bertipe santai tapi beruntung', 'L', 'I'),
(83, 83, 'Saya mengambil keputusan secara cepat', 'Saya bicara dengan cepat', 'I', 'T'),
(84, 84, 'Saya biasa bekerja cepat', 'Saya berolah raga secara teratur', 'T', 'V'),
(85, 85, 'Saya tidak suka bertemy orang', 'Saya cepat merasa lelah', 'V', 'S'),
(86, 86, 'Saya membuat banyak sekali teman', 'Saya banyak menghabiskan waktu dengan berpikir', 'S', 'R'),
(87, 87, 'Saya suka bekerja dengan teori', 'Saya suka bekerja dengan hal-hal terperinci', 'R', 'D'),
(88, 88, 'Saya dapat menikmati hal-hal/pekerjaan yang terperinci', 'Saya suka mengorganisir pekerjaan saya', 'D', 'C'),
(89, 89, 'Saya menaruh barang pada tempatnya', 'Saya selalu menyenangkan ', 'C', 'E'),
(90, 90, 'Saya suka diberitahu tentang apa yang saya perlu lakukan', 'Saya harus menyelesaikan apa yang saya mulai', 'X', 'N');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_soal_tpa`
--
CREATE TABLE `tb_soal_tpa` (
`id_soal_tpa` int(3) NOT NULL,
`soal` varchar(50) NOT NULL,
`opsi_a` varchar(50) NOT NULL,
`opsi_b` varchar(50) NOT NULL,
`opsi_c` varchar(50) NOT NULL,
`opsi_d` varchar(50) NOT NULL,
`opsi_e` varchar(50) NOT NULL,
`jawaban` varchar(50) NOT NULL,
`seksi` int(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_soal_tpa`
--
INSERT INTO `tb_soal_tpa` (`id_soal_tpa`, `soal`, `opsi_a`, `opsi_b`, `opsi_c`, `opsi_d`, `opsi_e`, `jawaban`, `seksi`) VALUES
(1, 'Epidemi = ...', 'Penyakit', 'Wabah', 'Menular', 'Berbahaya', 'Stabil', 'Penyakit', 1),
(2, 'Gegabah ><', 'Hati-hati', 'Berani', 'Kuat', 'Tangguh', 'Nekat', 'Hati-hati', 2),
(3, 'Gegap ><', 'Gemetar', 'Gugup', 'Gempita', 'Lancar', 'Ramai', 'Lancar', 2),
(4, 'Fusi = ...', 'Peleburan', 'Penghancuran', 'Pemersatu', 'Persatuan', 'Pemisahan', 'Peleburan', 1),
(5, 'Imla = ...', 'Atur', 'Rapi', 'Dikte', 'Baca', 'Keras', 'Dikte', 1),
(6, 'Ingsut = ...', 'Pecah', 'Jatuh', 'Pelan', 'Bergeser', 'Hilang', 'Bergeser', 1),
(7, 'Kasual = ...', 'Mewah', 'Biasa', 'Sederhana', 'Santai', 'Rapi', 'Sederhana', 1),
(8, 'Komperehensif = ...', 'Sempit', 'Lebar', 'Rasuk', 'Lengkap', 'Masuk', 'Lengkap', 1),
(9, 'Leksinon = ...', 'Kosa Kata', 'Indeks', 'Bahasa', 'Kiasan', 'Peribahasa', 'Kosa Kata', 1),
(10, 'Majasi = ...', 'Umpama', 'Hiasan', 'Kalimat Mutiara', 'Inden', 'Kiasan', 'Kiasan', 1),
(11, 'Mala = ...', 'Tanda', 'Bencana', 'Bahaya', 'Ancaman', 'Percobaan', 'Bencana', 1),
(12, 'Motorium = ...', 'Mufakat', 'Penundaan', 'Permalukan', 'Perizinan', 'Persetujuan', 'Penundaan', 1),
(13, 'Nidera = ...', 'Tidur', 'Surga', 'Sehat', 'Terlelap', 'Bangun', 'Tidur', 1),
(14, 'Oblak = ...', 'Sempit', 'Pancing', 'Lebar', 'Kail', 'Pantai', 'Lebar', 1),
(15, 'Ogel = ...', 'Kibas', 'Lonjong', 'Bulat', 'Melengkung', 'Lurus', 'Kibas', 1),
(16, 'Okulis = ...', 'Mikroskop', 'Dokter Mata', 'Penyakit', 'Buta', 'Kaca Mata', 'Dokter Mata', 1),
(17, 'Okupasi = ...', 'Pekerjaan', 'Penjualan', 'Pelelangan', 'Penyembahan', 'Pendudukan', 'Pendudukan', 1),
(18, 'Oposisi = ...', 'Penentangan', 'Musuh', 'Penyesuaian', 'Perdebatan', 'Diskusi', 'Penentangan', 1),
(19, 'Pacak = ...', 'Pantas', 'Sesuai', 'Tepat', 'Berbakat', 'Cakap', 'Cakap', 1),
(20, 'Pedar = ...', 'Pisah', 'Encer', 'Getir', 'Tajam', 'Temu', 'Getir', 1),
(21, 'Ranah = ...', 'Asal', 'Lembah', 'Kampung', 'Keluarga', 'Gunung', 'Lembah', 1),
(22, 'Skeptis = ...', 'Stabil', 'Ragu', 'Kasar', 'Tegas', 'Marah', 'Ragu', 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_ujian`
--
CREATE TABLE `tb_ujian` (
`id_ujian` int(11) NOT NULL,
`nama_ujian` varchar(100) NOT NULL,
`waktu_dimulai` datetime NOT NULL,
`waktu_berakhir` datetime NOT NULL,
`start_lat_sub1` datetime NOT NULL,
`end_lat_sub1` datetime NOT NULL,
`start_uji_sub1` datetime NOT NULL,
`end_uji_sub1` datetime NOT NULL,
`start_lat_sub2` datetime NOT NULL,
`end_lat_sub2` datetime NOT NULL,
`start_uji_sub2` datetime NOT NULL,
`end_uji_sub2` datetime NOT NULL,
`start_lat_sub3` datetime NOT NULL,
`end_lat_sub3` datetime NOT NULL,
`start_uji_sub3` datetime NOT NULL,
`end_uji_sub3` datetime NOT NULL,
`start_lat_sub4` datetime NOT NULL,
`end_lat_sub4` datetime NOT NULL,
`start_uji_sub4` datetime NOT NULL,
`end_uji_sub4` datetime NOT NULL,
`durasi` int(100) NOT NULL,
`nama_pembuat` varchar(50) NOT NULL,
`status` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_ujian`
--
INSERT INTO `tb_ujian` (`id_ujian`, `nama_ujian`, `waktu_dimulai`, `waktu_berakhir`, `start_lat_sub1`, `end_lat_sub1`, `start_uji_sub1`, `end_uji_sub1`, `start_lat_sub2`, `end_lat_sub2`, `start_uji_sub2`, `end_uji_sub2`, `start_lat_sub3`, `end_lat_sub3`, `start_uji_sub3`, `end_uji_sub3`, `start_lat_sub4`, `end_lat_sub4`, `start_uji_sub4`, `end_uji_sub4`, `durasi`, `nama_pembuat`, `status`) VALUES
(1, 'lk', '2020-11-24 00:00:00', '2020-11-25 04:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, '', '');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_ujian_holland`
--
CREATE TABLE `tb_ujian_holland` (
`id_ujian_holland` int(11) NOT NULL,
`nama_ujian` varchar(100) NOT NULL,
`waktu_mulai` datetime NOT NULL,
`waktu_akhir` datetime NOT NULL,
`status` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_ujian_papi`
--
CREATE TABLE `tb_ujian_papi` (
`id_ujian_papi` int(5) NOT NULL,
`nama_ujian` varchar(100) NOT NULL,
`waktu_mulai` datetime NOT NULL,
`waktu_akhir` datetime NOT NULL,
`status` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_ujian_papi`
--
INSERT INTO `tb_ujian_papi` (`id_ujian_papi`, `nama_ujian`, `waktu_mulai`, `waktu_akhir`, `status`) VALUES
(1, 'Papi Tes', '2020-12-22 08:00:00', '2020-12-23 15:00:00', 'tersedia');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `tb_admin`
--
ALTER TABLE `tb_admin`
ADD PRIMARY KEY (`id_admin`);
--
-- Indeks untuk tabel `tb_apply`
--
ALTER TABLE `tb_apply`
ADD PRIMARY KEY (`id_apply`);
--
-- Indeks untuk tabel `tb_berkas`
--
ALTER TABLE `tb_berkas`
ADD PRIMARY KEY (`id_berkas`);
--
-- Indeks untuk tabel `tb_data_diri`
--
ALTER TABLE `tb_data_diri`
ADD PRIMARY KEY (`nik`);
--
-- Indeks untuk tabel `tb_data_jawaban_cfit`
--
ALTER TABLE `tb_data_jawaban_cfit`
ADD PRIMARY KEY (`id_jawaban_cfit`);
--
-- Indeks untuk tabel `tb_data_jawaban_holland`
--
ALTER TABLE `tb_data_jawaban_holland`
ADD PRIMARY KEY (`id_jawaban_holland`);
--
-- Indeks untuk tabel `tb_data_jawaban_papi`
--
ALTER TABLE `tb_data_jawaban_papi`
ADD PRIMARY KEY (`id_jawaban_papi`);
--
-- Indeks untuk tabel `tb_data_keluarga`
--
ALTER TABLE `tb_data_keluarga`
ADD PRIMARY KEY (`id_keluarga`);
--
-- Indeks untuk tabel `tb_data_pendidikan`
--
ALTER TABLE `tb_data_pendidikan`
ADD PRIMARY KEY (`id_pendidikan`);
--
-- Indeks untuk tabel `tb_data_pendidikan_nonformal`
--
ALTER TABLE `tb_data_pendidikan_nonformal`
ADD PRIMARY KEY (`id_pendidikan_nonformal`);
--
-- Indeks untuk tabel `tb_data_pengalaman_kerja`
--
ALTER TABLE `tb_data_pengalaman_kerja`
ADD PRIMARY KEY (`id_pengalaman`);
--
-- Indeks untuk tabel `tb_jadwal`
--
ALTER TABLE `tb_jadwal`
ADD PRIMARY KEY (`id_jadwal`);
--
-- Indeks untuk tabel `tb_jenis_motlet`
--
ALTER TABLE `tb_jenis_motlet`
ADD PRIMARY KEY (`id_jenis_motlet`);
--
-- Indeks untuk tabel `tb_level`
--
ALTER TABLE `tb_level`
ADD PRIMARY KEY (`id_level`);
--
-- Indeks untuk tabel `tb_lowongan`
--
ALTER TABLE `tb_lowongan`
ADD PRIMARY KEY (`id_lowongan`);
--
-- Indeks untuk tabel `tb_motivation_letter`
--
ALTER TABLE `tb_motivation_letter`
ADD PRIMARY KEY (`id_motivasi`);
--
-- Indeks untuk tabel `tb_nilai`
--
ALTER TABLE `tb_nilai`
ADD PRIMARY KEY (`id_nilai`);
--
-- Indeks untuk tabel `tb_nilai_cfit`
--
ALTER TABLE `tb_nilai_cfit`
ADD PRIMARY KEY (`id_nilai_cfit`);
--
-- Indeks untuk tabel `tb_nilai_pwb`
--
ALTER TABLE `tb_nilai_pwb`
ADD PRIMARY KEY (`id_nilai_pwb`);
--
-- Indeks untuk tabel `tb_pelamar`
--
ALTER TABLE `tb_pelamar`
ADD PRIMARY KEY (`id_pelamar`);
--
-- Indeks untuk tabel `tb_perusahaan`
--
ALTER TABLE `tb_perusahaan`
ADD PRIMARY KEY (`id_perusahaan`);
--
-- Indeks untuk tabel `tb_pesan`
--
ALTER TABLE `tb_pesan`
ADD PRIMARY KEY (`id_pesan`);
--
-- Indeks untuk tabel `tb_psikolog`
--
ALTER TABLE `tb_psikolog`
ADD PRIMARY KEY (`id_psikolog`);
--
-- Indeks untuk tabel `tb_soal_cfit`
--
ALTER TABLE `tb_soal_cfit`
ADD PRIMARY KEY (`id_soal`);
--
-- Indeks untuk tabel `tb_soal_ist`
--
ALTER TABLE `tb_soal_ist`
ADD PRIMARY KEY (`id_soal_ist`);
--
-- Indeks untuk tabel `tb_soal_motlet`
--
ALTER TABLE `tb_soal_motlet`
ADD PRIMARY KEY (`id_soal`);
--
-- Indeks untuk tabel `tb_soal_papi`
--
ALTER TABLE `tb_soal_papi`
ADD PRIMARY KEY (`id_soal`);
--
-- Indeks untuk tabel `tb_soal_tpa`
--
ALTER TABLE `tb_soal_tpa`
ADD PRIMARY KEY (`id_soal_tpa`);
--
-- Indeks untuk tabel `tb_ujian`
--
ALTER TABLE `tb_ujian`
ADD PRIMARY KEY (`id_ujian`);
--
-- Indeks untuk tabel `tb_ujian_holland`
--
ALTER TABLE `tb_ujian_holland`
ADD PRIMARY KEY (`id_ujian_holland`);
--
-- Indeks untuk tabel `tb_ujian_papi`
--
ALTER TABLE `tb_ujian_papi`
ADD PRIMARY KEY (`id_ujian_papi`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `tb_admin`
--
ALTER TABLE `tb_admin`
MODIFY `id_admin` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `tb_apply`
--
ALTER TABLE `tb_apply`
MODIFY `id_apply` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT untuk tabel `tb_berkas`
--
ALTER TABLE `tb_berkas`
MODIFY `id_berkas` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `tb_data_jawaban_cfit`
--
ALTER TABLE `tb_data_jawaban_cfit`
MODIFY `id_jawaban_cfit` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tb_data_jawaban_holland`
--
ALTER TABLE `tb_data_jawaban_holland`
MODIFY `id_jawaban_holland` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `tb_data_jawaban_papi`
--
ALTER TABLE `tb_data_jawaban_papi`
MODIFY `id_jawaban_papi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `tb_data_keluarga`
--
ALTER TABLE `tb_data_keluarga`
MODIFY `id_keluarga` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT untuk tabel `tb_data_pendidikan`
--
ALTER TABLE `tb_data_pendidikan`
MODIFY `id_pendidikan` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT untuk tabel `tb_data_pendidikan_nonformal`
--
ALTER TABLE `tb_data_pendidikan_nonformal`
MODIFY `id_pendidikan_nonformal` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT untuk tabel `tb_data_pengalaman_kerja`
--
ALTER TABLE `tb_data_pengalaman_kerja`
MODIFY `id_pengalaman` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `tb_jadwal`
--
ALTER TABLE `tb_jadwal`
MODIFY `id_jadwal` int(5) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tb_jenis_motlet`
--
ALTER TABLE `tb_jenis_motlet`
MODIFY `id_jenis_motlet` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `tb_level`
--
ALTER TABLE `tb_level`
MODIFY `id_level` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `tb_lowongan`
--
ALTER TABLE `tb_lowongan`
MODIFY `id_lowongan` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `tb_motivation_letter`
--
ALTER TABLE `tb_motivation_letter`
MODIFY `id_motivasi` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT untuk tabel `tb_nilai`
--
ALTER TABLE `tb_nilai`
MODIFY `id_nilai` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT untuk tabel `tb_nilai_cfit`
--
ALTER TABLE `tb_nilai_cfit`
MODIFY `id_nilai_cfit` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `tb_nilai_pwb`
--
ALTER TABLE `tb_nilai_pwb`
MODIFY `id_nilai_pwb` int(5) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tb_pelamar`
--
ALTER TABLE `tb_pelamar`
MODIFY `id_pelamar` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT untuk tabel `tb_perusahaan`
--
ALTER TABLE `tb_perusahaan`
MODIFY `id_perusahaan` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `tb_pesan`
--
ALTER TABLE `tb_pesan`
MODIFY `id_pesan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `tb_psikolog`
--
ALTER TABLE `tb_psikolog`
MODIFY `id_psikolog` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `tb_soal_cfit`
--
ALTER TABLE `tb_soal_cfit`
MODIFY `id_soal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=63;
--
-- AUTO_INCREMENT untuk tabel `tb_soal_ist`
--
ALTER TABLE `tb_soal_ist`
MODIFY `id_soal_ist` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62;
--
-- AUTO_INCREMENT untuk tabel `tb_soal_motlet`
--
ALTER TABLE `tb_soal_motlet`
MODIFY `id_soal` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `tb_soal_papi`
--
ALTER TABLE `tb_soal_papi`
MODIFY `id_soal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=91;
--
-- AUTO_INCREMENT untuk tabel `tb_soal_tpa`
--
ALTER TABLE `tb_soal_tpa`
MODIFY `id_soal_tpa` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT untuk tabel `tb_ujian`
--
ALTER TABLE `tb_ujian`
MODIFY `id_ujian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `tb_ujian_holland`
--
ALTER TABLE `tb_ujian_holland`
MODIFY `id_ujian_holland` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tb_ujian_papi`
--
ALTER TABLE `tb_ujian_papi`
MODIFY `id_ujian_papi` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
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 */;
|
drop materialized view STK_SEARCH_MVIEW;
create materialized view STK_SEARCH_MVIEW
refresh complete on demand
next sysdate + 2/24
as
select * from stk_earning_search_view
union all
select code,name,market,f9,null as hot,null as industry,null as main_industry,null as my_industry,null as fn_date,null as roe,
null as close_change_10,null as close_change_20,null as close_change_30,null as close_change_60,null as close_change_120,
null as volume_avg_5,null as pe,null as pb,null as ps,null as market_cap,null as revenue_growth_rate,
null as gross_profit_margin,null as Sale_Profit_Margin,null as net_profit_growth_rate,null as debt_rate,
null as research_rate,null as pe_ntile,null as pb_ntile,null as ps_ntile,null as ntile,null as listing_days,
null as net_profit_er_0331,null as net_profit_er_0630,null as net_profit_er_0930,null as last_net_profit,
null as last_net_profit_fn_date,null as net_profit_max,null as net_profit_max_flag,null as revenue_max_flag,
null as last_net_profit_one_quarter,null as net_profit_last_year,null as Capital_reserve_per_share,
null as Undistributed_profit_per_share,null as cash_net_profit_rate,null as pe_yoy,
null as er_date,null as er_low,null as er_high,null as last_amount,null as er_pe,null as er_net_profit_max_flag,
null as peg,null as forecast_pe_this_year,null as forecast_pe_next_year,
null as holder
from stk_hk
;
select * from STK_SEARCH_MVIEW where market=1 order by market, code;
call dbms_refresh.refresh('STK_SEARCH_MVIEW');
create table stk_search_mview(
code varchar2(10),
name varchar2(40),
market number(1),
f9 clob,
industry varchar2(2000),
main_industry varchar2(200),
my_industry varchar2(40),
fn_date varchar2(10),
roe number(12,2),
close_change_10 number(12,2),
close_change_20 number(12,2),
close_change_30 number(12,2),
close_change_60 number(12,2),
close_change_120 number(12,2),
volume_avg_5 number(12,2),
pe number(12,2),
pb number(12,2),
ps number(12,2),
market_cap number(12,2),
revenue_growth_rate number(12,2),
gross_profit_margin number(12,2),
Sale_Profit_Margin number(12,2),
net_profit_growth_rate number(12,2),
debt_rate number(12,2),
research_rate number(12,2),
pe_ntile number(4),
pb_ntile number(4),
ps_ntile number(4),
ntile number(4),
listing_days number(8),
net_profit_er_0331 number(14),
net_profit_er_0630 number(14),
net_profit_er_0930 number(14),
last_net_profit number(14),
last_net_profit_fn_date varchar2(10),
net_profit_max number(12,2),
net_profit_max_flag number(2),
revenue_max_flag number(2),
last_net_profit_one_quarter number(12,2),
net_profit_last_year number(14),
cash_net_profit_rate number(12,2),
pe_yoy number(12,2),
er_date varchar2(10),
er_low number(12,2),
er_high number(12,2),
last_amount number(12,2),
er_pe number(12,2),
er_net_profit_max_flag number(2),
peg number(12,2),
forecast_pe_this_year number(12,2),
forecast_pe_next_year number(12,2)
);
|
CREATE TABLE user (
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
email_address VARCHAR(255) NOT NULL,
currency VARCHAR(3) NOT NULL,
country VARCHAR(3) NOT NULL,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE TABLE account (
id INT NOT NULL AUTO_INCREMENT,
user_id INT NOT NULL,
account_type INT NOT NULL,
account_balance number NOT NULL DEFAULT 0,
open BOOLEAN NOT NULL DEFAULT TRUE,
creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
FOREIGN KEY (user_id) REFERENCES user(id)
);
CREATE TABLE transaction (
id INT NOT NULL AUTO_INCREMENT,
from_account INT NOT NULL,
to_account INT NOT NULL,
amount number NOT NULL,
creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
FOREIGN KEY (from_account) REFERENCES account(id),
FOREIGN KEY (to_account) REFERENCES account(id)
);
|
/*
형식:
SELECT (값, 컬럼(항목)명, 함수, SUB QUERY)
FROM (테이블명, SUB QUERY)
*/
SELECT * FROM EMPLOYEES;
SELECT * FROM TAB;
SELECT employee_id, first_name, salary FROM EMPLOYEES;
SELECT employee_id, first_name, salary * 12 FROM EMPLOYEES;
-- ALIAS
SELECT employee_id AS 사원번호, salary as 월급, salary * 12 "일년치 연봉" FROM EMPLOYEES;
-- XXX의 월급은 XXX입니다 "이름 + 월급"
SELECT first_name || '의 월급은 ' || salary || '입니다' AS "이름 + 월급" FROM EMPLOYEES;
-- distinct : 중복행을 삭제
SELECT DISTINCT department_id FROM EMPLOYEES;
-- 문제1) EMPLOYEES Table의 모든 자료를 출력하여라.
SELECT * FROM EMPLOYEES;
-- 문제2) EMPLOYEES Table의 컬럼들을 모두 출력하라.
DESC EMPLOYEES;
SELECT * FROM COLS WHERE TABLE_NAME = 'EMPLOYEES';
-- 문제3) EMPLOYEES Table에서 사원 번호, 이름, 급여, 담당업무를 출력하여라.
SELECT employee_id, first_name, salary, job_id FROM EMPLOYEES;
-- 문제4) 모든 종업원의 급여를 $300증가 시키기 위해서 덧셈 연산자를 사용하고 결과에 SALARY+300을 디스플레이 합니다.
SELECT first_name, salary, salary + 300 FROM EMPLOYEES;
-- 문제5) EMP 테이블에서 사원번호, 이름, 급여, 보너스, 보너스 금액을 출력하여라.
-- (참고로 보너스는 월급 + (월급*커미션))
SELECT employee_id, first_name, salary, salary + NVL(salary * commission_pct, 0) AS BONUS FROM EMPLOYEES;
/*
NVL(컬럼, 컬럼의 값이 null이면 설정되는 값)
*/
-- 문제6) EMPLOYEES 테이블에서 LAST_NAME을 이름으로 SALARY을 급여로 출력하여라.
SELECT last_name AS "이름", salary AS "급여" FROM EMPLOYEES;
-- 문제7) EMPLOYEES 테이블에서 LAST_NAME을 Name으로 SALARY * 12를 Annual Salary(연봉)로 출력하여라
SELECT last_name AS "Name", salary * 12 AS "Annual Salary" FROM EMPLOYEES;
-- 문제8) EMPLOYEES 테이블에서 이름과 업무를 연결하여 출력하여라.
SELECT first_name || ' ' || job_id FROM EMPLOYEES;
-- 문제9) EMPLOYEES 테이블에서 이름과 업무를 “KING is a PRESIDENT” 형식으로 출력하여라.
SELECT first_name || ' is a ' || job_id FROM EMPLOYEES;
-- 문제10) EMPLOYEES 테이블에서 이름과 연봉을 “KING: 1 Year salary = 60000” 형식으로 출력하여라.
SELECT first_name || ': 1 Year salary = ' || salary * 12 FROM EMPLOYEES;
-- 문제11) EMPLOYEES 테이블에서 JOB을 모두 출력하라.
SELECT job_id FROM EMPLOYEES;
|
SELECT *,
(mean - LEAD(mean) OVER (ORDER BY variation_name DESC)) / NULLIF(LEAD(mean) OVER (ORDER BY variation_name DESC),0) AS lift
FROM (
SELECT variation_name,
SUM({{ outcome }}) / COUNT (anonymous_id)::numeric AS mean
FROM modeanalytics.demo_experiment_results
WHERE experiment_name = '{{ experiment }}'
AND variation_name IN ('Original','Variation #1')
GROUP BY 1
) a
ORDER BY 1 |
create or replace package app_util
/**
* Project: app_util <br/>
* Description: This package will hold base methods for other packages, types, functions
* or produres.<br/>
* Features:<br/>
* <pre>
* 1. manipulate string
* 2. manipulate table
* 3. manipulate date and time
* 4. manipulate dictionary
* 5. manipulate transaction
* 6. manipulate json
* 7. manipulate package
* </pre>
* @author Vinhpt
* @headcom
*/
as
/** Pading print format. */
g_rpad_size number := 30;
/** List of element. */
type tuple is table of varchar2(4000);
/** Key length: 64, value length: 4000. */
type dictionary is table of varchar2(4000) index by varchar2(64);
/*
* Feature: manipulate string
*/
/** <code>[string]</code><br/>
* Generate string to print format.
* @param pi_key Pass key string
* @param pi_value Pass value string
* @param pi_rpad_size Pading size, if ignore then using g_rpad_size(30)
* @return varchar2
*/
function get_string_format(
pi_key varchar2,
pi_value varchar2,
pi_rpad_size number default g_rpad_size) return varchar2;
/** <code>[string]</code><br/>
* Generate string to print format.
* @param pi_dictionary Pass dictionary
* @param pi_rpad_size Pading size, if ignore then using g_rpad_size(30)
* @return varchar2
*/
function get_string_format(
pi_dictionary dictionary,
pi_rpad_size number default g_rpad_size) return varchar2;
/** <code>[string]</code><br/>
* Generate string to print format.
* @param pi_jo Pass pljson type
* @param pi_rpad_size Pading size, if ignore then using g_rpad_size(30)
* @return varchar2
*/
function get_string_format(
pi_jo pljson,
pi_rpad_size number default g_rpad_size) return varchar2;
/** <code>[string]</code><br/>
* Print string from key, value.
* @param pi_key Pass key
* @param pi_value Pass value
*/
procedure print(
pi_key varchar2,
pi_value varchar2,
pi_rpad_size number default g_rpad_size);
/** <code>[string]</code><br/>
* Print dictionary.
* @param pi_dictionary Pass dictionary, defined by app_util
*/
procedure print(
pi_dictionary dictionary,
pi_rpad_size number default g_rpad_size);
/** <code>[string]</code><br/>
* Print pljson.
* @param pi_jo Pass plsjon
*/
procedure print(
pi_jo pljson,
pi_rpad_size number default g_rpad_size );
/** <code>[string]</code><br/>
* Print string with condition.
* @param pi_string Pass string to preview
* @param pi_is_previewed If true then print, or do nothing
*/
procedure print(
pi_string varchar2,
pi_is_previewed boolean default true
);
/*
* Feature: manipulate table
*/
/** <code>[table]</code><br/>
* Check table if exist.
* @param pi_table_name Table name
* @return boolean. If true then the table exists
*/
function exist_table(pi_table_name varchar2) return boolean;
/** <code>[table]</code><br/>
* Drop table if exist.
* @param pi_table_name Pass table name to drop
* @param pi_is_forced If true, this table will be dropped cascade
*/
procedure drop_table(pi_table_name varchar2, pi_is_forced boolean default false);
/*
* Feature: manipulate date and time
*/
/** <code>[datetime]</code><br/>
* Convert timestamp to format yyyymmdd.
* @param pi_ts Pass timestamp
* @return number
*/
function get_dnum(pi_ts timestamp default current_timestamp) return number;
/** <code>[datetime]</code><br/>
* Convert timestamp to format hh24miss.
* @param pi_ts Pass timestamp
* @return number
*/
function get_tnum(pi_ts timestamp default current_timestamp) return number;
/** <code>[datetime]</code><br/>
* Convert timestamp to unix timestamp.
* @param pi_ts Pass timestamp
* @return number
*/
function get_unix_ts(pi_ts timestamp default current_timestamp) return number;
/*
* Feature: manipulate dictionary
*/
/** <code>[dictionary]</code><br/>
* Generate a dictionary from pljson type.
* @param pi_json Pass pljson
* @return dictionary
*/
function get_dictionary(pi_json pljson) return dictionary;
/*
* Feature: manipulate transaction
*/
/** <code>[transaction]</code><br/>
* Generate local transaction id.
* @return varchar2
*/
function get_transaction_id return varchar2;
/*
* Feature: manipulate json
*/
/** <code>[json]</code><br/>
* Update pljson from another, only keys exist.
* @param pio_json Pass pljson object to update
* @param pi_json This is source to update
*/
procedure update_json(
pio_json in out pljson,
pi_json pljson
);
/** <code>[json]</code><br/>
* Update pljson from a json string, only keys exist.
* @param pio_json Pass pljson object to update
* @param pi_json This is source string to update
*/
procedure update_json(
pio_json in out pljson,
pi_json varchar2
);
/** <code>[json]</code><br/>
* Merge json from other.
* @param pio_tar_json Pass target pljson
* @param pi_src_json Pass source pljson
*/
procedure merge_json(
pio_tar_json in out pljson,
pi_src_json pljson
);
/** <code>[json]</code><br/>
* Merge json from other.
* @param pio_tar_json Pass target pljson
* @param pi_src_json Pass source json string
*/ procedure merge_json(
pio_tar_json in out pljson,
pi_src_json varchar2
);
/*
* Feature: manipulate package
*/
/** <code>[package]</code><br/>
* Check package is existed.
* @param pi_package_name Pass package name
*/
function exist_package(pi_package_name varchar2) return boolean;
/*
* Featue: execute sql
*/
/** <code>[sql]</code><br/>
* Execute sql with condition
* @param pi_is_forced Pass true, and run
*/
procedure exec(
pi_sql varchar2,
pi_is_forced boolean default false)
;
end app_util;
/ |
CREATE TABLE Vehicle(
registrationNumber char(10) UNIQUE,
color varchar(10),
slotNumber int PRIMARY KEY
); |
# Create and use database if it not exists
CREATE DATABASE IF NOT EXISTS songdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
USE songdb;
# Set names to utf-8
SET NAMES utf8;
# Create the authors table
CREATE TABLE songdb.authors
(
id INT(11) PRIMARY KEY AUTO_INCREMENT NOT NULL,
name VARCHAR(63) NOT NULL,
country VARCHAR(3) NOT NULL
) DEFAULT CHARSET=utf8;
# Create the songs table
CREATE TABLE songdb.songs
(
id INT(11) PRIMARY KEY AUTO_INCREMENT NOT NULL,
author_id INT(11) NOT NULL,
title VARCHAR(127) NOT NULL,
youtube_id VARCHAR(24) NOT NULL,
release_date DATE NOT NULL,
length INT(11) NOT NULL,
CONSTRAINT songs_fk0 FOREIGN KEY (author_id) REFERENCES songdb.authors (id)
) DEFAULT CHARSET=utf8;
CREATE INDEX songs_fk0 ON songdb.songs (author_id);
# Create ratings table
CREATE TABLE songdb.ratings
(
id INT(11) PRIMARY KEY AUTO_INCREMENT NOT NULL,
song_id INT(11) NOT NULL,
rating INT(11) NOT NULL,
CONSTRAINT ratings_fk0 FOREIGN KEY (song_id) REFERENCES songdb.songs(id)
) DEFAULT CHARSET=utf8;
CREATE INDEX ratings_fk0 ON songdb.ratings(song_id);
# Insert Authors
INSERT INTO songdb.authors (id, name, country) VALUES (1, 'Neşet Ertaş', 'TUR');
INSERT INTO songdb.authors (id, name, country) VALUES (2, 'Cem Karaca', 'TUR');
INSERT INTO songdb.authors (id, name, country) VALUES (3, 'Nujabes', 'JPN');
INSERT INTO songdb.authors (id, name, country) VALUES (4, 'DJ Krush', 'JPN');
INSERT INTO songdb.authors (id, name, country) VALUES (5, 'The Seatbelts', 'JPN');
INSERT INTO songdb.authors (id, name, country) VALUES (6, 'Ella Fitzgerald', 'USA');
# Insert Songs
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (1, 3, 'Feather', 'jfFTT3iz740', 175, '2005-11-11');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (2, 3, 'Aruarian Dance', 'TYRDgd3Tb44', 245, '2004-06-23');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (3, 4, 'Keeping The Motion', 'fV2jE7fGYUY', 397, '1994-06-12');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (4, 4, 'Mu Getsu', 'qaYy-ldpIXc', 380, '1996-08-08');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (5, 5, 'Spokey Dokey', 'fcSuJi1b0OU', 346, '1998-03-21');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (6, 5, 'Waltz for Zizi', 'Qbip5oZVL94', 211, '1998-03-21');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (7, 2, 'Dadaloğlu', 'IGIH3DHfqp4', 282, '1970-11-01');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (8, 2, 'Terketmedi Sevdan Beni', 'Uxezxfa0G0Y', 272, '1977-01-01');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (9, 1, 'Bir Ayrılık Bir Yoksuzluk Bir Ölüm', 'YXtBlJB2Udk', 353, '1997-01-01');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (10, 6, 'Dream a Little Dream of Me', 'XRpLb4PXVyQ', 192, '1993-03-30');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (11, 6, 'My Funny Valentine', 'KqjKOalcI10', 231, '1953-01-01');
INSERT INTO songdb.songs (id, author_id, title, youtube_id, length, release_date) VALUES (12, 4, 'Candle Chant', 'So0pr5J8QYw', 386, '2001-08-07');
|
/*
Script Name: Chapter 8 Justlee books store
Developer: Tu Tong
Date: October 27, 2017
Purpose: Restricing rows and sorting data
*/
-- Query perform search for FL state
SELECT lastname, state
FROM customers
WHERE state = 'FL';
-- search for customer 1010
SELECT *
FROM customers
WHERE customer# = 1010;
-- search for book math ISBN
SELECT *
FROM books
WHERE isbn = 1915762492;
-- query with a date condition
SELECT *
FROM books
WHERE pubdate = '21-JAN-05'; -- Default date format
-- Search for books with a retail price grater than $55
SELECT *
FROM books
WHERE retail > 55;
SELECT *
FROM books
WHERE title > 'HO';
-- Search profit with the "less than" operator
SELECT title, (retail - cost) profit
FROM books
WHERE (retail - cost) < (cost * 0.2);
-- Search State with the "less than or equal to" operator
SELECT firstname, lastname, state
FROM customers
WHERE state <= 'GA';
SELECT *
FROM customers
WHERE state != 'GA'; -- != or <> or ^=
-- Search for orders in the past
SELECT *
FROM orders
WHERE orderdate < '01-APR-09';
SELECT *
FROM orders
WHERE orderdate < SYSDATE;
-- Search for Pubid with the BETWEEN ... AND operator
SELECT title, pubid
FROM books
WHERE pubid BETWEEN 1 AND 3;
-- Searching for State with the IN operator
SELECT firstname, lastname, state
FROM customers
WHERE state IN ('CA', 'TX');
-- wildcard search
SELECT isbn, title
FROM books
WHERE isbn LIKE '_4%0';
-- Using the ESCAPE option with the LIKE operator
SELECT *
FROM testing
WHERE tvalue LIKE '\%__A%T' ESCAPE '\';
/* In regards to sorting, if a DISTINCT option is used
in the SELECT clause of a query then only columns in
the SELECT clause can be used for sorting */
SELECT DISTINCT shipdate
FROM orders
WHERE shipdate IS NOT NULL
ORDER BY order# DESC;
/* the query will return all books that cost at least $25.00 */
SELECT *
FROM books
WHERE cost >= 25.00;
/* query will retreive all books stored in the
BOOKS table with Pubid 1 or 2 that have a retail price
of at least $42.00 */
SELECT *
FROM books
WHERE pubid IN(1,2) OR retail >= 42;
/* Select books and sort them in order of their category
for the book in same category, sort the title of
the book in descending order */
SELECT category, title
FROM books
ORDER BY 1 ASC, 2 DESC;
/* search for order 1007 and display
how long it took to ship.
*/
SELECT order#, (shipdate - orderdate)
FROM orders WHERE order# = 1007;
/* list order placed by customer # 1020
that have not yet been shipped */
SELECT *
FROM orders
WHERE customer# = 1020 AND shipdate IS NULL;
/* list orders that were not shipped for at least three days
after the order was received */
SELECT *
FROM orders
WHERE (shipdate - orderdate) >= 3;
/* list orders placed in the month of March */
SELECT *
FROM orders
WHERE orderdate BETWEEN '01-Mar-09' AND '31-Mar-09';
/* query will list all orders contained in the ORDERS table
that have been shipped based upon the customer# and order# */
SELECT *
FROM orders
WHERE shipdate IS NOT NULL
ORDER BY customer#, order#;
|
set @index_exists := (SELECT COLUMN_KEY FROM `information_schema`.`COLUMNS` WHERE TABLE_NAME = 'nagios_logentries' AND COLUMN_NAME = 'logentry_data' LIMIT 1);
set @sqlstmt := if( @index_exists = '',
'select ''INFO: index did not exist''',
'ALTER TABLE `nagios_logentries` DROP INDEX `logentry_data`');
prepare stmt from @sqlstmt;
execute stmt;
ALTER TABLE nagios_logentries MODIFY `logentry_data` mediumtext NOT NULL;
CREATE INDEX `logentry_data` on nagios_logentries(`logentry_data`(255));
ALTER TABLE nagios_services MODIFY `check_command_args` varchar(1024) NOT NULL DEFAULT '';
ALTER TABLE nagios_hosts MODIFY `check_command_args` varchar(1024) NOT NULL DEFAULT ''; |
-- 데이터베이스 생성
CREATE DATABASE IF NOT EXISTS wedul DEFAULT CHARACTER SET utf8mb4; |
DROP DATABASE IF EXISTS simplecoin;
DROP DATABASE IF EXISTS simplecoin_testing;
CREATE USER simplecoin WITH PASSWORD 'testing';
CREATE DATABASE simplecoin;
GRANT ALL PRIVILEGES ON DATABASE simplecoin to simplecoin;
-- Create a testing database to be different than dev
CREATE DATABASE simplecoin_testing;
GRANT ALL PRIVILEGES ON DATABASE simplecoin to simplecoin;
\c simplecoin
CREATE EXTENSION hstore;
\c simplecoin_testing
CREATE EXTENSION hstore;
|
SELECT 'Dehtiarov' student FROM DUAL;
|
select ao.animal_id
, ao.name
from animal_outs ao
join animal_ins ai on ao.animal_id = ai.animal_id
where 1 = 1
and ao.datetime < ai.datetime
order by ai.datetime
; |
ALTER PROC [Hr].[GetPersonHealthCheck]
@pid INT
AS
BEGIN
SELECT *,
(STUFF((SELECT ',' + CONVERT(VARCHAR(2),c1.HealthStdId)
FROM [Hr].[PersonHealthStd] C1
WHERE c1.PersonHealthCheckId = hc.Id
FOR XML PATH('')),1,1,'')) AS [StandardIds]
FROM [Hr].[PersonHealthCheck] hc WHERE PersonId =@pid
END
|
select
aff_name
,count(distinct case when z.low >= '7.7' then enterprise_id else null end) as "MVPs"
,count(distinct case when ctbn_amt is not null and pay_period_dt > '2016-01-01' then enterprise_id else null end) as "Contbs"
,count(distinct enterprise_id)
from analytics.members
left join enterprise.pac_contributions using (enterprise_id)
left join
(select
distinct enterprise_id
,min(ctbn_amt) as low
from enterprise.pac_contributions
where pay_period_dt > '2016-01-01'
group by 1) z using (enterprise_id)
where aff_type in ('R','S')
and member_type = 'Retiree'
group by 1
order by 1
|
-- MySQL Workbench Forward Engineering
SET
@OLD_UNIQUE_CHECKS = @ @UNIQUE_CHECKS,
UNIQUE_CHECKS = 0;
SET
@OLD_FOREIGN_KEY_CHECKS = @ @FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS = 0;
SET
@OLD_SQL_MODE = @ @SQL_MODE,
SQL_MODE = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `instagram_clone` DEFAULT CHARACTER SET utf8;
USE `instagram_clone`;
-- -----------------------------------------------------
-- Table `mydb`.`users`
-- -----------------------------------------------------
CREATE TABLE users (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(192),
`email` VARCHAR(192) UNIQUE,
`username` VARCHAR(45) UNIQUE,
`password` VARCHAR(192),
`avatar` VARCHAR(192),
`create_at` DATETIME,
`update_at` DATETIME
);
-- -----------------------------------------------------
-- Table `mydb`.`publications`
-- -----------------------------------------------------
CREATE TABLE publications(
`id` INT AUTO_INCREMENT PRIMARY KEY,
`image` VARCHAR(192),
`like` INT,
`create_ate` DATETIME,
`update_at` DATETIME,
`users_id` INT NOT NULL,
FOREIGN KEY (users_id) REFERENCES users (id)
);
-- -----------------------------------------------------
-- Table `mydb`.`comments`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `instagram_clone`.`comments` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`description` TEXT,
`create_at` DATETIME,
`update_at` DATETIME,
`publications_id` INT NOT NULL,
FOREIGN KEY (publications_id) REFERENCES publications (id)
); |
CREATE DATABASE catmash;
CREATE TABLE `catmash`.`cat` (
`SCORE` INT NULL,
`URL` VARCHAR(45) NULL,
`ID` VARCHAR(45) NOT NULL,
PRIMARY KEY (`ID`));
ALTER TABLE `catmash`.`cat`
CHANGE COLUMN `URL` `URL` LONGBLOB NULL DEFAULT NULL ;
|
CREATE TABLE "LOCATION_DETAILS"
(
"UID" integer NOT NULL,
"COUNTRY" "char",
"STATE" "char",
"COUNTY" "char",
"LATITUDE" double precision,
"LONGITUDE" double precision,
CONSTRAINT "LOCATION_DETAILS_pkey" PRIMARY KEY ("UID")
)
;
CREATE TABLE "LOCATION_STATS"
(
"UID" integer NOT NULL,
"KEY" "char" NOT NULL,
"STAT_DATE" date NOT NULL,
"VALUE" integer,
CONSTRAINT "LOCATION_STATS_pkey" PRIMARY KEY ("UID", "KEY", "STAT_DATE")
)
;
|
/*
Navicat Premium Data Transfer
Source Server : test
Source Server Type : MySQL
Source Server Version : 100129
Source Host : localhost:3306
Source Schema : test
Target Server Type : MySQL
Target Server Version : 100129
File Encoding : 65001
Date: 25/04/2019 00:22:54
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`admin_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`forename` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`surname` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`username` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
PRIMARY KEY (`admin_id`) USING BTREE,
UNIQUE INDEX `uq_admin_email`(`email`) USING BTREE,
UNIQUE INDEX `uq_admin_username`(`username`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for category
-- ----------------------------
DROP TABLE IF EXISTS `category`;
CREATE TABLE `category` (
`category_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`category_id`) USING BTREE,
UNIQUE INDEX `uq_category_name`(`name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for cpu
-- ----------------------------
DROP TABLE IF EXISTS `cpu`;
CREATE TABLE `cpu` (
`cpu_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`manufacturer` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`model` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`frequency` double(10, 2) UNSIGNED NOT NULL,
`core_count` int(4) UNSIGNED NOT NULL,
PRIMARY KEY (`cpu_id`) USING BTREE,
UNIQUE INDEX `uq_cpu_model`(`model`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for display
-- ----------------------------
DROP TABLE IF EXISTS `display`;
CREATE TABLE `display` (
`display_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`screen_size` double(3, 1) UNSIGNED NOT NULL,
`resolution` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`is_touchscreen` smallint(1) UNSIGNED NOT NULL,
PRIMARY KEY (`display_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gpu
-- ----------------------------
DROP TABLE IF EXISTS `gpu`;
CREATE TABLE `gpu` (
`gpu_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` enum('integrated','external') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`model` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`video_memory` int(10) UNSIGNED NOT NULL,
PRIMARY KEY (`gpu_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for laptop
-- ----------------------------
DROP TABLE IF EXISTS `laptop`;
CREATE TABLE `laptop` (
`laptop_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`price` decimal(10, 2) UNSIGNED NOT NULL,
`image_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`operating_system` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`keyboard_layout` enum('US','UK','YU') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`is_numpad` smallint(1) UNSIGNED NOT NULL,
`is_deleted` smallint(1) UNSIGNED NOT NULL,
`cpu_id` int(10) UNSIGNED NOT NULL,
`category_id` int(10) UNSIGNED NOT NULL,
`display_id` int(10) UNSIGNED NOT NULL,
`gpu_id` int(10) UNSIGNED NOT NULL,
`ram_capacity` int(10) UNSIGNED NOT NULL,
`ram_type` enum('DDR2','DDR3','DDR4') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`manufacturer` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
PRIMARY KEY (`laptop_id`) USING BTREE,
INDEX `fk_laptop_cpu_id`(`cpu_id`) USING BTREE,
INDEX `fk_laptop_category_id`(`category_id`) USING BTREE,
INDEX `fk_laptop_display_id`(`display_id`) USING BTREE,
INDEX `fk_laptop_gpu_id`(`gpu_id`) USING BTREE,
CONSTRAINT `fk_laptop_category_id` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT `fk_laptop_cpu_id` FOREIGN KEY (`cpu_id`) REFERENCES `cpu` (`cpu_id`) ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT `fk_laptop_display_id` FOREIGN KEY (`display_id`) REFERENCES `display` (`display_id`) ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT `fk_laptop_gpu_id` FOREIGN KEY (`gpu_id`) REFERENCES `gpu` (`gpu_id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for port
-- ----------------------------
DROP TABLE IF EXISTS `port`;
CREATE TABLE `port` (
`port_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`laptop_id` int(10) UNSIGNED NOT NULL,
`type` enum('HDMI','Video Port','VGA','DVI','USB C') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`port_id`) USING BTREE,
INDEX `fk_laptop_port_laptop_id`(`laptop_id`) USING BTREE,
CONSTRAINT `fk_port_laptop_id` FOREIGN KEY (`laptop_id`) REFERENCES `laptop` (`laptop_id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for storage
-- ----------------------------
DROP TABLE IF EXISTS `storage`;
CREATE TABLE `storage` (
`storage_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`laptop_id` int(10) UNSIGNED NOT NULL,
`type` enum('SSD','HDD') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`capacity` int(10) UNSIGNED NOT NULL,
PRIMARY KEY (`storage_id`) USING BTREE,
INDEX `fk_laptop_storage_laptop_id`(`laptop_id`) USING BTREE,
CONSTRAINT `fk_storage_laptop_id` FOREIGN KEY (`laptop_id`) REFERENCES `laptop` (`laptop_id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;
|
# Sauvegarde infos client
UPDATE `client`
SET
`entreprise_client` = :entreprise
WHERE
`pk_client` = :client
;
|
SELECT * FROM Proyectos; |
use jade;
# Employee
insert into employee (employeeSeq, lastName, firstName) values (1, 'Cornelious-Smith', 'Bessie');
insert into employee (employeeSeq, lastName, firstName) values (2, 'Varverakis', 'Michael');
insert into employee (employeeSeq, lastName, firstName) values (3, 'Jevita', 'Anthony');
insert into employee (employeeSeq, lastName, firstName, title) values (4, 'Makki', '', 'Dr.');
#insert into employee (employeeSeq, lastName, firstName) values (5, 'Youngblood', 'Phyllis');
insert into employee (employeeSeq, lastName, firstName) values (6, 'Derr', 'Carol');
insert into employee (employeeSeq, lastName, firstName) values (7, 'Miller', 'Melvine');
insert into employee (employeeSeq, lastName, firstName) values (8, 'Marsh', 'Felicia');
insert into employee (employeeSeq, lastName, firstName) values (9, 'Wilford', 'DeNina');
insert into employee (employeeSeq, lastName, firstName) values (10, 'House', 'JD');
insert into employee (employeeSeq, lastName, firstName) values (11, 'Anderson', 'Glenice');
insert into employee (employeeSeq, lastName, firstName) values (12, 'Hudson', 'Gene');
insert into employee (employeeSeq, lastName, firstName) values (13, 'Coleman', 'Crystal');
insert into employee (employeeSeq, lastName, firstName) values (14, 'Miller', 'Rhonda');
insert into employee (employeeSeq, lastName, firstName) values (15, 'Essenmacher', 'Sheryl');
insert into employee (employeeSeq, lastName, firstName, title) values (17, 'Fuller', 'Lisa', 'DO');
insert into employee (employeeSeq, lastName, firstName, title) values (18, 'Rotar', 'Ana', 'MD');
insert into employee (employeeSeq, lastName, firstName) values (19, 'Montgomery', 'Pamela');
insert into employee (employeeSeq, lastName, firstName) values (22, 'Hurd', 'Kelly');
insert into employee (employeeSeq, lastName, firstName) values (23, 'Reeves', 'Ronda');
insert into employee (employeeSeq, lastName, firstName) values (24, 'Elliot', 'Stephany');
insert into employee (employeeSeq, lastName, firstName) values (25, 'Teachworth', 'Carol');
insert into employee (employeeSeq, lastName, firstName) values (26, 'Kimbrough', 'Hope');
insert into employee (employeeSeq, lastName, firstName) values (27, 'Ficker', 'Lisa');
insert into employee (employeeSeq, lastName, firstName) values (28, 'Lester', 'Sohonnie');
insert into employee (employeeSeq, lastName, firstName) values (29, 'Moskos', 'Patricia');
insert into employee (employeeSeq, lastName, firstName) values (30, 'Mauricio', 'Genevieve');
insert into employee (employeeSeq, lastName, firstName) values (31, 'Kleist', 'Jennifer');
insert into employee (employeeSeq, lastName, firstName, title) values (32, 'Fazzolari', 'Lisa', 'MD');
insert into employee (employeeSeq, lastName, firstName) values (33, 'Smith', 'Jackie');
insert into employee (employeeSeq, lastName, firstName) values (35, 'Karuoya', 'Priscilla');
insert into employee (employeeSeq, lastName, firstName) values (36, 'Hurskin', 'Cedric');
insert into employee (employeeSeq, lastName, firstName) values (37, 'Hagar', 'Tamara');
insert into employee (employeeSeq, lastName, firstName) values (38, 'West', 'Ron');
insert into employee (employeeSeq, lastName, firstName) values (39, 'Siddiqui', 'Wardah');
insert into employee (employeeSeq, lastName, firstName) values (40, 'Da Cunha', 'Marilene');
insert into employee (employeeSeq, lastName, firstName) values (41, 'Hurskin', 'John');
insert into employee (employeeSeq, lastName, firstName) values (42, 'Saunders', 'Tanikka');
insert into employee (employeeSeq, lastName, firstName) values (43, 'Reyes', 'Cheryl');
insert into employee (employeeSeq, lastName, firstName) values (45, 'Suprai', 'Sukhdeep');
insert into employee (employeeSeq, lastName, firstName) values (46, 'Guerrero', 'Alejandra');
insert into employee (employeeSeq, lastName, firstName) values (49, 'Singh', 'Diana');
insert into employee (employeeSeq, lastName, firstName) values (50, 'Bennett', 'Kellen');
insert into employee (employeeSeq, lastName, firstName) values (51, 'Bereteh', 'Mohamed');
insert into employee (employeeSeq, lastName, firstName) values (52, 'Marks', 'Jennifer');
insert into employee (employeeSeq, lastName, firstName) values (53, 'Lynch', 'Barton');
insert into employee (employeeSeq, lastName, firstName) values (54, 'Bradley', 'Virginia');
insert into employee (employeeSeq, lastName, firstName) values (55, 'Cerda', 'Krystelle');
insert into employee (employeeSeq, lastName, firstName, title) values (56, 'Choi', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (57, 'Nanda', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (59, 'Tom', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (60, 'Harris', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (61, 'Murphy', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName) values (62, 'Coleman', 'Cheri');
insert into employee (employeeSeq, lastName, firstName) values (63, 'Geralyn', 'Mitchell');
insert into employee (employeeSeq, lastName, firstName) values (64, 'Marte', 'Martine');
insert into employee (employeeSeq, lastName, firstName) values (65, 'Avila', 'Satyn');
insert into employee (employeeSeq, lastName, firstName) values (66, 'Lundag', 'Malou');
insert into employee (employeeSeq, lastName, firstName) values (67, 'Diaz', 'Ariel');
insert into employee (employeeSeq, lastName, firstName) values (68, 'Unadkat', 'Dipali');
insert into employee (employeeSeq, lastName, firstName) values (69, 'Liu', 'Viola');
insert into employee (employeeSeq, lastName, firstName, title) values (70, 'Andrada', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (71, 'Benoit', 'Bill', 'MFT');
insert into employee (employeeSeq, lastName, firstName, title) values (72, 'Deshmukh', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (73, 'Fan', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (74, 'Versales', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (75, 'Rahman', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName) values (76, 'Gentry', 'Kendra');
insert into employee (employeeSeq, lastName, firstName) values (77, 'Morales', 'Cassandra');
insert into employee (employeeSeq, lastName, firstName) values (78, 'Rivera', 'Fred');
insert into employee (employeeSeq, lastName, firstName) values (79, 'Longoria', 'Teresa');
insert into employee (employeeSeq, lastName, middleName, firstName) values (80, 'White', 'Llamoso', 'Jhonna');
insert into employee (employeeSeq, lastName, firstName) values (81, 'Mueller', 'Deborah');
insert into employee (employeeSeq, lastName, firstName) values (82, 'Corona', 'Lorena');
insert into employee (employeeSeq, lastName, firstName) values (83, 'Rios', 'Brittany');
insert into employee (employeeSeq, lastName, firstName, title) values (84, 'Luo', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (85, 'Reminajes', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (86, 'Hartman', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName, title) values (87, 'Obolnikov', '', 'Dr.');
insert into employee (employeeSeq, lastName, firstName) values (88, 'Ward', 'Eugenia');
insert into employee (employeeSeq, lastName, firstName) values (89, 'McCloud', 'Barbara');
insert into employee (employeeSeq, lastName, firstName) values (90, 'McClore', 'Sinitra');
insert into employee (employeeSeq, lastName, firstName) values (91, 'Greenlaw', 'Amy' );
insert into employee (employeeSeq, lastName, firstName) values (92, 'AzadAzad', 'Arian' );
insert into employee (employeeSeq, lastName, firstName) values (93, 'Smith-Grady', 'Tyrisha' );
insert into employee (employeeSeq, lastName, firstName) values (94, 'Econome', 'Kathryn' );
insert into employee (employeeSeq, lastName, middleName, firstName) values (95, 'Montenegro', 'Wycoff', 'Melissa' );
insert into employee (employeeSeq, lastName, firstName) values (96, 'Mills', 'Laquesha' );
insert into employee (employeeSeq, lastName, firstName) values (97, 'Gertsvolf', 'Mariya' );
insert into employee (employeeSeq, lastName, firstName) values (98, 'Keller', 'Kelly' );
insert into employee (employeeSeq, lastName, firstName, title) values (99, 'Quanbeck', 'Cameron', 'MD' );
insert into employee (employeeSeq, lastName, firstName) values (100, 'Moceri', 'Jessica' );
insert into employee (employeeSeq, lastName, firstName) values (101, 'Frey', 'Erin' );
insert into employee (employeeSeq, lastName, firstName) values (102, 'Fahmy', 'Amira' );
insert into employee (employeeSeq, lastName, firstName, title) values (103, 'Sun', 'Vivian', 'MD');
insert into employee (employeeSeq, lastName, firstName) values (104, 'Marks', ' Lauren' );
insert into employee (employeeSeq, lastName, firstName) values (105, 'Rohin', 'Sahar' );
insert into employee (employeeSeq, lastName, firstName, title) values (106, 'Bhatt', 'Usha', 'MD');
insert into employee (employeeSeq, lastName, firstName, title) values (107, 'Whitley', 'Celica', 'MD');
insert into employee (employeeSeq, lastName, firstName) values (108, 'Reyes', 'Ninaronna');
# Location
insert into location values ('Det PHP');
insert into location values ('Det Intk');
insert into location values ('Det Med');
insert into location values ('Det Corp');
insert into location values ('Det ACT');
insert into location values ('Det NGC');
insert into location values ('Det');
insert into location values ('NEG');
insert into location values ('Corp');
insert into location values ('Oak');
insert into location values ('PTW');
insert into location values ('Intake');
insert into location values ('UC');
insert into location values ('Martinez');
insert into location values ('PL');
insert into location values ('CHILDRPNS');
# role
insert into role values ('Manager');
insert into role values ('HR Manager');
insert into role values ('User');
# View
insert into employeeView (employeeViewSeq, viewName) values (1, 'All Employee');
insert into employeeView (employeeViewSeq, viewName) values (2, 'Program Administrator for PHP');
insert into employeeView (employeeViewSeq, viewName) values (3, 'Intake Director for Intake Department');
insert into employeeView (employeeViewSeq, viewName) values (4, 'Program Manager for North Park Medication Clinic');
insert into employeeView (employeeViewSeq, viewName) values (5, 'Director of Operations for BHR');
insert into employeeView (employeeViewSeq, viewName) values (6, 'ACT Director for ACT');
insert into employeeView (employeeViewSeq, viewName) values (7, 'Associate Director of Operations for Northeast Guidance Center');
insert into employeeView (employeeViewSeq, viewName) values (8, 'Unit Supervisor for Children''s Department N');
insert into employeeView (employeeViewSeq, viewName) values (9, 'CEO');
insert into employeeView (employeeViewSeq, viewName) values (10, 'COO and Director of Operations for BHR CA');
insert into employeeView (employeeViewSeq, viewName) values (11, 'Program Manager for Oakland PTW');
insert into employeeView (employeeViewSeq, viewName) values (12, 'Human Resources Specialist for BHR');
insert into employeeView (employeeViewSeq, viewName) values (13, 'Intake Director for BHR Pleasanton');
insert into employeeView (employeeViewSeq, viewName) values (14, 'Interim Program Manager for Union City PTW');
insert into employeeView (employeeViewSeq, viewName) values (15, 'Director of Fiscal and Business Management for BHR CA');
insert into employeeView (employeeViewSeq, viewName) values (16, 'Program Manager for Martinez PTW');
insert into employeeView (employeeViewSeq, viewName) values (17, 'Direct report for Gregory Matzelle');
# User
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('hradmin', 'f3b2010', 'HR Manager', 1, 'HR Manager', 'HR Administrator');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('ghudson', 't1m32017', 'Manager', 2, 'Program Administrator for PHP', 'Gene Hudson');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('ccoleman', 'g0g2011', 'Manager', 3, 'Intake Director for Intake Department', 'Crystal Coleman');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('rmiller', 'h0n,2015', 'Manager', 4, 'Program Manager for North Park Medication Clinic', 'Rhonda Miller');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('rwest', 'r0n>3578', 'Manager', 5, 'Director of Operations for BHR', 'Ron West' );
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('sessenmacher', 'sh3r?2345', 'Manager', 6, 'ACT Director for ACT', 'Sheryl Essenmacher');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('thagar', 'tam<@34', 'Manager', 7, 'Associate Director of Operations for Northeast Guidance Center', 'Tamara Hagar');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('kclampitt', 'k0m:232', 'Manager', 8, 'Unit Supervisor for Children''s Department N', 'Kathryn Clampitt');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('nbecton', 'c3oerty', 'Manager', 9, 'CEO', 'Neisha Becton');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('churskin', 'c3d23kk', 'Manager', 10, 'COO and Director of Operations for BHR CA', 'Cedric Hurskin');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('tsaunders', 'an1"231', 'Manager', 11, 'Program Manager for Oakland PTW', 'Tanikka Saunders');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('gmauricio', 'g3n{567', 'Manager', 12, 'Human Resources Specialist for BHR', 'Genevieve Mauricio');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('aguerrero', 'al3tywe', 'Manager', 13, 'Intake Director for BHR Pleasanton', 'Alejandra Guerrero');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('ssuprai', 'sk3<lopq', 'Manager', 14, 'Interim Program Manager for Union City PTW', 'Sukhdeep Suprai');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('creyes', 'ch3r-234', 'Manager', 15, 'Director of Fiscal and Business Management for BHR CA', 'Cheryl Reyes');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('dmueller', 'mueller123', 'Manager', 16,'Program Manager for Martinez PTW', 'Deborah Mueller');
insert into user (userId, password, role, employeeViewSeq, description, assignedTo) values ('gmatzelle', 'matzelle123', 'Manager', 17,'Direct report for Gregory Matzelle', 'Gregory Matzelle');
# ViewMapping
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (2, 1, 'Det PHP');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (2, 2, 'Det PHP');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (2, 3, 'Det PHP');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (2, 4, 'Det PHP');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 4, 'Det Intk');
#insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 5, 'Det Intk');
#insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 6, 'Det Intk');
#insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 7, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 8, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 9, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 10, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 88, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 89, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 100, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (3, 107, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (4, 11, 'Det Med');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (5, 12, 'Det PHP');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (5, 13, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (5, 14, 'Det Med');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (5, 15, 'Det ACT');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (5, 17, 'Det');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (5, 18, 'Det');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (6, 19, 'Det ACT');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (7, 10, 'Det NGC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (7, 22, 'Det NGC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (7, 23, 'Det NGC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (7, 24, 'Det NGC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (7, 25, 'Det NGC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (7, 26, 'Det NGC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (7, 27, 'Det NGC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (7, 28, 'Det NGC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (8, 29, 'CHILDRPNS');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 30, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 31, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 32, 'PL');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 33, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 35, 'PTW');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 36, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 37, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 38, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 39, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (9, 40, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (10, 41, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (10, 42, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (10, 43, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (10, 45, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (10, 46, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 49, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 50, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 51, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 52, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 53, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 54, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 55, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 56, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 57, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 59, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 60, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 61, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 87, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 71, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 93, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 95, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 96, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 98, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (11, 99, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (12, 62, 'Det Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (13, 63, 'Intake');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 57, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 64, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 65, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 66, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 67, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 68, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 69, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 69, 'PL');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 70, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 71, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 72, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 73, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 74, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 75, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 92, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 97, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 101, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 102, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 104, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (14, 105, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (15, 76, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (15, 77, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (15, 78, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (15, 79, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (15, 80, 'Corp');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 50, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 75, 'PL');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 81, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 82, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 82, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 83, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 84, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 85, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 86, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 86, 'PL');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 91, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 94, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 103, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 106, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (16, 108, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (17, 89, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (17, 90, 'Det');
# ViewMapping for All Employee
insert into viewMapping (employeeViewSeq, employeeSeq, location) select 1, employeeSeq, location from viewMapping;
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 88, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 89, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 90, 'Det');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 91, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 92, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 93, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 94, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 95, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 96, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 97, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 98, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 99, 'Oak');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 100, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 101, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 102, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 103, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 104, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 105, 'UC');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 106, 'Martinez');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 107, 'Det Intk');
insert into viewMapping (employeeViewSeq, employeeSeq, location) values (1, 108, 'Martinez'); |
# Task 3: Last month riders breakdown by Age and Gender for New York
SELECT
(2018 - birth_year) AS age,
gender,
COUNT(*) AS count_riders,
'New York' AS location
FROM `bigquery-public-data.new_york_citibike.citibike_trips`
WHERE starttime > (
SELECT DATE_SUB(DATE(MAX(starttime)),INTERVAL 1 MONTH)
FROM `bigquery-public-data.new_york_citibike.citibike_trips`
)
GROUP BY age, gender
ORDER BY
age,
count_riders DESC |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Gegenereerd op: 24 okt 2017 om 09:28
-- Serverversie: 10.1.26-MariaDB
-- PHP-versie: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `photobooth`
--
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `foto`
--
CREATE TABLE `foto` (
`id` int(11) NOT NULL,
`sessieID` int(11) NOT NULL,
`path` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Gegevens worden geëxporteerd voor tabel `foto`
--
INSERT INTO `foto` (`id`, `sessieID`, `path`) VALUES
(20, 6, 'images/IMG0.jpg'),
(21, 6, 'images/IMG1.jpg'),
(22, 6, 'images/IMG2.jpg'),
(23, 7, 'images/IMG3.jpg'),
(24, 7, 'images/IMG4.jpg'),
(25, 8, 'images/IMG5.jpg');
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `sessie`
--
CREATE TABLE `sessie` (
`id` int(11) NOT NULL,
`code` varchar(255) NOT NULL,
`locatie` varchar(255) NOT NULL,
`temperatuur` int(11) NOT NULL,
`aantal` int(11) NOT NULL,
`tijd` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Gegevens worden geëxporteerd voor tabel `sessie`
--
INSERT INTO `sessie` (`id`, `code`, `locatie`, `temperatuur`, `aantal`, `tijd`) VALUES
(6, 'CTcT7W', 'Alkmaar', 13, 3, '2017-10-13 17:45:35'),
(7, 'BvS9en', 'Amsterdam', 15, 2, '2017-10-13 22:00:44'),
(8, 'shwQ6s', 'Amsterdam', 15, 1, '2017-10-13 22:28:19');
--
-- Indexen voor geëxporteerde tabellen
--
--
-- Indexen voor tabel `foto`
--
ALTER TABLE `foto`
ADD PRIMARY KEY (`id`);
--
-- Indexen voor tabel `sessie`
--
ALTER TABLE `sessie`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT voor geëxporteerde tabellen
--
--
-- AUTO_INCREMENT voor een tabel `foto`
--
ALTER TABLE `foto`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT voor een tabel `sessie`
--
ALTER TABLE `sessie`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
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 */;
|
PostgreSQL nie jest case-sensitive # wyjątek: identyfikatory ujęte w cudzysłowy "" są case-sensitive
wpisywane identryfikatory nieujęte w cudzysłowy są zamieniane na pisane małymi literami
'string'
escapowanie stringów: e'string' - w escapowanym stringu można używać m.in.:
\b - backspace
\f - feed
\n - new line
\r - carriage return
\t - tab
aby użyć znaku ' należy go użyć dwukrotnie ''
można również wpisywać stringi literalnie za pomocą konstrukcji $$string$$ lub $tag$string$tag$, wtedy nie trzeba podwajać znaków ', nie jest również intrepretowane wtedy escapowanie stringów
konstrukcje z tagiem można zagnieżdzać
PostgreSQL automatycznie zamienia na małe litery wszystkie litery nazw (np.: nazwy tabel, kolumn, itp.) stosowanych w ramach wyrażeń SQL, jeżeli zatem konieczne jest skorzystanie z nazwy zawierającej
wielkie litery należy umieścić tą nazwę w cudzysłowach "nazwaZawierającaWielkieLitery"
rzutowanie typów danych:
typ 'string' # nie działa dla tablic
wyrażenie::typ
CAST(wyrażenie AS typ)
now() - zwraca aktualny timestamp // aktualny timestamp zwraca także wyrażenie SELECT current_timestamp;
current_date - aktualna data
-- komentarz do końca wiersza
/* komentarz wieloliniowy */
LIKE wildcards:
_ - pojedynczy znak
% - dowolny łańcuch znaków
standardowe nazwenictwo dla indeksów przyjmuje następujący schemat: nazwaTabeli_nazwyKolum_przyrostek, gdzie przyrostek przyjmuje następujące wartości:
* pkey - dla ograniczeń klucza głównego
* key - dla ograniczeń unikalności
* excl - dla ograniczeń rozłączności
* idx - dla pozostałych typów indeksów
|
DROP TABLE IF EXISTS `XXX_papoo_news_imp_lang`; ##b_dump##
CREATE TABLE `XXX_papoo_news_imp_lang` (
`news_imp_id` int(11) NOT NULL DEFAULT '0',
`news_imp_lang_id` int(11) NOT NULL DEFAULT '0',
`news_imp_imp` text NOT NULL,
`news_imp_imp_html` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
INSERT INTO `XXX_papoo_news_imp_lang` SET news_imp_id='1', news_imp_lang_id='1', news_imp_imp='', news_imp_imp_html='x' ; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_impressum`; ##b_dump##
CREATE TABLE `XXX_papoo_news_impressum` (
`news_imp_id` int(11) NOT NULL DEFAULT '0',
`news_email` varchar(255) NOT NULL,
`news_name` varchar(255) NOT NULL,
`mails_per_step` int(11) NOT NULL DEFAULT '100',
`news_erw` varchar(255) NOT NULL,
`wyswig` varchar(255) NOT NULL,
`news_html` varchar(255) NOT NULL,
`news_allow_delete` TINYINT(1) NOT NULL DEFAULT '0',
`news_anzeig_message` varchar(255) NOT NULL,
`news_sprachwahl` varchar(255) NOT NULL,
`news_impressum` text NOT NULL,
`news_lang` text NOT NULL,
`news_impressum_html` text NOT NULL,
`pop3_server` varchar(255) NOT NULL,
`pop3_username` varchar(255) NOT NULL,
`pop3_password` varchar(255) NOT NULL,
`pop3_port` int(5) NOT NULL DEFAULT '110',
`check_hardbounce` int(1) NOT NULL DEFAULT '0',
`max_hardbounce` int(2) NOT NULL DEFAULT '3',
`max_hardbounce_time` int(3) NOT NULL DEFAULT '14'
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
INSERT INTO `XXX_papoo_news_impressum` SET news_imp_id='0', news_email='newsletter@webseite.de', news_name='Ihr Absendername', news_erw='', wyswig='', news_html='', news_anzeig_message='', news_sprachwahl='', news_impressum='Inhalt', news_lang=';1', news_impressum_html='' ; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_user`; ##b_dump##
CREATE TABLE `XXX_papoo_news_user` (
`news_user_id` int(11) NOT NULL AUTO_INCREMENT,
`news_active` int(11) NOT NULL DEFAULT '0',
`deleted` TINYINT(1) NOT NULL DEFAULT '0',
`news_key` text NOT NULL,
`news_user_email` varchar(200) NOT NULL,
`news_name_vor` varchar(255) NOT NULL,
`news_name_nach` varchar(255) NOT NULL,
`news_name_gender` varchar(255) NOT NULL,
`news_name_str` varchar(255) NOT NULL,
`news_name_plz` varchar(255) NOT NULL,
`news_user_lang` varchar(255) NOT NULL DEFAULT '1',
`news_name_ort` varchar(255) NOT NULL,
`news_name_staat` varchar(255) NOT NULL,
`news_phone` varchar(255) NOT NULL,
`news_name_firma` varchar(255) NOT NULL,
`news_name_mitglied` tinyint(1) NOT NULL DEFAULT '0',
`news_name_abonnent` tinyint(1) NOT NULL DEFAULT '0',
`news_signup_date` varchar(50) NOT NULL,
`news_unsubscribe_date` varchar(50) NOT NULL,
`news_gruppen` text,
`news_hardbounce` int(2) NOT NULL DEFAULT '0',
`news_hardbounce_time` date NOT NULL,
PRIMARY KEY (`news_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
INSERT INTO `XXX_papoo_news_user` SET news_user_id='1', news_active='1', news_key='b7841872e8b138fc40a3b5f0a9db43e5', news_user_email='mail@webseite.de', news_name_vor='', news_name_nach='', news_name_gender='', news_name_str='', news_name_plz='', news_user_lang='1', news_name_ort='', news_signup_date='' ; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_newsletter`; ##b_dump##
CREATE TABLE `XXX_papoo_newsletter` (
`news_id` int(11) NOT NULL AUTO_INCREMENT,
`news_date` varchar(255) NOT NULL,
`news_date_send` varchar(255) NOT NULL,
`news_inhalt` text NOT NULL,
`news_inhalt_lang` text NOT NULL,
`news_inhalt_html` text NOT NULL,
`news_inhalt_attach` text NOT NULL,
`news_header` text NOT NULL,
`news_send` int(11) NOT NULL DEFAULT '0',
`news_abbonennten` int(11) NOT NULL DEFAULT '0',
`news_gruppe` text NOT NULL,
`news_nlgruppe` text NOT NULL,
PRIMARY KEY (`news_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_newsletter_messages`; ##b_dump##
CREATE TABLE `XXX_papoo_newsletter_messages` (
`news_msg_id` int(11) NOT NULL,
`news_msg_lang_id` int(11) NOT NULL,
`news_keyword` varchar(255) NOT NULL,
`news_header` text NOT NULL,
`news_inhalt` text NOT NULL,
PRIMARY KEY (`news_msg_id`,`news_msg_lang_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_gruppen`; ##b_dump##
CREATE TABLE `XXX_papoo_news_gruppen` (
`news_gruppe_id` int(11) NOT NULL AUTO_INCREMENT,
`news_gruppe_name` varchar(255) NOT NULL,
`news_gruppe_description` text NOT NULL,
PRIMARY KEY (`news_gruppe_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
INSERT INTO `XXX_papoo_news_gruppen` (`news_gruppe_id`, `news_gruppe_name`, `news_gruppe_description`) VALUES (1, 'NL Verteilerliste Standard', 'Standard NL Verteilerliste'); ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_attachments`; ##b_dump##
CREATE TABLE `XXX_papoo_news_attachments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`news_id` int(11) NOT NULL,
`name` text NOT NULL,
`name_stored` text NOT NULL,
`size` int(11) NOT NULL,
PRIMARY KEY (`id`,`news_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_protocol_attachments`; ##b_dump##
CREATE TABLE `XXX_papoo_news_protocol_attachments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`news_id` int(11) NOT NULL,
`name` text NOT NULL,
`name_stored` text NOT NULL,
`size` int(11) NOT NULL,
PRIMARY KEY (`id`,`news_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_protocol_newsletter`; ##b_dump##
CREATE TABLE `XXX_papoo_news_protocol_newsletter` (
`news_id` int(11) NOT NULL AUTO_INCREMENT,
`news_date` varchar(255) NOT NULL,
`news_date_send` varchar(255) NOT NULL,
`news_inhalt` text NOT NULL,
`news_inhalt_lang` text NOT NULL,
`news_inhalt_html` text NOT NULL,
`news_inhalt_attach` text NOT NULL,
`news_header` text NOT NULL,
`news_send` int(11) NOT NULL DEFAULT '0',
`news_abbonennten` int(11) NOT NULL DEFAULT '0',
`news_gruppe` text NOT NULL,
`news_nlgruppe` text NOT NULL,
PRIMARY KEY (`news_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_protocol_user`; ##b_dump##
CREATE TABLE `XXX_papoo_news_protocol_user` (
`news_user_id` int(11) NOT NULL,
`news_id` int(11) NOT NULL,
`deleted` TINYINT(1) NOT NULL DEFAULT '0',
`news_type` varchar(10) NOT NULL,
`news_active` int(11) NOT NULL DEFAULT '0',
`news_key` text NOT NULL,
`news_user_email` varchar(200) NOT NULL,
`news_name_vor` varchar(255) NOT NULL,
`news_name_nach` varchar(255) NOT NULL,
`news_name_gender` varchar(255) NOT NULL,
`news_name_str` varchar(255) NOT NULL,
`news_name_plz` varchar(255) NOT NULL,
`news_user_lang` varchar(255) NOT NULL DEFAULT '1',
`news_name_ort` varchar(255) NOT NULL,
`news_name_staat` varchar(255) NOT NULL,
`news_phone` varchar(255) NOT NULL,
`news_name_firma` varchar(255) NOT NULL,
`news_name_mitglied` tinyint(1) NOT NULL DEFAULT '0',
`news_name_abonnent` tinyint(1) NOT NULL DEFAULT '0',
`news_signup_date` varchar(50) NOT NULL,
`news_unsubscribe_date` varchar(50) NOT NULL,
`news_gruppen` text,
`news_hardbounce` int(2) NOT NULL DEFAULT '0',
`news_hardbounce_time` date NOT NULL,
PRIMARY KEY (`news_user_id`,`news_id`,`news_type` )
) ENGINE=MyISAM ; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_error_report`; ##b_dump##
CREATE TABLE `XXX_papoo_news_error_report` (
`report_id` int(11) NOT NULL auto_increment ,
`import_time` timestamp NOT NULL ,
`imported_by` text NOT NULL,
`records_to_import` int(11) NOT NULL DEFAULT 0 ,
`error_count` int(11) NOT NULL DEFAULT 0 ,
`success_count` int(11) NOT NULL DEFAULT 0,
`highest_cc` int(11) NOT NULL DEFAULT 0,
`used_file` text NOT NULL,
PRIMARY KEY (`report_id`)
) ENGINE=MyISAM ; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_error_report_details`; ##b_dump##
CREATE TABLE `XXX_papoo_news_error_report_details` (
`report_id` int(11) NOT NULL ,
`import_file_record_no` int(11) NOT NULL DEFAULT 0 ,
`import_file_field_position` smallint(11) NOT NULL DEFAULT 0 ,
`import_file_field_name` text NOT NULL ,
`completion_code` int(11) NOT NULL DEFAULT 0 ,
`NAME` TEXT CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL,
`VORNAME` TEXT CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL,
`STRASSE` TEXT CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL,
`PLZ` TEXT CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL,
`ORT` TEXT CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL,
`MAIL` TEXT CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL,
KEY `idx_records` (`report_id`)
) ENGINE=MyISAM ; ##b_dump##
DROP TABLE IF EXISTS `XXX_papoo_news_user_lookup_gruppen`; ##b_dump##
CREATE TABLE `XXX_papoo_news_user_lookup_gruppen` (
`news_user_id_lu` int(11) NOT NULL DEFAULT '0',
`news_gruppe_id_lu` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`news_user_id_lu`,`news_gruppe_id_lu`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; ##b_dump##
ALTER TABLE `XXX_papoo_news_gruppen` ADD `news_grpfront` INT( 11 ) NOT NULL DEFAULT '0' ; ##b_dump##
ALTER TABLE `XXX_papoo_news_gruppen` ADD `news_grpmoderated` INT( 11 ) NOT NULL DEFAULT '0' ; ##b_dump##
ALTER TABLE `XXX_papoo_news_user_lookup_gruppen` ADD `news_active` INT( 11 ) NOT NULL DEFAULT '1' ; ##b_dump##
ALTER TABLE `XXX_papoo_news_protocol_user` MODIFY `news_type` VARCHAR( 200 ) NOT NULL; ##b_dump## |
CREATE TABLE `admin` (
`admin_id` int(11) NOT NULL auto_increment,
`username` varchar(20) NOT NULL,
`password` varchar(14) NOT NULL,
PRIMARY KEY (`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
insert into `db_healthcare`.`admin`(`admin_id`,`username`,`password`) values (1,'Admin','admin');
|
CREATE TABLE IF NOT EXISTS `contact_messages` (
id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
phone VARCHAR(255) NOT NULL,
content VARCHAR(255) NOT NULL
); |
SELECT t.id , name
FROM teacher AS t
RIGHT JOIN university AS u
ON t.id=u.Teacher_id
WHERE u.Campus='multan'
query to print teacher name and id who are in multan
----------------------------
SELECT * FROM `teacher` WHERE CNIC ='1234'
quer to print teacher detail for cnic=1234.
----------------------------
SELECT * FROM `university` WHERE Courses='P.F'
qury for printing courses =p.f.
----------------------------
SELECT t.id , t.name
FROM teacher AS t
RIGHT JOIN university AS u
ON t.id=u.Teacher_id
WHERE u.Campus='lahore' OR u.Campus='Rawalpindi'
query to print teacher name who are in lahore or rawalpindi.
----------------------------
SELECT * FROM `university`
WHERE Courses='OOP';
query to print campus where courses =oop
----------------------------
SELECT t.id , name
FROM teacher AS t
RIGHT JOIN university AS u
ON t.id=u.Teacher_id
WHERE u.Courses='OOP'
query to print teacher name where courses = oop
----------------------------
adding new column in existing table
alter table table_name ADD new_column_name;
----------------------------
changing column name
ALTER TABLE table_name CHANGE old_column_name new_column_name data_type; |
SELECT
project.name
from
project
where
id_dep = 1; |
SELECT *
FROM perks
WHERE perks.class_id = 6 |
####################################################
DROP DATABASE IF EXISTS InventoryTest;
CREATE DATABASE IF NOT EXISTS InventoryTest;
USE InventoryTest;
CREATE TABLE Departments
(
DepartmentId int NOT NULL AUTO_INCREMENT,
DepartmentName varchar(100) NOT NULL,
PRIMARY KEY(DepartmentId)
);
CREATE TABLE Locations
(
LocationId int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (LocationId),
RoomNumber varchar(12) NOT NULL,
RoomDescription varchar(25)
);
CREATE TABLE Sublocations
(
#SELECT * FROM Sublocations where Sublocation.LocationId = Locations.LocationId
SublocationId int(12) NOT NULL AUTO_INCREMENT,
SubLocationNumber varchar(25) NOT NULL,
LocationId int NOT NULL,
PRIMARY KEY (SublocationId),
FOREIGN KEY (LocationId) REFERENCES Locations(LocationId)
);
CREATE TABLE Employees
(
EmployeeId int NOT NULL AUTO_INCREMENT,
DepartmentId int,
LocationId int NOT NULL,
SublocationId int,
FirstName varchar(50) NOT NULL,
LastName varchar(50) NOT NULL,
Email varchar(255),
PhoneNumber varchar(10),
AccessLevel int(2) NOT NULL,
PRIMARY KEY(EmployeeId),
FOREIGN KEY(DepartmentId) REFERENCES Department(DepartmentId),
FOREIGN KEY(LocationId) REFERENCES Locations(LocationId),
FOREIGN KEY (SublocationId) REFERENCES Sublocations(SublocationId)
);
CREATE TABLE Teams
(
TeamId int(2) NOT NULL AUTO_INCREMENT,
TeamName varchar(50),
DepartmentId int,
LocationId int,
PRIMARY KEY (TeamId),
FOREIGN KEY(DepartmentId) REFERENCES Department(DepartmentId),
FOREIGN KEY(LocationId) REFERENCES Locations(LocationId)
);
CREATE TABLE Items
(
ItemId int NOT NULL AUTO_INCREMENT,
InternalId varchar(10) NOT NULL UNIQUE,
LocationId int,
TeamLocationId int,
CheckedOutBy int,
InStorage tinyint(1),
Make varchar(255),
Model varchar(255),
Category varchar(255),
ServiceTag varchar(255),
ExpressServiceCode varchar(255),
SerialNumber varchar (255),
PartNumber varchar (255),
ModelNumber varchar (255),
CUPD varchar (255),
AcquiredDate date,
WarrantyExpirationDate date,
Comments text,
MarkForDeletion tinyint(1),
DeleteReason text,
HasBeenDisposed tinyint(1),
DisposalRequisitionNumber varchar(255),
RetiredDate date,
RegBarcode varchar(255),
IMEI int(16),
CCID int(25),
SmartchipNumber int(20),
ReviewStatus varchar(25),
#Review status should be enum
ReviewDate date,
StatusReviewedBy int,
FOREIGN KEY (StatusReviewedBy) REFERENCES Employees(EmployeeId),
FOREIGN KEY (LocationId) REFERENCES Locations(LocationId),
FOREIGN KEY (TeamLocationId) REFERENCES Locations(TeamLocationId),
FOREIGN Key (CheckedOutBy) REFERENCES Employees(EmployeeId),
PRIMARY KEY (ItemId)
);
###Values
INSERT INTO Departments (DepartmentName) VALUES ("Registrar"), ("Imaging");
INSERT INTO Locations (RoomNumber, RoomDescription) VALUES
("101", "Front Desk"),
("105", NULL),
("106", NULL),
("107", NULL),
("109", NULL),
("110", NULL),
("111", NULL),
("112", NULL),
("114", NULL),
("115", NULL),
("116", NULL),
("117", NULL),
("118", NULL),
("120", NULL),
("122", NULL),
("123", NULL),
("124", "Vault"),
("1B60", "Training Room"),
("1B77", NULL),
("1B78", NULL),
("1B79", NULL),
("1B90", NULL),
("1B95", "Storage Room");
INSERT INTO Sublocations (SubLocationNumber, LocationId) VALUES
("SC-1", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-2", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-3", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-4", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-5", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-6", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-7", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-8", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-9", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-10", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-11", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-12", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-13", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-14", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-15", (SELECT LocationId from Locations where RoomNumber = "124")),
("SC-16", (SELECT LocationId from Locations where RoomNumber = "124")),
("A", (SELECT LocationId from Locations where RoomNumber = "106")),
("B", (SELECT LocationId from Locations where RoomNumber = "106")),
("C", (SELECT LocationId from Locations where RoomNumber = "106")),
("D", (SELECT LocationId from Locations where RoomNumber = "106")),
("E", (SELECT LocationId from Locations where RoomNumber = "106")),
("F", (SELECT LocationId from Locations where RoomNumber = "106")),
("G", (SELECT LocationId from Locations where RoomNumber = "106")),
("H", (SELECT LocationId from Locations where RoomNumber = "106")),
("I", (SELECT LocationId from Locations where RoomNumber = "106")),
("A", (SELECT LocationId from Locations where RoomNumber = "1B77")),
("B", (SELECT LocationId from Locations where RoomNumber = "1B77")),
("A", (SELECT LocationId from Locations where RoomNumber = "1B77")),
("B", (SELECT LocationId from Locations where RoomNumber = "1B77")),
("C", (SELECT LocationId from Locations where RoomNumber = "1B77")),
("D", (SELECT LocationId from Locations where RoomNumber = "1B77")),
("E", (SELECT LocationId from Locations where RoomNumber = "1B77")),
("A", (SELECT LocationId from Locations where RoomNumber = "1B78")),
("B", (SELECT LocationId from Locations where RoomNumber = "1B78")),
("C", (SELECT LocationId from Locations where RoomNumber = "1B78"));
INSERT INTO Employees (DepartmentId, LocationId, SublocationId, FirstName, LastName, Email, PhoneNumber, AccessLevel) VALUES
(
(SELECT DepartmentId from Departments where DepartmentName = "Registrar"),
(SELECT LocationId from Locations where RoomNumber = "124"),
(SELECT SublocationId from Sublocations where SubLocationNumber = "SC-13"),
"test",
"test",
"email@email.com",
"3232076569",
2
);
|
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.5.5-10.4.19-MariaDB
/*!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 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
--
-- Create schema nodeapi
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ nodeapi;
USE nodeapi;
--
-- Table structure for table `nodeapi`.`users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
`company` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `nodeapi`.`users`
--
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` (`id`,`name`,`phone`,`company`,`email`,`createdAt`,`updatedAt`) VALUES
(3,'Lizalin Rout','9114770026','CSM','er.liza2010@gmail.com','2021-06-12 09:09:12','2021-06-12 09:09:12'),
(4,'Abhiram Samantara','9668455536','ESS','ram3792@gmail.com','2021-06-12 09:10:12','2021-06-12 09:10:12');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
/* Formatted on 17/06/2014 18:09:05 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCREI_RIO_RICHPROR_CNS_DB
(
REC
)
AS
SELECT DISTINCT r.cod_abi_cartolarizzato || '-' || r.cod_ndg
FROM v_mcre0_app_alert_rio_richpror r, t_mcrei_app_delibere p
WHERE p.cod_abi(+) = r.cod_abi_cartolarizzato
AND p.cod_ndg(+) = r.cod_ndg
AND p.cod_microtipologia_delib(+) = 'CI'
AND cod_macrostato = 'IN'
AND cod_fase_delibera(+) = 'CO'
AND p.cod_protocollo_delibera IS NULL;
GRANT SELECT ON MCRE_OWN.V_MCREI_RIO_RICHPROR_CNS_DB TO MCRE_USR;
|
create table table21 ( column1 varchar(256) ); |
IF(OBJECT_ID(N'contest_participations', N'U') IS NULL)
BEGIN
CREATE TABLE contest_participations(
user_id INT NOT NULL,
contest_id INT NOT NULL,
score INT,
placement INT CHECK(placement > 0),
FOREIGN KEY (user_id) REFERENCES users(id),
FOREIGN KEY (contest_id) REFERENCES contests(id),
PRIMARY KEY (user_id, contest_id))
END;
|
/*-------4.业务表管理--------*/
/*
num: 序号
modelID: 模块ID
tableID: 表ID,
tableCaption: 表描述,
className: 业务类名称,
Responsible: 责任人,
remark: 备注
*/
CREATE TABLE frm_systable
(
num number,
modelID varchar(50) ,
tableID varchar(50) not null primary key,
tableCaption varchar(50),
className varchar(50),
Responsible varchar(50),
remark varchar(200)
) |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 22-11-2016 a las 22:40:13
-- Versión del servidor: 10.1.10-MariaDB
-- Versión de PHP: 5.6.19
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 utf8mb4 */;
--
-- Base de datos: `restaurar`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuarios`
--
CREATE TABLE `usuarios` (
`id_usuario` int(2) NOT NULL,
`usuario` varchar(20) NOT NULL,
`contrasena` varchar(20) NOT NULL,
`email` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `usuarios`
--
INSERT INTO `usuarios` (`id_usuario`, `usuario`, `contrasena`, `email`) VALUES
(4, 'hector_izarra', '94022db78fc801d08a9f', 'hector_izarra@outlokk.com');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `usuarios`
--
ALTER TABLE `usuarios`
ADD PRIMARY KEY (`id_usuario`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `usuarios`
--
ALTER TABLE `usuarios`
MODIFY `id_usuario` int(2) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
/*!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 */;
|
SELECT DATE_TRUNC('day',o.occurred_at) AS date,
r.name AS region,
we.channel,
SUM(o.gloss_qty) AS gloss_units,
SUM(o.poster_qty) AS poster_units,
SUM(o.standard_qty) AS standard_units,
SUM(o.total_amt_usd) AS total_sales_usd
FROM demo.accounts a
JOIN demo.orders o
ON o.account_id = a.id
AND o.occurred_at < '2017-01-01'
JOIN demo.sales_reps sr
ON a.sales_rep_id = sr.id
JOIN demo.region r
ON sr.region_id = r.id
JOIN demo.web_events_new we
ON we.account_id = o.account_id
AND o.occurred_at BETWEEN we.occurred_at AND we.occurred_at + interval '31 minutes'
GROUP BY 1, 2, 3
ORDER BY 1 |
SELECT SalesOrderHeader.SubTotal, SalesOrderHeader.Status, SalesOrderDetail.UnitPrice, Product.Name, Product.Size, Vendor.Name
FROM Sales.salesorderheader, Sales.SalesOrderDetail, Purchasing.ProductVendor, Purchasing.Vendor, Production.Product, Purchasing.ShipMethod
WHERE Sales.SalesOrderHeader.SalesOrderID = Sales.SalesOrderDetail.SalesOrderID
and Sales.SalesOrderHeader.ShipMethodID = Purchasing.ShipMethod.ShipMethodID
and Purchasing.ProductVendor.ProductID = Production.Product.ProductID
and Purchasing.Vendor.businessentityid= Purchasing.ProductVendor.businessentityid
SELECT SalesOrderHeader.SubTotal, SalesOrderHeader.Status, SalesOrderHeader.OrderDate as Mes, SUM(SalesOrderHeader.SubTotal) total_mes, SalesOrderDetail.UnitPrice, Product.Name, Product.Size, Vendor.Name
FROM Sales.SalesOrderHeader, Sales.SalesOrderDetail, Purchasing.ProductVendor, Purchasing.Vendor, Production.Product, Purchasing.ShipMethod
WHERE Sales.SalesOrderHeader.SalesOrderID = Sales.SalesOrderDetail.SalesOrderID
and Sales.SalesOrderHeader.ShipMethodID = Purchasing.ShipMethod.ShipMethodID
and Purchasing.ProductVendor.ProductID = Production.Product.ProductID
and Purchasing.Vendor.businessentityid = Purchasing.ProductVendor.businessentityid
GROUP BY (SalesOrderHeader.SubTotal,SalesOrderHeader.Status,SalesOrderHeader.OrderDate,Vendor.Name, Product.Name,SalesOrderDetail.UnitPrice,Product.Size) |
-- Not used for SQLAnywhere
SELECT
p.name AS [PropertyName],
p.value AS [PropertyValue],
SQL_VARIANT_PROPERTY(p.value,'BaseType') AS [PropertyBaseType],
SQL_VARIANT_PROPERTY(p.value,'MaxLength') AS [PropertyMaxLength],
SQL_VARIANT_PROPERTY(p.value,'Precision') AS [PropertyPrecision],
SQL_VARIANT_PROPERTY(p.value,'Scale') AS [PropertyScale]
FROM
::fn_listextendedproperty(NULL, @level0type, @level0name, @level1type, @level1name, @level2type, @level2name) p |
SET NAMES UTF8;
DROP database IF EXISTS fashionShop;
create database fanke CHARSET=UTF8;
USE fashionShop;
create table user(
user_id int primary key auto_increment,
user_name varchar(9),
user_pwd varchar(12),
user_email varchar(32),
user_phone varchar(11),
sex varchar(1),
user_safequestion varchar(32),
user_safepwd varchar(10),
user_registtime date,
user_logintime date
);
create table admin(
admin_id int primary key ,
admin_name varchar(5),
admin_pwd varchar(15),
role varchar(1)
)
create table collect(
collect_id int primary key,
user_id int,
collect_time date,
product_id int,
product_name varchar(20),
product_price varchar(10),
product_img varchar(50)
)
create table product(
product_id int primary key auto_increment,
product_name varchar(20),
cate_id int,
product_price varchar(10),
product_oldPrice varchar(10),
product_content varchar(500),
product_postTime date,
product_weight varchar(10),
is_cheap varchar(1),
is_recommend varchar(1),
is_top varchar(1),
product_count varchar(10),
img_id int
)
create table img(
img_id int primary key,
img_url varchar(200),
img_color varchar(5),
size_id int
)
create table size(
size_id int primary key ,
size_name varchar(5)
)
create table cate(
cate_id int primary key,
cate_name varchar(20),
fatherCate_id int
)
create table fatherCate(
fatherCate_id int primary key,
fathercate_name varchar(10)
)
create table address(
user_id int,
address varchar(100),
address_tel varchar(11),
address_mobile varchar(15),
receive_name varchar(10)
)
create table order(
order_id int primary key auto_increment,
order_count varchar(10),
order_price varchar(10),
order_time date,
order_weight varchar(10),
product_id int,
product_price varchar(10),
product_weight varchar(10),
product_name varchar(20),
size_name varchar(5),
img_color varchar(5),
img_url varchar(200),
cate_name varchar(20),
)
create table orderList(
order_id int,
order_time date,
order_price varchar(10),
paystate varchar(1),
prostate varchar(1),
user_id int,
address varchar(100),
address_tel varchar(11),
address_mobile varchar(15),
receive_name varchar(10),
waygive varchar(1)
)
create table help(
help_id int primary key,
help_title varchar(20),
help_content varchar(500).
helpCate_id int
)
create table helpCate(
helpCate_id int primary key,
helpCate_name varchar(10)
)
create table news(
news_id int primary key,
news_title varchar(200),
news_from varchar(50),
news_author varchar(10),
news_top varchar(1),
news_click varchar(20),
news_content varchar(500),
newsCate_id int,
news_postTime date
)
create table newsCate(
newsCate_id int primary key,
newsCate_name varchar(20)
)
create table article(
article_id int primary key,
article_name varchar(10)
)
create table message(
message_id int primary key,
message_title varchar(50),
message_content varchar(500),
)
insert into user values(null,'张三',123456,'123@qq.com',12222222222,1,'无',123,null,null);
insert into size values(1,'xxl');
insert into admin values(1,'admin',123456,1);
insert into admin values(1,'校长',123456,0);
insert into article values(1,'文章'),
insert into help values(1,'顺丰物流','顺丰不包邮',2),
insert into helpCate values(1,'货到付款'),
insert into helpCate values(2,'物流配送'),
insert into helpCate values(3,'联系合作'),
UPDATE user SET upwd='777777',phone='19912345678' WHERE uid='1';
DELETE FROM user WHERE uid='2';
SELECT * FROM user;
|
SELECT e1.eno, e1.manager, e2.eno
FROM employee e1, employee e2
WHERE e1.manager = e2.eno;
SELECT e1.eno, e1.manager, e2.eno
FROM employee e1, employee e2
WHERE e1.manager = e2.eno(+);
SELECT e1.eno, e1.manager, e2.eno
FROM employee e1, employee e2
WHERE e1.manager(+) = e2.eno;
SELECT e1.eno, e1.ename, e1.manager, e2.eno, e2.ename
FROM employee e1 JOIN employee e2
ON e1.manager = e2.eno;
SELECT e1.eno, e1.ename, e1.manager, e2.eno, e2.ename
FROM employee e1, employee e2
WHERE e1.manager = e2.eno;
SELECT e1.eno, e1.manager, e2.eno
FROM employee e1 LEFT OUTER JOIN employee e2
ON e1.manager = e2.eno;
SELECT e1.eno, e1.manager, e2.eno
FROM employee e1 RIGHT OUTER JOIN employee e2
ON e1.manager = e2.eno;
SELECT e1.eno, e1.manager, e2.eno
FROM employee e1 FULL OUTER JOIN employee e2
ON e1.manager = e2.eno;
SELECT e1.ename ||'의 직속 상관은 '|| e2.ename
FROM employee e1 JOIN employee e2
ON e1.manager = e2.eno(+);
SELECT e1.ename ||'의 직속상관은 '|| e2.ename
FROM employee e1 LEFT OUTER JOIN employee e2
ON e1.manager = e2.eno;
SELECT emp.ename "Employee", emp.manager "Emp#",
mgr.eno "Manager", mgr.ename "Mgr#"
FROM employee emp, employee mgr
WHERE emp.manager = mgr.eno
AND emp.eno = 7566;
SELECT emp.ename "Employee", emp.manager "Emp#",
mgr.eno "Manager", mgr.ename "Mgr#"
FROM employee emp, employee mgr
WHERE emp.manager = mgr.eno(+)
ORDER BY emp.eno DESC;
SELECT me.ename "이름", me.dno "부서번호", other.ename "동료"
FROM employee me, employee other
WHERE me.dno = other.dno
AND me.ename = 'SCOTT'
AND other.ename != 'SCOTT';
SELECT other.ename, other.hiredate
FROM employee ward, employee other
WHERE other.hiredate > ward.hiredate
AND ward.ename = 'WARD'
ORDER BY hiredate;
SELECT other.ename, other.hiredate, mgr.ename, mgr.hiredate
FROM employee mgr, employee other
WHERE other.manager = mgr.eno
AND other.hiredate <= mgr.hiredate;
SELECT * FROM employee;
SELECT e.eno, e.ename, e.hiredate, e.salary, d.dname
FROM employee e, department d
WHERE e.dno = d.dno
AND eno =7369;
SELECT * FROM salgrade;
SELECT e.eno, e.ename, e.hiredate, e.salary, d.dname, e.job, s.grade
FROM employee e, department d, salgrade s
WHERE e.dno = d.dno
AND e.salary BETWEEN s.losal AND s.hisal
AND eno =7782;
SELECT e.eno, e.ename, e.hiredate, e.salary, d.dname, e.job, s.grade
FROM employee e, department d, salgrade s
WHERE e.dno = d.dno
AND e.salary BETWEEN s.losal AND s.hisal
AND eno = 1234;
SELECT * FROM employee WHERE eno = 7839;
SELECT * FROM employee;
SELECT * FROM department;
update employee set dno = 50 WHERE eno = 1234;
commit;
SELECT emp.ename "Employee", emp.manager "Emp#",
mgr.eno "Manager", mgr.ename "Mgr#"
FROM employee emp, employee mgr
WHERE emp.manager = mgr.eno
AND emp.eno = 7566;
SELECT e.eno, e.ename, m.eno, m.ename MANAGER, e.hiredate, e.salary, d.dname, e.job, s.grade
FROM employee e, employee m, department d, salgrade s
WHERE e.dno = d.dno
AND e.salary BETWEEN s.losal AND s.hisal
AND e.manager = m.eno
AND e.eno = 1234;
SELECT e.eno, e.ename, m.eno, m.ename MANAGER, e.hiredate, e.salary, d.dname, e.job, s.grade
FROM employee e, employee m, department d, salgrade s
WHERE e.dno = d.dno
AND e.salary BETWEEN s.losal AND s.hisal
AND e.manager = m.eno(+)
AND e.eno =7839; |
-- Table - orders
-- 1. Create a table called orders that records: order_id, person_id, product_name, product_price, quantity.
CREATE TABLE orders (
order_id SERIAL PRIMARY KEY,
person_id INTEGER,
product_name VARCHAR(80),
product_price INTEGER,
quantity INTEGER
);
-- 2. Add 5 orders to the orders table.
-- 3. Make orders for at least two different people.
-- 4. person_id should be different for different people.
INSERT INTO orders (person_id, product_name, product_price, quantity)
VALUES (001, 'shorts', 20, 2);
INSERT INTO orders (person_id, product_name, product_price, quantity)
VALUES (001, 'shoes', 10, 5);
INSERT INTO orders (person_id, product_name, product_price, quantity)
VALUES (002, 'pants', 50, 1);
INSERT INTO orders (person_id, product_name, product_price, quantity)
VALUES (002, 'socks', 5, 1);
INSERT INTO orders (person_id, product_name, product_price, quantity)
VALUES (003, 'tops', 45, 4);
select * from orders;
-- 5. Select all the records from the orders table.
select * from orders
where product_name = 'records';
-- 6. Calculate the total number of products ordered.
select SUM(quantity) from orders;
-- 7. Calculate the total order price.
select COUNT(product_price) * SUM(quantity) from orders;
-- 8. Calculate the total order price by a single person_id.
select person_id, SUM(product_price * quantity) from orders
group by person_id;
-- from solutions:
-- SELECT SUM(product_price * quantity) FROM orders WHERE person_id = 1; |
CREATE TABLE USUARIO (
id IDENTITY PRIMARY KEY,
email VARCHAR(255),
senha VARCHAR(200),
perfil CHAR(1)
);
CREATE TABLE DATASOURCECONFIG (
id IDENTITY PRIMARY KEY,
driverclassname VARCHAR(255),
url VARCHAR(255),
name VARCHAR(255),
username VARCHAR(255),
password VARCHAR(255),
tenant_id INT,
initialize BOOLEAN,
FOREIGN KEY (tenant_id)
REFERENCES USUARIO(id)
);
CREATE TABLE PRODUCT (
id IDENTITY PRIMARY KEY,
name VARCHAR(255)
);
|
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Máy chủ: localhost:3306
-- Thời gian đã tạo: Th9 03, 2021 lúc 03:36 PM
-- Phiên bản máy phục vụ: 5.7.33
-- Phiên bản PHP: 7.4.19
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 */;
--
-- Cơ sở dữ liệu: `quanly_congty`
--
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Đang đổ dữ liệu cho bảng `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `nhanvien`
--
CREATE TABLE `nhanvien` (
`id` int(10) NOT NULL,
`hoten` varchar(255) CHARACTER SET utf8 NOT NULL,
`namsinh` date NOT NULL,
`gioitinh` varchar(10) CHARACTER SET utf8 NOT NULL,
`diachi` varchar(255) CHARACTER SET utf8 NOT NULL,
`phongban` int(10) NOT NULL,
`updated_at` varchar(255) NOT NULL,
`created_at` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Đang đổ dữ liệu cho bảng `nhanvien`
--
INSERT INTO `nhanvien` (`id`, `hoten`, `namsinh`, `gioitinh`, `diachi`, `phongban`, `updated_at`, `created_at`) VALUES
(13, 'Hứa Minh Đạt', '2021-08-13', 'Nam', 'Sài Gòn', 3, '2021-09-03 14:43:54', '2021-08-31 07:10:29'),
(14, 'Huỳnh Trấn Thành', '2021-08-15', 'Nam', 'Hậu giang', 2, '2021-08-31 07:11:07', '2021-08-31 07:11:07'),
(15, 'Võ Hoài Linh', '2021-08-06', 'Nam', 'Quận 9', 4, '2021-09-03 14:42:21', '2021-08-31 07:11:33'),
(16, 'Lâm Vỹ Dạ', '2021-08-05', 'Nữ', 'Vĩnh Long', 4, '2021-09-03 14:55:09', '2021-08-31 07:12:11'),
(18, 'Đàm Vĩnh Hưng', '2021-08-14', 'Nam', 'Cần Thơ', 3, '2021-08-31 07:55:22', '2021-08-31 07:55:22'),
(19, 'Bùi Thị Thoa', '1995-02-08', 'Nữ', 'Sóc Trăng', 2, '2021-09-02 02:31:52', '2021-09-02 02:31:52'),
(22, 'Phương Hằng CEO', '2021-09-15', 'Nữ', 'Bình Dương', 1, '2021-09-03 05:21:47', '2021-09-03 05:21:47'),
(25, 'Le Hoai Han', '2021-09-25', 'Nam', 'Hậu giang', 6, '2021-09-03 15:29:02', '2021-09-03 15:25:30');
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `personal_access_tokens`
--
CREATE TABLE `personal_access_tokens` (
`id` bigint(20) UNSIGNED NOT NULL,
`tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`tokenable_id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
`abilities` text COLLATE utf8mb4_unicode_ci,
`last_used_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `phongban`
--
CREATE TABLE `phongban` (
`id` int(10) NOT NULL,
`tenphong` varchar(255) CHARACTER SET utf32 NOT NULL,
`updated_at` text NOT NULL,
`created_at` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Đang đổ dữ liệu cho bảng `phongban`
--
INSERT INTO `phongban` (`id`, `tenphong`, `updated_at`, `created_at`) VALUES
(1, 'Phòng CEO', '2021-08-31 07:50:48', '2021-08-31 07:50:48'),
(2, 'Phòng Nhân sự', '2021-08-31 07:49:56', '2021-08-31 07:34:21'),
(3, 'Phòng Maketting', '2021-08-31 07:50:06', '2021-08-31 07:34:43'),
(4, 'Phòng Kế Toán', '2021-08-31 07:50:21', '2021-08-31 07:50:21'),
(5, 'Phòng Tổ Chức-Hành Chính', '2021-09-02 02:29:37', '2021-09-02 02:29:37'),
(6, 'Phòng Kinh Tế - Kỹ Thuật', '2021-09-02 02:30:15', '2021-09-02 02:30:15');
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Chỉ mục cho các bảng đã đổ
--
--
-- Chỉ mục cho bảng `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- Chỉ mục cho bảng `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Chỉ mục cho bảng `nhanvien`
--
ALTER TABLE `nhanvien`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_nhanvien` (`phongban`);
--
-- Chỉ mục cho bảng `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Chỉ mục cho bảng `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
--
-- Chỉ mục cho bảng `phongban`
--
ALTER TABLE `phongban`
ADD PRIMARY KEY (`id`);
--
-- Chỉ mục cho bảng `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT cho các bảng đã đổ
--
--
-- AUTO_INCREMENT cho bảng `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT cho bảng `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT cho bảng `nhanvien`
--
ALTER TABLE `nhanvien`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
--
-- AUTO_INCREMENT cho bảng `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT cho bảng `phongban`
--
ALTER TABLE `phongban`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT cho bảng `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- Các ràng buộc cho các bảng đã đổ
--
--
-- Các ràng buộc cho bảng `nhanvien`
--
ALTER TABLE `nhanvien`
ADD CONSTRAINT `fk_nhanvien` FOREIGN KEY (`phongban`) REFERENCES `phongban` (`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 */;
|
/* Drop Tables */
DROP TABLE announcement CASCADE CONSTRAINTS;
DROP TABLE Files CASCADE CONSTRAINTS;
DROP TABLE pointslog CASCADE CONSTRAINTS;
DROP TABLE posts CASCADE CONSTRAINTS;
DROP TABLE replies CASCADE CONSTRAINTS;
DROP TABLE userinfo CASCADE CONSTRAINTS;
/* Drop Sequences */
DROP SEQUENCE SEQ_NEW_TABLE_userNum;
DROP SEQUENCE SEQ_pointslog_logid;
DROP SEQUENCE SEQ_userinfo_userNum;
/* Create Sequences */
CREATE SEQUENCE SEQ_NEW_TABLE_userNum INCREMENT BY 1 START WITH 1;
CREATE SEQUENCE SEQ_pointslog_logid INCREMENT BY 1 START WITH 1;
CREATE SEQUENCE SEQ_userinfo_userNum INCREMENT BY 1 START WITH 1;
/* Create Tables */
CREATE TABLE announcement
(
annNo number NOT NULL,
anndate date DEFAULT sysdate,
anntitle varchar2(500),
anncontent varchar2(1000),
-- 회원이 로그인할 때 쓸 아이디이다.
userid varchar2(50) NOT NULL UNIQUE,
PRIMARY KEY (annNo)
);
CREATE TABLE Files
(
-- 파일들을 관리하기 위한 고유 번호
fileno number NOT NULL,
-- 회원이 로그인할 때 쓸 아이디이다.
userid varchar2(50) NOT NULL UNIQUE,
-- 파일크기
filesize number,
filename varchar2(500),
filedate date,
PRIMARY KEY (fileno)
);
CREATE TABLE pointslog
(
logid number NOT NULL,
-- 회원이 로그인할 때 쓸 아이디이다.
userid varchar2(50) NOT NULL UNIQUE,
theOtherId varchar2(50),
eventdate date,
amount number,
-- 포인트를 상대방에게 주고 난 뒤 얼마나 남아있는지 추적하기 위한 칼럼
balance number,
PRIMARY KEY (logid)
);
CREATE TABLE posts
(
-- 게시물번호
postno number NOT NULL 게시물 번호. 기본키,
-- 회원이 로그인할 때 쓸 아이디이다.
userid varchar2(50) NOT NULL UNIQUE,
postview ,
postlike ,
-- 베스트 게시물 등재 여부
--
--
isBest ,
PRIMARY KEY (postno)
);
CREATE TABLE replies
(
replyno NOT NULL,
-- 회원이 로그인할 때 쓸 아이디이다.
userid varchar2(50) NOT NULL UNIQUE,
replyContent varchar2(500),
replyDate date DEFAULT sysdate,
PRIMARY KEY (replyno)
);
-- 회원 정보 테이블이다.
CREATE TABLE userinfo
(
-- 유저 아이디와 별도로 만들 user number. 시퀀스처리
userNum number NOT NULL 기본키,
-- 회원이 로그인할 때 쓸 아이디이다.
userid varchar2(50) NOT NULL UNIQUE,
-- 유저 비밀번호
userpwd varchar2(40) NOT NULL,
-- 유저가 회원 가입할 때 입력한 실명
username varchar2(30),
-- 유저 휴대폰 번호.
userphone varchar2(20),
userbirth varchar2(20),
-- 가입날짜
signupDate date DEFAULT sysdate,
userAddress varchar2(100),
userEmail varchar2(50),
-- 유저의 포인트 보유수
userpoint number(10),
isManager char(2),
PRIMARY KEY (userNum)
);
/* Create Foreign Keys */
ALTER TABLE announcement
ADD FOREIGN KEY (userid)
REFERENCES userinfo (userid)
;
ALTER TABLE Files
ADD FOREIGN KEY (userid)
REFERENCES userinfo (userid)
;
ALTER TABLE pointslog
ADD FOREIGN KEY (userid)
REFERENCES userinfo (userid)
;
ALTER TABLE posts
ADD FOREIGN KEY (userid)
REFERENCES userinfo (userid)
;
ALTER TABLE replies
ADD FOREIGN KEY (userid)
REFERENCES userinfo (userid)
;
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.3
-- Dumped by pg_dump version 9.5.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: auth_group; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE auth_group (
id integer NOT NULL,
name character varying(80) NOT NULL
);
ALTER TABLE auth_group OWNER TO postgres;
--
-- Name: auth_group_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE auth_group_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE auth_group_id_seq OWNER TO postgres;
--
-- Name: auth_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE auth_group_id_seq OWNED BY auth_group.id;
--
-- Name: auth_group_permissions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE auth_group_permissions (
id integer NOT NULL,
group_id integer NOT NULL,
permission_id integer NOT NULL
);
ALTER TABLE auth_group_permissions OWNER TO postgres;
--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE auth_group_permissions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE auth_group_permissions_id_seq OWNER TO postgres;
--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE auth_group_permissions_id_seq OWNED BY auth_group_permissions.id;
--
-- Name: auth_permission; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE auth_permission (
id integer NOT NULL,
name character varying(255) NOT NULL,
content_type_id integer NOT NULL,
codename character varying(100) NOT NULL
);
ALTER TABLE auth_permission OWNER TO postgres;
--
-- Name: auth_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE auth_permission_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE auth_permission_id_seq OWNER TO postgres;
--
-- Name: auth_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE auth_permission_id_seq OWNED BY auth_permission.id;
--
-- Name: auth_user; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE auth_user (
id integer NOT NULL,
password character varying(128) NOT NULL,
last_login timestamp with time zone,
is_superuser boolean NOT NULL,
username character varying(30) NOT NULL,
first_name character varying(30) NOT NULL,
last_name character varying(30) NOT NULL,
email character varying(254) NOT NULL,
is_staff boolean NOT NULL,
is_active boolean NOT NULL,
date_joined timestamp with time zone NOT NULL
);
ALTER TABLE auth_user OWNER TO postgres;
--
-- Name: auth_user_groups; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE auth_user_groups (
id integer NOT NULL,
user_id integer NOT NULL,
group_id integer NOT NULL
);
ALTER TABLE auth_user_groups OWNER TO postgres;
--
-- Name: auth_user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE auth_user_groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE auth_user_groups_id_seq OWNER TO postgres;
--
-- Name: auth_user_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE auth_user_groups_id_seq OWNED BY auth_user_groups.id;
--
-- Name: auth_user_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE auth_user_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE auth_user_id_seq OWNER TO postgres;
--
-- Name: auth_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE auth_user_id_seq OWNED BY auth_user.id;
--
-- Name: auth_user_user_permissions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE auth_user_user_permissions (
id integer NOT NULL,
user_id integer NOT NULL,
permission_id integer NOT NULL
);
ALTER TABLE auth_user_user_permissions OWNER TO postgres;
--
-- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE auth_user_user_permissions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE auth_user_user_permissions_id_seq OWNER TO postgres;
--
-- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE auth_user_user_permissions_id_seq OWNED BY auth_user_user_permissions.id;
--
-- Name: django_admin_log; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE django_admin_log (
id integer NOT NULL,
action_time timestamp with time zone NOT NULL,
object_id text,
object_repr character varying(200) NOT NULL,
action_flag smallint NOT NULL,
change_message text NOT NULL,
content_type_id integer,
user_id integer NOT NULL,
CONSTRAINT django_admin_log_action_flag_check CHECK ((action_flag >= 0))
);
ALTER TABLE django_admin_log OWNER TO postgres;
--
-- Name: django_admin_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE django_admin_log_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE django_admin_log_id_seq OWNER TO postgres;
--
-- Name: django_admin_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE django_admin_log_id_seq OWNED BY django_admin_log.id;
--
-- Name: django_content_type; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE django_content_type (
id integer NOT NULL,
app_label character varying(100) NOT NULL,
model character varying(100) NOT NULL
);
ALTER TABLE django_content_type OWNER TO postgres;
--
-- Name: django_content_type_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE django_content_type_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE django_content_type_id_seq OWNER TO postgres;
--
-- Name: django_content_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE django_content_type_id_seq OWNED BY django_content_type.id;
--
-- Name: django_migrations; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE django_migrations (
id integer NOT NULL,
app character varying(255) NOT NULL,
name character varying(255) NOT NULL,
applied timestamp with time zone NOT NULL
);
ALTER TABLE django_migrations OWNER TO postgres;
--
-- Name: django_migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE django_migrations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE django_migrations_id_seq OWNER TO postgres;
--
-- Name: django_migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE django_migrations_id_seq OWNED BY django_migrations.id;
--
-- Name: django_session; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE django_session (
session_key character varying(40) NOT NULL,
session_data text NOT NULL,
expire_date timestamp with time zone NOT NULL
);
ALTER TABLE django_session OWNER TO postgres;
--
-- Name: teamBuilder_comment; Type: TABLE; Schema: public; Owner: dbuser
--
CREATE TABLE "teamBuilder_comment" (
id integer NOT NULL,
content character varying(50) NOT NULL,
"time" timestamp with time zone NOT NULL,
marker_id integer
);
ALTER TABLE "teamBuilder_comment" OWNER TO dbuser;
--
-- Name: teamBuilder_comment_id_seq; Type: SEQUENCE; Schema: public; Owner: dbuser
--
CREATE SEQUENCE "teamBuilder_comment_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE "teamBuilder_comment_id_seq" OWNER TO dbuser;
--
-- Name: teamBuilder_comment_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dbuser
--
ALTER SEQUENCE "teamBuilder_comment_id_seq" OWNED BY "teamBuilder_comment".id;
--
-- Name: teamBuilder_profile; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE "teamBuilder_profile" (
id integer NOT NULL,
realname character varying(20) NOT NULL,
phone character varying(20) NOT NULL,
school character varying(20) NOT NULL,
major character varying(20) NOT NULL,
description text NOT NULL,
user_id integer NOT NULL,
role character varying(20),
grade character varying(20) NOT NULL,
department character varying(20) NOT NULL,
tags character varying(20)[]
);
ALTER TABLE "teamBuilder_profile" OWNER TO postgres;
--
-- Name: teamBuilder_profile_commentList; Type: TABLE; Schema: public; Owner: dbuser
--
CREATE TABLE "teamBuilder_profile_commentList" (
id integer NOT NULL,
profile_id integer NOT NULL,
comment_id integer NOT NULL
);
ALTER TABLE "teamBuilder_profile_commentList" OWNER TO dbuser;
--
-- Name: teamBuilder_profile_commentList_id_seq; Type: SEQUENCE; Schema: public; Owner: dbuser
--
CREATE SEQUENCE "teamBuilder_profile_commentList_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE "teamBuilder_profile_commentList_id_seq" OWNER TO dbuser;
--
-- Name: teamBuilder_profile_commentList_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dbuser
--
ALTER SEQUENCE "teamBuilder_profile_commentList_id_seq" OWNED BY "teamBuilder_profile_commentList".id;
--
-- Name: teamBuilder_profile_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE "teamBuilder_profile_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE "teamBuilder_profile_id_seq" OWNER TO postgres;
--
-- Name: teamBuilder_profile_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE "teamBuilder_profile_id_seq" OWNED BY "teamBuilder_profile".id;
--
-- Name: teamBuilder_project; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE "teamBuilder_project" (
id integer NOT NULL,
title character varying(20) NOT NULL,
description text NOT NULL,
publisher_id integer NOT NULL
);
ALTER TABLE "teamBuilder_project" OWNER TO postgres;
--
-- Name: teamBuilder_project_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE "teamBuilder_project_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE "teamBuilder_project_id_seq" OWNER TO postgres;
--
-- Name: teamBuilder_project_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE "teamBuilder_project_id_seq" OWNED BY "teamBuilder_project".id;
--
-- Name: teamBuilder_restriction; Type: TABLE; Schema: public; Owner: dbuser
--
CREATE TABLE "teamBuilder_restriction" (
id integer NOT NULL,
school character varying(40) NOT NULL,
department character varying(40) NOT NULL,
major character varying(40) NOT NULL,
min_num integer,
max_num integer,
CONSTRAINT "teamBuilder_restriction_max_num_check" CHECK ((max_num >= 0)),
CONSTRAINT "teamBuilder_restriction_min_num_check" CHECK ((min_num >= 0))
);
ALTER TABLE "teamBuilder_restriction" OWNER TO dbuser;
--
-- Name: teamBuilder_restriction_id_seq; Type: SEQUENCE; Schema: public; Owner: dbuser
--
CREATE SEQUENCE "teamBuilder_restriction_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE "teamBuilder_restriction_id_seq" OWNER TO dbuser;
--
-- Name: teamBuilder_restriction_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dbuser
--
ALTER SEQUENCE "teamBuilder_restriction_id_seq" OWNED BY "teamBuilder_restriction".id;
--
-- Name: teamBuilder_team; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE "teamBuilder_team" (
id integer NOT NULL,
name character varying(20) NOT NULL,
captain_id integer,
tags character varying(20)[],
is_confirmed boolean NOT NULL,
project_id integer,
description text NOT NULL
);
ALTER TABLE "teamBuilder_team" OWNER TO postgres;
--
-- Name: teamBuilder_team_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE "teamBuilder_team_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE "teamBuilder_team_id_seq" OWNER TO postgres;
--
-- Name: teamBuilder_team_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE "teamBuilder_team_id_seq" OWNED BY "teamBuilder_team".id;
--
-- Name: teamBuilder_team_memberList; Type: TABLE; Schema: public; Owner: dbuser
--
CREATE TABLE "teamBuilder_team_memberList" (
id integer NOT NULL,
team_id integer NOT NULL,
user_id integer NOT NULL
);
ALTER TABLE "teamBuilder_team_memberList" OWNER TO dbuser;
--
-- Name: teamBuilder_team_memberList_id_seq; Type: SEQUENCE; Schema: public; Owner: dbuser
--
CREATE SEQUENCE "teamBuilder_team_memberList_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE "teamBuilder_team_memberList_id_seq" OWNER TO dbuser;
--
-- Name: teamBuilder_team_memberList_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dbuser
--
ALTER SEQUENCE "teamBuilder_team_memberList_id_seq" OWNED BY "teamBuilder_team_memberList".id;
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_group ALTER COLUMN id SET DEFAULT nextval('auth_group_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_group_permissions ALTER COLUMN id SET DEFAULT nextval('auth_group_permissions_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_permission ALTER COLUMN id SET DEFAULT nextval('auth_permission_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user ALTER COLUMN id SET DEFAULT nextval('auth_user_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_groups ALTER COLUMN id SET DEFAULT nextval('auth_user_groups_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_user_permissions ALTER COLUMN id SET DEFAULT nextval('auth_user_user_permissions_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_admin_log ALTER COLUMN id SET DEFAULT nextval('django_admin_log_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_content_type ALTER COLUMN id SET DEFAULT nextval('django_content_type_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_migrations ALTER COLUMN id SET DEFAULT nextval('django_migrations_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_comment" ALTER COLUMN id SET DEFAULT nextval('"teamBuilder_comment_id_seq"'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_profile" ALTER COLUMN id SET DEFAULT nextval('"teamBuilder_profile_id_seq"'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_profile_commentList" ALTER COLUMN id SET DEFAULT nextval('"teamBuilder_profile_commentList_id_seq"'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_project" ALTER COLUMN id SET DEFAULT nextval('"teamBuilder_project_id_seq"'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_restriction" ALTER COLUMN id SET DEFAULT nextval('"teamBuilder_restriction_id_seq"'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_team" ALTER COLUMN id SET DEFAULT nextval('"teamBuilder_team_id_seq"'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_team_memberList" ALTER COLUMN id SET DEFAULT nextval('"teamBuilder_team_memberList_id_seq"'::regclass);
--
-- Data for Name: auth_group; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY auth_group (id, name) FROM stdin;
\.
--
-- Name: auth_group_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('auth_group_id_seq', 1, false);
--
-- Data for Name: auth_group_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY auth_group_permissions (id, group_id, permission_id) FROM stdin;
\.
--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('auth_group_permissions_id_seq', 1, false);
--
-- Data for Name: auth_permission; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY auth_permission (id, name, content_type_id, codename) FROM stdin;
1 Can add log entry 1 add_logentry
2 Can change log entry 1 change_logentry
3 Can delete log entry 1 delete_logentry
4 Can add permission 2 add_permission
5 Can change permission 2 change_permission
6 Can delete permission 2 delete_permission
7 Can add group 3 add_group
8 Can change group 3 change_group
9 Can delete group 3 delete_group
10 Can add user 4 add_user
11 Can change user 4 change_user
12 Can delete user 4 delete_user
13 Can add content type 5 add_contenttype
14 Can change content type 5 change_contenttype
15 Can delete content type 5 delete_contenttype
16 Can add session 6 add_session
17 Can change session 6 change_session
18 Can delete session 6 delete_session
19 Can add profile 7 add_profile
20 Can change profile 7 change_profile
21 Can delete profile 7 delete_profile
22 Can add team 8 add_team
23 Can change team 8 change_team
24 Can delete team 8 delete_team
25 Can add project 9 add_project
26 Can change project 9 change_project
27 Can delete project 9 delete_project
28 Can add comment 10 add_comment
29 Can change comment 10 change_comment
30 Can delete comment 10 delete_comment
31 Can add restriction 11 add_restriction
32 Can change restriction 11 change_restriction
33 Can delete restriction 11 delete_restriction
\.
--
-- Name: auth_permission_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('auth_permission_id_seq', 33, true);
--
-- Data for Name: auth_user; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY auth_user (id, password, last_login, is_superuser, username, first_name, last_name, email, is_staff, is_active, date_joined) FROM stdin;
2 pbkdf2_sha256$24000$lK0XLhrvqaxE$1XFBGTV3BHeMva2oRg5q9E8diYpN764Pp37NLSrqXrY= \N f user001 f t 2016-05-25 16:17:32+08
9 pbkdf2_sha256$24000$36Eap7ip1bla$5Mi7RgXrD0mJMp6IkIGnrjSvgmyCyfySRJJBKpyfkNw= \N f user007 f t 2016-05-26 18:21:00+08
3 pbkdf2_sha256$24000$5uTtiYNPlFzA$ii86FmOd3n2GEQObfBrdOvL7zGMC8QvCoi7AIMrZqqk= \N f user002 f t 2016-05-25 16:17:43+08
4 pbkdf2_sha256$24000$whUQIor4AGjQ$ozxR2y6tBloXXWg8n6oC1B3siYKVjdWwoHCA0UADQ7s= \N f user003 f t 2016-05-25 16:17:55+08
5 pbkdf2_sha256$24000$Ks72qJR1or96$/mVVh5GY5FJjCSm0WVP1Qk3ZUz4lYyQAxwzZPsfnkzU= \N f user004 f t 2016-05-25 16:18:09+08
6 pbkdf2_sha256$24000$Rt0pacwo98Ly$MYiykkIZPVEU7H7rcVbe7rO49uhoCeMbNrC55dmpJwc= \N f user005 f t 2016-05-26 18:20:42+08
7 pbkdf2_sha256$24000$1EbtWgpDalLO$hgo9iLvGxaqpwStVginVFBTCVZjlLZvOnkOZM4+7KyI= \N f user006 f t 2016-05-26 18:20:49+08
10 pbkdf2_sha256$24000$6Boqt6o3feyk$EeMuNxHTkJpXw3TBvhh3p31clSdrFp8hLanc2PlrUfs= \N f user008 user008@qq.com f t 2016-05-27 10:36:40.367852+08
1 pbkdf2_sha256$24000$9ZW6GnSrlpd2$jpdWMx1S67kn6jyK8EaAA44ZjhI7TJR/R+pymd0p/IY= 2016-05-27 10:34:22+08 t peter sptzxbbb@gmail.com t t 2016-05-25 16:16:04+08
11 pbkdf2_sha256$24000$cuMePOkKTLtM$rimK9R2695XfEEcyoXjaugHxI9udwcCVqL2+HTs2R9c= 2016-05-27 12:17:07.882027+08 f user009 f t 2016-05-27 12:07:26.704462+08
\.
--
-- Data for Name: auth_user_groups; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY auth_user_groups (id, user_id, group_id) FROM stdin;
\.
--
-- Name: auth_user_groups_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('auth_user_groups_id_seq', 1, false);
--
-- Name: auth_user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('auth_user_id_seq', 11, true);
--
-- Data for Name: auth_user_user_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY auth_user_user_permissions (id, user_id, permission_id) FROM stdin;
\.
--
-- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('auth_user_user_permissions_id_seq', 1, false);
--
-- Data for Name: django_admin_log; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY django_admin_log (id, action_time, object_id, object_repr, action_flag, change_message, content_type_id, user_id) FROM stdin;
1 2016-05-25 16:17:32.821646+08 2 user001 1 Added. 4 1
2 2016-05-25 16:17:43.98168+08 3 user002 1 Added. 4 1
3 2016-05-25 16:17:55.958984+08 4 user003 1 Added. 4 1
4 2016-05-25 16:18:09.573128+08 5 user004 1 Added. 4 1
5 2016-05-25 16:19:11.964369+08 1 Team object 1 Added. 8 1
6 2016-05-25 16:19:19.025005+08 1 Team object 2 Changed tags. 8 1
7 2016-05-25 16:19:59.986512+08 1 Team object 2 Changed tags. 8 1
8 2016-05-25 16:22:35.448762+08 1 Team object 2 Changed captain. 8 1
9 2016-05-25 16:24:21.253044+08 1 Project object 1 Added. 9 1
10 2016-05-25 16:52:41.160601+08 1 Team object 2 Changed members. 8 1
11 2016-05-25 17:20:13.770053+08 2 team2 1 Added. 8 1
12 2016-05-25 17:20:23.414348+08 2 team002 2 Changed name. 8 1
13 2016-05-25 20:16:24.169182+08 2 team002 2 Changed project. 8 1
14 2016-05-25 20:17:25.817986+08 3 Project2 1 Added. 9 1
15 2016-05-25 20:17:43.454123+08 1 team001 2 Changed project. 8 1
16 2016-05-25 20:19:41.362833+08 2 team002 2 Changed project. 8 1
17 2016-05-25 20:46:07.076402+08 1 peter 2 Changed password. 4 1
18 2016-05-26 17:06:42.660686+08 1 Comment object 1 Added. 10 1
19 2016-05-26 17:07:17.62368+08 2 Comment object 1 Added. 10 1
20 2016-05-26 17:07:24.200076+08 3 Comment object 1 Added. 10 1
21 2016-05-26 17:49:23.15976+08 2 user001 2 Added profile "user001's Profile". 4 1
22 2016-05-26 18:13:26.060723+08 1 peter 2 Added profile "peter's Profile". 4 1
23 2016-05-26 18:15:37.562377+08 2 user001 2 Changed school, major, grade and description for profile "user001's Profile". 4 1
24 2016-05-26 18:20:42.599673+08 6 user005 1 Added. 4 1
25 2016-05-26 18:20:49.562026+08 7 user006 1 Added. 4 1
26 2016-05-26 18:20:52.451778+08 8 user 1 Added. 4 1
27 2016-05-26 18:21:00.618428+08 9 user007 1 Added. 4 1
28 2016-05-26 18:21:37.893643+08 3 team003 1 Added. 8 1
29 2016-05-26 18:26:12.014644+08 9 user007 2 Added profile "user007's Profile". 4 1
30 2016-05-26 18:27:19.937591+08 8 user 3 4 1
31 2016-05-26 19:13:42.890954+08 3 user002 2 Added profile "user002's Profile". 4 1
32 2016-05-26 19:13:57.422467+08 3 user002 2 Changed commentList for profile "user002's Profile". 4 1
33 2016-05-26 21:34:10.371497+08 4 user003 2 Added profile "user003's Profile". 4 1
34 2016-05-26 21:34:15.807859+08 5 user004 2 Added profile "user004's Profile". 4 1
35 2016-05-26 21:34:20.60503+08 6 user005 2 Added profile "user005's Profile". 4 1
36 2016-05-26 21:34:24.952969+08 7 user006 2 Added profile "user006's Profile". 4 1
37 2016-05-27 10:38:21.788708+08 10 user008 2 Changed password. 4 1
38 2016-05-27 12:03:50.735013+08 1 Restriction object 1 Added. 11 1
39 2016-05-27 12:04:56.18909+08 1 Restriction object 2 Changed department. 11 1
40 2016-05-27 12:05:04.136996+08 1 Restriction object 2 Changed school, min_num and max_num. 11 1
41 2016-05-27 12:06:13.096079+08 1 peter 2 Changed tags for profile "peter's Profile". 4 1
42 2016-05-27 12:07:26.7639+08 11 user009 1 Added. Added profile "user009's Profile". 4 1
\.
--
-- Name: django_admin_log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('django_admin_log_id_seq', 42, true);
--
-- Data for Name: django_content_type; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY django_content_type (id, app_label, model) FROM stdin;
1 admin logentry
2 auth permission
3 auth group
4 auth user
5 contenttypes contenttype
6 sessions session
7 teamBuilder profile
8 teamBuilder team
9 teamBuilder project
10 teamBuilder comment
11 teamBuilder restriction
\.
--
-- Name: django_content_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('django_content_type_id_seq', 11, true);
--
-- Data for Name: django_migrations; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY django_migrations (id, app, name, applied) FROM stdin;
1 contenttypes 0001_initial 2016-05-25 16:14:45.036067+08
2 auth 0001_initial 2016-05-25 16:14:45.169573+08
3 admin 0001_initial 2016-05-25 16:14:45.202242+08
4 admin 0002_logentry_remove_auto_add 2016-05-25 16:14:45.21502+08
5 contenttypes 0002_remove_content_type_name 2016-05-25 16:14:45.241111+08
6 auth 0002_alter_permission_name_max_length 2016-05-25 16:14:45.253567+08
7 auth 0003_alter_user_email_max_length 2016-05-25 16:14:45.267327+08
8 auth 0004_alter_user_username_opts 2016-05-25 16:14:45.278564+08
9 auth 0005_alter_user_last_login_null 2016-05-25 16:14:45.308164+08
10 auth 0006_require_contenttypes_0002 2016-05-25 16:14:45.311564+08
11 auth 0007_alter_validators_add_error_messages 2016-05-25 16:14:45.320879+08
12 sessions 0001_initial 2016-05-25 16:14:45.342113+08
13 teamBuilder 0001_initial 2016-05-25 16:14:45.384965+08
14 teamBuilder 0002_team_tags 2016-05-25 16:14:45.40275+08
15 teamBuilder 0003_auto_20160525_0823 2016-05-25 16:23:58.350688+08
16 teamBuilder 0004_team_is_accepted 2016-05-25 16:25:38.085021+08
17 teamBuilder 0005_auto_20160525_0851 2016-05-25 16:51:17.249734+08
18 teamBuilder 0006_team_members 2016-05-25 16:52:25.861055+08
19 teamBuilder 0007_auto_20160525_0923 2016-05-25 17:23:21.735647+08
20 teamBuilder 0008_remove_profile_tags 2016-05-25 17:30:05.145163+08
21 teamBuilder 0009_auto_20160525_1216 2016-05-25 20:16:09.828182+08
22 teamBuilder 0010_auto_20160525_1217 2016-05-25 20:17:22.470719+08
23 teamBuilder 0011_auto_20160526_0905 2016-05-26 17:05:50.558728+08
24 teamBuilder 0012_auto_20160526_0942 2016-05-26 17:42:59.259914+08
25 teamBuilder 0013_auto_20160526_1119 2016-05-26 19:19:09.086225+08
26 teamBuilder 0014_auto_20160526_1333 2016-05-26 21:33:21.489186+08
27 teamBuilder 0015_auto_20160526_1407 2016-05-26 22:07:27.85443+08
28 teamBuilder 0016_auto_20160527_0404 2016-05-27 12:04:47.593984+08
29 teamBuilder 0017_auto_20160527_0407 2016-05-27 12:07:06.659006+08
30 teamBuilder 0018_auto_20160527_0412 2016-05-27 12:12:13.586254+08
\.
--
-- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('django_migrations_id_seq', 30, true);
--
-- Data for Name: django_session; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY django_session (session_key, session_data, expire_date) FROM stdin;
w8z6ilnpxiziimnunxyku3rl3kvjq2fn ZGViNWFkY2JhYWNlMWYwZWZkNGM1NGM3MmViMTZkNzMzZWU5MDBkODp7Il9hdXRoX3VzZXJfaWQiOiIxIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2hhc2giOiI1NDdmM2VjYzJlY2NiY2NmMTQ1YjY0M2Y0MWFkMTE1OGVmOWNjNDZkIn0= 2016-06-08 16:16:39.696377+08
zfrszc7limhtx3pdnpz5oheuasiios6d NDZjYzA2NzExZTBhOGU3MWJhMDA3MzE3MzUzNzNmOTYyZjIwNjAxODp7Il9hdXRoX3VzZXJfaGFzaCI6IjQ3OWFhNTU0N2E5YTExMmU0M2YyZDA3NTJkZGQ3MTdmNWEwZTIxNTkiLCJfYXV0aF91c2VyX2lkIjoiMSIsIl9hdXRoX3VzZXJfYmFja2VuZCI6ImRqYW5nby5jb250cmliLmF1dGguYmFja2VuZHMuTW9kZWxCYWNrZW5kIn0= 2016-06-08 20:46:07.081788+08
70v62ha4cnx6jb1pe9j64uf6q5bbp2wd ZmZiN2I5OTU4MTU2OWEwMzc0M2M5MTQ0OTY0MWUyNDNiNGI4YWJiMjp7Il9hdXRoX3VzZXJfaWQiOiIxMSIsIl9hdXRoX3VzZXJfYmFja2VuZCI6ImRqYW5nby5jb250cmliLmF1dGguYmFja2VuZHMuTW9kZWxCYWNrZW5kIiwiX2F1dGhfdXNlcl9oYXNoIjoiYTY2YTJiMTM5YTI2OTJlOGMxYThiMWRmY2ViNTVhNTA0Y2JjOGQ1NiJ9 2016-06-10 12:17:07.885975+08
\.
--
-- Data for Name: teamBuilder_comment; Type: TABLE DATA; Schema: public; Owner: dbuser
--
COPY "teamBuilder_comment" (id, content, "time", marker_id) FROM stdin;
1 This is a comment 2016-05-26 17:06:40+08 2
2 This is a comment 2016-05-26 17:06:50+08 3
3 This is a comment 2016-05-26 17:07:23+08 4
\.
--
-- Name: teamBuilder_comment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: dbuser
--
SELECT pg_catalog.setval('"teamBuilder_comment_id_seq"', 3, true);
--
-- Data for Name: teamBuilder_profile; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY "teamBuilder_profile" (id, realname, phone, school, major, description, user_id, role, grade, department, tags) FROM stdin;
1 张三 123456 A B D 2 common C \N
3 F 9 common \N
4 This is a description 3 common \N
5 This is a description 4 common {}
6 This is a description 5 common {}
7 This is a description 6 common {}
8 This is a description 7 common {}
2 Peter 123 A B D 1 common C {A,B,C}
9 This is a description 11 common {tag1,tag2,tag3}
\.
--
-- Data for Name: teamBuilder_profile_commentList; Type: TABLE DATA; Schema: public; Owner: dbuser
--
COPY "teamBuilder_profile_commentList" (id, profile_id, comment_id) FROM stdin;
1 3 1
2 4 1
\.
--
-- Name: teamBuilder_profile_commentList_id_seq; Type: SEQUENCE SET; Schema: public; Owner: dbuser
--
SELECT pg_catalog.setval('"teamBuilder_profile_commentList_id_seq"', 2, true);
--
-- Name: teamBuilder_profile_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('"teamBuilder_profile_id_seq"', 9, true);
--
-- Data for Name: teamBuilder_project; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY "teamBuilder_project" (id, title, description, publisher_id) FROM stdin;
1 Project1 This is project1 1
3 Project2 this is project2 1
\.
--
-- Name: teamBuilder_project_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('"teamBuilder_project_id_seq"', 3, true);
--
-- Data for Name: teamBuilder_restriction; Type: TABLE DATA; Schema: public; Owner: dbuser
--
COPY "teamBuilder_restriction" (id, school, department, major, min_num, max_num) FROM stdin;
1 Sun Yat-Sen University School of Data and Computer Science Software Engineering 3 10
\.
--
-- Name: teamBuilder_restriction_id_seq; Type: SEQUENCE SET; Schema: public; Owner: dbuser
--
SELECT pg_catalog.setval('"teamBuilder_restriction_id_seq"', 1, true);
--
-- Data for Name: teamBuilder_team; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY "teamBuilder_team" (id, name, captain_id, tags, is_confirmed, project_id, description) FROM stdin;
1 team001 2 {tag1,tag2,tag3} f 1 This is a description
2 team002 3 {} f 3 This is a description
3 team003 9 {} f 1 This is a description
\.
--
-- Name: teamBuilder_team_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('"teamBuilder_team_id_seq"', 3, true);
--
-- Data for Name: teamBuilder_team_memberList; Type: TABLE DATA; Schema: public; Owner: dbuser
--
COPY "teamBuilder_team_memberList" (id, team_id, user_id) FROM stdin;
1 3 5
2 3 6
3 3 7
\.
--
-- Name: teamBuilder_team_memberList_id_seq; Type: SEQUENCE SET; Schema: public; Owner: dbuser
--
SELECT pg_catalog.setval('"teamBuilder_team_memberList_id_seq"', 3, true);
--
-- Name: auth_group_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_group
ADD CONSTRAINT auth_group_name_key UNIQUE (name);
--
-- Name: auth_group_permissions_group_id_0cd325b0_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_group_permissions
ADD CONSTRAINT auth_group_permissions_group_id_0cd325b0_uniq UNIQUE (group_id, permission_id);
--
-- Name: auth_group_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_group_permissions
ADD CONSTRAINT auth_group_permissions_pkey PRIMARY KEY (id);
--
-- Name: auth_group_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_group
ADD CONSTRAINT auth_group_pkey PRIMARY KEY (id);
--
-- Name: auth_permission_content_type_id_01ab375a_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_permission
ADD CONSTRAINT auth_permission_content_type_id_01ab375a_uniq UNIQUE (content_type_id, codename);
--
-- Name: auth_permission_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_permission
ADD CONSTRAINT auth_permission_pkey PRIMARY KEY (id);
--
-- Name: auth_user_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_groups
ADD CONSTRAINT auth_user_groups_pkey PRIMARY KEY (id);
--
-- Name: auth_user_groups_user_id_94350c0c_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_groups
ADD CONSTRAINT auth_user_groups_user_id_94350c0c_uniq UNIQUE (user_id, group_id);
--
-- Name: auth_user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user
ADD CONSTRAINT auth_user_pkey PRIMARY KEY (id);
--
-- Name: auth_user_user_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_user_permissions
ADD CONSTRAINT auth_user_user_permissions_pkey PRIMARY KEY (id);
--
-- Name: auth_user_user_permissions_user_id_14a6b632_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_user_permissions
ADD CONSTRAINT auth_user_user_permissions_user_id_14a6b632_uniq UNIQUE (user_id, permission_id);
--
-- Name: auth_user_username_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user
ADD CONSTRAINT auth_user_username_key UNIQUE (username);
--
-- Name: django_admin_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_admin_log
ADD CONSTRAINT django_admin_log_pkey PRIMARY KEY (id);
--
-- Name: django_content_type_app_label_76bd3d3b_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_content_type
ADD CONSTRAINT django_content_type_app_label_76bd3d3b_uniq UNIQUE (app_label, model);
--
-- Name: django_content_type_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_content_type
ADD CONSTRAINT django_content_type_pkey PRIMARY KEY (id);
--
-- Name: django_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_migrations
ADD CONSTRAINT django_migrations_pkey PRIMARY KEY (id);
--
-- Name: django_session_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_session
ADD CONSTRAINT django_session_pkey PRIMARY KEY (session_key);
--
-- Name: teamBuilder_comment_pkey; Type: CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_comment"
ADD CONSTRAINT "teamBuilder_comment_pkey" PRIMARY KEY (id);
--
-- Name: teamBuilder_profile_commentList_pkey; Type: CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_profile_commentList"
ADD CONSTRAINT "teamBuilder_profile_commentList_pkey" PRIMARY KEY (id);
--
-- Name: teamBuilder_profile_commentList_profile_id_a364e636_uniq; Type: CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_profile_commentList"
ADD CONSTRAINT "teamBuilder_profile_commentList_profile_id_a364e636_uniq" UNIQUE (profile_id, comment_id);
--
-- Name: teamBuilder_profile_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_profile"
ADD CONSTRAINT "teamBuilder_profile_pkey" PRIMARY KEY (id);
--
-- Name: teamBuilder_profile_user_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_profile"
ADD CONSTRAINT "teamBuilder_profile_user_id_key" UNIQUE (user_id);
--
-- Name: teamBuilder_project_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_project"
ADD CONSTRAINT "teamBuilder_project_pkey" PRIMARY KEY (id);
--
-- Name: teamBuilder_restriction_pkey; Type: CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_restriction"
ADD CONSTRAINT "teamBuilder_restriction_pkey" PRIMARY KEY (id);
--
-- Name: teamBuilder_team_captain_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_team"
ADD CONSTRAINT "teamBuilder_team_captain_id_key" UNIQUE (captain_id);
--
-- Name: teamBuilder_team_memberList_pkey; Type: CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_team_memberList"
ADD CONSTRAINT "teamBuilder_team_memberList_pkey" PRIMARY KEY (id);
--
-- Name: teamBuilder_team_memberList_team_id_7a6db36b_uniq; Type: CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_team_memberList"
ADD CONSTRAINT "teamBuilder_team_memberList_team_id_7a6db36b_uniq" UNIQUE (team_id, user_id);
--
-- Name: teamBuilder_team_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_team"
ADD CONSTRAINT "teamBuilder_team_pkey" PRIMARY KEY (id);
--
-- Name: auth_group_name_a6ea08ec_like; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_group_name_a6ea08ec_like ON auth_group USING btree (name varchar_pattern_ops);
--
-- Name: auth_group_permissions_0e939a4f; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_group_permissions_0e939a4f ON auth_group_permissions USING btree (group_id);
--
-- Name: auth_group_permissions_8373b171; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_group_permissions_8373b171 ON auth_group_permissions USING btree (permission_id);
--
-- Name: auth_permission_417f1b1c; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_permission_417f1b1c ON auth_permission USING btree (content_type_id);
--
-- Name: auth_user_groups_0e939a4f; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_user_groups_0e939a4f ON auth_user_groups USING btree (group_id);
--
-- Name: auth_user_groups_e8701ad4; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_user_groups_e8701ad4 ON auth_user_groups USING btree (user_id);
--
-- Name: auth_user_user_permissions_8373b171; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_user_user_permissions_8373b171 ON auth_user_user_permissions USING btree (permission_id);
--
-- Name: auth_user_user_permissions_e8701ad4; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_user_user_permissions_e8701ad4 ON auth_user_user_permissions USING btree (user_id);
--
-- Name: auth_user_username_6821ab7c_like; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX auth_user_username_6821ab7c_like ON auth_user USING btree (username varchar_pattern_ops);
--
-- Name: django_admin_log_417f1b1c; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX django_admin_log_417f1b1c ON django_admin_log USING btree (content_type_id);
--
-- Name: django_admin_log_e8701ad4; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX django_admin_log_e8701ad4 ON django_admin_log USING btree (user_id);
--
-- Name: django_session_de54fa62; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX django_session_de54fa62 ON django_session USING btree (expire_date);
--
-- Name: django_session_session_key_c0390e0f_like; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX django_session_session_key_c0390e0f_like ON django_session USING btree (session_key varchar_pattern_ops);
--
-- Name: teamBuilder_comment_945c7b03; Type: INDEX; Schema: public; Owner: dbuser
--
CREATE INDEX "teamBuilder_comment_945c7b03" ON "teamBuilder_comment" USING btree (marker_id);
--
-- Name: teamBuilder_profile_commentList_69b97d17; Type: INDEX; Schema: public; Owner: dbuser
--
CREATE INDEX "teamBuilder_profile_commentList_69b97d17" ON "teamBuilder_profile_commentList" USING btree (comment_id);
--
-- Name: teamBuilder_profile_commentList_83a0eb3f; Type: INDEX; Schema: public; Owner: dbuser
--
CREATE INDEX "teamBuilder_profile_commentList_83a0eb3f" ON "teamBuilder_profile_commentList" USING btree (profile_id);
--
-- Name: teamBuilder_team_b098ad43; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX "teamBuilder_team_b098ad43" ON "teamBuilder_team" USING btree (project_id);
--
-- Name: teamBuilder_team_memberList_e8701ad4; Type: INDEX; Schema: public; Owner: dbuser
--
CREATE INDEX "teamBuilder_team_memberList_e8701ad4" ON "teamBuilder_team_memberList" USING btree (user_id);
--
-- Name: teamBuilder_team_memberList_f6a7ca40; Type: INDEX; Schema: public; Owner: dbuser
--
CREATE INDEX "teamBuilder_team_memberList_f6a7ca40" ON "teamBuilder_team_memberList" USING btree (team_id);
--
-- Name: auth_group_permiss_permission_id_84c5c92e_fk_auth_permission_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_group_permissions
ADD CONSTRAINT auth_group_permiss_permission_id_84c5c92e_fk_auth_permission_id FOREIGN KEY (permission_id) REFERENCES auth_permission(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: auth_group_permissions_group_id_b120cbf9_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_group_permissions
ADD CONSTRAINT auth_group_permissions_group_id_b120cbf9_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: auth_permiss_content_type_id_2f476e4b_fk_django_content_type_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_permission
ADD CONSTRAINT auth_permiss_content_type_id_2f476e4b_fk_django_content_type_id FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: auth_user_groups_group_id_97559544_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_groups
ADD CONSTRAINT auth_user_groups_group_id_97559544_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: auth_user_groups_user_id_6a12ed8b_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_groups
ADD CONSTRAINT auth_user_groups_user_id_6a12ed8b_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: auth_user_user_per_permission_id_1fbb5f2c_fk_auth_permission_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_user_permissions
ADD CONSTRAINT auth_user_user_per_permission_id_1fbb5f2c_fk_auth_permission_id FOREIGN KEY (permission_id) REFERENCES auth_permission(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY auth_user_user_permissions
ADD CONSTRAINT auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: django_admin_content_type_id_c4bce8eb_fk_django_content_type_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_admin_log
ADD CONSTRAINT django_admin_content_type_id_c4bce8eb_fk_django_content_type_id FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: django_admin_log_user_id_c564eba6_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY django_admin_log
ADD CONSTRAINT django_admin_log_user_id_c564eba6_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_comment_marker_id_e0ccaada_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_comment"
ADD CONSTRAINT "teamBuilder_comment_marker_id_e0ccaada_fk_auth_user_id" FOREIGN KEY (marker_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_profi_comment_id_3bce42bf_fk_teamBuilder_comment_id; Type: FK CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_profile_commentList"
ADD CONSTRAINT "teamBuilder_profi_comment_id_3bce42bf_fk_teamBuilder_comment_id" FOREIGN KEY (comment_id) REFERENCES "teamBuilder_comment"(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_profi_profile_id_d1a78446_fk_teamBuilder_profile_id; Type: FK CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_profile_commentList"
ADD CONSTRAINT "teamBuilder_profi_profile_id_d1a78446_fk_teamBuilder_profile_id" FOREIGN KEY (profile_id) REFERENCES "teamBuilder_profile"(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_profile_user_id_e939c523_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_profile"
ADD CONSTRAINT "teamBuilder_profile_user_id_e939c523_fk_auth_user_id" FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_project_publisher_id_10fdb76c_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_project"
ADD CONSTRAINT "teamBuilder_project_publisher_id_10fdb76c_fk_auth_user_id" FOREIGN KEY (publisher_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_team_captain_id_69fba53d_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_team"
ADD CONSTRAINT "teamBuilder_team_captain_id_69fba53d_fk_auth_user_id" FOREIGN KEY (captain_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_team_memberList_user_id_7e189c8c_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_team_memberList"
ADD CONSTRAINT "teamBuilder_team_memberList_user_id_7e189c8c_fk_auth_user_id" FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_team_member_team_id_946adb88_fk_teamBuilder_team_id; Type: FK CONSTRAINT; Schema: public; Owner: dbuser
--
ALTER TABLE ONLY "teamBuilder_team_memberList"
ADD CONSTRAINT "teamBuilder_team_member_team_id_946adb88_fk_teamBuilder_team_id" FOREIGN KEY (team_id) REFERENCES "teamBuilder_team"(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: teamBuilder_team_project_id_c0109c4f_fk_teamBuilder_project_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "teamBuilder_team"
ADD CONSTRAINT "teamBuilder_team_project_id_c0109c4f_fk_teamBuilder_project_id" FOREIGN KEY (project_id) REFERENCES "teamBuilder_project"(id) DEFERRABLE INITIALLY DEFERRED;
--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
|
/*
Navicat Premium Data Transfer
Source Server : hi
Source Server Type : MySQL
Source Server Version : 80011
Source Host : localhost:3306
Source Schema : news1
Target Server Type : MySQL
Target Server Version : 80011
File Encoding : 65001
Date: 25/07/2018 23:32:56
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for info_category
-- ----------------------------
DROP TABLE IF EXISTS `info_category`;
CREATE TABLE `info_category` (
`create_time` datetime(0) DEFAULT NULL,
`update_time` datetime(0) DEFAULT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of info_category
-- ----------------------------
INSERT INTO `info_category` VALUES ('2018-01-17 20:55:48', '2018-04-01 21:45:12', 1, '最新');
INSERT INTO `info_category` VALUES ('2018-01-17 20:55:49', '2018-01-17 20:55:50', 2, '股市');
INSERT INTO `info_category` VALUES ('2018-01-17 20:56:04', '2018-01-17 20:56:06', 3, '债市');
INSERT INTO `info_category` VALUES ('2018-01-17 20:56:18', '2018-01-17 20:56:20', 4, '商品');
INSERT INTO `info_category` VALUES ('2018-01-17 20:56:26', '2018-01-17 20:56:28', 5, '外汇');
INSERT INTO `info_category` VALUES ('2018-04-01 21:45:16', '2018-04-01 21:45:16', 6, '公司');
SET FOREIGN_KEY_CHECKS = 1;
|
/*
################################################################################
Migration script to create:
- IS_CLOSEST_GENE column in GENOMIC_CONTEXT
Designed for execution with Flyway database migrations tool; this should be
automatically run to completely generate the schema that is out-of-the-box
compatibile with the GOCI model (see
https://github.com/tburdett/goci/tree/2.x-dev/goci-core/goci-model for more).
author: Emma Hastings
date: July 17th 2015
version: 2.0.1.010
################################################################################
#######################################
# ALTER GENOMIC_CONTEXT
#######################################
*/
ALTER TABLE "GENOMIC_CONTEXT" ADD "IS_CLOSEST_GENE" VARCHAR2(255 CHAR);
|
-- SCRIPT INFORMATION --
-- Types: mysql mariadb
-- Version: 1
-- Upgrades: 0
-- SCRIPT INFORMATION --
START TRANSACTION;
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS sapphire_tower CASCADE;
DROP TABLE IF EXISTS sapphire_tower_block CASCADE;
CREATE TABLE sapphire_tower (
tower_id BIGINT NOT NULL AUTO_INCREMENT,
group_id BIGINT NOT NULL,
x INTEGER NOT NULL,
y INTEGER NOT NULL,
z INTEGER NOT NULL,
world_uuid BINARY(16) NOT NULL,
participant_size INTEGER NOT NULL,
range_size INTEGER NOT NULL,
FOREIGN KEY (group_id) REFERENCES ivory_groups (group_id)
ON DELETE CASCADE
ON UPDATE CASCADE,
PRIMARY KEY (tower_id)
);
CREATE TABLE sapphire_tower_block (
tower_id BIGINT NOT NULL,
x INTEGER NOT NULL,
y INTEGER NOT NULL,
z INTEGER NOT NULL,
world_uuid BINARY(16) NOT NULL,
material INTEGER NOT NULL,
FOREIGN KEY (tower_id) REFERENCES sapphire_tower (tower_id)
ON DELETE CASCADE
ON UPDATE CASCADE,
PRIMARY KEY (x, y, z, world_uuid),
UNIQUE (tower_id, x, y, z, world_uuid)
);
SET foreign_key_checks = 1;
COMMIT; |
USE SoftUni
--EXCERCISE 1
SELECT TOP(5) e.EmployeeID, e.JobTitle, a.AddresSID, a.AddressText
FROM Employees AS e
LEFT JOIN Addresses AS a
ON a.AddressID = e.AddressID
ORDER BY a.AddressID
--EXCERCISE 2
SELECT TOP(50) e.FirstName,e.LastName,t.[Name] AS Town,a.AddressText
FROM Employees AS e
LEFT JOIN Addresses AS a
ON a.AddressID = e.AddressID
LEFT JOIN Towns AS t
ON a.TownID=t.TownID
ORDER BY e.FirstName, e.LastName
--EXCERCISE 3
SELECT e.EmployeeID, e.FirstName, e.LastName, d.[Name] AS [DepartmentName]
FROM Employees AS e
JOIN DeparTments AS d
ON e.DepartmentID = d.DepartmentID
WHERE d.[Name] = 'Sales'
ORDER BY e.EmployeeID
--EXCERCISE 4
SELECT TOP(5) e.EmployeeID, e.FirstName, e.Salary, d.[Name] AS [DepartmentName]
FROM Employees AS e
JOIN Departments AS d
ON e.DepartmentID=d.DepartmentID
WHERE e.Salary > 15000
ORDER BY e.DepartmentID
--EXCERCISE 5
SELECT TOP(3) e.EmployeeID, e.FirstName
FROM Employees AS e
LEFT JOIN EmployeesProjects AS ep
ON e.EmployeeID = ep.EmployeeID
WHERE ep.ProjectID IS NULL
ORDER BY e.EmployeeID
--EXCERCISE 6
SELECT e.FirstName, e.LastName, e.HireDate, d.[Name] AS [DeptName]
FROM Employees AS e
JOIN Departments AS d
ON e.DepartmentID = d.DepartmentID
WHERE e.HireDate>'01/01/1999' AND d.[Name] IN ('Sales','Finance')
ORDER BY e.HireDate
--EXCERCISE 7
SELECT TOP(5) e.EmployeeID, e.FirstName, p.[Name] AS [ProjectName]
FROM Employees AS e
JOIN EmployeesProjects AS ep
ON e.EmployeeID = ep.EmployeeID
JOIN Projects AS p
ON ep.ProjectID = p.ProjectID
WHERE p.StartDate>'08/13/2002' AND p.EndDate IS NULL
ORDER BY e.EmployeeID
--EXCERCISE 8
SELECT e.EmployeeID, e.FirstName, IIF (p.StartDate>'12/31/2004', NULL, p.[Name]) AS [ProjectName]
FROM Employees AS e
JOIN EmployeesProjects AS ep
ON e.EmployeeID = ep.EmployeeID
JOIN Projects AS p
ON ep.ProjectID = p.ProjectID
WHERE e.EmployeeID = 24
--EXCERCISE 9
SELECT e.EmployeeID, e.FirstName, e.ManagerID, m.FirstName
FROM Employees AS e
JOIN Employees AS m
ON m.EmployeeID = e.ManagerID
WHERE m.EmployeeID IN (3,7)
ORDER BY e.EmployeeID
--EXCERCISE 10
SELECT TOP(50) e.EmployeeID,
CONCAT(e.FirstName, ' ', e.LastName) AS [EmployeeName],
CONCAT(m.FirstName, ' ', m.LastName) AS [ManagerName],
d.[Name] AS [DepartmentName]
FROM Employees AS e
JOIN Employees AS m
ON m.EmployeeID = e.ManagerID
JOIN Departments AS d
ON e.DepartmentID = d.DepartmentID
ORDER BY e.EmployeeID
--EXCERCISE 11
SELECT TOP(1) AVG(e.Salary) AS [MinAvarageSalary]
FROM Employees AS e
GROUP BY e.DepartmentID
ORDER BY MinAvarageSalary |
SELECT
count(CLIENTES."TIPO_VEHICULO")
FROM
"ADMINISTRADOR"."CLIENTES" CLIENTES
WHERE
TIEMPO=0 |
-- Count orphan records
-- change parent_table, child_table, and key accordingly
SELECT
COUNT(*) as n_orphans
FROM child_table c
WHERE NOT EXISTS (SELECT
key
FROM parent_table p
WHERE p.key = c.key);
-- Count replication errors
-- change original_table, derived_table, key, and field_name
SELECT
COUNT(*) as n_rep_errors
FROM original_table a
INNER JOIN derived_table ON a.key = b.key
WHERE a.field_name != b.field_name;
-- Valueset validation; returns count of invalid records for a given field
-- change field_name,and table
SELECT
SUM(CASE WHEN field_name NOT IN valueset THEN 1 ELSE 0 END) as n_invalid
FROM table
-- Count extreme values for a numeric field
-- change table, field_name, low_val, and high_val
SELECT
COUNT(*) as n_extreme
FROM table
WHERE field_name NOT BETWEEN low_val AND high_val;
-- Calculate events per encounter type
-- change table, provide enc_type_vals
SELECT
a.enc_type, a.n, b.n_enc, (a.n / b.enc_type) AS ratio
FROM (
SELECT
enc_type, COUNT(*) as n
FROM table
WHERE enc_type IN enc_type_vals
GROUP BY enc_type
) a
FULL OUTER JOIN (
SELECT field_type, COUNT(*) as n_enc
FROM ENCOUNTER
GROUP BY enc_type
) b
ON a.enc_type = b.enc_type;
-- Calculate percentage of patients with encounters who have diagnosis (or procedure) records
-- change table (diagnosis or procedure table)
SELECT
100 * ROUND((n / n_enc), 3) as perc_patients_with_records
FROM (
SELECT
COUNT(DISTINCT patid) as n, 1 as id
FROM table
) a
LEFT JOIN (
SELECT
COUNT(DISTINCT patid) as n_enc, 1 as id
FROM ENCOUNTER
) b
ON a.id = b.id;
|
CREATE DATABASE IF NOT EXISTS `project_history` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `project_history`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: project_history
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `area`
--
DROP TABLE IF EXISTS `area`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `area` (
`Id_Area` int(11) NOT NULL AUTO_INCREMENT,
`Nombre_Area` varchar(30) NOT NULL,
PRIMARY KEY (`Id_Area`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cliente`
--
DROP TABLE IF EXISTS `cliente`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cliente` (
`Id_Cliente` int(11) NOT NULL AUTO_INCREMENT,
`Razon_Social` varchar(60) NOT NULL,
`Nit` int(15) DEFAULT NULL,
`Direccion` varchar(100) DEFAULT NULL,
`Telefono` int(11) DEFAULT NULL,
`Email` varchar(20) DEFAULT NULL,
`Activo` bit(2) NOT NULL,
PRIMARY KEY (`Id_Cliente`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COMMENT='Tabla donde se registran los clientes';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `documento`
--
DROP TABLE IF EXISTS `documento`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `documento` (
`id_documento` int(11) NOT NULL AUTO_INCREMENT,
`nombre_documento` varchar(50) DEFAULT NULL,
`fecha_cargue` datetime DEFAULT NULL,
`fecha_aprobacion` datetime DEFAULT NULL,
`documento` longblob,
`tamanio_documento` int(15) DEFAULT NULL,
`tipo_archivo` varchar(10) DEFAULT NULL,
`estado` char(1) DEFAULT NULL,
`id_documento_asociado` int(11) DEFAULT NULL,
PRIMARY KEY (`id_documento`),
KEY `id_documento_asociado_idx` (`id_documento_asociado`),
CONSTRAINT `documento_asociado_fk` FOREIGN KEY (`id_documento_asociado`) REFERENCES `documento_asociado` (`Id_Documento_Asociado`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `documento_asociado`
--
DROP TABLE IF EXISTS `documento_asociado`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `documento_asociado` (
`Id_Documento_Asociado` int(11) NOT NULL AUTO_INCREMENT,
`Id_Usuario` int(11) NOT NULL,
`Id_Tipo_Documento` int(11) NOT NULL,
`Id_Proyecto` int(11) NOT NULL,
`fecha_modificacion` datetime DEFAULT NULL,
PRIMARY KEY (`Id_Documento_Asociado`),
KEY `Fk_documento_asociado_usuario` (`Id_Usuario`),
KEY `Fk_documento_asociado_proyecto` (`Id_Proyecto`),
KEY `Fk_documento_asociado_tipodocumento` (`Id_Tipo_Documento`),
CONSTRAINT `Fk_documento_asociado_proyecto` FOREIGN KEY (`Id_Proyecto`) REFERENCES `proyecto` (`Id_Proyecto`),
CONSTRAINT `Fk_documento_asociado_tipodocumento` FOREIGN KEY (`Id_Tipo_Documento`) REFERENCES `tipo_documento` (`Id_Tipo_Documento`),
CONSTRAINT `Fk_documento_asociado_usuario` FOREIGN KEY (`Id_Usuario`) REFERENCES `usuario` (`Id_usuario`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `proyecto`
--
DROP TABLE IF EXISTS `proyecto`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `proyecto` (
`Id_Proyecto` int(11) NOT NULL AUTO_INCREMENT,
`Nombre_Proyecto` varchar(40) NOT NULL,
`descripcion` varchar(200) DEFAULT NULL,
`Fecha_Creacion_Proyecto` datetime NOT NULL,
`Id_Usuario` int(11) NOT NULL,
`Id_Area` int(11) NOT NULL,
`Id_Cliente` int(11) NOT NULL,
`estado` varchar(50) DEFAULT NULL,
PRIMARY KEY (`Id_Proyecto`),
KEY `FK_proyecto_usuario` (`Id_Usuario`),
KEY `Fk_proyecto_area` (`Id_Area`),
KEY `Fk_proyecto_cliente` (`Id_Cliente`),
CONSTRAINT `FK_proyecto_usuario` FOREIGN KEY (`Id_Usuario`) REFERENCES `usuario` (`Id_usuario`),
CONSTRAINT `Fk_proyecto_area` FOREIGN KEY (`Id_Area`) REFERENCES `area` (`Id_Area`),
CONSTRAINT `Fk_proyecto_cliente` FOREIGN KEY (`Id_Cliente`) REFERENCES `cliente` (`Id_Cliente`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Temporary view structure for view `reporteplantillas`
--
DROP TABLE IF EXISTS `reporteplantillas`;
/*!50001 DROP VIEW IF EXISTS `reporteplantillas`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE VIEW `reporteplantillas` AS SELECT
1 AS `Id_Tipo_Documento`,
1 AS `Nombre_Tipo_Documento`,
1 AS `cantidad`,
1 AS `Id_Proyecto`,
1 AS `Nombre_Proyecto`,
1 AS `Fecha_Creacion_Proyecto`,
1 AS `Id_Cliente`,
1 AS `Razon_Social`,
1 AS `Nit`,
1 AS `Id_Area`,
1 AS `Nombre_Area`*/;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `rol`
--
DROP TABLE IF EXISTS `rol`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rol` (
`Id_Rol` int(11) NOT NULL,
`Nombre_Rol` varchar(30) NOT NULL,
`Descripcion_Rol` varchar(50) DEFAULT NULL,
`Activo` bit(2) NOT NULL,
PRIMARY KEY (`Id_Rol`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Listado de roles';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `rol_usuario`
--
DROP TABLE IF EXISTS `rol_usuario`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rol_usuario` (
`Id_Usuario` int(11) NOT NULL,
`Id_Rol` int(11) NOT NULL,
KEY `FK_rol_usuario_Usuario` (`Id_Usuario`),
KEY `FK_rol_usuario_rol` (`Id_Rol`),
CONSTRAINT `FK_rol_usuario_Usuario` FOREIGN KEY (`Id_Usuario`) REFERENCES `usuario` (`Id_usuario`),
CONSTRAINT `FK_rol_usuario_rol` FOREIGN KEY (`Id_Rol`) REFERENCES `rol` (`Id_Rol`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tipo_documento`
--
DROP TABLE IF EXISTS `tipo_documento`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tipo_documento` (
`Id_Tipo_Documento` int(11) NOT NULL AUTO_INCREMENT,
`Nombre_Tipo_Documento` varchar(30) NOT NULL,
`Plantilla` longblob,
`tipo_archivo` varchar(10) DEFAULT NULL,
`fecha_modificacion` datetime DEFAULT NULL,
`tamanio_documento` int(15) DEFAULT NULL,
PRIMARY KEY (`Id_Tipo_Documento`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `usuario`
--
DROP TABLE IF EXISTS `usuario`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuario` (
`Id_usuario` int(11) NOT NULL AUTO_INCREMENT,
`Nombre_Usuario` varchar(40) NOT NULL,
`Apellido` varchar(40) NOT NULL,
`Genero` varchar(15) NOT NULL,
`Login` varchar(20) NOT NULL,
`Contraseña` varchar(100) NOT NULL,
`Fecha_Ultimo_Acceso` datetime DEFAULT NULL,
`Activo` bit(3) NOT NULL,
PRIMARY KEY (`Id_usuario`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=latin1 COMMENT='Tabla donde se almacen todos los usuarios ';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Final view structure for view `reporteplantillas`
--
/*!50001 DROP VIEW IF EXISTS `reporteplantillas`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8 */;
/*!50001 SET character_set_results = utf8 */;
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `reporteplantillas` AS select `td`.`Id_Tipo_Documento` AS `Id_Tipo_Documento`,`td`.`Nombre_Tipo_Documento` AS `Nombre_Tipo_Documento`,count(`td`.`Id_Tipo_Documento`) AS `cantidad`,`p`.`Id_Proyecto` AS `Id_Proyecto`,`p`.`Nombre_Proyecto` AS `Nombre_Proyecto`,`p`.`Fecha_Creacion_Proyecto` AS `Fecha_Creacion_Proyecto`,`c`.`Id_Cliente` AS `Id_Cliente`,`c`.`Razon_Social` AS `Razon_Social`,`c`.`Nit` AS `Nit`,`a`.`Id_Area` AS `Id_Area`,`a`.`Nombre_Area` AS `Nombre_Area` from ((((`tipo_documento` `td` join `documento_asociado` `da` on((`td`.`Id_Tipo_Documento` = `da`.`Id_Tipo_Documento`))) join `proyecto` `p` on((`da`.`Id_Proyecto` = `p`.`Id_Proyecto`))) join `cliente` `c` on((`p`.`Id_Cliente` = `c`.`Id_Cliente`))) join `area` `a` on((`p`.`Id_Area` = `a`.`Id_Area`))) group by `td`.`Id_Tipo_Documento` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-11-18 23:25:13
/*DATA INICIAL*/
INSERT INTO `area` VALUES (1,'IBM WebSphere Portal'),(2,'IBM BPM'),(3,'Mega'),(4,'Dirección general');
INSERT INTO `rol` VALUES (1,'Administrador','Este perfil tiene permisos sobre todos los módulos',1),(2,'Consultor','Este perfil tiene permisos para consultar',1),(3,'Aprobador','Este perfil tiene permisos para aprobar',1);
INSERT INTO `usuario` VALUES (1,'Joel','Pulido G','M','joel','c0b84d1ccb798a5d7b82a2af42203428','2017-10-03 11:43:32',1);
INSERT INTO `rol_usuario` VALUES (1,3),(1,2),(1,1); |
-- Drops the blogger if it exists currently --
DROP DATABASE IF EXISTS crm_db;
-- Creates the "blogger" database --
CREATE DATABASE crm_db;
USE crm_db;
|
-- User
insert into user(user_id,age,email,name,role) values(1001,25,'amitemail@gmail.com','Amit','Admin');
insert into user(user_id,age,email,name,role) values(1002,25,'ajeetemail@gmail.com','Ajeet','User');
insert into user(user_id,age,email,name,role) values(1003,26,'rakeshemail@gmail.com','Rakesh','User');
insert into user(user_id,age,email,name,role) values(1004,27,'murariemail@gmail.com','Murari','User');
insert into user(user_id,age,email,name,role) values(1005,25,'shivamemail@gmail.com','Shivam','User');
insert into user(user_id,age,email,name,role) values(1006,25,'abhishekemail@gmail.com','Abhishek','User');
insert into user(user_id,age,email,name,role) values(1007,26,'mataemail@gmail.com','Mata','User');
insert into user(user_id,age,email,name,role) values(1008,25,'umaemail@gmail.com','Uma','User');
insert into user(user_id,age,email,name,role) values(1009,25,'aarzooemail@gmail.com','Aarzoo','User');
insert into user(user_id,age,email,name,role) values(1010,23,'rashiemail@gmail.com','Rashi','User');
-- Movie
insert into Movie(movie_id,name,country,rating) values(2001,'Drishyam','India',4.7);
insert into Movie(movie_id,name,country,rating) values(2002,'PK','India',4.1);
insert into Movie(movie_id,name,country,rating) values(2003,'Pink','India',3.7);
insert into Movie(movie_id,name,country,rating) values(2004,'Court','India',4.7);
insert into Movie(movie_id,name,country,rating) values(2005,'Inception','US',4.7);
insert into Movie(movie_id,name,country,rating) values(2006,'Shutter Island','US',4.7);
insert into Movie(movie_id,name,country,rating) values(2007,'Newton','India',4.9);
insert into Movie(movie_id,name,country,rating) values(2008,'Avengers','US',3.9);
insert into Movie(movie_id,name,country,rating) values(2009,'October','India',3.6);
insert into Movie(movie_id,name,country,rating) values(2010,'3Idiots','India',4.8);
-- City
insert into city(city_id,name,state,country,pin) values(3001,'Pune','Maharashtra','India',411057);
insert into city(city_id,name,state,country,pin) values(3002,'Mumbai','Maharashtra','India',400004);
insert into city(city_id,name,state,country,pin) values(3003,'Nashik','Maharashtra','India',420005);
insert into city(city_id,name,state,country,pin) values(3004,'Azamgarh','Uttar Pradesh','India',276001);
insert into city(city_id,name,state,country,pin) values(3005,'Mau','Uttar Pradesh','India',275101);
insert into city(city_id,name,state,country,pin) values(3006,'Ballia','Uttar Pradesh','India',277001);
insert into city(city_id,name,state,country,pin) values(3007,'Agra','Uttar Pradesh','India',223007);
insert into city(city_id,name,state,country,pin) values(3008,'Ahamedabad','Gujarat','India',320008);
insert into city(city_id,name,state,country,pin) values(3009,'Rajkot','Gujarat','India',360001);
insert into city(city_id,name,state,country,pin) values(3010,'Vadodara','Gujarat','India',300018);
insert into city(city_id,name,state,country,pin) values(3011,'Jaipur','Rajasthan','India',302001);
insert into city(city_id,name,state,country,pin) values(3012,'Kota','Rajasthan','India',323021);
insert into city(city_id,name,state,country,pin) values(3013,'Jaisalmer','Rajasthan','India',345001);
insert into city(city_id,name,state,country,pin) values(3014,'Udaipur','Rajasthan','India',313001);
-- Cinema
insert into cinema(cinema_id,name,city_city_id) values(4001,'Spice Cinema',3004);
insert into cinema(cinema_id,name,city_city_id) values(4002,'PVR',3001);
insert into cinema(cinema_id,name,city_city_id) values(4003,'iMAX',3001);
insert into cinema(cinema_id,name,city_city_id) values(4004,'Inox',3001);
insert into cinema(cinema_id,name,city_city_id) values(4005,'Wave',3002);
insert into cinema(cinema_id,name,city_city_id) values(4006,'Rave',3004);
insert into cinema(cinema_id,name,city_city_id) values(4007,'Mirrage',3004);
insert into cinema(cinema_id,name,city_city_id) values(4008,'Bombay Talkies',3002);
insert into cinema(cinema_id,name,city_city_id) values(4009,'Xion',3001);
insert into cinema(cinema_id,name,city_city_id) values(4010,'Murli Cinema',3004);
insert into cinema(cinema_id,name,city_city_id) values(4011,'Gujrat Talkis',3008);
insert into cinema(cinema_id,name,city_city_id) values(4012,'Big Screen',3008);
insert into cinema(cinema_id,name,city_city_id) values(4013,'Rahul 70mm',3001);
insert into cinema(cinema_id,name,city_city_id) values(4014,'Sharda',3004);
insert into cinema(cinema_id,name,city_city_id) values(4015,'Wanderer',3002); |
SELECT 'O PREÇO DO CURSO ' + NOME_CURSO + ' É DE R$ ' + CAST(PRECO_CURSO AS VARCHAR(6))
FROM TB_CURSOS
WHERE ID_PROFESSOR = 2
SELECT 'A DATA DE LANÇAMENTO ' + CONVERT(VARCHAR(20), DATA_CRIACAO,103)
FROM TB_CURSOS
WHERE ID_CURSO = 102 |
-- Table: season_rankings
-- DROP TABLE season_rankings;
CREATE TABLE season_rankings
(
season_ranking_id serial NOT NULL,
season_year smallint NOT NULL,
team_id character varying(3) NOT NULL,
off_pts double precision NOT NULL,
off_pass_yds double precision,
off_pass_tds double precision,
off_rush_yds double precision,
off_rush_tds double precision,
off_int double precision,
off_fumble double precision,
off_sack double precision,
def_pts double precision NOT NULL,
def_pass_yds double precision,
def_pass_tds double precision,
def_rush_yds double precision,
def_rush_tds double precision,
def_int double precision,
def_fumble double precision,
def_sack double precision,
def_block double precision,
def_safety double precision,
def_tds double precision,
avg boolean,
CONSTRAINT season_rankings_pkey PRIMARY KEY (season_ranking_id),
CONSTRAINT team_id FOREIGN KEY (team_id)
REFERENCES team (team_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);
ALTER TABLE season_rankings
OWNER TO nfldb;
-- Index: fki_team_id
-- DROP INDEX fki_team_id;
CREATE INDEX fki_team_id
ON season_rankings
USING btree
(team_id COLLATE pg_catalog."default");
-- Index: season_rankings_in_season_year_team_id_nuc
-- DROP INDEX season_rankings_in_season_year_team_id_nuc;
CREATE INDEX season_rankings_in_season_year_team_id_nuc
ON season_rankings
USING btree
(season_year, team_id COLLATE pg_catalog."default");
ALTER TABLE season_rankings CLUSTER ON season_rankings_in_season_year_team_id_nuc;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.