text stringlengths 6 9.38M |
|---|
CREATE PROC [ERP].[Usp_Sel_Report_Vale_By_ID]
@ID INT
AS
BEGIN
SELECT V.ID
,V.IdTipoMovimiento
,TM.Nombre NombreTipoMovimiento
,V.IdEntidad
,ETD.NumeroDocumento+ ' ' + E.Nombre NombreEntidad
,V.IdConcepto
,TTO.CodigoSunat +' '+ TTO.Nombre NombreConcepto
,V.IdProyecto
,P.Nombre NombreProyecto
,V.IdAlmacen
,A.Nombre NombreAlmacen
,V.IdMoneda
,M.Nombre NombreMoneda
,V.IdEmpresa
,V.Fecha
,V.Documento
,V.TipoCambio
,V.PorcentajeIGV
,V.Observacion
,V.SubTotal
,V.IGV
,V.Total
,V.Peso
,EST.Nombre NombreEstablecimiento
FROM ERP.Vale V
LEFT JOIN Maestro.TipoMovimiento TM ON TM.ID = V.IdTipoMovimiento
LEFT JOIN ERP.Entidad E ON E.ID = V.IdEntidad
LEFT JOIN ERP.EntidadTipoDocumento ETD ON ETD.IdEntidad = V.IdEntidad
LEFT JOIN [PLE].[T12TipoOperacion] TTO ON TTO.ID = V.IdConcepto
LEFT JOIN ERP.Proyecto P ON P.ID = V.IdProyecto
LEFT JOIN ERP.Almacen A ON A.ID = V.IdAlmacen
LEFT JOIN ERP.Establecimiento EST ON EST.ID = A.IdEstablecimiento
LEFT JOIN Maestro.Moneda M ON M.ID = V.IdMoneda
WHERE V.ID = @ID
END
|
-- =======================================================================
-- 1.3.48-national-pilot-all-firms\02_AddAccountCreatedColumn
-- =======================================================================
--reports
ALTER TABLE public."UserAccounts" ADD COLUMN "AccountCreated" TIMESTAMP(0) WITH TIME ZONE;
update "UserAccounts" set "AccountCreated" = "PasswordChanged" where "IsTemporaryAccount" = false;
update "UserAccounts" a set "Created" = (select "Created" from "UserAccounts" b where b."IsTemporaryAccount" = true and b."Email" = a."Email") where a."IsTemporaryAccount" = false and EXISTS (select "Created" from "UserAccounts" b where b."IsTemporaryAccount" = true and b."Email" = a."Email");
-- =======================================================================
-- END - 1.3.48-national-pilot-all-firms\02_AddAccountCreatedColumn
-- =======================================================================
|
SELECT * FROM coowell.departments; |
/*
Napomena:
A.
Prilikom bodovanja rješenja prioritet ima rezultat
koji upit treba da vrati (broj zapisa, vrijednosti agregatnih funkcija...).
U slu?aju da rezultat upita nije ta?an, a pogled, tabela...
koji su rezultat tog upita se koriste u narednim zadacima,
tada se rješenja narednih zadataka, bez obzira na ta?nost koda,
ne boduju punim brojem bodova, jer ni ta rješenja ne mogu vratiti ta?an rezultat
(broj zapisa, vrijednosti agregatnih funkcija...).
B.
Tokom pisanja koda obratiti pažnju na tekst zadatka
i ono što se traži zadatkom. Prilikom pregleda rada pokre?e se
kod koji se nalazi u sql skripti i sve ono što nije ura?eno prema zahtjevima zadatka
ili je pogrešno ura?eno predstavlja grešku.
Shodno navedenom, na uvidu se ne prihvata prigovor
da je neki dio koda posljedica previda ("nisam vidio", "slu?ajno sam to napisao"...)
*/
------------------------------------------------
--1.
/*
a) Kreirati bazu pod vlastitim brojem indeksa.
*/
create database IB190049_1
use IB190049_1
---------------------------------------------------------------------------
--Prilikom kreiranja tabela voditi ra?una o njihovom me?usobnom odnosu.
---------------------------------------------------------------------------
/*
b) Kreirati tabelu kreditna sljede?e strukture:
- kreditnaID - cjelobrojni tip, primarni klju?
- tip_kreditne - 50 unicode karaktera
- br_kreditne - 25 unicode karatera, obavezan unos
- dtm_evid - datumska varijabla za unos datuma
*/
create table kreditna(
kreditnaID int,
tip_kreditne nvarchar(50),
br_kreditne nvarchar(25) not null,
dtm_evid date,
constraint PK_kreditna primary key (kreditnaID)
)
/*
c) Kreirati tabelu osoba sljede?e strukture:
- osobaID - cjelobrojni tip, primarni klju?
- kreditnaID - cjelobrojni tip, obavezan unos
- mail_lozinka - 50 unicode karaktera
- lozinka - 10 unicode karaktera
- br_tel - 25 unicode karaktera
Na koloni mail_lozinka postaviti ograni?enje
kojim se omogu?uje unos podatka koji ima
maksimalno 20 karaktera.
*/
create table osoba
(
osobaID int,
kreditnaID int not null,
mail_lozinka nvarchar(50) constraint CK_osoba_mail_lozinka check (len(mail_lozinka) between 0 and 21),
lozinka nvarchar(10),
br_tel nvarchar(25),
constraint PK_osoba primary key (osobaID),
constraint FK_osoba_kreditna foreign key(kreditnaID) references kreditna(kreditnaID)
)
/*
d) Kreirati tabelu narudzba sljede?e strukture:
- narudzbaID - cjelobrojni tip, primarni klju?
- kreditnaID - cjelobrojni tip
- br_narudzbe - 25 unicode karaktera
- br_racuna - 15 unicode karaktera
- prodavnicaID - cjelobrojni tip
*/
create table narudzba(
narudzbaID int,
kreditnaID int,
br_narudzbe nvarchar(25),
br_racuna nvarchar(15),
prodavnicaID int,
constraint PK_narudzba primary key(narudzbaID),
constraint FK_narudzba_kreditna foreign key(kreditnaID) references kreditna(kreditnaID)
)
--2.
/*
a)
Iz tabele Sales.CreditCard baze AdventureWorks2017
importovati podatke u tabelu kreditna na sljede?i na?in:
- CreditCardID -> kreditnaID
- CardNUmber -> br_kreditne
- ModifiedDate -> dtm_evid
- kreditnaID - cjelobrojni tip, primarni klju?
- tip_kreditne - 50 unicode karaktera
- br_kreditne - 25 unicode karatera, obavezan unos
- dtm_evid - datumska varijabla za unos datuma
*/
insert into kreditna
select CreditCardID as kreditnaID,
CardType as tip_kreditne,
CardNumber as br_kreditne,
ModifiedDate as dtm_evid
from AdventureWorks2019.Sales.CreditCard c
select * from kreditna
/*
b)
Iz tabela Person.Person, Person.Password,
Sales.PersonCreditCard i Person.PersonPhone
baze AdventureWorks2017
importovati podatke u tabelu osoba na sljede?i na?in:
- BussinesEntityID -> osobaID
- CreditCardID -> kreditnaID
- PasswordHash -> mail_lozinka
- PasswordSalt -> lozinka
- PhoneNumber -> br_tel
Prilikom importa voditi ra?una o ograni?enju
na koloni mail_lozinka.
- osobaID - cjelobrojni tip, primarni klju?
- kreditnaID - cjelobrojni tip, obavezan unos
- mail_lozinka - 50 unicode karaktera
- lozinka - 10 unicode karaktera
- br_tel - 25 unicode karaktera
*/
insert into osoba
select p.BusinessEntityID as osobaID,
CreditCardID as kreditnaID,
left(PasswordHash,20) as mail_lozinka, --ne postoji nijedan zapis koji sadrži samo 20 karaktera pa moram ovako popunit
PasswordSalt as lozinka,
PhoneNumber as br_tel
from AdventureWorks2019.Person.Person p inner join AdventureWorks2019.Person.Password pw
on p.BusinessEntityID=pw.BusinessEntityID inner join AdventureWorks2019.Sales.PersonCreditCard spc
on pw.BusinessEntityID=spc.BusinessEntityID inner join AdventureWorks2019.Person.PersonPhone pph
on spc.BusinessEntityID=pph.BusinessEntityID
select * from osoba
/*
c)
Iz tabela Sales.Customer i Sales.SalesOrderHeader baze AdventureWorks2017
importovati podatke u tabelu narudzba na sljede?i na?in:
- SalesOrderID -> narudzbaID
- CreditCardID -> kreditnaID
- PurchaseOrderNumber -> br_narudzbe
- AccountNumber -> br_racuna
- StoreID -> prodavnicaID
- narudzbaID - cjelobrojni tip, primarni klju?
- kreditnaID - cjelobrojni tip
- br_narudzbe - 25 unicode karaktera
- br_racuna - 15 unicode karaktera
- prodavnicaID - cjelobrojni tip
*/
insert into narudzba
select SalesOrderID as narudzbaID,
CreditCardID as kreditnaID,
PurchaseOrderNumber as br_narudzbe,
c.AccountNumber as br_racuna,
StoreID as prodavnicaID
from AdventureWorks2019.Sales.Customer c inner join AdventureWorks2019.Sales.SalesOrderHeader soh
on c.CustomerID=soh.CustomerID
/*
3---
a)
U tabeli kreditna dodati novu izra?unatu kolonu
god_evid u koju ?e se smještati godina iz kolone dtm_evid
b)
U tabeli kreditna izvršiti update kolone tip_kreditne
tako što ?e se Vista zamijeniti sa Visa
c)
U tabeli osoba izvršiti update kolone
mail_lozinka u svim zapisima u kojima
se podatak u mail_lozinka završava bilo kojom cifrom.
Update izvršiti tako da se umjesto cifre postavi znak @.
*/
alter table kreditna
add god_evid as year(dtm_evid)
select * from kreditna
update kreditna
set tip_kreditne='Visa' where tip_kreditne = 'Vista'
select * from kreditna
select * from osoba
update osoba
set mail_lozinka = LEFT(mail_lozinka, 19) + '@' where not RIGHT(mail_lozinka, 1) like '%[^0-9]%'
--4.
/*
Koriste?i tabele kreditna i osoba kreirati
pogled view_kred_mail koji ?e se sastojati od kolona:
- br_kreditne,
- mail_lozinka,
- br_tel i
- br_cif_br_tel,
pri ?emu ?e se kolone puniti na sljede?i na?in:
- br_kreditne - odbaciti prve 4 cifre
- mail_lozinka - preuzeti sve znakove od znaka na 10. mjestu (uklju?iti i njega)
- br_tel - prenijeti cijelu kolonu
- br_cif_br_tel - broj znakova (cifara) u koloni br_tel
*/
select COunt(kreditnaID) as br_kreditnih, len(br_kreditne) as duzina
from kreditna
group by len(br_kreditne)
--ovdje vidim koliko je dug broj kreditne kartice da bih poslije mogao znati koliko cifara ?e da mi ostane
create view view_kred_mail
as
select right(br_kreditne, 10) as br_kreditne, right(mail_lozinka, 10) as mail_lozinka, br_tel, len(br_tel) as br_cif_br_tel
from kreditna k inner join osoba o
on k.kreditnaID=o.kreditnaID
select * from view_kred_mail
--5.
/*
a)
Iz pogleda view_kred_mail kreirati tabelu kred_mail
b)
Nad tabelom kred_mail kreirati proceduru p_del_kred_mail
tako da se obrišu svi zapisi u kojima se
broj kreditne kartice završava neparnom cifrom.
Nakon kreiranja pokrenuti proceduru.
c)
U tabeli kred_mail kreirati izra?unatu kolonu indikator
koja ?e puniti prema pravilu:
- br_cif_br_tel = 12, indikator = 0
- br_cif_br_tel = 19, indikator = 1
*/
select * into kred_mail from view_kred_mail
select * from kred_mail
create procedure p_del_kred_mail
as
begin
delete from kred_mail where RIGHT(br_kreditne, 1)%2=1
end
exec p_del_kred_mail
select * from kred_mail
alter table kred_mail
add indikator as (
case
when br_cif_br_tel=12 then 0
when br_cif_br_tel=19 then 1
end
)
select * from kred_mail
--6.
/*
a)
Kopirati tabelu kreditna u kreditna1,
b)
U tabeli kreditna1 dodati novu kolonu dtm_aktivni
?ija je default vrijednost aktivni datum sa vremenom.
Kolona je sa obaveznim unosom.
c)
U tabeli kreditna1 dodati novu kolonu br_mjeseci
koja ?e broj mjeseci izme?u aktivnog datuma i datuma evidencije.
d)
Prebrojati broj zapisa u tabeli kreditna1
kod kojih se datum evidencije nalazi u intevalu
do najviše 84 mjeseca u odnosu na aktivni datum.
*/
select * into kreditna1 from kreditna
select * from kreditna1
alter table kreditna1
add aktivni date not null default(getdate())
alter table kreditna1
add br_mjeseci int
update kreditna1
set br_mjeseci = datediff(month, dtm_evid, aktivni)
select * from kreditna1
select count(kreditnaID) as br_kreditnih, br_mjeseci
from kreditna1
where br_mjeseci < 90 --u zadatku se traži 84, me?utim tada ne vra?a nijedan zapis
group by br_mjeseci
--7.
/*
Iz tabele narudzba jednim upitom:
- prebrojati broj zapisa u kojima je u koloni
br_narudzbe NULL vrijednost
- prebrojati broj zapisa u kojima je u koloni
prodavnicaID NULL vrijednost
Upit treba da vrati rezultat u obliku:
broj NULL u br_narudzbe je (navesti broj zapisa)
broj NULL u prodavnicaID je (navesti broj zapisa)
narudzbaID int,
kreditnaID int,
br_narudzbe nvarchar(25),
br_racuna nvarchar(15),
prodavnicaID int,
*/
select ('broj NULL u br_narudzbe je: ' + CONVERT(nvarchar(10), (count(narudzbaID))))
from narudzba
where br_narudzbe is null
union
select ('broj NULL u prodavnicaID je: ' + CONVERT(nvarchar(10), (count(narudzbaID))))
from narudzba
where prodavnicaID is null
select * from narudzba
--8.
/*
a)
Koriste?i tabelu narudzba kreirati
pogled v_duz_br_nar strukture:
- broj karaktera u koloni br_narudzbe
- prebrojani broj zapisa prema broju karaktera
b)
Koriste?i pogled v_duz_br_nar dati pregled
zapisa u kojima se prebrojani broj nalazi u rasponu
do maksimalno 1800 u odnosu na minimalnu vrijednost u koloni prebrojano,
uz uslov da se ne prikazuje minimalna vrijednost
*/
create view v_duz_br_nar
as
select count(narudzbaID) br_narudzbi, len(br_narudzbe) as br_karaktera
from narudzba
group by len(br_narudzbe)
select * from v_duz_br_nar
select br_narudzbi, br_karaktera
from v_duz_br_nar
where br_narudzbi<=1800 and br_narudzbi > (select min(br_narudzbi) from v_duz_br_nar)
group by br_narudzbi, br_karaktera
--9.
/*
Koriste?i tabelu narudzba
kreirati funkciju f_pocetak koja vra?a podatke
u formi tabele sa parametrima:
- poc_br_rac, 7 karaktera
- kreditnaID, cjelobrojni tip
Parametar poc_br_rac se referira na
prvih 7 karaktera kolone br_racuna,
pri ?emu je njegova zadana (default) vrijednost 10-4020.
kreditnaID se referira na kolonu kreditnaID.
Funkcija vra?a kolone kreditnaID, br_narudzbe i br_racuna.
uz uslov da se vra?aju samo zapisi kod kojih je
kreditnaID ve?i od 10000.
Provjeriti funkcioniranje funkcije za kreditnaID = 1200.
Rezultat sortirati prema kreditnaID.
*/
--10.
/*
a)
Kreirati tabelu kreditna1_log strukture:
- log_id, primarni klju?, automatsko punjenje sa po?etnom vrijednoš?u 1 i inkrementom 1
- kreditnaID int
- br_kreditne nvarchar (25)
- br_mjeseci int
- dogadjaj varchar (3)
- mod_date datetime
b)
Nad tabelom kreditna1 kreirati okida? t_upd_kred
kojim ?e se prilikom update podataka u
tabelu prodavac izvršiti insert podataka u
tabelu prodavac_log.
c)
U tabelu autori updatovati zapise tako da se
u svim zapisima u koloni br_kreditne
po?etne niz cifara 1111 promijeni u 2222.
d)
Obavezno napisati kod za pregled sadržaja
tabela kreditna1 i kreditna1_log.
*/
create table kreditna1_log
(
log_id int identity(1,1),
kreditnaID int,
br_kreditne nvarchar(25),
br_mjeseci int,
dogadjaj varchar(3),
mod_date datetime,
constraint PK_kreditna1_log primary key (log_id),
)
|
SELECT name, people_num, COUNT(proj_name) AS count_project
FROM employee, department, project
WHERE in_dpt = dpt_name AND of_dpt = dpt_name
GROUP BY name, people_num;
|
CREATE TABLE `beloved` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Id',
`first_name` varchar(100) DEFAULT NULL COMMENT 'First name',
`last_name` varchar(100) DEFAULT NULL COMMENT 'Last name',
`description` varchar(300) NOT NULL COMMENT 'Full description with titles, attributes and nicknames',
`date_of_birth` date DEFAULT NULL COMMENT 'Date of birth',
`date_of_death` date DEFAULT NULL COMMENT 'Date of death',
`epitaph` text COMMENT 'Epitaph',
`main_place` geometry NOT NULL COMMENT 'Main place',
`main_photo` varchar(100) DEFAULT NULL COMMENT 'Main photo',
`creation_datetime` datetime NOT NULL COMMENT 'Creatione date and time',
`change_datetime` datetime NOT NULL COMMENT 'Change date and time',
PRIMARY KEY (`id`),
KEY `first_name` (`first_name`) COMMENT 'Names search',
KEY `date_of_birth` (`date_of_birth`),
KEY `date_of_death` (`date_of_death`),
KEY `last_name` (`last_name`),
SPATIAL KEY `place` (`main_place`),
KEY `creation_datetime` (`creation_datetime`),
KEY `change_datetime` (`change_datetime`),
FULLTEXT KEY `full_text_name` (`description`,`epitaph`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Deceased table' |
/*
SQLyog Community v8.81
MySQL - 5.5.17-log : Database - seminarioupeu
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`seminarioupeu` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `seminarioupeu`;
/*Table structure for table `encargado` */
DROP TABLE IF EXISTS `encargado`;
CREATE TABLE `encargado` (
`idenc` int(11) NOT NULL AUTO_INCREMENT,
`direccion` varchar(40) NOT NULL,
`estado` varchar(10) NOT NULL,
`name` varchar(60) NOT NULL,
`rol` varchar(60) NOT NULL,
`usuario` varchar(60) NOT NULL,
`clave` varchar(10) NOT NULL,
`numtelefono` varchar(20) NOT NULL,
PRIMARY KEY (`idenc`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
/*Data for the table `encargado` */
insert into `encargado`(`idenc`,`direccion`,`estado`,`name`,`rol`,`usuario`,`clave`,`numtelefono`) values (1,'dir1','1','web','web','web','123456','0000000'),(2,'xyz','1','juan','responsable 1,2,3','juan','123456','00000'),(3,'nnn','1','gerson','esternos','gerson','123456','00000'),(4,'Groenlandia','1','william','admin','magwi','123456','00000'),(5,'antartida','1','raul','admin','riko','123456','00000'),(6,'antartida','1','oscar','admin','oscar','123456','00000'),(7,'inivitada','1','yovana','admin','yovis','123','10101');
/*Table structure for table `persona` */
DROP TABLE IF EXISTS `persona`;
CREATE TABLE `persona` (
`idper` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(60) NOT NULL,
`codigo` varchar(20) DEFAULT NULL,
`email` varchar(60) DEFAULT NULL,
`estado` varchar(10) DEFAULT NULL,
`asistencia` varchar(10) NOT NULL,
`comentario` varchar(200) DEFAULT NULL,
`dni` varchar(10) DEFAULT NULL,
`idenc` int(11) NOT NULL,
`monto` decimal(10,0) NOT NULL,
`entregado` decimal(10,0) DEFAULT NULL,
`nroticket` int(10) NOT NULL,
`actualizado` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idper`),
KEY `encargado_persona_fk` (`idenc`),
CONSTRAINT `encargado_persona_fk` FOREIGN KEY (`idenc`) REFERENCES `encargado` (`idenc`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
/*Data for the table `persona` */
insert into `persona`(`idper`,`name`,`codigo`,`email`,`estado`,`asistencia`,`comentario`,`dni`,`idenc`,`monto`,`entregado`,`nroticket`,`actualizado`) values (2,'WILLIAM CALISAYA PARI','200810381','elmagwi@gmail.com','1','0','cool','44444444',1,'15','0',101,NULL),(13,'DELGADO COASACA LUCERO SANCAYO','0','lucerosancayo@gmail.com','1','0','\'\'','47649677',1,'0','0',0,NULL),(16,'SANDRA MILAGROS RIZGO AQUINO','0','milagrosrisgo@hotmail.com','1','0','','47860259',1,'0','0',0,NULL),(18,'CRISTIAN JUNIOR SAAVEDRA QUISPE','0','cristiansaavedraquispe@gmail.com','1','0','espero pasarla bien y aprender muchas cosas. Gracias','71574820',1,'0','0',0,NULL),(19,'CRISTIAN SAAVEDRA QUISPE','0','cristiansaavedraquispe@gmail.com','1','0','','71574820',1,'0','0',0,NULL);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
---------------
-- PROCEDURY --
---------------
/*
SHOW PROCEDURE STATUS
SHOW triggers
SHOW FULL TABLES IN sklep_db WHERE TABLE_TYPE LIKE 'VIEW'
*/
-- 1. DODAWANIE ADRESU ---------------------------------------------------------------------------------
-- dodaje adres do bazy i zwraca jego identyfikator
DROP PROCEDURE IF EXISTS dodaj_adres;
delimiter //
CREATE PROCEDURE dodaj_adres
(
IN adr VARCHAR(45),
IN kod VARCHAR(6),
IN miej VARCHAR(20)
)
BEGIN
INSERT INTO Adresy(adres,kod_pocztowy,miejscowosc,osoba_id) VALUES(adr, kod, miej,osoba);
SELECT LAST_INSERT_ID() AS id;
END
//
delimiter ;
--- 2. DODAWANIE KLIENTA--------------------------------------------------------------------------------
-- wstawia osobę do bazy oraz jej adres gdy ta nie istnieje lub zwraca komunikat błędu
DROP PROCEDURE IF EXISTS dodaj_klienta;
delimiter //
CREATE PROCEDURE dodaj_klienta
(
IN login VARCHAR(20),
IN haslo VARCHAR(30),
IN imie VARCHAR(20),
IN nazwisko VARCHAR(30),
IN telefon VARCHAR(15),
IN email VARCHAR(45),
IN adres VARCHAR(45),
IN kod VARCHAR(6),
IN miejscowosc VARCHAR(20)
)
BEGIN
DECLARE ile INT default 0;
DECLARE id INT default 0;
SELECT COUNT(*) FROM Logowanie WHERE Logowanie.login = login INTO ile;
IF(ile=0) THEN
INSERT INTO Osoby VALUES(NULL, imie, nazwisko, telefon, email);
SET id = LAST_INSERT_ID();
INSERT INTO Logowanie VALUES(login, haslo, id);
INSERT INTO Adresy VALUES(NULL, adres, kod, miejscowosc, id);
ELSE
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Osoba o tym loginie już istnieje';
END IF;
END
//
delimiter ;
--- 3. WYŚWIETLA WYBRANY PRODUKT -----------------------------------------------------------------------
-- sprawdza do ktorej tabeli szczegółowej został przypisany produkt i wypisuje dane o nim
DROP PROCEDURE IF EXISTS pokaz_produkt;
delimiter //
CREATE PROCEDURE pokaz_produkt
(
IN klucz INT
)
BEGIN
IF EXISTS (SELECT * FROM Siedzenia WHERE produkt_id=klucz) THEN
SELECT nazwa,
cast((cena_netto*(1+stawka_vat/100)) as decimal(7,2)) as cena_brutto,
opis, szerokosc, wysokosc, dlugosc, waga, material, przeznaczenie
FROM Siedzenia, Produkty WHERE produkt_id=klucz AND id=klucz;
ELSEIF EXISTS (SELECT produkt_id FROM Stoly WHERE produkt_id=klucz) THEN
SELECT nazwa,
cast((cena_netto*(1+stawka_vat/100)) as decimal(7,2)) as cena_brutto,
opis, szerokosc, wysokosc, dlugosc, waga, material, przeznaczenie, rodzaj_blatu, ilosc_nog
FROM Stoly, Produkty WHERE produkt_id=klucz AND id=klucz;
ELSEIF EXISTS (SELECT produkt_id FROM Szafy_komody WHERE produkt_id=klucz) THEN
SELECT nazwa,
cast((cena_netto*(1+stawka_vat/100)) as decimal(7,2)) as cena_brutto,
opis, szerokosc, wysokosc, dlugosc, waga, material, przeznaczenie, rodzaj_drzwi, ilosc_drzwi, ilosc_szuflad
FROM Szafy_komody, Produkty WHERE produkt_id=klucz AND id=klucz;
ELSE
SELECT nazwa,
cast((cena_netto*(1+stawka_vat/100)) as decimal(7,2)) as cena_brutto,
opis, szerokosc, wysokosc, dlugosc, waga
FROM Produkty WHERE id=klucz;
END IF;
END
//
delimiter ;
--- 4. WYPISYWANIE PRODUKTÓW Z WYBRANEJ KATEGORII ------------------------------------------------------
-- sprawdza jaki porządek został wybrany i w zależności od niego wypisuje produkty z wybranej kategorii
--nie dzialajace
DROP PROCEDURE IF EXISTS wypisz_produkty;
delimiter //
CREATE PROCEDURE wypisz_produkty
(
IN klucz INT,
IN kat INT
)
BEGIN
SELECT * FROM vKategorie
WHERE kategoria_id=kat
ORDER BY
CASE klucz
WHEN 1 THEN nazwa;
WHEN 2 THEN nazwa desc;
WHEN 3 THEN cena_brutto;
WHEN 4 THEN cena_brutto desc;
END
END
delimiter ;
--dzialajace
delimiter //
CREATE PROCEDURE wypisz_produkty
(
IN klucz INT,
IN kat INT
)
BEGIN
IF(klucz=1 OR klucz=3) THEN
SELECT * FROM vKategorie
WHERE kategoria_id=kat
ORDER BY
CASE
WHEN klucz=1 THEN nazwa
WHEN klucz=3 THEN cena_brutto
END;
ELSE
SELECT * FROM vKategorie
WHERE kategoria_id=kat
ORDER BY
CASE
WHEN klucz=2 THEN nazwa
WHEN klucz=4 THEN cena_brutto
END DESC;
END IF;
END
//
delimiter ;
--- 5. ZMIENIA OPIS PRODUKTU - admin -------------------------------------------------------------------
-- wypisuje kompletne dane o produkcie oraz kolumne z typem produktu (nazwe tabeli z ktorej pochodzi)
DROP PROCEDURE IF EXISTS zmien_opis;
delimiter //
CREATE PROCEDURE zmien_opis
(
IN klucz INT
)
BEGIN
IF EXISTS (SELECT * FROM Siedzenia WHERE produkt_id=klucz) THEN
SELECT *, 'Siedzenia' AS Tabela
FROM vSiedzenia
WHERE id=klucz;
ELSEIF EXISTS (SELECT produkt_id FROM Stoly WHERE produkt_id=klucz) THEN
SELECT *, 'Stoly' AS Tabela
FROM vStoly
WHERE id=klucz;
ELSEIF EXISTS (SELECT produkt_id FROM Szafy_komody WHERE produkt_id=klucz) THEN
SELECT *, 'Szafy_komody' AS Tabela
FROM vSzafy_komody
WHERE id=klucz;
ELSE
SELECT id,nazwa,opis,wysokosc,szerokosc,dlugosc,waga,cena_netto,stawka_vat, 'Produkty' AS Tabela
FROM Produkty WHERE id=klucz;
END IF;
END
//
delimiter ;
--- 6. USUWANIE KATEGORII -admin -----------------------------------------------------------------------
-- usuwa wskazaną kategorię oraz ukrywa wszystkie produkty które do niej należą
DROP PROCEDURE IF EXISTS usun_kategorie;
delimiter //
CREATE PROCEDURE usun_kategorie
(
IN kat_id TINYINT
)
BEGIN
DELETE FROM Kategorie WHERE id=kat_id;
UPDATE Produkty SET ukryty=1 WHERE kategoria_id = kat_id;
END
//
delimiter ;
-- 7. USUWANIE ZAMOWIEŃ STARSZYCH NIŻ 2 LATA I STARYCH PRODUKTÓW - admin -------------------------------
-- usuwa zamowienia od których złożenia minęło conajmniej 730 dni, resztę robią triggery
-- usuwa także produkty ktore zostały ukryte i nie występują w żadnym z zamówień
-- uruchamiane okresowo - przy logowaniu admina w sobote/niedziele
DROP PROCEDURE IF EXISTS usun_stare_zamowienia;
DELIMITER //
CREATE PROCEDURE usun_stare_zamowienia()
BEGIN
DELETE FROM Zamowienia WHERE id IN (
SELECT id FROM vZamowienia_wiek
WHERE roznica_dat >= 730
);
DELETE FROM Produkty
WHERE ukryty=1 AND id NOT IN(
SELECT produkt_id FROM Zamowienia_szczegoly
);
END
//
DELIMITER ;
|
DELIMITER /
ALTER TABLE IACUC_PERSON_TRAINING
ADD CONSTRAINT UQ_IACUC_PERSON_TRAINING
UNIQUE (PERSON_TRAINING_ID, SPECIES_CODE, PROCEDURE_CODE)
/
DELIMITER ;
|
SELECT
t.transaction_id,
s.salesperson_code,
t.total_profit,
t.received+t.received2 AS revenue,
t.expense,
(SELECT code FROM CouponCode WHERE cc_id = t.cc_id) AS couponCode,
t.coupon,
cs.source_name,
t.clear_status,
t.lock_status,
t.note
FROM Transactions t
JOIN CustomerSource cs ON t.source_id = cs.source_id
JOIN Salesperson s ON t.salesperson_id = s.salesperson_id
WHERE t.transaction_id LIKE '%'
/*只点了“未完成订单”*/
AND t.clear_status = 'N'
AND t.lock_status = 'N'
/*点了“未完成订单”和“clear订单”*/
--AND t.lock_status = 'N'
/*点了“未完成订单”和“lock订单”,此时“clear订单”会自动被勾上*/
--无条件
/*只点了“clear订单”*/
--AND t.clear_status = 'Y'
--AND t.lock_status = 'N'
/*点了“clear订单”和“lock订单”*/
--AND t.clear_status = 'Y'
/*只点了“lock订单”,“clear”会被自动勾上,所以同上*/
/*三个全点*/
--无条件
/*备注:和之前版本唯一的区别在于,clear和lock同时勾上,应该是既看clear又看lock,所以是clear_status='Y'
还有一个地方要修改的是,只勾上lock不会自动勾上clear了。这里用到的默认前提是
网页里的”clear订单“是指”只clear但是还没有lock的单子“*/
AND t.create_time <= current_timestamp
AND t.create_time >= 0
AND t.payment_type LIKE '%'
AND
(
t.currency = 'USD'
AND t.total_profit >= -999999999.99
AND t.total_profit <= 999999999.99
AND t.expense >= -999999999.99
AND t.expense <= 999999999.99
AND t.received+t.received2 >= -999999999.99
AND t.received+t.received2 <= 999999999.99
)
OR
(t.currency = 'RMB'
AND t.total_profit/(SELECT value FROM OtherInfo WHERE name = 'default_currency') >= -999999999.99
AND t.total_profit/(SELECT value FROM OtherInfo WHERE name = 'default_currency') <= 999999999.99
AND t.expense/(SELECT value FROM OtherInfo WHERE name = 'default_currency') >= -999999999.99
AND t.expense/(SELECT value FROM OtherInfo WHERE name = 'default_currency') <= 999999999.99
AND (t.received+t.received2)/(SELECT value FROM OtherInfo WHERE name = 'default_currency') >= -999999999.99
AND (t.received+t.received2)/(SELECT value FROM OtherInfo WHERE name = 'default_currency') <= 999999999.99
)
AND s.salesperson_code LIKE '%'
AND cs.source_name LIKE '%'
AND t.type IN ('individual', 'group')
ORDER BY t.transaction_id DESC
LIMIT 15; |
-- Q1 returns (first_name)
SELECT SUBSTRING(name FROM 1 FOR (POSITION(' ' IN name)+LENGTH(name))%(LENGTH(name)+1)) AS first_name
FROM person
ORDER BY first_name
;
-- Q2 returns (born_in,popularity)
SELECT born_in,
COUNT(person) AS popularity
FROM person
GROUP BY born_in
ORDER BY popularity DESC, born_in
;
-- Q3 returns (house,seventeenth,eighteenth,nineteenth,twentieth)
SELECT house,
COUNT(CASE WHEN accession BETWEEN '1600-01-01' AND '1699-12-31' THEN name ELSE NULL END) AS seventeenth,
COUNT(CASE WHEN accession BETWEEN '1700-01-01' AND '1799-12-31' THEN name ELSE NULL END) AS eighteenth,
COUNT(CASE WHEN accession BETWEEN '1800-01-01' AND '1899-12-31' THEN name ELSE NULL END) AS nineteenth,
COUNT(CASE WHEN accession BETWEEN '1900-01-01' AND '1999-12-31' THEN name ELSE NULL END) AS twentieth
FROM monarch
WHERE house IS NOT NULL
GROUP BY house
ORDER BY house
;
-- Q4 returns (name,age)
SELECT *
FROM (
SELECT father.name AS name,
DATE_PART('year', AGE(child.dob,father.dob)) AS AGE
FROM person AS child
JOIN person AS father ON child.father = father.name
WHERE child.dob <= ALL(SELECT dob
FROM person
WHERE father = father.name)
UNION ALL
SELECT mother.name AS name,
DATE_PART('year', AGE(child.dob,mother.dob)) AS AGE
FROM person AS child
JOIN person AS mother ON child.mother = mother.name
WHERE child.dob <= ALL(SELECT dob
FROM person
WHERE mother = mother.name)
) AS parents
ORDER BY name
;
-- Q5 returns (father,child,born)
SELECT father.name AS father,
children.name as child,
CASE WHEN children.name IS NOT NULL
THEN RANK() OVER
(PARTITION BY father.name ORDER BY children.dob)
ELSE 0
END AS born
FROM person AS father
LEFT JOIN person AS children ON father.name = children.father
WHERE father.gender = 'M'
;
-- Q6 returns (monarch,prime_minister)
-- FIRST: SELECT ALL monarchs & PMs where the PM's TERM BEGINS BEFORE THE MONARCH'S SUCCESSION
SELECT mon.name AS monarch,
pm.name AS prime_minister
FROM monarch AS mon
JOIN person ON mon.name = person.name
LEFT JOIN monarch AS successor ON mon.accession < successor.accession
AND successor.accession <= ALL( SELECT accession
FROM monarch
WHERE monarch.accession > mon.accession)
JOIN prime_minister AS pm ON pm.entry <= COALESCE(successor.accession, CURRENT_DATE)
INTERSECT
-- SECOND: I SELECT ALL monarchs & PMs where PM's TERM *ENDS* AFTER THE MONARCH's ACCESSION
SELECT monarch.name AS monarch,
pm.name AS prime_minister
FROM prime_minister pm
LEFT JOIN prime_minister AS successor ON pm.entry < successor.entry
AND successor.entry <= ALL( SELECT entry
FROM prime_minister
WHERE prime_minister.entry > pm.entry)
JOIN monarch ON COALESCE(successor.entry, CURRENT_DATE) >= monarch.accession
;
|
insert into ticket (id, placa_vehiculo, tipo_vehiculo, hora_entrada, created_at, hora_salida, total_pagado)
values(1, 'UNA008', 1, '2021-02-17', '2021-02-17', '2021-02-17', 1200) |
DELETE FROM
Capes
WHERE
Uuid = '%1' AND CapeUrl = '%2';
|
/* UPDATE 5.0.0.0*/
SET SEARCH_PATH = "COMMON";
UPDATE "Variable" SET "VALUE" = '5.0.0.0' WHERE "NAME" = 'DB_VERSION';
SET search_path TO "0001";
ALTER TABLE "CuentaBancaria" ADD COLUMN "ENTIDAD" varchar(255);
ALTER TABLE "Gasto" ADD COLUMN "OID_TIPO" int8 DEFAULT 0; |
--https://www.dbdelta.com/sql-server-system-table-statistics-update/
SELECT QUOTENAME(OBJECT_SCHEMA_NAME(i.object_id))+N'.'+QUOTENAME(OBJECT_NAME(i.object_id))+N'.'+QUOTENAME(name) AS index_name,
STATS_DATE(i.object_id, i.index_id) AS stats_date
FROM sys.indexes AS i
JOIN sys.partitions AS p ON p.object_id = i.object_id
AND p.index_id = i.index_id
WHERE OBJECTPROPERTYEX(i.object_id, 'IsSystemTable') = 1
AND i.index_id > 0
AND p.rows > 0; |
select user_pyr1_Cat
, COUNT(DISTINCT(pt_no)) as [Cases]
, SUM(tot_chg_Amt) as [Charges]
FROM smsdss.BMH_PLM_PtAcct_V
WHERE hosp_Svc IN('WCC','WCH')
AND Adm_Date BETWEEN '01/01/2017' AND '12/31/2017'
AND tot_chg_amt > '0'
AND Pt_No NOT IN (
SELECT DISTINCT(a.Pt_id)
FROM smsmir.mir_actv as a
left outer join smsmir.acct as b
ON a.pt_id = b.pt_id
WHERE a.actv_cd IN (
'02501005','02501013','02501021','02501039','02501047',
'02501054','02501062','02501070','02501088','02501096'
)
AND b.adm_Date BETWEEN '01/01/2017' AND '12/31/2017'
AND b.hosp_svc in ('WCC','WCH')
)
GROUP BY User_Pyr1_Cat
ORDER BY user_pyr1_cat
; |
-- -----------------------------------------------------
-- Insertar LotusProject.rol
-- -----------------------------------------------------
call LotusProject.rolIn('Administrador', 'Encargado del negocio', 1);
call LotusProject.rolIn('Ing. Calidad', 'Encargadito del negocio', 1);
call LotusProject.rolIn('Ast. Calidad', 'Encargado del negocio', 1);
call LotusProject.rolIn('Ast. Comercial', 'Encargado del negocio', 1);
call LotusProject.rolIn('Supervisor', 'Encargado del negocio', 1);
call LotusProject.rolIn('Estandar', 'Encargado del negocio', 1);
-- call LotusProject.rolMo(1,8 'Admin', 'El puto amo', 1);
-- call LotusProject.rolLi();
-- call LotusProject.rolEl(1);
-- call LotusProject.rolCo(1);
-- -----------------------------------------------------
-- Insertar LotusProject.Usuario
-- -----------------------------------------------------
call LotusProject.usuarioIn('1070949', 'Alexander', 'Moreno', 'almoreno', '1234', '2315', '301463', 'almoreno@eliteflower.com','M' ,'img/Usuario/almoreno.png',1, 1);
call LotusProject.usuarioIn('1075', 'Neissy', 'Medina', 'nmedina', '1234', '2315', '301463', 'nmedina@eliteflower.com','F', 'img/Usuario/Usuaria.png',1, 1);
call LotusProject.usuarioIn('1073', 'Erika', 'Guerrero', 'eguerrero', '1234', '2315', '301463', 'eguerrero@eliteflower.com','F', 'img/Usuario/Usuaria.png',1, 1);
call LotusProject.usuarioIn('1075515', 'Camilo', 'Lara', 'clara', '1234', '2315', '301463', 'clara@eliteflower.com','M', 'img/Usuario/Usuario.png',1, 1);
-- call LotusProject.usuarioMo('1070949', 'Alexander', 'Moreno', 'almoreno', '1234', '2315', '3014638753', 'almoreno@eliteflower.com', '1', 1);
-- call LotusProject.usuarioLi();
-- call LotusProject.usuarioEl('1070949');
-- call LotusProject.usuarioCo('1070949');
-- call LotusProject.usuarioLogin('1070949', '1234');
-- -----------------------------------------------------
-- Insertar LotusProject.Permisos
-- -----------------------------------------------------
call LotusProject.permisoIn('Usuario', 'Usuario', 'Permisos de usuario', 'usuario.jsp', 'face', 1);
call LotusProject.permisoIn('Rol', 'Usuario', 'Permisos de usuario', 'rol.jsp', 'assignment_ind', 1);
call LotusProject.permisoIn('Permiso', 'Usuario', 'Permisos de usuario', 'permiso.jsp', 'lock_open', 1);
call LotusProject.permisoIn('Poscosecha', 'Poscosecha', 'Permisos de poscosecha', 'poscosecha.jsp', 'business', 1);
call LotusProject.permisoIn('Cliente', 'Cliente', 'Permisos de cliente', 'cliente.jsp', 'local_mall', 1);
call LotusProject.permisoIn('Producto', 'Producto', 'Permisos de producto', 'producto.jsp', 'local_florist', 1);
call LotusProject.permisoIn('Marcación', 'Marcación', 'Permisos de marcación', 'marcacion.jsp', 'local_offer', 1);
call LotusProject.permisoIn('Armado', 'Armado', 'Permisos de armado', 'armado.jsp', 'extension', 1);
call LotusProject.permisoIn('Parametro', 'Producto', 'Permisos de parametros', 'parametros.jsp', 'tune', 1);
call LotusProject.permisoIn('Variedad', 'Producto', 'Permisos de variedad', 'variedad.jsp', 'filter_vintage', 1);
call LotusProject.permisoIn('Grado', 'Producto', 'Permisos de grado', 'grados.jsp', 'blur_linear', 1);
call LotusProject.permisoIn('Parte', 'Producto', 'Permisos para parte', 'partes.jsp', 'flip', 1);
call LotusProject.permisoIn('Material Seco', 'Marcación', 'Permisos para materiales secos', 'materialseco.jsp', 'style', 1);
call LotusProject.permisoIn('Fitosanidad', 'Producto', 'Permisos para fitosanidad', 'fitosanidad.jsp', 'bug_report', 1);
call LotusProject.permisoIn('Linea', 'Poscosecha', 'Permisos para linea', 'linea.jsp', 'label_outline', 1);
call LotusProject.permisoIn('Producto maestro', 'Producto', 'Permisos para producto maestro', 'maestro.jsp', 'vpn_key', 1);
call LotusProject.permisoIn('Menú', 'Marcación', 'Permisos de menu', 'menu.jsp', 'loyalty', 1);
call LotusProject.permisoIn('Paso', 'Armado', 'Permisos para ajuste de pasos', 'paso.jsp', 'plus_one', 1);
-- call LotusProject.permisoIn('Probador', 'Pruebas', 'Para probar', 'Probar.jsp', 'test', 1);
-- call LotusProject.permisoEl(7);
-- call LotusProject.permisoCo(7);
-- call LotusProject.permisoLi();
-- -----------------------------------------------------
-- Insertar LotusProject.AsgPer
-- -----------------------------------------------------
call LotusProject.AsgPerIn(1, 1, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 2, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 3, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 4, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 5, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 6, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 7, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 8, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 9, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 10, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 11, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 12, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 13, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 14, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 15, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 16, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 17, 1, 1, 1, 1);
call LotusProject.AsgPerIn(1, 18, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 1, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 2, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 3, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 4, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 5, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 6, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 7, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 8, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 9, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 10, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 11, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 12, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 13, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 14, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 15, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 16, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 17, 1, 1, 1, 1);
call LotusProject.AsgPerIn(2, 18, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 1, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 2, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 3, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 4, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 5, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 6, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 7, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 8, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 9, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 10, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 11, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 12, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 13, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 14, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 15, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 16, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 17, 1, 1, 1, 1);
call LotusProject.AsgPerIn(3, 18, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 1, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 2, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 3, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 4, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 5, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 6, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 7, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 8, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 9, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 10, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 11, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 12, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 13, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 14, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 15, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 16, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 17, 1, 1, 1, 1);
call LotusProject.AsgPerIn(4, 18, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 1, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 2, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 3, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 4, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 5, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 6, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 7, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 8, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 9, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 10, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 11, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 12, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 13, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 14, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 15, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 16, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 17, 1, 1, 1, 1);
call LotusProject.AsgPerIn(5, 18, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 1, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 2, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 3, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 4, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 5, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 6, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 7, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 8, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 9, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 10, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 11, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 12, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 13, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 14, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 15, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 16, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 17, 1, 1, 1, 1);
call LotusProject.AsgPerIn(6, 18, 1, 1, 1, 1);
-- call LotusProject.AsgPerLi(1);
-- call LotusProject.AsgPerMo(2, 1, 0, 0, 0, 0);
-- call LotusProject.AsgPerCo(1, 1);
-- call LotusProject.AsgPerSession(1070949);
-- call LotusProject.AsgPerEl(3, 6);
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla maestro
-- -----------------------------------------------------
call LotusProject.maestroIn('Green', 'Agrupa los productos verdes, sin flor ');
call LotusProject.maestroIn('Alstroemeria', 'Agrupa los producto familiares de la alstroemeria');
call LotusProject.maestroIn('Pompom', 'Agrupa los producto familiares del pompon sin desbotonar');
call LotusProject.maestroIn('Arandano', 'Agrupa los producto familiares del arandano');
call LotusProject.maestroIn('Lirios', 'Agrupa los producto familiares del lirio ');
call LotusProject.maestroIn('Fillers', 'Agrupa los producto de flor pequeña, utilizados para decoracion de productos principales');
call LotusProject.maestroIn('Diver', 'Agrupa los producto de siembras menores que se prestan para elaborcion de ramos solidos');
call LotusProject.maestroIn('Carnation', 'Agrupa los producto familiares del clavel');
call LotusProject.maestroIn('Disbud', 'Agrupa los producto familiares del pompon desbotonados');
call LotusProject.maestroIn('Gerberas', 'Agrupa los producto familiares de la gerbera');
call LotusProject.maestroIn('Roses', 'Agrupa los producto familiares de la rosa estandar');
-- call LotusProject.maestroMo(123, 'rosa', 'amarilla');
-- call LotusProject.maestroLi();
-- call LotusProject.maestroCo(12);
-- -----------------------------------------------------
-- Procedimientos LotusProject poscosecha
-- -----------------------------------------------------
call LotusProject.poscosechaIn('A. Carnations', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('A. Las Palmas', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('A. Las Palmas Alstroemeria', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Bqt - Santamaria', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('El Morado', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('El Morado Alstroemeria', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('El Rosal', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Guacari', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Las Margaritas', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Normandia', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Postcosecha Fantasy', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Postcosecha San Valentino', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Santamaria', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Valdaya', 'Km x ', '1234', 1);
call LotusProject.poscosechaIn('Vista - Elite', 'Km x ', '1234', 1);
-- call LotusProject.poscosechaIn('rosa amarilla', 'cra 21a numero 13a 64', '1234567', 1);
-- call LotusProject.poscosechaMo(123, 'rosa amarilla', 'cra 21a numero 13a 64', '567890', 1);
-- call LotusProject.poscosechaLi();
-- call LotusProject.poscosechaCo(16);
-- call LotusProject.productoIn('Acacia','img/Maestro/Producto/acacia.png',1,1);
-- call LotusProject.productoIn('Adenanthus','img/Maestro/Producto/adenanthus.png',1,1);
-- call LotusProject.productoIn('Agonis','img/Maestro/Producto/agonis.png',1,1);
call LotusProject.productoIn('Alstroemeria','img/Maestro/Producto/alstroemeria.png',1,2);
-- call LotusProject.productoIn('Anemonas','img/Maestro/Producto/anemonas.png',1,3);
-- call LotusProject.productoIn('Aralia','img/Maestro/Producto/aralia.png',1,1);
call LotusProject.productoIn('Arandano','img/Maestro/Producto/arandano.png',1,4);
call LotusProject.productoIn('Asiatic','img/Maestro/Producto/asiatic.png',1,5);
call LotusProject.productoIn('Aster','img/Maestro/Producto/aster.png',1,6);
-- call LotusProject.productoIn('Brassicas','img/Maestro/Producto/brassicas.png',1,7);
call LotusProject.productoIn('Button','img/Maestro/Producto/button.png',1,3);
call LotusProject.productoIn('Callas','img/Maestro/Producto/callas.png',1,7);
call LotusProject.productoIn('Carnation','img/Maestro/Producto/carnation.png',1,8);
-- call LotusProject.productoIn('Cocculos','img/Maestro/Producto/cocculos.png',1,1);
call LotusProject.productoIn('Craspedia','img/Maestro/Producto/craspedia.png',1,7);
call LotusProject.productoIn('Cremon','img/Maestro/Producto/cremon.png',1,9);
-- call LotusProject.productoIn('Cupressus','img/Maestro/Producto/cupressus.png',1,1);
-- call LotusProject.productoIn('Cushion','img/Maestro/Producto/cushion.png',1,3);
-- call LotusProject.productoIn('Cypres','img/Maestro/Producto/cypres.png',1,1);
-- call LotusProject.productoIn('Daisy','img/Maestro/Producto/daisy.png',1,3);
-- call LotusProject.productoIn('Delphinium','img/Maestro/Producto/delphinium.png',1,7);
call LotusProject.productoIn('Dianthus','img/Maestro/Producto/dianthus.png',1,6);
call LotusProject.productoIn('Eryngium','img/Maestro/Producto/eryngium.png',1,6);
call LotusProject.productoIn('Eucaliptus','img/Maestro/Producto/eucaliptus.png',1,1);
-- call LotusProject.productoIn('Euonymous','img/Maestro/Producto/euonymous.png',1,1);
call LotusProject.productoIn('Garden Roses','img/Maestro/Producto/garden roses.png',1,11);
call LotusProject.productoIn('Gerbera','img/Maestro/Producto/gerbera.png',1,10);
call LotusProject.productoIn('Gerrondo','img/Maestro/Producto/gerrondo.png',1,10);
-- call LotusProject.productoIn('Grevilleas','img/Maestro/Producto/grevilleas.png',1,1);
call LotusProject.productoIn('Gypsophila','img/Maestro/Producto/gypsophila.png',1,6);
call LotusProject.productoIn('Hydrangea','img/Maestro/Producto/hydrangea.png',1,7);
-- call LotusProject.productoIn('Kalanchoe','img/Maestro/Producto/kalanchoe.png',1,7);
-- call LotusProject.productoIn('Leucadendron','img/Maestro/Producto/leucadendron.png',1,1);
-- call LotusProject.productoIn('Ligustrum','img/Maestro/Producto/ligustrum.png',1,1);
-- call LotusProject.productoIn('Lilly Grass','img/Maestro/Producto/lilly grass.png',1,1);
-- call LotusProject.productoIn('Limonium','img/Maestro/Producto/limonium.png',1,6);
-- call LotusProject.productoIn('Lirios','img/Maestro/Producto/lirios.png',1,5);
call LotusProject.productoIn('Matsumoto','img/Maestro/Producto/matsumoto.png',1,7);
-- call LotusProject.productoIn('Micro','img/Maestro/Producto/micro.png',1,3);
-- call LotusProject.produimg\ClienteBloomstar\Bloomstar Rainbow 24 tallos.jpg
call LotusProject.productoIn('Gerbera Mini','img/Maestro/Producto/gerbera mini.png',1,10);
call LotusProject.productoIn('Minicarnation','img/Maestro/Producto/minicarnation.png',1,8);
-- call LotusProject.productoIn('Novelty','img/Maestro/Producto/novelty.png',1,3);
call LotusProject.productoIn('Oriental','img/Maestro/Producto/oriental.png',1,5);
-- call LotusProject.productoIn('Photinia','img/Maestro/Producto/photinia.png',1,1);
-- call LotusProject.productoIn('Gerbera Piccolin','img/Maestro/Producto/gerbera piccolin.png',1,10);
-- call LotusProject.productoIn('Pompon','img/Maestro/Producto/pompon.png',1,3);
call LotusProject.productoIn('Roses','img/Maestro/Producto/roses.png',1,11);
-- call LotusProject.productoIn('Ruscus','img/Maestro/Producto/ruscus.png',1,1);
call LotusProject.productoIn('Santini','img/Maestro/Producto/santini.png',1,3);
-- call LotusProject.productoIn('Scabiosa','img/Maestro/Producto/scabiosa.png',1,7);
-- call LotusProject.productoIn('Solidago','img/Maestro/Producto/solidago.png',1,6);
-- call LotusProject.productoIn('Gerbera Spider','img/Maestro/Producto/gerbera spider.png',1,10);
call LotusProject.productoIn('Roses Spray','img/Maestro/Producto/roses spray.png',1,11);
call LotusProject.productoIn('Stock','img/Maestro/Producto/stock.png',1,6);
-- call LotusProject.productoIn('Spider','img/Maestro/Producto/spider.png',1,3);
call LotusProject.productoIn('Sunflower','img/Maestro/Producto/sunflower.png',1,7);
-- call LotusProject.productoIn('Trachelium','img/Maestro/Producto/trachelium.png',1,7);
-- call LotusProject.productoIn('Viburnum','img/Maestro/Producto/viburnum.png',1,1);
-- -----------------------------------------------------
-- Procedimientos LotusProject armado
-- -----------------------------------------------------
call LotusProject.armadoIn('Bloomstar Rainbow', 'Armado de 24 tallos', 1);
-- call lotusproject.armadoMo(1234, 'rosa', 'verde', 1);
-- call lotusproject.armadoLi();
-- call lotusproject.armadoCo(2);
-- -----------------------------------------------------
-- Procedimientos LotusProject paso
-- -----------------------------------------------------
call LotusProject.pasoIn(1, 'Hacer y hacer 1', 'img/Armado/Bloomstar Rainbow con lamina/1ro.png', 1);
call LotusProject.pasoIn(2, 'Hacer y hacer 2', 'img/Armado/Bloomstar Rainbow con lamina/2do.png', 1);
call LotusProject.pasoIn(3,'Hacer y hacer! 3','img/Armado/Bloomstar Rainbow con lamina/3ro.png',1);
call LotusProject.pasoIn(4,'Hacer y hacer! 4','img/Armado/Bloomstar Rainbow con lamina/4to.png',1);
call LotusProject.pasoIn(5,'Hacer y hacer! 5','img/Armado/Bloomstar Rainbow con lamina/5to.png',1);
call LotusProject.pasoIn(6,'Hacer y hacer! 6','img/Armado/Bloomstar Rainbow con lamina/6to.png',1);
call LotusProject.pasoIn(7,'Hacer y hacer! 7','img/Armado/Bloomstar Rainbow con lamina/7mo.png',1);
call LotusProject.pasoIn(8,'Hacer y hacer! 8','img/Armado/Bloomstar Rainbow con lamina/8vo.png',1);
call LotusProject.pasoIn(9,'Hacer y hacer! 9','img/Armado/Bloomstar Rainbow con lamina/9no.png',1);
call LotusProject.pasoIn(10,'Hacer y hacer! 10','img/Armado/Bloomstar Rainbow con lamina/10mo.png',1);
call LotusProject.pasoIn(11,'Hacer y hacer! 11','img/Armado/Bloomstar Rainbow con lamina/11vo.png',1);
call LotusProject.pasoIn(12,'Hacer y hacer! 12','img/Armado/Bloomstar Rainbow con lamina/12vo.png',1);
call LotusProject.pasoIn(13,'Hacer y hacer! 13','img/Armado/Bloomstar Rainbow con lamina/13vo.png',1);
call LotusProject.pasoIn(14,'Hacer y hacer! 14','img/Armado/Bloomstar Rainbow con lamina/14vo.png',1);
call LotusProject.pasoIn(15,'Hacer y hacer! 15','img/Armado/Bloomstar Rainbow con lamina/15vo.png',1);
call LotusProject.pasoIn(16,'Hacer y hacer! 16','img/Armado/Bloomstar Rainbow con lamina/16vo.png',1);
call LotusProject.pasoIn(17,'Hacer y hacer! 17','img/Armado/Bloomstar Rainbow con lamina/17vo.png',1);
call LotusProject.pasoIn(18,'Hacer y hacer! 18','img/Armado/Bloomstar Rainbow con lamina/18vo.png',1);
call LotusProject.pasoIn(19,'Hacer y hacer! 19','img/Armado/Bloomstar Rainbow con lamina/19vo.png',1);
call LotusProject.pasoIn(20,'Hacer y hacer! 20','img/Armado/Bloomstar Rainbow con lamina/20vo.png',1);
call LotusProject.pasoIn(21,'Hacer y hacer! 21','img/Armado/Bloomstar Rainbow con lamina/21vo.png',1);
call LotusProject.pasoIn(22,'Hacer y hacer! 22','img/Armado/Bloomstar Rainbow con lamina/22vo.png',1);
call LotusProject.pasoIn(23,'Hacer y hacer! 23','img/Armado/Bloomstar Rainbow con lamina/23vo.png',1);
-- call LotusProject.pasoMo(1, 12345, 'rosa amarilla', 'abcd', 12345);
-- call LotusProject.pasoLi();
-- call LotusProject.pasoCo(1);
-- -----------------------------------------------------
-- Procedimientos LotusProject grados
-- -----------------------------------------------------
call LotusProject.gradosIn('40', 'Rosas de 42 a 52 cm', 1);
call LotusProject.gradosIn('50', 'Rosas de 52 a 62 cm', 1);
call LotusProject.gradosIn('60', 'Rosas de 62 a 72 cm', 1);
call LotusProject.gradosIn('70', 'Rosas de 72 a 82 cm', 1);
call LotusProject.gradosIn('80', 'Rosas de 82 a 92 cm', 1);
call LotusProject.gradosIn('90', 'Rosas de 92 a 102 cm', 1);
call LotusProject.gradosIn('Standard', 'Rosas de 42 a 52 cm', 1);
call LotusProject.gradosIn('Fancy', 'Rosas de 42 a 52 cm', 1);
call LotusProject.gradosIn('Select', 'Rosas de 42 a 52 cm', 1);
call LotusProject.gradosIn('Premium', 'Rosas de 42 a 52 cm', 1);
-- call LotusProject.gradosMo(12345, 'rosa', 'amarillo', 1);
-- call LotusProject.gradosLi();
-- call LotusProject.gradosCo(1);
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla linea
-- -----------------------------------------------------
call LotusProject.lineaIn(1, 1);
-- call LotusProject.lineaMo(1, 1, 1);
-- call LotusProject.lineaLi();
-- call LotusProject.lineaCo();
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla cliente
-- -----------------------------------------------------
call LotusProject.ClienteIn('Bloomstar', '1075515', 'Toronto (Canada)', 'img/Cliente/BloomstarLogo.png', 1);
-- call lotusproject.ClienteMo(1, 'rosa amarilla', 'abcd', 1, 1);
-- call LotusProject.clienteLi();
-- call lotusproject.ClienteCo(2);
-- call lotusproject.ClienteEl(2);
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla marcacion
-- -----------------------------------------------------
call LotusProject.marcacionIn('Bloomstar Rainbow 24 tallos', 'img/Cliente/Bloomstar/Bloomstar Rainbow 24 tallos.jpg', 1, 1, 1);
-- call lotusproject.marcacionMo(1, 'rosa amarilla', 'abcd', 1, 1);
-- call lotusproject.marcacionLi();
-- call lotusproject.permisomarcacionCo(3);
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla tipoms
-- -----------------------------------------------------
call LotusProject.tipomsIn('Capuchon', 'Capuchon');
call LotusProject.tipomsIn('UPC', 'UPC');
call LotusProject.tipomsIn('Lamina', 'Lamina');
call LotusProject.tipomsIn('Candado', 'Candado');
call LotusProject.tipomsIn('Flower Food', 'Flower Food');
call LotusProject.tipomsIn('Pick', 'Pick');
-- call LotusProject.tipomsMo(123, 'girasol ', 'verde');
-- call LotusProject.tipomsLi();
-- call LotusProject.tipomsCo(1);
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla materialseco
-- -----------------------------------------------------
-- call LotusProject.materialsecoIn('', 'asdf', 'roja', 1, 1, 1, 1, 1);
-- call lotusproject.materialsecoMo(1, 'rosa', 'abcd', 'verde', 1, 1, 1, 1, 1);
-- call LotusProject.materialsecoLi();
-- call LotusProject.materialsecoCo(2);
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla Parametros
-- -----------------------------------------------------
call LotusProject.parametrosIn('Longitud de solo tallo', 1);
call LotusProject.parametrosIn('Longitud de punta a punta', 1);
call LotusProject.parametrosIn('Nivel de follaje', 1);
call LotusProject.parametrosIn('Tamaño de cabeza', 1);
call LotusProject.parametrosIn('Diametro de cabeza', 1);
call LotusProject.parametrosIn('Grosor de tallo', 1);
call LotusProject.parametrosIn('Numero de puntos', 1);
call LotusProject.parametrosIn('Inflorescencia', 1);
call LotusProject.parametrosIn('Punto de corte', 1);
-- call LotusProject.parametrosMo(123, 'rosita', 1);
-- call LotusProject.parametrosLi();
-- call LotusProject.parametrosCo(1);
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla Preliminar
-- -----------------------------------------------------
call LotusProject.preliminarIn('2018-12-12', 'pendiente', 1);
-- call LotusProject.preliminarMo(12345, '2018-12-12', '1', 1);
-- call LotusProject.preliminarLi();
-- call LotusProject.preliminarCo(1);
-- -----------------------------------------------------
-- Procedimientos LotusProject Tabla Partes
-- -----------------------------------------------------
call LotusProject.partesIn('Flor', 'Lo que no es la follaje ni el follaje');
call LotusProject.partesIn('Tallo', 'Lo que no es la flor ni el follaje');
call LotusProject.partesIn('Follaje', 'Lo que no es la flor ni el tallo');
-- call lotusproject.partesMo(1234, 'rosas', 'verdes');
-- call lotusproject.partesLi();
-- call lotusproject.partesCo(1);
call LotusProject.variedadIn('Rosita Vendela', 1, 21, 'img/Producto/Roses/Rosita Vendela.png', 'Ligth Pink');
call LotusProject.variedadIn('Vendela', 1, 21, 'img/Producto/Roses/Vendela.png', 'White');
-- en prueba
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES (null, '9', '11', null, null, 'Normal: de 4 a 5 petalos sueltos del centro', 'XD');
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES ('1', '1', '11', null, null, 'XD', 'XD');
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES ('1', '4', '11', null, null, 'XD', 'XD');
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES ('1', '5', '11', null, null, 'XD', 'XD');
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES ('1', '6', '11', null, null, 'XD', 'XD');
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES ('2', '1', '11', null, null, 'XD', 'XD');
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES ('2', '4', '11', null, null, 'XD', 'XD');
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES ('2', '5', '11', null, null, 'XD', 'XD');
INSERT INTO LotusProject.asignaparametro (GraID, ParId, MaeId, ProId, VarId, PaProDescripcion, PaProFoto) VALUES ('2', '6', '11', null, null, 'XD', 'XD');
SELECT ap.GraID, g.GraNombre, ap.MaeId, ma.MaeNombre, ap.ParId, pa.ParNombre, ap.PaProDescripcion, ap.PaProFoto
FROM asignaparametro AS ap
INNER JOIN grados AS g ON ap.GraID = g.GraID or ap.GraID = null
INNER JOIN parametros AS pa ON ap.ParId = pa.ParId
INNER JOIN maestro AS ma ON ap.MaeId = ma.MaeId; |
INSERT INTO public.odin_devs(name, email, key, create_time, last_login_time)
VALUES ('test', 'test@ginno.com', 'odin', '1999-01-08 04:05:06', '1999-01-08 04:05:06');
INSERT INTO public.odin_regions(name, description)
VALUES ('vn', 'Viet Nam'),
('cn', 'China');
INSERT INTO public.odin_productions(name, region_id, hw_version, firmware_key, os_latest_version, os_history)
VALUES ('odin', 1, '1.0', 'firmware_key_vn', '2.1.0', '{1.2.0,2.1.0}'),
('odin', 2, '1.0', 'firmware_key_cn', '2.2.0','{1.0.2,1.1.2,2.0.1}');
INSERT INTO public.odin_devices(imei, user_key, production_id, hw_version, update_permission, os_version,init_time)
VALUES ('014869004732113', 'odin', 1, '1.0', 1, '1.0', '1999-01-08 04:05:06');
INSERT INTO public.odin_versions(production_id,type, version, url, release_time, release_dev_id)
VALUES (1,'OS', '1.2.0', 'https://cdnotastaging.xor.support/odin/OS/1.2.0/OS_123456.zip', '1999-01-08 04:05:06', 1),
(2,'OS', '1.0.2', 'https://d19sohnjnsw0y4.cloudfront.net/OS/1.0.2', '1999-01-08 04:05:06', 1),
(2,'OS', '1.1.2', 'odin/OS/20.1.218', '2020-04-22 02:49:48.2591', 1),
(2,'OS', '2.0.1', 'odin/OS/2.1.218', '2020-04-22 08:12:52.094', 1),
(1,'OS', '2.1.0', 'https://cdnotastaging.xor.support/odin/OS/2.1.0/OS_234567.zip', '2020-04-22 10:36:37.079', 1);
|
insert into params(name) VALUES ('last_run_date') on conflict (name) do nothing; |
insert into courses values (crn,cid,cnum,sem,cname);
insert into section values (cid,cnum,sloc,maxsize,overflowsize,0,sem,yr,time,day,prof_id);
select distinct courses.title
from courses;
insert into registration values (sid,crn,sem,yr,' ');
select distinct student.L_name, student.F_name
from student;
select distinct registration.stud_id
from registration, courses, section
where courses.crn=registration.crn
and courses.sect_num=section.sect_num; |
# insert a few rows into your table
INSERT INTO tasks (name, description) VALUES
('katie', 'clean bathroom'),
('nick', 'take out the trash'),
('mike', 'paint the ceiling'),
('john', 'fix the car');
|
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.6.25)
# Database: laravel_pyrocms
# Generation Time: 2016-12-11 00:38:12 +0000
# ************************************************************
/*!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_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 */;
# Dump of table applications
# ------------------------------------------------------------
DROP TABLE IF EXISTS `applications`;
CREATE TABLE `applications` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`reference` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`domain` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`enabled` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_references` (`reference`),
UNIQUE KEY `unique_domains` (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `applications` WRITE;
/*!40000 ALTER TABLE `applications` DISABLE KEYS */;
INSERT INTO `applications` (`id`, `name`, `reference`, `domain`, `enabled`)
VALUES
(1,'Default','default','laravel-pyrocms.dev',1);
/*!40000 ALTER TABLE `applications` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table applications_domains
# ------------------------------------------------------------
DROP TABLE IF EXISTS `applications_domains`;
CREATE TABLE `applications_domains` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`application_id` int(11) NOT NULL,
`domain` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_domains` (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_addons_extensions
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_addons_extensions`;
CREATE TABLE `default_addons_extensions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`namespace` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`installed` tinyint(1) NOT NULL DEFAULT '0',
`enabled` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_extensions` (`namespace`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_addons_extensions` WRITE;
/*!40000 ALTER TABLE `default_addons_extensions` DISABLE KEYS */;
INSERT INTO `default_addons_extensions` (`id`, `namespace`, `installed`, `enabled`)
VALUES
(1,'anomaly.extension.default_authenticator',1,1),
(2,'anomaly.extension.default_page_handler',1,1),
(3,'anomaly.extension.local_storage_adapter',1,1),
(4,'anomaly.extension.page_link_type',1,1),
(5,'anomaly.extension.robots',1,1),
(6,'anomaly.extension.sitemap',1,1),
(7,'anomaly.extension.throttle_security_check',1,1),
(8,'anomaly.extension.url_link_type',1,1),
(9,'anomaly.extension.user_security_check',1,1),
(10,'anomaly.extension.xml_feed_widget',1,1);
/*!40000 ALTER TABLE `default_addons_extensions` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_addons_modules
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_addons_modules`;
CREATE TABLE `default_addons_modules` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`namespace` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`installed` tinyint(1) NOT NULL DEFAULT '0',
`enabled` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_modules` (`namespace`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_addons_modules` WRITE;
/*!40000 ALTER TABLE `default_addons_modules` DISABLE KEYS */;
INSERT INTO `default_addons_modules` (`id`, `namespace`, `installed`, `enabled`)
VALUES
(1,'anomaly.module.addons',1,1),
(2,'anomaly.module.configuration',1,1),
(3,'anomaly.module.dashboard',1,1),
(4,'anomaly.module.files',1,1),
(5,'anomaly.module.navigation',1,1),
(6,'anomaly.module.pages',1,1),
(7,'anomaly.module.posts',1,1),
(8,'anomaly.module.preferences',1,1),
(9,'anomaly.module.redirects',1,1),
(10,'anomaly.module.settings',1,1),
(11,'anomaly.module.users',1,1),
(12,'anomaly.module.variables',1,1);
/*!40000 ALTER TABLE `default_addons_modules` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_configuration_configuration
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_configuration_configuration`;
CREATE TABLE `default_configuration_configuration` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`scope` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_configuration_configuration` WRITE;
/*!40000 ALTER TABLE `default_configuration_configuration` DISABLE KEYS */;
INSERT INTO `default_configuration_configuration` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `scope`, `key`, `value`)
VALUES
(1,1,'2016-12-11 00:36:12',NULL,NULL,NULL,'1','anomaly.extension.xml_feed_widget::url','http://www.pyrocms.com/posts/rss.xml');
/*!40000 ALTER TABLE `default_configuration_configuration` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_dashboard_dashboards
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_dashboard_dashboards`;
CREATE TABLE `default_dashboard_dashboards` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`layout` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_dashboard_dashboards` WRITE;
/*!40000 ALTER TABLE `default_dashboard_dashboards` DISABLE KEYS */;
INSERT INTO `default_dashboard_dashboards` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `slug`, `layout`)
VALUES
(1,1,'2016-12-11 00:36:12',NULL,NULL,NULL,'welcome','24');
/*!40000 ALTER TABLE `default_dashboard_dashboards` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_dashboard_dashboards_allowed_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_dashboard_dashboards_allowed_roles`;
CREATE TABLE `default_dashboard_dashboards_allowed_roles` (
`entry_id` int(11) NOT NULL,
`related_id` int(11) NOT NULL,
`sort_order` int(11) DEFAULT NULL,
PRIMARY KEY (`entry_id`,`related_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_dashboard_dashboards_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_dashboard_dashboards_translations`;
CREATE TABLE `default_dashboard_dashboards_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `dashboard_dashboards_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_dashboard_dashboards_translations` WRITE;
/*!40000 ALTER TABLE `default_dashboard_dashboards_translations` DISABLE KEYS */;
INSERT INTO `default_dashboard_dashboards_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `name`, `description`)
VALUES
(1,1,'2016-12-11 00:36:12',NULL,'2016-12-11 00:36:12',NULL,'en','Welcome','This is the default dashboard for PyroCMS.');
/*!40000 ALTER TABLE `default_dashboard_dashboards_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_dashboard_widgets
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_dashboard_widgets`;
CREATE TABLE `default_dashboard_widgets` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`extension` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`column` int(11) NOT NULL DEFAULT '1',
`dashboard_id` int(11) NOT NULL,
`pinned` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_dashboard_widgets` WRITE;
/*!40000 ALTER TABLE `default_dashboard_widgets` DISABLE KEYS */;
INSERT INTO `default_dashboard_widgets` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `extension`, `column`, `dashboard_id`, `pinned`)
VALUES
(1,1,'2016-12-11 00:36:12',NULL,NULL,NULL,'anomaly.extension.xml_feed_widget',1,1,0);
/*!40000 ALTER TABLE `default_dashboard_widgets` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_dashboard_widgets_allowed_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_dashboard_widgets_allowed_roles`;
CREATE TABLE `default_dashboard_widgets_allowed_roles` (
`entry_id` int(11) NOT NULL,
`related_id` int(11) NOT NULL,
`sort_order` int(11) DEFAULT NULL,
PRIMARY KEY (`entry_id`,`related_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_dashboard_widgets_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_dashboard_widgets_translations`;
CREATE TABLE `default_dashboard_widgets_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `dashboard_widgets_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_dashboard_widgets_translations` WRITE;
/*!40000 ALTER TABLE `default_dashboard_widgets_translations` DISABLE KEYS */;
INSERT INTO `default_dashboard_widgets_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `title`, `description`)
VALUES
(1,1,'2016-12-11 00:36:12',NULL,'2016-12-11 00:36:12',NULL,'en','Recent News','Recent news from http://pyrocms.com/');
/*!40000 ALTER TABLE `default_dashboard_widgets_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_failed_jobs
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_failed_jobs`;
CREATE TABLE `default_failed_jobs` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`connection` text COLLATE utf8_unicode_ci NOT NULL,
`queue` text COLLATE utf8_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_files_disks
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_disks`;
CREATE TABLE `default_files_disks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`adapter` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_files_disks` WRITE;
/*!40000 ALTER TABLE `default_files_disks` DISABLE KEYS */;
INSERT INTO `default_files_disks` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `slug`, `adapter`)
VALUES
(1,1,'2016-12-11 00:36:13',NULL,NULL,NULL,'local','anomaly.extension.local_storage_adapter');
/*!40000 ALTER TABLE `default_files_disks` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_files_disks_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_disks_translations`;
CREATE TABLE `default_files_disks_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `files_disks_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_files_disks_translations` WRITE;
/*!40000 ALTER TABLE `default_files_disks_translations` DISABLE KEYS */;
INSERT INTO `default_files_disks_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `name`, `description`)
VALUES
(1,1,'2016-12-11 00:36:13',NULL,'2016-12-11 00:36:13',NULL,'en','Local','A local (public) storage disk.');
/*!40000 ALTER TABLE `default_files_disks_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_files_documents
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_documents`;
CREATE TABLE `default_files_documents` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_files_documents_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_documents_translations`;
CREATE TABLE `default_files_documents_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `files_documents_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_files_files
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_files`;
CREATE TABLE `default_files_files` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`disk_id` int(11) NOT NULL,
`folder_id` int(11) NOT NULL,
`extension` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`size` int(11) NOT NULL,
`mime_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`entry_id` int(11) DEFAULT NULL,
`entry_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`keywords` text COLLATE utf8_unicode_ci,
`height` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`width` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_files_folders
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_folders`;
CREATE TABLE `default_files_folders` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`disk_id` int(11) NOT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`allowed_types` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_files_folders` WRITE;
/*!40000 ALTER TABLE `default_files_folders` DISABLE KEYS */;
INSERT INTO `default_files_folders` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `disk_id`, `slug`, `allowed_types`)
VALUES
(1,1,'2016-12-11 00:36:13',NULL,NULL,NULL,NULL,1,'images','a:3:{i:0;s:3:\"png\";i:1;s:4:\"jpeg\";i:2;s:3:\"jpg\";}'),
(2,2,'2016-12-11 00:36:13',NULL,NULL,NULL,NULL,1,'documents','a:2:{i:0;s:3:\"pdf\";i:1;s:4:\"docx\";}');
/*!40000 ALTER TABLE `default_files_folders` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_files_folders_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_folders_translations`;
CREATE TABLE `default_files_folders_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `files_folders_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_files_folders_translations` WRITE;
/*!40000 ALTER TABLE `default_files_folders_translations` DISABLE KEYS */;
INSERT INTO `default_files_folders_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `name`, `description`)
VALUES
(1,1,'2016-12-11 00:36:13',NULL,'2016-12-11 00:36:13',NULL,'en','Images','A folder for images.'),
(2,2,'2016-12-11 00:36:14',NULL,'2016-12-11 00:36:14',NULL,'en','Documents','A folder for documents.');
/*!40000 ALTER TABLE `default_files_folders_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_files_images
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_images`;
CREATE TABLE `default_files_images` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_files_images_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_files_images_translations`;
CREATE TABLE `default_files_images_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `files_images_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_jobs
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_jobs`;
CREATE TABLE `default_jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`queue` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8_unicode_ci NOT NULL,
`attempts` tinyint(3) unsigned NOT NULL,
`reserved_at` int(10) unsigned DEFAULT NULL,
`available_at` int(10) unsigned NOT NULL,
`created_at` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `jobs_queue_reserved_at_index` (`queue`,`reserved_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_migrations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_migrations`;
CREATE TABLE `default_migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_migrations` WRITE;
/*!40000 ALTER TABLE `default_migrations` DISABLE KEYS */;
INSERT INTO `default_migrations` (`id`, `migration`, `batch`)
VALUES
(1,'2015_03_15_171404_create_applications_table',1),
(2,'2015_03_15_171506_create_applications_domains_table',1),
(3,'2015_03_15_171506_create_jobs_table',2),
(4,'2015_03_15_171507_create_failed_jobs_table',2),
(5,'2015_03_15_171508_create_sessions_table',2),
(6,'2015_03_15_171620_create_streams_tables',2),
(7,'2015_03_15_171646_create_fields_tables',2),
(8,'2015_03_15_171720_create_assignments_tables',2),
(9,'2015_03_15_171838_create_modules_table',2),
(10,'2015_03_15_171926_create_extensions_table',2),
(11,'2016_08_30_185635_create_notifications_table',2),
(12,'2016_09_02_164448_add_searchable_column_to_streams',2),
(13,'2015_03_25_091755_anomaly.module.configuration__create_configuration_fields',3),
(14,'2015_03_25_091845_anomaly.module.configuration__create_configuration_stream',3),
(15,'2015_11_01_164326_anomaly.module.dashboard__create_dashboard_fields',4),
(16,'2015_11_01_170645_anomaly.module.dashboard__create_dashboards_stream',4),
(17,'2015_11_01_170650_anomaly.module.dashboard__create_widgets_stream',4),
(18,'2015_03_05_021725_anomaly.module.files__create_files_fields',5),
(19,'2015_03_05_022227_anomaly.module.files__create_disks_stream',5),
(20,'2015_06_09_031343_anomaly.module.files__create_folders_stream',5),
(21,'2015_06_09_031351_anomaly.module.files__create_files_stream',5),
(22,'2016_08_29_151020_anomaly.module.files__remove_required_from_entry_assignment',5),
(23,'2016_09_02_175659_anomaly.module.files__make_files_searchable',5),
(24,'2016_10_05_221741_anomaly.module.files__make_disks_sortable',5),
(25,'2015_05_21_061832_anomaly.module.navigation__create_navigation_fields',6),
(26,'2015_05_21_062115_anomaly.module.navigation__create_menus_stream',6),
(27,'2015_05_21_064952_anomaly.module.navigation__create_links_stream',6),
(28,'2015_03_20_171947_anomaly.module.pages__create_pages_fields',7),
(29,'2015_03_20_171955_anomaly.module.pages__create_pages_stream',7),
(30,'2015_04_22_150211_anomaly.module.pages__create_types_stream',7),
(31,'2016_09_02_175135_anomaly.module.pages__make_pages_searchable',7),
(32,'2015_03_20_184103_anomaly.module.posts__create_posts_fields',8),
(33,'2015_03_20_184141_anomaly.module.posts__create_categories_stream',8),
(34,'2015_03_20_184148_anomaly.module.posts__create_posts_stream',8),
(35,'2015_05_16_050818_anomaly.module.posts__create_types_stream',8),
(36,'2016_09_02_175531_anomaly.module.posts__make_posts_searchable',8),
(37,'2015_02_27_101227_anomaly.module.preferences__create_preferences_fields',9),
(38,'2015_02_27_101300_anomaly.module.preferences__create_preferences_streams',9),
(39,'2016_11_16_151654_anomaly.module.preferences__update_user_related_config',9),
(40,'2015_03_21_153325_anomaly.module.redirects__create_redirects_fields',10),
(41,'2015_03_21_153326_anomaly.module.redirects__create_redirects_stream',10),
(42,'2015_02_27_101410_anomaly.module.settings__create_settings_fields',11),
(43,'2015_02_27_101510_anomaly.module.settings__create_settings_stream',11),
(44,'2015_02_27_101816_anomaly.module.users__create_users_fields',12),
(45,'2015_02_27_101851_anomaly.module.users__create_users_stream',12),
(46,'2015_02_27_101940_anomaly.module.users__create_roles_stream',12),
(47,'2016_09_02_175848_anomaly.module.users__make_users_searchable',12),
(48,'2015_06_02_170526_anomaly.extension.page_link_type__create_page_link_type_fields',13),
(49,'2015_06_02_170542_anomaly.extension.page_link_type__create_page_links_stream',13),
(50,'2015_05_24_201105_anomaly.extension.url_link_type__create_url_link_type_fields',14),
(51,'2015_05_24_201134_anomaly.extension.url_link_type__create_links_stream',14);
/*!40000 ALTER TABLE `default_migrations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_navigation_links
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_navigation_links`;
CREATE TABLE `default_navigation_links` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`menu_id` int(11) NOT NULL,
`type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`entry_id` int(11) NOT NULL,
`entry_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`target` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '_self',
`class` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_navigation_links` WRITE;
/*!40000 ALTER TABLE `default_navigation_links` DISABLE KEYS */;
INSERT INTO `default_navigation_links` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `menu_id`, `type`, `entry_id`, `entry_type`, `target`, `class`, `parent_id`)
VALUES
(1,1,'2016-12-11 00:36:14',NULL,NULL,NULL,NULL,1,'anomaly.extension.url_link_type',1,'Anomaly\\UrlLinkTypeExtension\\UrlLinkTypeModel','_blank',NULL,NULL),
(2,2,'2016-12-11 00:36:15',NULL,NULL,NULL,NULL,1,'anomaly.extension.url_link_type',2,'Anomaly\\UrlLinkTypeExtension\\UrlLinkTypeModel','_blank',NULL,NULL);
/*!40000 ALTER TABLE `default_navigation_links` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_navigation_links_allowed_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_navigation_links_allowed_roles`;
CREATE TABLE `default_navigation_links_allowed_roles` (
`entry_id` int(11) NOT NULL,
`related_id` int(11) NOT NULL,
`sort_order` int(11) DEFAULT NULL,
PRIMARY KEY (`entry_id`,`related_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_navigation_menus
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_navigation_menus`;
CREATE TABLE `default_navigation_menus` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_navigation_menus` WRITE;
/*!40000 ALTER TABLE `default_navigation_menus` DISABLE KEYS */;
INSERT INTO `default_navigation_menus` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `slug`)
VALUES
(1,1,'2016-12-11 00:36:14',NULL,NULL,NULL,NULL,'footer');
/*!40000 ALTER TABLE `default_navigation_menus` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_navigation_menus_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_navigation_menus_translations`;
CREATE TABLE `default_navigation_menus_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `navigation_menus_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_navigation_menus_translations` WRITE;
/*!40000 ALTER TABLE `default_navigation_menus_translations` DISABLE KEYS */;
INSERT INTO `default_navigation_menus_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `name`, `description`)
VALUES
(1,1,'2016-12-11 00:36:14',NULL,'2016-12-11 00:36:14',NULL,'en','Footer','This is the footer.');
/*!40000 ALTER TABLE `default_navigation_menus_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_notifications
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_notifications`;
CREATE TABLE `default_notifications` (
`id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`notifiable_id` int(10) unsigned NOT NULL,
`notifiable_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`data` text COLLATE utf8_unicode_ci NOT NULL,
`read_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `notifications_notifiable_id_notifiable_type_index` (`notifiable_id`,`notifiable_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_page_link_type_pages
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_page_link_type_pages`;
CREATE TABLE `default_page_link_type_pages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`page_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_page_link_type_pages_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_page_link_type_pages_translations`;
CREATE TABLE `default_page_link_type_pages_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `page_link_type_pages_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_pages_default_pages
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_pages_default_pages`;
CREATE TABLE `default_pages_default_pages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_pages_default_pages` WRITE;
/*!40000 ALTER TABLE `default_pages_default_pages` DISABLE KEYS */;
INSERT INTO `default_pages_default_pages` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`)
VALUES
(1,1,'2016-12-11 00:36:16',NULL,NULL,NULL,NULL),
(2,2,'2016-12-11 00:36:16',NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `default_pages_default_pages` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_pages_default_pages_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_pages_default_pages_translations`;
CREATE TABLE `default_pages_default_pages_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`content` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `pages_default_pages_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_pages_default_pages_translations` WRITE;
/*!40000 ALTER TABLE `default_pages_default_pages_translations` DISABLE KEYS */;
INSERT INTO `default_pages_default_pages_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `content`)
VALUES
(1,1,'2016-12-11 00:36:16',NULL,'2016-12-11 00:36:16',NULL,'en','<p>Welcome to PyroCMS!</p>'),
(2,2,'2016-12-11 00:36:16',NULL,'2016-12-11 00:36:16',NULL,'en','<p>Drop us a line! We\'d love to hear from you!</p><p><br></p>\n<p>{{ form(\'contact\').to(\'example@domain.com\')|raw }}</p>');
/*!40000 ALTER TABLE `default_pages_default_pages_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_pages_pages
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_pages_pages`;
CREATE TABLE `default_pages_pages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`str_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`path` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`type_id` int(11) NOT NULL,
`entry_id` int(11) DEFAULT NULL,
`entry_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
`visible` tinyint(1) DEFAULT '1',
`enabled` tinyint(1) DEFAULT '1',
`exact` tinyint(1) DEFAULT '1',
`home` tinyint(1) DEFAULT '0',
`theme_layout` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'theme::layouts/default.twig',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_pages_pages` WRITE;
/*!40000 ALTER TABLE `default_pages_pages` DISABLE KEYS */;
INSERT INTO `default_pages_pages` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `str_id`, `slug`, `path`, `type_id`, `entry_id`, `entry_type`, `parent_id`, `visible`, `enabled`, `exact`, `home`, `theme_layout`)
VALUES
(1,1,'2016-12-11 00:36:16',NULL,NULL,NULL,NULL,'X0D9Ldb5BJ7GxPD4kC0zoAks','welcome','/',1,1,'Anomaly\\Streams\\Platform\\Model\\Pages\\PagesDefaultPagesEntryModel',NULL,1,1,1,1,'theme::layouts/default.twig'),
(2,2,'2016-12-11 00:36:16',NULL,NULL,NULL,NULL,'DnvB4EUESRgFQ7iZ9arH7kwC','contact','/contact',1,2,'Anomaly\\Streams\\Platform\\Model\\Pages\\PagesDefaultPagesEntryModel',NULL,1,1,1,0,'theme::layouts/default.twig');
/*!40000 ALTER TABLE `default_pages_pages` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_pages_pages_allowed_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_pages_pages_allowed_roles`;
CREATE TABLE `default_pages_pages_allowed_roles` (
`entry_id` int(11) NOT NULL,
`related_id` int(11) NOT NULL,
`sort_order` int(11) DEFAULT NULL,
PRIMARY KEY (`entry_id`,`related_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_pages_pages_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_pages_pages_translations`;
CREATE TABLE `default_pages_pages_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`meta_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`meta_description` text COLLATE utf8_unicode_ci,
`meta_keywords` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `pages_pages_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_pages_pages_translations` WRITE;
/*!40000 ALTER TABLE `default_pages_pages_translations` DISABLE KEYS */;
INSERT INTO `default_pages_pages_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `title`, `meta_title`, `meta_description`, `meta_keywords`)
VALUES
(1,1,'2016-12-11 00:36:16',NULL,'2016-12-11 00:36:16',NULL,'en','Welcome',NULL,NULL,NULL),
(2,2,'2016-12-11 00:36:16',NULL,'2016-12-11 00:36:16',NULL,'en','Contact',NULL,NULL,NULL);
/*!40000 ALTER TABLE `default_pages_pages_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_pages_types
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_pages_types`;
CREATE TABLE `default_pages_types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`theme_layout` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'theme::layouts/default.twig',
`layout` text COLLATE utf8_unicode_ci NOT NULL,
`handler` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'anomaly.extension.default_page_handler',
PRIMARY KEY (`id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_pages_types` WRITE;
/*!40000 ALTER TABLE `default_pages_types` DISABLE KEYS */;
INSERT INTO `default_pages_types` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `slug`, `theme_layout`, `layout`, `handler`)
VALUES
(1,1,'2016-12-11 00:36:15',NULL,NULL,NULL,NULL,'default','theme::layouts/default.twig','<h1>{{ page.title }}</h1>\n\n{{ page.content.render|raw }}','anomaly.extension.default_page_handler');
/*!40000 ALTER TABLE `default_pages_types` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_pages_types_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_pages_types_translations`;
CREATE TABLE `default_pages_types_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `pages_types_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_pages_types_translations` WRITE;
/*!40000 ALTER TABLE `default_pages_types_translations` DISABLE KEYS */;
INSERT INTO `default_pages_types_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `name`, `description`)
VALUES
(1,1,'2016-12-11 00:36:16',NULL,'2016-12-11 00:36:16',NULL,'en','Default','A simple page type.');
/*!40000 ALTER TABLE `default_pages_types_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_posts_categories
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_posts_categories`;
CREATE TABLE `default_posts_categories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_posts_categories` WRITE;
/*!40000 ALTER TABLE `default_posts_categories` DISABLE KEYS */;
INSERT INTO `default_posts_categories` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `slug`)
VALUES
(1,1,'2016-12-11 00:36:18',NULL,NULL,NULL,NULL,'news');
/*!40000 ALTER TABLE `default_posts_categories` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_posts_categories_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_posts_categories_translations`;
CREATE TABLE `default_posts_categories_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `posts_categories_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_posts_categories_translations` WRITE;
/*!40000 ALTER TABLE `default_posts_categories_translations` DISABLE KEYS */;
INSERT INTO `default_posts_categories_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `name`, `description`)
VALUES
(1,1,'2016-12-11 00:36:18',NULL,'2016-12-11 00:36:18',NULL,'en','News','Company news and updates.');
/*!40000 ALTER TABLE `default_posts_categories_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_posts_default_posts
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_posts_default_posts`;
CREATE TABLE `default_posts_default_posts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`content` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_posts_default_posts` WRITE;
/*!40000 ALTER TABLE `default_posts_default_posts` DISABLE KEYS */;
INSERT INTO `default_posts_default_posts` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `content`)
VALUES
(1,1,'2016-12-11 00:36:18',NULL,NULL,NULL,NULL,'<p>Welcome to PyroCMS!</p>');
/*!40000 ALTER TABLE `default_posts_default_posts` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_posts_default_posts_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_posts_default_posts_translations`;
CREATE TABLE `default_posts_default_posts_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `posts_default_posts_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_posts_default_posts_translations` WRITE;
/*!40000 ALTER TABLE `default_posts_default_posts_translations` DISABLE KEYS */;
INSERT INTO `default_posts_default_posts_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`)
VALUES
(1,1,'2016-12-11 00:36:18',NULL,'2016-12-11 00:36:18',NULL,'en');
/*!40000 ALTER TABLE `default_posts_default_posts_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_posts_posts
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_posts_posts`;
CREATE TABLE `default_posts_posts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`str_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`type_id` int(11) NOT NULL,
`publish_at` datetime NOT NULL,
`author_id` int(11) NOT NULL,
`entry_id` int(11) NOT NULL,
`entry_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`category_id` int(11) DEFAULT NULL,
`featured` tinyint(1) DEFAULT '0',
`enabled` tinyint(1) DEFAULT '0',
`tags` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `3205137b58c7608b77cb961242373242` (`str_id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_posts_posts` WRITE;
/*!40000 ALTER TABLE `default_posts_posts` DISABLE KEYS */;
INSERT INTO `default_posts_posts` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `str_id`, `slug`, `type_id`, `publish_at`, `author_id`, `entry_id`, `entry_type`, `category_id`, `featured`, `enabled`, `tags`)
VALUES
(1,1,'2016-12-11 00:36:18',NULL,NULL,NULL,NULL,'tA3XxPja5Gn48zrR','welcome-to-pyrocms',1,'2016-12-11 00:36:18',1,1,'Anomaly\\Streams\\Platform\\Model\\Posts\\PostsDefaultPostsEntryModel',1,0,1,NULL);
/*!40000 ALTER TABLE `default_posts_posts` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_posts_posts_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_posts_posts_translations`;
CREATE TABLE `default_posts_posts_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`summary` text COLLATE utf8_unicode_ci,
`meta_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`meta_description` text COLLATE utf8_unicode_ci,
`meta_keywords` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `posts_posts_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_posts_posts_translations` WRITE;
/*!40000 ALTER TABLE `default_posts_posts_translations` DISABLE KEYS */;
INSERT INTO `default_posts_posts_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `title`, `summary`, `meta_title`, `meta_description`, `meta_keywords`)
VALUES
(1,1,'2016-12-11 00:36:18',NULL,'2016-12-11 00:36:18',NULL,'en','Welcome to PyroCMS!','This is an example post to demonstrate the posts module.',NULL,NULL,NULL);
/*!40000 ALTER TABLE `default_posts_posts_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_posts_types
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_posts_types`;
CREATE TABLE `default_posts_types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`layout` text COLLATE utf8_unicode_ci NOT NULL,
`theme_layout` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_posts_types` WRITE;
/*!40000 ALTER TABLE `default_posts_types` DISABLE KEYS */;
INSERT INTO `default_posts_types` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `slug`, `layout`, `theme_layout`)
VALUES
(1,1,'2016-12-11 00:36:17',NULL,NULL,NULL,NULL,'default','{{ post.content.render|raw }}','theme::layouts/default.twig');
/*!40000 ALTER TABLE `default_posts_types` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_posts_types_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_posts_types_translations`;
CREATE TABLE `default_posts_types_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `posts_types_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_posts_types_translations` WRITE;
/*!40000 ALTER TABLE `default_posts_types_translations` DISABLE KEYS */;
INSERT INTO `default_posts_types_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `name`, `description`)
VALUES
(1,1,'2016-12-11 00:36:17',NULL,'2016-12-11 00:36:17',NULL,'en','Default','A simple post type.');
/*!40000 ALTER TABLE `default_posts_types_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_preferences_preferences
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_preferences_preferences`;
CREATE TABLE `default_preferences_preferences` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_redirects_redirects
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_redirects_redirects`;
CREATE TABLE `default_redirects_redirects` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`from` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`to` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '301',
`secure` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `a0622c0146c143edaf2eef1cc1aa7286` (`from`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_sessions
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_sessions`;
CREATE TABLE `default_sessions` (
`id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user_id` int(11) DEFAULT NULL,
`ip_address` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`user_agent` text COLLATE utf8_unicode_ci,
`payload` text COLLATE utf8_unicode_ci NOT NULL,
`last_activity` int(11) NOT NULL,
UNIQUE KEY `sessions_id_unique` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table default_settings_settings
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_settings_settings`;
CREATE TABLE `default_settings_settings` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `0ebe1a6e88a95d473b0d03f8ba344523` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_settings_settings` WRITE;
/*!40000 ALTER TABLE `default_settings_settings` DISABLE KEYS */;
INSERT INTO `default_settings_settings` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `key`, `value`)
VALUES
(1,1,'2016-12-11 00:36:20',NULL,NULL,NULL,'streams::timezone','UTC'),
(2,2,'2016-12-11 00:36:20',NULL,NULL,NULL,'streams::default_locale','en');
/*!40000 ALTER TABLE `default_settings_settings` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_streams_assignments
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_streams_assignments`;
CREATE TABLE `default_streams_assignments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) NOT NULL,
`stream_id` int(11) NOT NULL,
`field_id` int(11) NOT NULL,
`config` text COLLATE utf8_unicode_ci NOT NULL,
`unique` tinyint(1) NOT NULL DEFAULT '0',
`required` tinyint(1) NOT NULL DEFAULT '0',
`translatable` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_assignments` (`stream_id`,`field_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_streams_assignments` WRITE;
/*!40000 ALTER TABLE `default_streams_assignments` DISABLE KEYS */;
INSERT INTO `default_streams_assignments` (`id`, `sort_order`, `stream_id`, `field_id`, `config`, `unique`, `required`, `translatable`)
VALUES
(1,1,1,1,'a:0:{}',0,1,0),
(2,2,1,2,'a:0:{}',0,1,0),
(3,3,1,3,'a:0:{}',0,0,0),
(4,4,2,4,'a:0:{}',0,1,1),
(5,5,2,5,'a:0:{}',1,1,0),
(6,6,2,6,'a:0:{}',0,0,1),
(7,7,2,7,'a:0:{}',0,1,0),
(8,8,2,13,'a:0:{}',0,0,0),
(9,9,3,8,'a:0:{}',0,1,1),
(10,10,3,6,'a:0:{}',0,0,1),
(11,11,3,9,'a:0:{}',0,1,0),
(12,12,3,10,'a:0:{}',0,1,0),
(13,13,3,12,'a:0:{}',0,1,0),
(14,14,3,13,'a:0:{}',0,0,0),
(15,15,3,11,'a:0:{}',0,0,0),
(16,16,4,14,'a:0:{}',1,1,1),
(17,17,4,15,'a:0:{}',1,1,0),
(18,18,4,16,'a:0:{}',0,1,0),
(19,19,4,20,'a:0:{}',0,0,1),
(20,20,5,18,'a:0:{}',0,1,0),
(21,21,5,14,'a:1:{s:3:\"max\";i:50;}',0,1,1),
(22,22,5,15,'a:1:{s:3:\"max\";i:50;}',1,1,0),
(23,23,5,20,'a:0:{}',0,0,1),
(24,24,5,21,'a:0:{}',0,0,0),
(25,25,6,14,'a:0:{}',0,1,0),
(26,26,6,18,'a:0:{}',0,1,0),
(27,27,6,17,'a:0:{}',0,1,0),
(28,28,6,23,'a:0:{}',0,1,0),
(29,29,6,27,'a:0:{}',0,1,0),
(30,30,6,26,'a:0:{}',0,1,0),
(31,31,6,19,'a:0:{}',0,0,0),
(32,32,6,22,'a:0:{}',0,0,0),
(33,33,6,25,'a:0:{}',0,0,0),
(34,34,6,24,'a:0:{}',0,0,0),
(35,35,7,28,'a:0:{}',1,1,1),
(36,36,7,32,'a:0:{}',1,1,0),
(37,37,7,30,'a:0:{}',0,0,1),
(38,38,8,33,'a:0:{}',0,1,0),
(39,39,8,36,'a:0:{}',0,1,0),
(40,40,8,31,'a:0:{}',0,1,0),
(41,41,8,37,'a:0:{}',0,1,0),
(42,42,8,29,'a:0:{}',0,0,0),
(43,43,8,34,'a:0:{}',0,0,0),
(44,44,8,35,'a:0:{}',0,0,0),
(45,45,9,38,'a:0:{}',0,1,0),
(46,46,9,39,'a:0:{}',0,1,1),
(47,47,9,40,'a:0:{}',0,1,0),
(48,48,9,42,'a:0:{}',0,1,0),
(49,49,9,52,'a:0:{}',0,1,0),
(50,50,9,56,'a:0:{}',0,0,0),
(51,51,9,50,'a:0:{}',0,0,0),
(52,52,9,54,'a:0:{}',0,0,0),
(53,53,9,43,'a:0:{}',0,0,0),
(54,54,9,55,'a:0:{}',0,0,0),
(55,55,9,44,'a:0:{}',0,0,0),
(56,56,9,45,'a:0:{}',0,0,1),
(57,57,9,46,'a:0:{}',0,0,1),
(58,58,9,47,'a:0:{}',0,0,1),
(59,59,9,51,'a:0:{}',0,0,0),
(60,60,9,49,'a:0:{}',0,0,0),
(61,61,10,57,'a:1:{s:3:\"max\";i:50;}',1,1,1),
(62,62,10,40,'a:3:{s:7:\"slugify\";s:4:\"name\";s:4:\"type\";s:1:\"_\";s:3:\"max\";i:50;}',1,1,0),
(63,63,10,58,'a:0:{}',0,0,1),
(64,64,10,51,'a:0:{}',0,1,0),
(65,65,10,48,'a:0:{}',0,1,0),
(66,66,10,53,'a:0:{}',0,1,0),
(67,67,11,60,'a:0:{}',1,1,1),
(68,68,11,62,'a:1:{s:7:\"slugify\";s:4:\"name\";}',1,1,0),
(69,69,11,67,'a:0:{}',0,0,1),
(70,70,12,59,'a:0:{}',1,1,0),
(71,71,12,61,'a:0:{}',0,1,1),
(72,72,12,66,'a:0:{}',0,0,1),
(73,73,12,62,'a:0:{}',1,1,0),
(74,74,12,64,'a:0:{}',0,1,0),
(75,75,12,68,'a:0:{}',0,1,0),
(76,76,12,70,'a:0:{}',0,1,0),
(77,77,12,69,'a:0:{}',0,1,0),
(78,78,12,75,'a:0:{}',0,0,1),
(79,79,12,76,'a:0:{}',0,0,1),
(80,80,12,77,'a:0:{}',0,0,1),
(81,81,12,72,'a:0:{}',0,0,0),
(82,82,12,74,'a:0:{}',0,0,0),
(83,83,12,73,'a:0:{}',0,0,0),
(84,84,12,65,'a:0:{}',0,0,0),
(85,85,13,60,'a:1:{s:3:\"max\";i:50;}',1,1,1),
(86,86,13,62,'a:3:{s:7:\"slugify\";s:4:\"name\";s:4:\"type\";s:1:\"_\";s:3:\"max\";i:50;}',1,1,0),
(87,87,13,71,'a:0:{}',0,1,0),
(88,88,13,79,'a:0:{}',0,1,0),
(89,89,13,67,'a:0:{}',0,0,1),
(90,90,14,80,'a:0:{}',0,1,0),
(91,91,14,81,'a:0:{}',0,1,0),
(92,92,14,82,'a:0:{}',0,0,0),
(93,93,15,83,'a:0:{}',1,1,0),
(94,94,15,84,'a:0:{}',0,1,0),
(95,95,15,85,'a:0:{}',0,1,0),
(96,96,15,86,'a:0:{}',0,0,0),
(97,97,16,87,'a:0:{}',1,1,0),
(98,98,16,88,'a:0:{}',0,0,0),
(99,99,17,89,'a:0:{}',1,1,0),
(100,100,17,90,'a:0:{}',1,1,0),
(101,101,17,91,'a:0:{}',0,1,0),
(102,102,17,109,'a:0:{}',0,1,0),
(103,103,17,97,'a:0:{}',0,1,0),
(104,104,17,98,'a:0:{}',0,0,0),
(105,105,17,99,'a:0:{}',0,0,0),
(106,106,17,106,'a:0:{}',0,0,0),
(107,107,17,107,'a:0:{}',0,0,0),
(108,108,17,96,'a:0:{}',0,0,0),
(109,109,17,94,'a:0:{}',0,0,0),
(110,110,17,92,'a:0:{}',0,0,0),
(111,111,17,104,'a:0:{}',0,0,0),
(112,112,17,102,'a:0:{}',0,0,0),
(113,113,17,95,'a:0:{}',0,0,0),
(114,114,17,93,'a:0:{}',0,0,0),
(115,115,18,100,'a:0:{}',0,1,1),
(116,116,18,108,'a:0:{}',1,1,0),
(117,117,18,101,'a:0:{}',0,0,1),
(118,118,18,96,'a:0:{}',0,0,0),
(119,119,19,110,'a:0:{}',0,0,1),
(120,120,19,111,'a:0:{}',0,1,0),
(121,121,19,112,'a:0:{}',0,0,1),
(122,122,20,113,'a:0:{}',0,1,1),
(123,123,20,114,'a:0:{}',0,1,0),
(124,124,20,115,'a:0:{}',0,0,1),
(125,125,23,41,'a:0:{}',0,0,1),
(126,126,24,63,'a:0:{}',0,0,0);
/*!40000 ALTER TABLE `default_streams_assignments` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_streams_assignments_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_streams_assignments_translations`;
CREATE TABLE `default_streams_assignments_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`assignment_id` int(11) NOT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`warning` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`placeholder` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`instructions` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `streams_assignments_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_streams_assignments_translations` WRITE;
/*!40000 ALTER TABLE `default_streams_assignments_translations` DISABLE KEYS */;
INSERT INTO `default_streams_assignments_translations` (`id`, `assignment_id`, `locale`, `label`, `warning`, `placeholder`, `instructions`)
VALUES
(1,1,'en','anomaly.module.configuration::field.scope.label.configuration','anomaly.module.configuration::field.scope.warning.configuration','anomaly.module.configuration::field.scope.placeholder.configuration','anomaly.module.configuration::field.scope.instructions.configuration'),
(2,2,'en','anomaly.module.configuration::field.key.label.configuration','anomaly.module.configuration::field.key.warning.configuration','anomaly.module.configuration::field.key.placeholder.configuration','anomaly.module.configuration::field.key.instructions.configuration'),
(3,3,'en','anomaly.module.configuration::field.value.label.configuration','anomaly.module.configuration::field.value.warning.configuration','anomaly.module.configuration::field.value.placeholder.configuration','anomaly.module.configuration::field.value.instructions.configuration'),
(4,4,'en','anomaly.module.dashboard::field.name.label.dashboards','anomaly.module.dashboard::field.name.warning.dashboards','anomaly.module.dashboard::field.name.placeholder.dashboards','anomaly.module.dashboard::field.name.instructions.dashboards'),
(5,5,'en','anomaly.module.dashboard::field.slug.label.dashboards','anomaly.module.dashboard::field.slug.warning.dashboards','anomaly.module.dashboard::field.slug.placeholder.dashboards','anomaly.module.dashboard::field.slug.instructions.dashboards'),
(6,6,'en','anomaly.module.dashboard::field.description.label.dashboards','anomaly.module.dashboard::field.description.warning.dashboards','anomaly.module.dashboard::field.description.placeholder.dashboards','anomaly.module.dashboard::field.description.instructions.dashboards'),
(7,7,'en','anomaly.module.dashboard::field.layout.label.dashboards','anomaly.module.dashboard::field.layout.warning.dashboards','anomaly.module.dashboard::field.layout.placeholder.dashboards','anomaly.module.dashboard::field.layout.instructions.dashboards'),
(8,8,'en','anomaly.module.dashboard::field.allowed_roles.label.dashboards','anomaly.module.dashboard::field.allowed_roles.warning.dashboards','anomaly.module.dashboard::field.allowed_roles.placeholder.dashboards','anomaly.module.dashboard::field.allowed_roles.instructions.dashboards'),
(9,9,'en','anomaly.module.dashboard::field.title.label.widgets','anomaly.module.dashboard::field.title.warning.widgets','anomaly.module.dashboard::field.title.placeholder.widgets','anomaly.module.dashboard::field.title.instructions.widgets'),
(10,10,'en','anomaly.module.dashboard::field.description.label.widgets','anomaly.module.dashboard::field.description.warning.widgets','anomaly.module.dashboard::field.description.placeholder.widgets','anomaly.module.dashboard::field.description.instructions.widgets'),
(11,11,'en','anomaly.module.dashboard::field.extension.label.widgets','anomaly.module.dashboard::field.extension.warning.widgets','anomaly.module.dashboard::field.extension.placeholder.widgets','anomaly.module.dashboard::field.extension.instructions.widgets'),
(12,12,'en','anomaly.module.dashboard::field.column.label.widgets','anomaly.module.dashboard::field.column.warning.widgets','anomaly.module.dashboard::field.column.placeholder.widgets','anomaly.module.dashboard::field.column.instructions.widgets'),
(13,13,'en','anomaly.module.dashboard::field.dashboard.label.widgets','anomaly.module.dashboard::field.dashboard.warning.widgets','anomaly.module.dashboard::field.dashboard.placeholder.widgets','anomaly.module.dashboard::field.dashboard.instructions.widgets'),
(14,14,'en','anomaly.module.dashboard::field.allowed_roles.label.widgets','anomaly.module.dashboard::field.allowed_roles.warning.widgets','anomaly.module.dashboard::field.allowed_roles.placeholder.widgets','anomaly.module.dashboard::field.allowed_roles.instructions.widgets'),
(15,15,'en','anomaly.module.dashboard::field.pinned.label.widgets','anomaly.module.dashboard::field.pinned.warning.widgets','anomaly.module.dashboard::field.pinned.placeholder.widgets','anomaly.module.dashboard::field.pinned.instructions.widgets'),
(16,16,'en','anomaly.module.files::field.name.label.disks','anomaly.module.files::field.name.warning.disks','anomaly.module.files::field.name.placeholder.disks','anomaly.module.files::field.name.instructions.disks'),
(17,17,'en','anomaly.module.files::field.slug.label.disks','anomaly.module.files::field.slug.warning.disks','anomaly.module.files::field.slug.placeholder.disks','anomaly.module.files::field.slug.instructions.disks'),
(18,18,'en','anomaly.module.files::field.adapter.label.disks','anomaly.module.files::field.adapter.warning.disks','anomaly.module.files::field.adapter.placeholder.disks','anomaly.module.files::field.adapter.instructions.disks'),
(19,19,'en','anomaly.module.files::field.description.label.disks','anomaly.module.files::field.description.warning.disks','anomaly.module.files::field.description.placeholder.disks','anomaly.module.files::field.description.instructions.disks'),
(20,20,'en','anomaly.module.files::field.disk.label.folders','anomaly.module.files::field.disk.warning.folders','anomaly.module.files::field.disk.placeholder.folders','anomaly.module.files::field.disk.instructions.folders'),
(21,21,'en','anomaly.module.files::field.name.label.folders','anomaly.module.files::field.name.warning.folders','anomaly.module.files::field.name.placeholder.folders','anomaly.module.files::field.name.instructions.folders'),
(22,22,'en','anomaly.module.files::field.slug.label.folders','anomaly.module.files::field.slug.warning.folders','anomaly.module.files::field.slug.placeholder.folders','anomaly.module.files::field.slug.instructions.folders'),
(23,23,'en','anomaly.module.files::field.description.label.folders','anomaly.module.files::field.description.warning.folders','anomaly.module.files::field.description.placeholder.folders','anomaly.module.files::field.description.instructions.folders'),
(24,24,'en','anomaly.module.files::field.allowed_types.label.folders','anomaly.module.files::field.allowed_types.warning.folders','anomaly.module.files::field.allowed_types.placeholder.folders','anomaly.module.files::field.allowed_types.instructions.folders'),
(25,25,'en','anomaly.module.files::field.name.label.files','anomaly.module.files::field.name.warning.files','anomaly.module.files::field.name.placeholder.files','anomaly.module.files::field.name.instructions.files'),
(26,26,'en','anomaly.module.files::field.disk.label.files','anomaly.module.files::field.disk.warning.files','anomaly.module.files::field.disk.placeholder.files','anomaly.module.files::field.disk.instructions.files'),
(27,27,'en','anomaly.module.files::field.folder.label.files','anomaly.module.files::field.folder.warning.files','anomaly.module.files::field.folder.placeholder.files','anomaly.module.files::field.folder.instructions.files'),
(28,28,'en','anomaly.module.files::field.extension.label.files','anomaly.module.files::field.extension.warning.files','anomaly.module.files::field.extension.placeholder.files','anomaly.module.files::field.extension.instructions.files'),
(29,29,'en','anomaly.module.files::field.size.label.files','anomaly.module.files::field.size.warning.files','anomaly.module.files::field.size.placeholder.files','anomaly.module.files::field.size.instructions.files'),
(30,30,'en','anomaly.module.files::field.mime_type.label.files','anomaly.module.files::field.mime_type.warning.files','anomaly.module.files::field.mime_type.placeholder.files','anomaly.module.files::field.mime_type.instructions.files'),
(31,31,'en','anomaly.module.files::field.entry.label.files','anomaly.module.files::field.entry.warning.files','anomaly.module.files::field.entry.placeholder.files','anomaly.module.files::field.entry.instructions.files'),
(32,32,'en','anomaly.module.files::field.keywords.label.files','anomaly.module.files::field.keywords.warning.files','anomaly.module.files::field.keywords.placeholder.files','anomaly.module.files::field.keywords.instructions.files'),
(33,33,'en','anomaly.module.files::field.height.label.files','anomaly.module.files::field.height.warning.files','anomaly.module.files::field.height.placeholder.files','anomaly.module.files::field.height.instructions.files'),
(34,34,'en','anomaly.module.files::field.width.label.files','anomaly.module.files::field.width.warning.files','anomaly.module.files::field.width.placeholder.files','anomaly.module.files::field.width.instructions.files'),
(35,35,'en','anomaly.module.navigation::field.name.label.menus','anomaly.module.navigation::field.name.warning.menus','anomaly.module.navigation::field.name.placeholder.menus','anomaly.module.navigation::field.name.instructions.menus'),
(36,36,'en','anomaly.module.navigation::field.slug.label.menus','anomaly.module.navigation::field.slug.warning.menus','anomaly.module.navigation::field.slug.placeholder.menus','anomaly.module.navigation::field.slug.instructions.menus'),
(37,37,'en','anomaly.module.navigation::field.description.label.menus','anomaly.module.navigation::field.description.warning.menus','anomaly.module.navigation::field.description.placeholder.menus','anomaly.module.navigation::field.description.instructions.menus'),
(38,38,'en','anomaly.module.navigation::field.menu.label.links','anomaly.module.navigation::field.menu.warning.links','anomaly.module.navigation::field.menu.placeholder.links','anomaly.module.navigation::field.menu.instructions.links'),
(39,39,'en','anomaly.module.navigation::field.type.label.links','anomaly.module.navigation::field.type.warning.links','anomaly.module.navigation::field.type.placeholder.links','anomaly.module.navigation::field.type.instructions.links'),
(40,40,'en','anomaly.module.navigation::field.entry.label.links','anomaly.module.navigation::field.entry.warning.links','anomaly.module.navigation::field.entry.placeholder.links','anomaly.module.navigation::field.entry.instructions.links'),
(41,41,'en','anomaly.module.navigation::field.target.label.links','anomaly.module.navigation::field.target.warning.links','anomaly.module.navigation::field.target.placeholder.links','anomaly.module.navigation::field.target.instructions.links'),
(42,42,'en','anomaly.module.navigation::field.class.label.links','anomaly.module.navigation::field.class.warning.links','anomaly.module.navigation::field.class.placeholder.links','anomaly.module.navigation::field.class.instructions.links'),
(43,43,'en','anomaly.module.navigation::field.parent.label.links','anomaly.module.navigation::field.parent.warning.links','anomaly.module.navigation::field.parent.placeholder.links','anomaly.module.navigation::field.parent.instructions.links'),
(44,44,'en','anomaly.module.navigation::field.allowed_roles.label.links','anomaly.module.navigation::field.allowed_roles.warning.links','anomaly.module.navigation::field.allowed_roles.placeholder.links','anomaly.module.navigation::field.allowed_roles.instructions.links'),
(45,45,'en','anomaly.module.pages::field.str_id.label.pages','anomaly.module.pages::field.str_id.warning.pages','anomaly.module.pages::field.str_id.placeholder.pages','anomaly.module.pages::field.str_id.instructions.pages'),
(46,46,'en','anomaly.module.pages::field.title.label.pages','anomaly.module.pages::field.title.warning.pages','anomaly.module.pages::field.title.placeholder.pages','anomaly.module.pages::field.title.instructions.pages'),
(47,47,'en','anomaly.module.pages::field.slug.label.pages','anomaly.module.pages::field.slug.warning.pages','anomaly.module.pages::field.slug.placeholder.pages','anomaly.module.pages::field.slug.instructions.pages'),
(48,48,'en','anomaly.module.pages::field.path.label.pages','anomaly.module.pages::field.path.warning.pages','anomaly.module.pages::field.path.placeholder.pages','anomaly.module.pages::field.path.instructions.pages'),
(49,49,'en','anomaly.module.pages::field.type.label.pages','anomaly.module.pages::field.type.warning.pages','anomaly.module.pages::field.type.placeholder.pages','anomaly.module.pages::field.type.instructions.pages'),
(50,50,'en','anomaly.module.pages::field.entry.label.pages','anomaly.module.pages::field.entry.warning.pages','anomaly.module.pages::field.entry.placeholder.pages','anomaly.module.pages::field.entry.instructions.pages'),
(51,51,'en','anomaly.module.pages::field.parent.label.pages','anomaly.module.pages::field.parent.warning.pages','anomaly.module.pages::field.parent.placeholder.pages','anomaly.module.pages::field.parent.instructions.pages'),
(52,52,'en','anomaly.module.pages::field.visible.label.pages','anomaly.module.pages::field.visible.warning.pages','anomaly.module.pages::field.visible.placeholder.pages','anomaly.module.pages::field.visible.instructions.pages'),
(53,53,'en','anomaly.module.pages::field.enabled.label.pages','anomaly.module.pages::field.enabled.warning.pages','anomaly.module.pages::field.enabled.placeholder.pages','anomaly.module.pages::field.enabled.instructions.pages'),
(54,54,'en','anomaly.module.pages::field.exact.label.pages','anomaly.module.pages::field.exact.warning.pages','anomaly.module.pages::field.exact.placeholder.pages','anomaly.module.pages::field.exact.instructions.pages'),
(55,55,'en','anomaly.module.pages::field.home.label.pages','anomaly.module.pages::field.home.warning.pages','anomaly.module.pages::field.home.placeholder.pages','anomaly.module.pages::field.home.instructions.pages'),
(56,56,'en','anomaly.module.pages::field.meta_title.label.pages','anomaly.module.pages::field.meta_title.warning.pages','anomaly.module.pages::field.meta_title.placeholder.pages','anomaly.module.pages::field.meta_title.instructions.pages'),
(57,57,'en','anomaly.module.pages::field.meta_description.label.pages','anomaly.module.pages::field.meta_description.warning.pages','anomaly.module.pages::field.meta_description.placeholder.pages','anomaly.module.pages::field.meta_description.instructions.pages'),
(58,58,'en','anomaly.module.pages::field.meta_keywords.label.pages','anomaly.module.pages::field.meta_keywords.warning.pages','anomaly.module.pages::field.meta_keywords.placeholder.pages','anomaly.module.pages::field.meta_keywords.instructions.pages'),
(59,59,'en','anomaly.module.pages::field.theme_layout.label.pages','anomaly.module.pages::field.theme_layout.warning.pages','anomaly.module.pages::field.theme_layout.placeholder.pages','anomaly.module.pages::field.theme_layout.instructions.pages'),
(60,60,'en','anomaly.module.pages::field.allowed_roles.label.pages','anomaly.module.pages::field.allowed_roles.warning.pages','anomaly.module.pages::field.allowed_roles.placeholder.pages','anomaly.module.pages::field.allowed_roles.instructions.pages'),
(61,61,'en','anomaly.module.pages::field.name.label.types','anomaly.module.pages::field.name.warning.types','anomaly.module.pages::field.name.placeholder.types','anomaly.module.pages::field.name.instructions.types'),
(62,62,'en','anomaly.module.pages::field.slug.label.types','anomaly.module.pages::field.slug.warning.types','anomaly.module.pages::field.slug.placeholder.types','anomaly.module.pages::field.slug.instructions.types'),
(63,63,'en','anomaly.module.pages::field.description.label.types','anomaly.module.pages::field.description.warning.types','anomaly.module.pages::field.description.placeholder.types','anomaly.module.pages::field.description.instructions.types'),
(64,64,'en','anomaly.module.pages::field.theme_layout.label.types','anomaly.module.pages::field.theme_layout.warning.types','anomaly.module.pages::field.theme_layout.placeholder.types','anomaly.module.pages::field.theme_layout.instructions.types'),
(65,65,'en','anomaly.module.pages::field.layout.label.types','anomaly.module.pages::field.layout.warning.types','anomaly.module.pages::field.layout.placeholder.types','anomaly.module.pages::field.layout.instructions.types'),
(66,66,'en','anomaly.module.pages::field.handler.label.types','anomaly.module.pages::field.handler.warning.types','anomaly.module.pages::field.handler.placeholder.types','anomaly.module.pages::field.handler.instructions.types'),
(67,67,'en','anomaly.module.posts::field.name.label.categories','anomaly.module.posts::field.name.warning.categories','anomaly.module.posts::field.name.placeholder.categories','anomaly.module.posts::field.name.instructions.categories'),
(68,68,'en','anomaly.module.posts::field.slug.label.categories','anomaly.module.posts::field.slug.warning.categories','anomaly.module.posts::field.slug.placeholder.categories','anomaly.module.posts::field.slug.instructions.categories'),
(69,69,'en','anomaly.module.posts::field.description.label.categories','anomaly.module.posts::field.description.warning.categories','anomaly.module.posts::field.description.placeholder.categories','anomaly.module.posts::field.description.instructions.categories'),
(70,70,'en','anomaly.module.posts::field.str_id.label.posts','anomaly.module.posts::field.str_id.warning.posts','anomaly.module.posts::field.str_id.placeholder.posts','anomaly.module.posts::field.str_id.instructions.posts'),
(71,71,'en','anomaly.module.posts::field.title.label.posts','anomaly.module.posts::field.title.warning.posts','anomaly.module.posts::field.title.placeholder.posts','anomaly.module.posts::field.title.instructions.posts'),
(72,72,'en','anomaly.module.posts::field.summary.label.posts','anomaly.module.posts::field.summary.warning.posts','anomaly.module.posts::field.summary.placeholder.posts','anomaly.module.posts::field.summary.instructions.posts'),
(73,73,'en','anomaly.module.posts::field.slug.label.posts','anomaly.module.posts::field.slug.warning.posts','anomaly.module.posts::field.slug.placeholder.posts','anomaly.module.posts::field.slug.instructions.posts'),
(74,74,'en','anomaly.module.posts::field.type.label.posts','anomaly.module.posts::field.type.warning.posts','anomaly.module.posts::field.type.placeholder.posts','anomaly.module.posts::field.type.instructions.posts'),
(75,75,'en','anomaly.module.posts::field.publish_at.label.posts','anomaly.module.posts::field.publish_at.warning.posts','anomaly.module.posts::field.publish_at.placeholder.posts','anomaly.module.posts::field.publish_at.instructions.posts'),
(76,76,'en','anomaly.module.posts::field.author.label.posts','anomaly.module.posts::field.author.warning.posts','anomaly.module.posts::field.author.placeholder.posts','anomaly.module.posts::field.author.instructions.posts'),
(77,77,'en','anomaly.module.posts::field.entry.label.posts','anomaly.module.posts::field.entry.warning.posts','anomaly.module.posts::field.entry.placeholder.posts','anomaly.module.posts::field.entry.instructions.posts'),
(78,78,'en','anomaly.module.posts::field.meta_title.label.posts','anomaly.module.posts::field.meta_title.warning.posts','anomaly.module.posts::field.meta_title.placeholder.posts','anomaly.module.posts::field.meta_title.instructions.posts'),
(79,79,'en','anomaly.module.posts::field.meta_description.label.posts','anomaly.module.posts::field.meta_description.warning.posts','anomaly.module.posts::field.meta_description.placeholder.posts','anomaly.module.posts::field.meta_description.instructions.posts'),
(80,80,'en','anomaly.module.posts::field.meta_keywords.label.posts','anomaly.module.posts::field.meta_keywords.warning.posts','anomaly.module.posts::field.meta_keywords.placeholder.posts','anomaly.module.posts::field.meta_keywords.instructions.posts'),
(81,81,'en','anomaly.module.posts::field.category.label.posts','anomaly.module.posts::field.category.warning.posts','anomaly.module.posts::field.category.placeholder.posts','anomaly.module.posts::field.category.instructions.posts'),
(82,82,'en','anomaly.module.posts::field.featured.label.posts','anomaly.module.posts::field.featured.warning.posts','anomaly.module.posts::field.featured.placeholder.posts','anomaly.module.posts::field.featured.instructions.posts'),
(83,83,'en','anomaly.module.posts::field.enabled.label.posts','anomaly.module.posts::field.enabled.warning.posts','anomaly.module.posts::field.enabled.placeholder.posts','anomaly.module.posts::field.enabled.instructions.posts'),
(84,84,'en','anomaly.module.posts::field.tags.label.posts','anomaly.module.posts::field.tags.warning.posts','anomaly.module.posts::field.tags.placeholder.posts','anomaly.module.posts::field.tags.instructions.posts'),
(85,85,'en','anomaly.module.posts::field.name.label.types','anomaly.module.posts::field.name.warning.types','anomaly.module.posts::field.name.placeholder.types','anomaly.module.posts::field.name.instructions.types'),
(86,86,'en','anomaly.module.posts::field.slug.label.types','anomaly.module.posts::field.slug.warning.types','anomaly.module.posts::field.slug.placeholder.types','anomaly.module.posts::field.slug.instructions.types'),
(87,87,'en','anomaly.module.posts::field.layout.label.types','anomaly.module.posts::field.layout.warning.types','anomaly.module.posts::field.layout.placeholder.types','anomaly.module.posts::field.layout.instructions.types'),
(88,88,'en','anomaly.module.posts::field.theme_layout.label.types','anomaly.module.posts::field.theme_layout.warning.types','anomaly.module.posts::field.theme_layout.placeholder.types','anomaly.module.posts::field.theme_layout.instructions.types'),
(89,89,'en','anomaly.module.posts::field.description.label.types','anomaly.module.posts::field.description.warning.types','anomaly.module.posts::field.description.placeholder.types','anomaly.module.posts::field.description.instructions.types'),
(90,90,'en','anomaly.module.preferences::field.user.label.preferences','anomaly.module.preferences::field.user.warning.preferences','anomaly.module.preferences::field.user.placeholder.preferences','anomaly.module.preferences::field.user.instructions.preferences'),
(91,91,'en','anomaly.module.preferences::field.key.label.preferences','anomaly.module.preferences::field.key.warning.preferences','anomaly.module.preferences::field.key.placeholder.preferences','anomaly.module.preferences::field.key.instructions.preferences'),
(92,92,'en','anomaly.module.preferences::field.value.label.preferences','anomaly.module.preferences::field.value.warning.preferences','anomaly.module.preferences::field.value.placeholder.preferences','anomaly.module.preferences::field.value.instructions.preferences'),
(93,93,'en','anomaly.module.redirects::field.from.label.redirects','anomaly.module.redirects::field.from.warning.redirects','anomaly.module.redirects::field.from.placeholder.redirects','anomaly.module.redirects::field.from.instructions.redirects'),
(94,94,'en','anomaly.module.redirects::field.to.label.redirects','anomaly.module.redirects::field.to.warning.redirects','anomaly.module.redirects::field.to.placeholder.redirects','anomaly.module.redirects::field.to.instructions.redirects'),
(95,95,'en','anomaly.module.redirects::field.status.label.redirects','anomaly.module.redirects::field.status.warning.redirects','anomaly.module.redirects::field.status.placeholder.redirects','anomaly.module.redirects::field.status.instructions.redirects'),
(96,96,'en','anomaly.module.redirects::field.secure.label.redirects','anomaly.module.redirects::field.secure.warning.redirects','anomaly.module.redirects::field.secure.placeholder.redirects','anomaly.module.redirects::field.secure.instructions.redirects'),
(97,97,'en','anomaly.module.settings::field.key.label.settings','anomaly.module.settings::field.key.warning.settings','anomaly.module.settings::field.key.placeholder.settings','anomaly.module.settings::field.key.instructions.settings'),
(98,98,'en','anomaly.module.settings::field.value.label.settings','anomaly.module.settings::field.value.warning.settings','anomaly.module.settings::field.value.placeholder.settings','anomaly.module.settings::field.value.instructions.settings'),
(99,99,'en','anomaly.module.users::field.email.label.users','anomaly.module.users::field.email.warning.users','anomaly.module.users::field.email.placeholder.users','anomaly.module.users::field.email.instructions.users'),
(100,100,'en','anomaly.module.users::field.username.label.users','anomaly.module.users::field.username.warning.users','anomaly.module.users::field.username.placeholder.users','anomaly.module.users::field.username.instructions.users'),
(101,101,'en','anomaly.module.users::field.password.label.users','anomaly.module.users::field.password.warning.users','anomaly.module.users::field.password.placeholder.users','anomaly.module.users::field.password.instructions.users'),
(102,102,'en','anomaly.module.users::field.roles.label.users','anomaly.module.users::field.roles.warning.users','anomaly.module.users::field.roles.placeholder.users','anomaly.module.users::field.roles.instructions.users'),
(103,103,'en','anomaly.module.users::field.display_name.label.users','anomaly.module.users::field.display_name.warning.users','anomaly.module.users::field.display_name.placeholder.users','anomaly.module.users::field.display_name.instructions.users'),
(104,104,'en','anomaly.module.users::field.first_name.label.users','anomaly.module.users::field.first_name.warning.users','anomaly.module.users::field.first_name.placeholder.users','anomaly.module.users::field.first_name.instructions.users'),
(105,105,'en','anomaly.module.users::field.last_name.label.users','anomaly.module.users::field.last_name.warning.users','anomaly.module.users::field.last_name.placeholder.users','anomaly.module.users::field.last_name.instructions.users'),
(106,106,'en','anomaly.module.users::field.activated.label.users','anomaly.module.users::field.activated.warning.users','anomaly.module.users::field.activated.placeholder.users','anomaly.module.users::field.activated.instructions.users'),
(107,107,'en','anomaly.module.users::field.enabled.label.users','anomaly.module.users::field.enabled.warning.users','anomaly.module.users::field.enabled.placeholder.users','anomaly.module.users::field.enabled.instructions.users'),
(108,108,'en','anomaly.module.users::field.permissions.label.users','anomaly.module.users::field.permissions.warning.users','anomaly.module.users::field.permissions.placeholder.users','anomaly.module.users::field.permissions.instructions.users'),
(109,109,'en','anomaly.module.users::field.last_login_at.label.users','anomaly.module.users::field.last_login_at.warning.users','anomaly.module.users::field.last_login_at.placeholder.users','anomaly.module.users::field.last_login_at.instructions.users'),
(110,110,'en','anomaly.module.users::field.remember_token.label.users','anomaly.module.users::field.remember_token.warning.users','anomaly.module.users::field.remember_token.placeholder.users','anomaly.module.users::field.remember_token.instructions.users'),
(111,111,'en','anomaly.module.users::field.activation_code.label.users','anomaly.module.users::field.activation_code.warning.users','anomaly.module.users::field.activation_code.placeholder.users','anomaly.module.users::field.activation_code.instructions.users'),
(112,112,'en','anomaly.module.users::field.reset_code.label.users','anomaly.module.users::field.reset_code.warning.users','anomaly.module.users::field.reset_code.placeholder.users','anomaly.module.users::field.reset_code.instructions.users'),
(113,113,'en','anomaly.module.users::field.last_activity_at.label.users','anomaly.module.users::field.last_activity_at.warning.users','anomaly.module.users::field.last_activity_at.placeholder.users','anomaly.module.users::field.last_activity_at.instructions.users'),
(114,114,'en','anomaly.module.users::field.ip_address.label.users','anomaly.module.users::field.ip_address.warning.users','anomaly.module.users::field.ip_address.placeholder.users','anomaly.module.users::field.ip_address.instructions.users'),
(115,115,'en','anomaly.module.users::field.name.label.roles','anomaly.module.users::field.name.warning.roles','anomaly.module.users::field.name.placeholder.roles','anomaly.module.users::field.name.instructions.roles'),
(116,116,'en','anomaly.module.users::field.slug.label.roles','anomaly.module.users::field.slug.warning.roles','anomaly.module.users::field.slug.placeholder.roles','anomaly.module.users::field.slug.instructions.roles'),
(117,117,'en','anomaly.module.users::field.description.label.roles','anomaly.module.users::field.description.warning.roles','anomaly.module.users::field.description.placeholder.roles','anomaly.module.users::field.description.instructions.roles'),
(118,118,'en','anomaly.module.users::field.permissions.label.roles','anomaly.module.users::field.permissions.warning.roles','anomaly.module.users::field.permissions.placeholder.roles','anomaly.module.users::field.permissions.instructions.roles'),
(119,119,'en','anomaly.extension.page_link_type::field.title.label.pages','anomaly.extension.page_link_type::field.title.warning.pages','anomaly.extension.page_link_type::field.title.placeholder.pages','anomaly.extension.page_link_type::field.title.instructions.pages'),
(120,120,'en','anomaly.extension.page_link_type::field.page.label.pages','anomaly.extension.page_link_type::field.page.warning.pages','anomaly.extension.page_link_type::field.page.placeholder.pages','anomaly.extension.page_link_type::field.page.instructions.pages'),
(121,121,'en','anomaly.extension.page_link_type::field.description.label.pages','anomaly.extension.page_link_type::field.description.warning.pages','anomaly.extension.page_link_type::field.description.placeholder.pages','anomaly.extension.page_link_type::field.description.instructions.pages'),
(122,122,'en','anomaly.extension.url_link_type::field.title.label.urls','anomaly.extension.url_link_type::field.title.warning.urls','anomaly.extension.url_link_type::field.title.placeholder.urls','anomaly.extension.url_link_type::field.title.instructions.urls'),
(123,123,'en','anomaly.extension.url_link_type::field.url.label.urls','anomaly.extension.url_link_type::field.url.warning.urls','anomaly.extension.url_link_type::field.url.placeholder.urls','anomaly.extension.url_link_type::field.url.instructions.urls'),
(124,124,'en','anomaly.extension.url_link_type::field.description.label.urls','anomaly.extension.url_link_type::field.description.warning.urls','anomaly.extension.url_link_type::field.description.placeholder.urls','anomaly.extension.url_link_type::field.description.instructions.urls'),
(125,125,'en',NULL,NULL,NULL,NULL),
(126,126,'en',NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `default_streams_assignments_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_streams_fields
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_streams_fields`;
CREATE TABLE `default_streams_fields` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`namespace` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`config` text COLLATE utf8_unicode_ci NOT NULL,
`locked` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_streams` (`namespace`,`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_streams_fields` WRITE;
/*!40000 ALTER TABLE `default_streams_fields` DISABLE KEYS */;
INSERT INTO `default_streams_fields` (`id`, `namespace`, `slug`, `type`, `config`, `locked`)
VALUES
(1,'configuration','scope','anomaly.field_type.text','a:0:{}',1),
(2,'configuration','key','anomaly.field_type.text','a:0:{}',1),
(3,'configuration','value','anomaly.field_type.textarea','a:0:{}',1),
(4,'dashboard','name','anomaly.field_type.text','a:0:{}',1),
(5,'dashboard','slug','anomaly.field_type.slug','a:1:{s:7:\"slugify\";s:4:\"name\";}',1),
(6,'dashboard','description','anomaly.field_type.textarea','a:0:{}',1),
(7,'dashboard','layout','anomaly.field_type.select','a:1:{s:7:\"options\";a:9:{i:24;s:48:\"anomaly.module.dashboard::field.layout.option.24\";s:5:\"12-12\";s:51:\"anomaly.module.dashboard::field.layout.option.12-12\";s:4:\"16-8\";s:50:\"anomaly.module.dashboard::field.layout.option.16-8\";s:4:\"8-16\";s:50:\"anomaly.module.dashboard::field.layout.option.8-16\";s:5:\"8-8-8\";s:51:\"anomaly.module.dashboard::field.layout.option.8-8-8\";s:6:\"6-12-6\";s:52:\"anomaly.module.dashboard::field.layout.option.6-12-6\";s:6:\"12-6-6\";s:52:\"anomaly.module.dashboard::field.layout.option.12-6-6\";s:6:\"6-6-12\";s:52:\"anomaly.module.dashboard::field.layout.option.6-6-12\";s:7:\"6-6-6-6\";s:53:\"anomaly.module.dashboard::field.layout.option.6-6-6-6\";}}',1),
(8,'dashboard','title','anomaly.field_type.text','a:0:{}',1),
(9,'dashboard','extension','anomaly.field_type.addon','a:2:{s:4:\"type\";s:9:\"extension\";s:6:\"search\";s:34:\"anomaly.module.dashboard::widget.*\";}',1),
(10,'dashboard','column','anomaly.field_type.integer','a:2:{s:3:\"min\";i:1;s:13:\"default_value\";i:1;}',1),
(11,'dashboard','pinned','anomaly.field_type.boolean','a:0:{}',1),
(12,'dashboard','dashboard','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:48:\"Anomaly\\DashboardModule\\Dashboard\\DashboardModel\";}',1),
(13,'dashboard','allowed_roles','anomaly.field_type.multiple','a:1:{s:7:\"related\";s:34:\"Anomaly\\UsersModule\\Role\\RoleModel\";}',1),
(14,'files','name','anomaly.field_type.text','a:0:{}',1),
(15,'files','slug','anomaly.field_type.slug','a:1:{s:7:\"slugify\";s:4:\"name\";}',1),
(16,'files','adapter','anomaly.field_type.addon','a:2:{s:4:\"type\";s:10:\"extensions\";s:6:\"search\";s:31:\"anomaly.module.files::adapter.*\";}',1),
(17,'files','folder','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:38:\"Anomaly\\FilesModule\\Folder\\FolderModel\";}',1),
(18,'files','disk','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:34:\"Anomaly\\FilesModule\\Disk\\DiskModel\";}',1),
(19,'files','entry','anomaly.field_type.polymorphic','a:0:{}',1),
(20,'files','description','anomaly.field_type.textarea','a:0:{}',1),
(21,'files','allowed_types','anomaly.field_type.tags','a:0:{}',1),
(22,'files','keywords','anomaly.field_type.tags','a:0:{}',1),
(23,'files','extension','anomaly.field_type.text','a:0:{}',1),
(24,'files','width','anomaly.field_type.text','a:0:{}',1),
(25,'files','height','anomaly.field_type.text','a:0:{}',1),
(26,'files','mime_type','anomaly.field_type.text','a:0:{}',1),
(27,'files','size','anomaly.field_type.integer','a:0:{}',1),
(28,'navigation','name','anomaly.field_type.text','a:0:{}',1),
(29,'navigation','class','anomaly.field_type.text','a:0:{}',1),
(30,'navigation','description','anomaly.field_type.textarea','a:0:{}',1),
(31,'navigation','entry','anomaly.field_type.polymorphic','a:0:{}',1),
(32,'navigation','slug','anomaly.field_type.slug','a:1:{s:7:\"slugify\";s:4:\"name\";}',1),
(33,'navigation','menu','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:39:\"Anomaly\\NavigationModule\\Menu\\MenuModel\";}',1),
(34,'navigation','parent','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:39:\"Anomaly\\NavigationModule\\Link\\LinkModel\";}',1),
(35,'navigation','allowed_roles','anomaly.field_type.multiple','a:1:{s:7:\"related\";s:34:\"Anomaly\\UsersModule\\Role\\RoleModel\";}',1),
(36,'navigation','type','anomaly.field_type.addon','a:2:{s:4:\"type\";s:9:\"extension\";s:6:\"search\";s:38:\"anomaly.module.navigation::link_type.*\";}',1),
(37,'navigation','target','anomaly.field_type.select','a:2:{s:13:\"default_value\";s:5:\"_self\";s:7:\"options\";a:2:{s:5:\"_self\";s:51:\"anomaly.module.navigation::field.target.option.self\";s:6:\"_blank\";s:52:\"anomaly.module.navigation::field.target.option.blank\";}}',1),
(38,'pages','str_id','anomaly.field_type.text','a:0:{}',1),
(39,'pages','title','anomaly.field_type.text','a:0:{}',1),
(40,'pages','slug','anomaly.field_type.slug','a:2:{s:7:\"slugify\";s:5:\"title\";s:4:\"type\";s:1:\"-\";}',1),
(41,'pages','content','anomaly.field_type.wysiwyg','a:0:{}',0),
(42,'pages','path','anomaly.field_type.text','a:0:{}',1),
(43,'pages','enabled','anomaly.field_type.boolean','a:1:{s:13:\"default_value\";b:1;}',1),
(44,'pages','home','anomaly.field_type.boolean','a:1:{s:13:\"default_value\";b:0;}',1),
(45,'pages','meta_title','anomaly.field_type.text','a:0:{}',1),
(46,'pages','meta_description','anomaly.field_type.textarea','a:0:{}',1),
(47,'pages','meta_keywords','anomaly.field_type.tags','a:0:{}',1),
(48,'pages','layout','anomaly.field_type.editor','a:2:{s:13:\"default_value\";s:25:\"<h1>{{ page.title }}</h1>\";s:4:\"mode\";s:4:\"twig\";}',1),
(49,'pages','allowed_roles','anomaly.field_type.multiple','a:1:{s:7:\"related\";s:34:\"Anomaly\\UsersModule\\Role\\RoleModel\";}',1),
(50,'pages','parent','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:34:\"Anomaly\\PagesModule\\Page\\PageModel\";}',1),
(51,'pages','theme_layout','anomaly.field_type.select','a:2:{s:13:\"default_value\";s:27:\"theme::layouts/default.twig\";s:7:\"handler\";s:46:\"Anomaly\\SelectFieldType\\Handler\\Layouts@handle\";}',1),
(52,'pages','type','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:34:\"Anomaly\\PagesModule\\Type\\TypeModel\";}',1),
(53,'pages','handler','anomaly.field_type.addon','a:3:{s:4:\"type\";s:9:\"extension\";s:6:\"search\";s:31:\"anomaly.module.pages::handler.*\";s:13:\"default_value\";s:38:\"anomaly.extension.default_page_handler\";}',1),
(54,'pages','visible','anomaly.field_type.boolean','a:1:{s:13:\"default_value\";b:1;}',1),
(55,'pages','exact','anomaly.field_type.boolean','a:1:{s:13:\"default_value\";b:1;}',1),
(56,'pages','entry','anomaly.field_type.polymorphic','a:0:{}',1),
(57,'pages','name','anomaly.field_type.text','a:0:{}',1),
(58,'pages','description','anomaly.field_type.textarea','a:0:{}',1),
(59,'posts','str_id','anomaly.field_type.text','a:0:{}',1),
(60,'posts','name','anomaly.field_type.text','a:0:{}',1),
(61,'posts','title','anomaly.field_type.text','a:0:{}',1),
(62,'posts','slug','anomaly.field_type.slug','a:2:{s:7:\"slugify\";s:5:\"title\";s:4:\"type\";s:1:\"-\";}',1),
(63,'posts','content','anomaly.field_type.wysiwyg','a:0:{}',0),
(64,'posts','type','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:34:\"Anomaly\\PostsModule\\Type\\TypeModel\";}',1),
(65,'posts','tags','anomaly.field_type.tags','a:0:{}',1),
(66,'posts','summary','anomaly.field_type.textarea','a:0:{}',1),
(67,'posts','description','anomaly.field_type.textarea','a:0:{}',1),
(68,'posts','publish_at','anomaly.field_type.datetime','a:0:{}',1),
(69,'posts','entry','anomaly.field_type.polymorphic','a:0:{}',1),
(70,'posts','author','anomaly.field_type.relationship','a:2:{s:4:\"mode\";s:6:\"lookup\";s:7:\"related\";s:34:\"Anomaly\\UsersModule\\User\\UserModel\";}',1),
(71,'posts','layout','anomaly.field_type.editor','a:2:{s:13:\"default_value\";s:22:\"{{ post.content|raw }}\";s:4:\"mode\";s:4:\"twig\";}',1),
(72,'posts','category','anomaly.field_type.relationship','a:1:{s:7:\"related\";s:42:\"Anomaly\\PostsModule\\Category\\CategoryModel\";}',1),
(73,'posts','enabled','anomaly.field_type.boolean','a:1:{s:13:\"default_value\";b:0;}',1),
(74,'posts','featured','anomaly.field_type.boolean','a:1:{s:13:\"default_value\";b:0;}',1),
(75,'posts','meta_title','anomaly.field_type.text','a:0:{}',1),
(76,'posts','meta_description','anomaly.field_type.textarea','a:0:{}',1),
(77,'posts','meta_keywords','anomaly.field_type.tags','a:0:{}',1),
(78,'posts','ttl','anomaly.field_type.integer','a:3:{s:3:\"min\";i:0;s:4:\"step\";i:1;s:4:\"page\";i:5;}',1),
(79,'posts','theme_layout','anomaly.field_type.select','a:1:{s:7:\"handler\";s:39:\"Anomaly\\SelectFieldType\\Handler\\Layouts\";}',1),
(80,'preferences','user','anomaly.field_type.relationship','a:2:{s:4:\"mode\";s:6:\"lookup\";s:7:\"related\";s:34:\"Anomaly\\UsersModule\\User\\UserModel\";}',1),
(81,'preferences','key','anomaly.field_type.text','a:0:{}',1),
(82,'preferences','value','anomaly.field_type.textarea','a:0:{}',1),
(83,'redirects','from','anomaly.field_type.text','a:0:{}',1),
(84,'redirects','to','anomaly.field_type.text','a:0:{}',1),
(85,'redirects','status','anomaly.field_type.select','a:2:{s:13:\"default_value\";s:3:\"301\";s:7:\"options\";a:2:{i:301;s:49:\"anomaly.module.redirects::field.status.option.301\";i:302;s:49:\"anomaly.module.redirects::field.status.option.302\";}}',1),
(86,'redirects','secure','anomaly.field_type.boolean','a:0:{}',1),
(87,'settings','key','anomaly.field_type.text','a:0:{}',1),
(88,'settings','value','anomaly.field_type.textarea','a:0:{}',1),
(89,'users','email','anomaly.field_type.email','a:0:{}',1),
(90,'users','username','anomaly.field_type.slug','a:2:{s:4:\"type\";s:1:\"_\";s:9:\"lowercase\";b:0;}',1),
(91,'users','password','anomaly.field_type.text','a:1:{s:4:\"type\";s:8:\"password\";}',1),
(92,'users','remember_token','anomaly.field_type.text','a:0:{}',1),
(93,'users','ip_address','anomaly.field_type.text','a:0:{}',1),
(94,'users','last_login_at','anomaly.field_type.datetime','a:0:{}',1),
(95,'users','last_activity_at','anomaly.field_type.datetime','a:0:{}',1),
(96,'users','permissions','anomaly.field_type.checkboxes','a:0:{}',1),
(97,'users','display_name','anomaly.field_type.text','a:0:{}',1),
(98,'users','first_name','anomaly.field_type.text','a:0:{}',1),
(99,'users','last_name','anomaly.field_type.text','a:0:{}',1),
(100,'users','name','anomaly.field_type.text','a:0:{}',1),
(101,'users','description','anomaly.field_type.textarea','a:0:{}',1),
(102,'users','reset_code','anomaly.field_type.text','a:0:{}',1),
(103,'users','reset_code_expires_at','anomaly.field_type.datetime','a:0:{}',1),
(104,'users','activation_code','anomaly.field_type.text','a:0:{}',1),
(105,'users','activation_code_expires_at','anomaly.field_type.datetime','a:0:{}',1),
(106,'users','activated','anomaly.field_type.boolean','a:1:{s:13:\"default_value\";b:0;}',1),
(107,'users','enabled','anomaly.field_type.boolean','a:1:{s:13:\"default_value\";b:1;}',1),
(108,'users','slug','anomaly.field_type.slug','a:1:{s:7:\"slugify\";s:4:\"name\";}',1),
(109,'users','roles','anomaly.field_type.multiple','a:1:{s:7:\"related\";s:34:\"Anomaly\\UsersModule\\Role\\RoleModel\";}',1),
(110,'page_link_type','title','anomaly.field_type.text','a:0:{}',1),
(111,'page_link_type','page','anomaly.field_type.relationship','a:2:{s:4:\"mode\";s:6:\"lookup\";s:7:\"related\";s:34:\"Anomaly\\PagesModule\\Page\\PageModel\";}',1),
(112,'page_link_type','description','anomaly.field_type.textarea','a:0:{}',1),
(113,'url_link_type','title','anomaly.field_type.text','a:0:{}',1),
(114,'url_link_type','url','anomaly.field_type.text','a:0:{}',1),
(115,'url_link_type','description','anomaly.field_type.textarea','a:0:{}',1);
/*!40000 ALTER TABLE `default_streams_fields` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_streams_fields_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_streams_fields_translations`;
CREATE TABLE `default_streams_fields_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`field_id` int(11) NOT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`placeholder` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`warning` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`instructions` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `streams_fields_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_streams_fields_translations` WRITE;
/*!40000 ALTER TABLE `default_streams_fields_translations` DISABLE KEYS */;
INSERT INTO `default_streams_fields_translations` (`id`, `field_id`, `locale`, `name`, `placeholder`, `warning`, `instructions`)
VALUES
(1,1,'en','anomaly.module.configuration::field.scope.name','anomaly.module.configuration::field.scope.placeholder','anomaly.module.configuration::field.scope.warning','anomaly.module.configuration::field.scope.instructions'),
(2,2,'en','anomaly.module.configuration::field.key.name','anomaly.module.configuration::field.key.placeholder','anomaly.module.configuration::field.key.warning','anomaly.module.configuration::field.key.instructions'),
(3,3,'en','anomaly.module.configuration::field.value.name','anomaly.module.configuration::field.value.placeholder','anomaly.module.configuration::field.value.warning','anomaly.module.configuration::field.value.instructions'),
(4,4,'en','anomaly.module.dashboard::field.name.name','anomaly.module.dashboard::field.name.placeholder','anomaly.module.dashboard::field.name.warning','anomaly.module.dashboard::field.name.instructions'),
(5,5,'en','anomaly.module.dashboard::field.slug.name','anomaly.module.dashboard::field.slug.placeholder','anomaly.module.dashboard::field.slug.warning','anomaly.module.dashboard::field.slug.instructions'),
(6,6,'en','anomaly.module.dashboard::field.description.name','anomaly.module.dashboard::field.description.placeholder','anomaly.module.dashboard::field.description.warning','anomaly.module.dashboard::field.description.instructions'),
(7,7,'en','anomaly.module.dashboard::field.layout.name','anomaly.module.dashboard::field.layout.placeholder','anomaly.module.dashboard::field.layout.warning','anomaly.module.dashboard::field.layout.instructions'),
(8,8,'en','anomaly.module.dashboard::field.title.name','anomaly.module.dashboard::field.title.placeholder','anomaly.module.dashboard::field.title.warning','anomaly.module.dashboard::field.title.instructions'),
(9,9,'en','anomaly.module.dashboard::field.extension.name','anomaly.module.dashboard::field.extension.placeholder','anomaly.module.dashboard::field.extension.warning','anomaly.module.dashboard::field.extension.instructions'),
(10,10,'en','anomaly.module.dashboard::field.column.name','anomaly.module.dashboard::field.column.placeholder','anomaly.module.dashboard::field.column.warning','anomaly.module.dashboard::field.column.instructions'),
(11,11,'en','anomaly.module.dashboard::field.pinned.name','anomaly.module.dashboard::field.pinned.placeholder','anomaly.module.dashboard::field.pinned.warning','anomaly.module.dashboard::field.pinned.instructions'),
(12,12,'en','anomaly.module.dashboard::field.dashboard.name','anomaly.module.dashboard::field.dashboard.placeholder','anomaly.module.dashboard::field.dashboard.warning','anomaly.module.dashboard::field.dashboard.instructions'),
(13,13,'en','anomaly.module.dashboard::field.allowed_roles.name','anomaly.module.dashboard::field.allowed_roles.placeholder','anomaly.module.dashboard::field.allowed_roles.warning','anomaly.module.dashboard::field.allowed_roles.instructions'),
(14,14,'en','anomaly.module.files::field.name.name','anomaly.module.files::field.name.placeholder','anomaly.module.files::field.name.warning','anomaly.module.files::field.name.instructions'),
(15,15,'en','anomaly.module.files::field.slug.name','anomaly.module.files::field.slug.placeholder','anomaly.module.files::field.slug.warning','anomaly.module.files::field.slug.instructions'),
(16,16,'en','anomaly.module.files::field.adapter.name','anomaly.module.files::field.adapter.placeholder','anomaly.module.files::field.adapter.warning','anomaly.module.files::field.adapter.instructions'),
(17,17,'en','anomaly.module.files::field.folder.name','anomaly.module.files::field.folder.placeholder','anomaly.module.files::field.folder.warning','anomaly.module.files::field.folder.instructions'),
(18,18,'en','anomaly.module.files::field.disk.name','anomaly.module.files::field.disk.placeholder','anomaly.module.files::field.disk.warning','anomaly.module.files::field.disk.instructions'),
(19,19,'en','anomaly.module.files::field.entry.name','anomaly.module.files::field.entry.placeholder','anomaly.module.files::field.entry.warning','anomaly.module.files::field.entry.instructions'),
(20,20,'en','anomaly.module.files::field.description.name','anomaly.module.files::field.description.placeholder','anomaly.module.files::field.description.warning','anomaly.module.files::field.description.instructions'),
(21,21,'en','anomaly.module.files::field.allowed_types.name','anomaly.module.files::field.allowed_types.placeholder','anomaly.module.files::field.allowed_types.warning','anomaly.module.files::field.allowed_types.instructions'),
(22,22,'en','anomaly.module.files::field.keywords.name','anomaly.module.files::field.keywords.placeholder','anomaly.module.files::field.keywords.warning','anomaly.module.files::field.keywords.instructions'),
(23,23,'en','anomaly.module.files::field.extension.name','anomaly.module.files::field.extension.placeholder','anomaly.module.files::field.extension.warning','anomaly.module.files::field.extension.instructions'),
(24,24,'en','anomaly.module.files::field.width.name','anomaly.module.files::field.width.placeholder','anomaly.module.files::field.width.warning','anomaly.module.files::field.width.instructions'),
(25,25,'en','anomaly.module.files::field.height.name','anomaly.module.files::field.height.placeholder','anomaly.module.files::field.height.warning','anomaly.module.files::field.height.instructions'),
(26,26,'en','anomaly.module.files::field.mime_type.name','anomaly.module.files::field.mime_type.placeholder','anomaly.module.files::field.mime_type.warning','anomaly.module.files::field.mime_type.instructions'),
(27,27,'en','anomaly.module.files::field.size.name','anomaly.module.files::field.size.placeholder','anomaly.module.files::field.size.warning','anomaly.module.files::field.size.instructions'),
(28,28,'en','anomaly.module.navigation::field.name.name','anomaly.module.navigation::field.name.placeholder','anomaly.module.navigation::field.name.warning','anomaly.module.navigation::field.name.instructions'),
(29,29,'en','anomaly.module.navigation::field.class.name','anomaly.module.navigation::field.class.placeholder','anomaly.module.navigation::field.class.warning','anomaly.module.navigation::field.class.instructions'),
(30,30,'en','anomaly.module.navigation::field.description.name','anomaly.module.navigation::field.description.placeholder','anomaly.module.navigation::field.description.warning','anomaly.module.navigation::field.description.instructions'),
(31,31,'en','anomaly.module.navigation::field.entry.name','anomaly.module.navigation::field.entry.placeholder','anomaly.module.navigation::field.entry.warning','anomaly.module.navigation::field.entry.instructions'),
(32,32,'en','anomaly.module.navigation::field.slug.name','anomaly.module.navigation::field.slug.placeholder','anomaly.module.navigation::field.slug.warning','anomaly.module.navigation::field.slug.instructions'),
(33,33,'en','anomaly.module.navigation::field.menu.name','anomaly.module.navigation::field.menu.placeholder','anomaly.module.navigation::field.menu.warning','anomaly.module.navigation::field.menu.instructions'),
(34,34,'en','anomaly.module.navigation::field.parent.name','anomaly.module.navigation::field.parent.placeholder','anomaly.module.navigation::field.parent.warning','anomaly.module.navigation::field.parent.instructions'),
(35,35,'en','anomaly.module.navigation::field.allowed_roles.name','anomaly.module.navigation::field.allowed_roles.placeholder','anomaly.module.navigation::field.allowed_roles.warning','anomaly.module.navigation::field.allowed_roles.instructions'),
(36,36,'en','anomaly.module.navigation::field.type.name','anomaly.module.navigation::field.type.placeholder','anomaly.module.navigation::field.type.warning','anomaly.module.navigation::field.type.instructions'),
(37,37,'en','anomaly.module.navigation::field.target.name','anomaly.module.navigation::field.target.placeholder','anomaly.module.navigation::field.target.warning','anomaly.module.navigation::field.target.instructions'),
(38,38,'en','anomaly.module.pages::field.str_id.name','anomaly.module.pages::field.str_id.placeholder','anomaly.module.pages::field.str_id.warning','anomaly.module.pages::field.str_id.instructions'),
(39,39,'en','anomaly.module.pages::field.title.name','anomaly.module.pages::field.title.placeholder','anomaly.module.pages::field.title.warning','anomaly.module.pages::field.title.instructions'),
(40,40,'en','anomaly.module.pages::field.slug.name','anomaly.module.pages::field.slug.placeholder','anomaly.module.pages::field.slug.warning','anomaly.module.pages::field.slug.instructions'),
(41,41,'en','anomaly.module.pages::field.content.name','anomaly.module.pages::field.content.placeholder','anomaly.module.pages::field.content.warning','anomaly.module.pages::field.content.instructions'),
(42,42,'en','anomaly.module.pages::field.path.name','anomaly.module.pages::field.path.placeholder','anomaly.module.pages::field.path.warning','anomaly.module.pages::field.path.instructions'),
(43,43,'en','anomaly.module.pages::field.enabled.name','anomaly.module.pages::field.enabled.placeholder','anomaly.module.pages::field.enabled.warning','anomaly.module.pages::field.enabled.instructions'),
(44,44,'en','anomaly.module.pages::field.home.name','anomaly.module.pages::field.home.placeholder','anomaly.module.pages::field.home.warning','anomaly.module.pages::field.home.instructions'),
(45,45,'en','anomaly.module.pages::field.meta_title.name','anomaly.module.pages::field.meta_title.placeholder','anomaly.module.pages::field.meta_title.warning','anomaly.module.pages::field.meta_title.instructions'),
(46,46,'en','anomaly.module.pages::field.meta_description.name','anomaly.module.pages::field.meta_description.placeholder','anomaly.module.pages::field.meta_description.warning','anomaly.module.pages::field.meta_description.instructions'),
(47,47,'en','anomaly.module.pages::field.meta_keywords.name','anomaly.module.pages::field.meta_keywords.placeholder','anomaly.module.pages::field.meta_keywords.warning','anomaly.module.pages::field.meta_keywords.instructions'),
(48,48,'en','anomaly.module.pages::field.layout.name','anomaly.module.pages::field.layout.placeholder','anomaly.module.pages::field.layout.warning','anomaly.module.pages::field.layout.instructions'),
(49,49,'en','anomaly.module.pages::field.allowed_roles.name','anomaly.module.pages::field.allowed_roles.placeholder','anomaly.module.pages::field.allowed_roles.warning','anomaly.module.pages::field.allowed_roles.instructions'),
(50,50,'en','anomaly.module.pages::field.parent.name','anomaly.module.pages::field.parent.placeholder','anomaly.module.pages::field.parent.warning','anomaly.module.pages::field.parent.instructions'),
(51,51,'en','anomaly.module.pages::field.theme_layout.name','anomaly.module.pages::field.theme_layout.placeholder','anomaly.module.pages::field.theme_layout.warning','anomaly.module.pages::field.theme_layout.instructions'),
(52,52,'en','anomaly.module.pages::field.type.name','anomaly.module.pages::field.type.placeholder','anomaly.module.pages::field.type.warning','anomaly.module.pages::field.type.instructions'),
(53,53,'en','anomaly.module.pages::field.handler.name','anomaly.module.pages::field.handler.placeholder','anomaly.module.pages::field.handler.warning','anomaly.module.pages::field.handler.instructions'),
(54,54,'en','anomaly.module.pages::field.visible.name','anomaly.module.pages::field.visible.placeholder','anomaly.module.pages::field.visible.warning','anomaly.module.pages::field.visible.instructions'),
(55,55,'en','anomaly.module.pages::field.exact.name','anomaly.module.pages::field.exact.placeholder','anomaly.module.pages::field.exact.warning','anomaly.module.pages::field.exact.instructions'),
(56,56,'en','anomaly.module.pages::field.entry.name','anomaly.module.pages::field.entry.placeholder','anomaly.module.pages::field.entry.warning','anomaly.module.pages::field.entry.instructions'),
(57,57,'en','anomaly.module.pages::field.name.name','anomaly.module.pages::field.name.placeholder','anomaly.module.pages::field.name.warning','anomaly.module.pages::field.name.instructions'),
(58,58,'en','anomaly.module.pages::field.description.name','anomaly.module.pages::field.description.placeholder','anomaly.module.pages::field.description.warning','anomaly.module.pages::field.description.instructions'),
(59,59,'en','anomaly.module.posts::field.str_id.name','anomaly.module.posts::field.str_id.placeholder','anomaly.module.posts::field.str_id.warning','anomaly.module.posts::field.str_id.instructions'),
(60,60,'en','anomaly.module.posts::field.name.name','anomaly.module.posts::field.name.placeholder','anomaly.module.posts::field.name.warning','anomaly.module.posts::field.name.instructions'),
(61,61,'en','anomaly.module.posts::field.title.name','anomaly.module.posts::field.title.placeholder','anomaly.module.posts::field.title.warning','anomaly.module.posts::field.title.instructions'),
(62,62,'en','anomaly.module.posts::field.slug.name','anomaly.module.posts::field.slug.placeholder','anomaly.module.posts::field.slug.warning','anomaly.module.posts::field.slug.instructions'),
(63,63,'en','anomaly.module.posts::field.content.name','anomaly.module.posts::field.content.placeholder','anomaly.module.posts::field.content.warning','anomaly.module.posts::field.content.instructions'),
(64,64,'en','anomaly.module.posts::field.type.name','anomaly.module.posts::field.type.placeholder','anomaly.module.posts::field.type.warning','anomaly.module.posts::field.type.instructions'),
(65,65,'en','anomaly.module.posts::field.tags.name','anomaly.module.posts::field.tags.placeholder','anomaly.module.posts::field.tags.warning','anomaly.module.posts::field.tags.instructions'),
(66,66,'en','anomaly.module.posts::field.summary.name','anomaly.module.posts::field.summary.placeholder','anomaly.module.posts::field.summary.warning','anomaly.module.posts::field.summary.instructions'),
(67,67,'en','anomaly.module.posts::field.description.name','anomaly.module.posts::field.description.placeholder','anomaly.module.posts::field.description.warning','anomaly.module.posts::field.description.instructions'),
(68,68,'en','anomaly.module.posts::field.publish_at.name','anomaly.module.posts::field.publish_at.placeholder','anomaly.module.posts::field.publish_at.warning','anomaly.module.posts::field.publish_at.instructions'),
(69,69,'en','anomaly.module.posts::field.entry.name','anomaly.module.posts::field.entry.placeholder','anomaly.module.posts::field.entry.warning','anomaly.module.posts::field.entry.instructions'),
(70,70,'en','anomaly.module.posts::field.author.name','anomaly.module.posts::field.author.placeholder','anomaly.module.posts::field.author.warning','anomaly.module.posts::field.author.instructions'),
(71,71,'en','anomaly.module.posts::field.layout.name','anomaly.module.posts::field.layout.placeholder','anomaly.module.posts::field.layout.warning','anomaly.module.posts::field.layout.instructions'),
(72,72,'en','anomaly.module.posts::field.category.name','anomaly.module.posts::field.category.placeholder','anomaly.module.posts::field.category.warning','anomaly.module.posts::field.category.instructions'),
(73,73,'en','anomaly.module.posts::field.enabled.name','anomaly.module.posts::field.enabled.placeholder','anomaly.module.posts::field.enabled.warning','anomaly.module.posts::field.enabled.instructions'),
(74,74,'en','anomaly.module.posts::field.featured.name','anomaly.module.posts::field.featured.placeholder','anomaly.module.posts::field.featured.warning','anomaly.module.posts::field.featured.instructions'),
(75,75,'en','anomaly.module.posts::field.meta_title.name','anomaly.module.posts::field.meta_title.placeholder','anomaly.module.posts::field.meta_title.warning','anomaly.module.posts::field.meta_title.instructions'),
(76,76,'en','anomaly.module.posts::field.meta_description.name','anomaly.module.posts::field.meta_description.placeholder','anomaly.module.posts::field.meta_description.warning','anomaly.module.posts::field.meta_description.instructions'),
(77,77,'en','anomaly.module.posts::field.meta_keywords.name','anomaly.module.posts::field.meta_keywords.placeholder','anomaly.module.posts::field.meta_keywords.warning','anomaly.module.posts::field.meta_keywords.instructions'),
(78,78,'en','anomaly.module.posts::field.ttl.name','anomaly.module.posts::field.ttl.placeholder','anomaly.module.posts::field.ttl.warning','anomaly.module.posts::field.ttl.instructions'),
(79,79,'en','anomaly.module.posts::field.theme_layout.name','anomaly.module.posts::field.theme_layout.placeholder','anomaly.module.posts::field.theme_layout.warning','anomaly.module.posts::field.theme_layout.instructions'),
(80,80,'en','anomaly.module.preferences::field.user.name','anomaly.module.preferences::field.user.placeholder','anomaly.module.preferences::field.user.warning','anomaly.module.preferences::field.user.instructions'),
(81,81,'en','anomaly.module.preferences::field.key.name','anomaly.module.preferences::field.key.placeholder','anomaly.module.preferences::field.key.warning','anomaly.module.preferences::field.key.instructions'),
(82,82,'en','anomaly.module.preferences::field.value.name','anomaly.module.preferences::field.value.placeholder','anomaly.module.preferences::field.value.warning','anomaly.module.preferences::field.value.instructions'),
(83,83,'en','anomaly.module.redirects::field.from.name','anomaly.module.redirects::field.from.placeholder','anomaly.module.redirects::field.from.warning','anomaly.module.redirects::field.from.instructions'),
(84,84,'en','anomaly.module.redirects::field.to.name','anomaly.module.redirects::field.to.placeholder','anomaly.module.redirects::field.to.warning','anomaly.module.redirects::field.to.instructions'),
(85,85,'en','anomaly.module.redirects::field.status.name','anomaly.module.redirects::field.status.placeholder','anomaly.module.redirects::field.status.warning','anomaly.module.redirects::field.status.instructions'),
(86,86,'en','anomaly.module.redirects::field.secure.name','anomaly.module.redirects::field.secure.placeholder','anomaly.module.redirects::field.secure.warning','anomaly.module.redirects::field.secure.instructions'),
(87,87,'en','anomaly.module.settings::field.key.name','anomaly.module.settings::field.key.placeholder','anomaly.module.settings::field.key.warning','anomaly.module.settings::field.key.instructions'),
(88,88,'en','anomaly.module.settings::field.value.name','anomaly.module.settings::field.value.placeholder','anomaly.module.settings::field.value.warning','anomaly.module.settings::field.value.instructions'),
(89,89,'en','anomaly.module.users::field.email.name','anomaly.module.users::field.email.placeholder','anomaly.module.users::field.email.warning','anomaly.module.users::field.email.instructions'),
(90,90,'en','anomaly.module.users::field.username.name','anomaly.module.users::field.username.placeholder','anomaly.module.users::field.username.warning','anomaly.module.users::field.username.instructions'),
(91,91,'en','anomaly.module.users::field.password.name','anomaly.module.users::field.password.placeholder','anomaly.module.users::field.password.warning','anomaly.module.users::field.password.instructions'),
(92,92,'en','anomaly.module.users::field.remember_token.name','anomaly.module.users::field.remember_token.placeholder','anomaly.module.users::field.remember_token.warning','anomaly.module.users::field.remember_token.instructions'),
(93,93,'en','anomaly.module.users::field.ip_address.name','anomaly.module.users::field.ip_address.placeholder','anomaly.module.users::field.ip_address.warning','anomaly.module.users::field.ip_address.instructions'),
(94,94,'en','anomaly.module.users::field.last_login_at.name','anomaly.module.users::field.last_login_at.placeholder','anomaly.module.users::field.last_login_at.warning','anomaly.module.users::field.last_login_at.instructions'),
(95,95,'en','anomaly.module.users::field.last_activity_at.name','anomaly.module.users::field.last_activity_at.placeholder','anomaly.module.users::field.last_activity_at.warning','anomaly.module.users::field.last_activity_at.instructions'),
(96,96,'en','anomaly.module.users::field.permissions.name','anomaly.module.users::field.permissions.placeholder','anomaly.module.users::field.permissions.warning','anomaly.module.users::field.permissions.instructions'),
(97,97,'en','anomaly.module.users::field.display_name.name','anomaly.module.users::field.display_name.placeholder','anomaly.module.users::field.display_name.warning','anomaly.module.users::field.display_name.instructions'),
(98,98,'en','anomaly.module.users::field.first_name.name','anomaly.module.users::field.first_name.placeholder','anomaly.module.users::field.first_name.warning','anomaly.module.users::field.first_name.instructions'),
(99,99,'en','anomaly.module.users::field.last_name.name','anomaly.module.users::field.last_name.placeholder','anomaly.module.users::field.last_name.warning','anomaly.module.users::field.last_name.instructions'),
(100,100,'en','anomaly.module.users::field.name.name','anomaly.module.users::field.name.placeholder','anomaly.module.users::field.name.warning','anomaly.module.users::field.name.instructions'),
(101,101,'en','anomaly.module.users::field.description.name','anomaly.module.users::field.description.placeholder','anomaly.module.users::field.description.warning','anomaly.module.users::field.description.instructions'),
(102,102,'en','anomaly.module.users::field.reset_code.name','anomaly.module.users::field.reset_code.placeholder','anomaly.module.users::field.reset_code.warning','anomaly.module.users::field.reset_code.instructions'),
(103,103,'en','anomaly.module.users::field.reset_code_expires_at.name','anomaly.module.users::field.reset_code_expires_at.placeholder','anomaly.module.users::field.reset_code_expires_at.warning','anomaly.module.users::field.reset_code_expires_at.instructions'),
(104,104,'en','anomaly.module.users::field.activation_code.name','anomaly.module.users::field.activation_code.placeholder','anomaly.module.users::field.activation_code.warning','anomaly.module.users::field.activation_code.instructions'),
(105,105,'en','anomaly.module.users::field.activation_code_expires_at.name','anomaly.module.users::field.activation_code_expires_at.placeholder','anomaly.module.users::field.activation_code_expires_at.warning','anomaly.module.users::field.activation_code_expires_at.instructions'),
(106,106,'en','anomaly.module.users::field.activated.name','anomaly.module.users::field.activated.placeholder','anomaly.module.users::field.activated.warning','anomaly.module.users::field.activated.instructions'),
(107,107,'en','anomaly.module.users::field.enabled.name','anomaly.module.users::field.enabled.placeholder','anomaly.module.users::field.enabled.warning','anomaly.module.users::field.enabled.instructions'),
(108,108,'en','anomaly.module.users::field.slug.name','anomaly.module.users::field.slug.placeholder','anomaly.module.users::field.slug.warning','anomaly.module.users::field.slug.instructions'),
(109,109,'en','anomaly.module.users::field.roles.name','anomaly.module.users::field.roles.placeholder','anomaly.module.users::field.roles.warning','anomaly.module.users::field.roles.instructions'),
(110,110,'en','anomaly.extension.page_link_type::field.title.name','anomaly.extension.page_link_type::field.title.placeholder','anomaly.extension.page_link_type::field.title.warning','anomaly.extension.page_link_type::field.title.instructions'),
(111,111,'en','anomaly.extension.page_link_type::field.page.name','anomaly.extension.page_link_type::field.page.placeholder','anomaly.extension.page_link_type::field.page.warning','anomaly.extension.page_link_type::field.page.instructions'),
(112,112,'en','anomaly.extension.page_link_type::field.description.name','anomaly.extension.page_link_type::field.description.placeholder','anomaly.extension.page_link_type::field.description.warning','anomaly.extension.page_link_type::field.description.instructions'),
(113,113,'en','anomaly.extension.url_link_type::field.title.name','anomaly.extension.url_link_type::field.title.placeholder','anomaly.extension.url_link_type::field.title.warning','anomaly.extension.url_link_type::field.title.instructions'),
(114,114,'en','anomaly.extension.url_link_type::field.url.name','anomaly.extension.url_link_type::field.url.placeholder','anomaly.extension.url_link_type::field.url.warning','anomaly.extension.url_link_type::field.url.instructions'),
(115,115,'en','anomaly.extension.url_link_type::field.description.name','anomaly.extension.url_link_type::field.description.placeholder','anomaly.extension.url_link_type::field.description.warning','anomaly.extension.url_link_type::field.description.instructions');
/*!40000 ALTER TABLE `default_streams_fields_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_streams_streams
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_streams_streams`;
CREATE TABLE `default_streams_streams` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`namespace` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`prefix` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`title_column` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'id',
`order_by` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'id',
`locked` tinyint(1) NOT NULL DEFAULT '0',
`hidden` tinyint(1) NOT NULL DEFAULT '0',
`sortable` tinyint(1) NOT NULL DEFAULT '0',
`searchable` tinyint(1) NOT NULL DEFAULT '0',
`trashable` tinyint(1) NOT NULL DEFAULT '0',
`translatable` tinyint(1) NOT NULL DEFAULT '0',
`config` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_streams` (`namespace`,`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_streams_streams` WRITE;
/*!40000 ALTER TABLE `default_streams_streams` DISABLE KEYS */;
INSERT INTO `default_streams_streams` (`id`, `namespace`, `slug`, `prefix`, `title_column`, `order_by`, `locked`, `hidden`, `sortable`, `searchable`, `trashable`, `translatable`, `config`)
VALUES
(1,'configuration','configuration','configuration_','id','id',1,0,0,0,0,0,'a:0:{}'),
(2,'dashboard','dashboards','dashboard_','name','id',0,0,1,0,0,1,'a:0:{}'),
(3,'dashboard','widgets','dashboard_','title','id',0,0,1,0,0,1,'a:0:{}'),
(4,'files','disks','files_','name','id',0,0,1,0,0,1,'a:0:{}'),
(5,'files','folders','files_','name','id',0,0,1,0,1,1,'a:0:{}'),
(6,'files','files','files_','name','id',0,0,0,1,1,0,'a:0:{}'),
(7,'navigation','menus','navigation_','name','id',0,0,0,0,1,1,'a:0:{}'),
(8,'navigation','links','navigation_','id','id',0,0,1,0,1,0,'a:0:{}'),
(9,'pages','pages','pages_','title','id',0,0,1,1,1,1,'a:0:{}'),
(10,'pages','types','pages_','name','id',0,0,1,0,1,1,'a:0:{}'),
(11,'posts','categories','posts_','name','id',0,0,1,0,1,1,'a:0:{}'),
(12,'posts','posts','posts_','title','id',0,0,0,1,1,1,'a:0:{}'),
(13,'posts','types','posts_','name','id',0,0,1,0,1,1,'a:0:{}'),
(14,'preferences','preferences','preferences_','id','id',0,0,0,0,0,0,'a:0:{}'),
(15,'redirects','redirects','redirects_','from','id',0,0,1,0,1,0,'a:0:{}'),
(16,'settings','settings','settings_','id','id',0,0,0,0,0,0,'a:0:{}'),
(17,'users','users','users_','display_name','id',0,0,0,1,1,0,'a:0:{}'),
(18,'users','roles','users_','name','id',0,0,0,0,1,1,'a:0:{}'),
(19,'page_link_type','pages','page_link_type_','title','id',0,0,0,0,0,1,'a:0:{}'),
(20,'url_link_type','urls','url_link_type_','title','id',0,0,0,0,0,1,'a:0:{}'),
(21,'files','images','files_','id','id',0,0,0,0,1,1,'a:0:{}'),
(22,'files','documents','files_','id','id',0,0,0,0,1,1,'a:0:{}'),
(23,'pages','default_pages','pages_','id','id',0,1,0,0,1,1,'a:0:{}'),
(24,'posts','default_posts','posts_','id','id',0,1,0,0,1,1,'a:0:{}');
/*!40000 ALTER TABLE `default_streams_streams` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_streams_streams_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_streams_streams_translations`;
CREATE TABLE `default_streams_streams_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`stream_id` int(11) NOT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `streams_streams_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_streams_streams_translations` WRITE;
/*!40000 ALTER TABLE `default_streams_streams_translations` DISABLE KEYS */;
INSERT INTO `default_streams_streams_translations` (`id`, `stream_id`, `locale`, `name`, `description`)
VALUES
(1,1,'en','anomaly.module.configuration::stream.configuration.name','anomaly.module.configuration::stream.configuration.description'),
(2,2,'en','anomaly.module.dashboard::stream.dashboards.name','anomaly.module.dashboard::stream.dashboards.description'),
(3,3,'en','anomaly.module.dashboard::stream.widgets.name','anomaly.module.dashboard::stream.widgets.description'),
(4,4,'en','anomaly.module.files::stream.disks.name','anomaly.module.files::stream.disks.description'),
(5,5,'en','anomaly.module.files::stream.folders.name','anomaly.module.files::stream.folders.description'),
(6,6,'en','anomaly.module.files::stream.files.name','anomaly.module.files::stream.files.description'),
(7,7,'en','anomaly.module.navigation::stream.menus.name','anomaly.module.navigation::stream.menus.description'),
(8,8,'en','anomaly.module.navigation::stream.links.name','anomaly.module.navigation::stream.links.description'),
(9,9,'en','anomaly.module.pages::stream.pages.name','anomaly.module.pages::stream.pages.description'),
(10,10,'en','anomaly.module.pages::stream.types.name','anomaly.module.pages::stream.types.description'),
(11,11,'en','anomaly.module.posts::stream.categories.name','anomaly.module.posts::stream.categories.description'),
(12,12,'en','anomaly.module.posts::stream.posts.name','anomaly.module.posts::stream.posts.description'),
(13,13,'en','anomaly.module.posts::stream.types.name','anomaly.module.posts::stream.types.description'),
(14,14,'en','anomaly.module.preferences::stream.preferences.name','anomaly.module.preferences::stream.preferences.description'),
(15,15,'en','anomaly.module.redirects::stream.redirects.name','anomaly.module.redirects::stream.redirects.description'),
(16,16,'en','anomaly.module.settings::stream.settings.name','anomaly.module.settings::stream.settings.description'),
(17,17,'en','anomaly.module.users::stream.users.name','anomaly.module.users::stream.users.description'),
(18,18,'en','anomaly.module.users::stream.roles.name','anomaly.module.users::stream.roles.description'),
(19,19,'en','anomaly.extension.page_link_type::stream.pages.name','anomaly.extension.page_link_type::stream.pages.description'),
(20,20,'en','anomaly.extension.url_link_type::stream.urls.name','anomaly.extension.url_link_type::stream.urls.description'),
(21,21,'en','Images','A folder for images.'),
(22,22,'en','Documents','A folder for documents.'),
(23,23,'en','Default','A simple page type.'),
(24,24,'en','Default',NULL);
/*!40000 ALTER TABLE `default_streams_streams_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_url_link_type_urls
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_url_link_type_urls`;
CREATE TABLE `default_url_link_type_urls` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_url_link_type_urls` WRITE;
/*!40000 ALTER TABLE `default_url_link_type_urls` DISABLE KEYS */;
INSERT INTO `default_url_link_type_urls` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `url`)
VALUES
(1,1,'2016-12-11 00:36:14',NULL,NULL,NULL,'http://pyrocms.com/'),
(2,2,'2016-12-11 00:36:14',NULL,NULL,NULL,'http://pyrocms.com/documentation');
/*!40000 ALTER TABLE `default_url_link_type_urls` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_url_link_type_urls_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_url_link_type_urls_translations`;
CREATE TABLE `default_url_link_type_urls_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `url_link_type_urls_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_url_link_type_urls_translations` WRITE;
/*!40000 ALTER TABLE `default_url_link_type_urls_translations` DISABLE KEYS */;
INSERT INTO `default_url_link_type_urls_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `title`, `description`)
VALUES
(1,1,'2016-12-11 00:36:14',NULL,'2016-12-11 00:36:14',NULL,'en','PyroCMS.com',NULL),
(2,2,'2016-12-11 00:36:14',NULL,'2016-12-11 00:36:14',NULL,'en','Documentation',NULL);
/*!40000 ALTER TABLE `default_url_link_type_urls_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_users_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_users_roles`;
CREATE TABLE `default_users_roles` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`permissions` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `caf6c27189763021b0adb2df06ac215a` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_users_roles` WRITE;
/*!40000 ALTER TABLE `default_users_roles` DISABLE KEYS */;
INSERT INTO `default_users_roles` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `slug`, `permissions`)
VALUES
(1,1,'2016-12-11 00:36:20',NULL,NULL,NULL,NULL,'admin',NULL),
(2,2,'2016-12-11 00:36:20',NULL,NULL,NULL,NULL,'user',NULL),
(3,3,'2016-12-11 00:36:20',NULL,NULL,NULL,NULL,'guest',NULL);
/*!40000 ALTER TABLE `default_users_roles` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_users_roles_translations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_users_roles_translations`;
CREATE TABLE `default_users_roles_translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `users_roles_translations_locale_index` (`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_users_roles_translations` WRITE;
/*!40000 ALTER TABLE `default_users_roles_translations` DISABLE KEYS */;
INSERT INTO `default_users_roles_translations` (`id`, `entry_id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `locale`, `name`, `description`)
VALUES
(1,1,'2016-12-11 00:36:20',NULL,'2016-12-11 00:36:20',NULL,'en','Admin','The super admin role.'),
(2,2,'2016-12-11 00:36:20',NULL,'2016-12-11 00:36:20',NULL,'en','User','The default user role.'),
(3,3,'2016-12-11 00:36:20',NULL,'2016-12-11 00:36:20',NULL,'en','Guest','The fallback role for non-users.');
/*!40000 ALTER TABLE `default_users_roles_translations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_users_users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_users_users`;
CREATE TABLE `default_users_users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sort_order` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`display_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`activated` tinyint(1) DEFAULT '0',
`enabled` tinyint(1) DEFAULT '1',
`permissions` text COLLATE utf8_unicode_ci,
`last_login_at` datetime DEFAULT NULL,
`remember_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`activation_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`reset_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_activity_at` datetime DEFAULT NULL,
`ip_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `629261acd8d03fcded8346ea75c17f69` (`email`),
UNIQUE KEY `f2670725cfcd5865ce00c00c4ce0fe7a` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_users_users` WRITE;
/*!40000 ALTER TABLE `default_users_users` DISABLE KEYS */;
INSERT INTO `default_users_users` (`id`, `sort_order`, `created_at`, `created_by`, `updated_at`, `updated_by`, `deleted_at`, `email`, `username`, `password`, `display_name`, `first_name`, `last_name`, `activated`, `enabled`, `permissions`, `last_login_at`, `remember_token`, `activation_code`, `reset_code`, `last_activity_at`, `ip_address`)
VALUES
(1,1,'2016-12-11 00:36:21',NULL,'2016-12-11 00:36:21',NULL,NULL,'admin@localhost.com','admin','$2y$10$y40zCgInrFdd6AIJuQZQyO4kHYfF/oEXlt7/QyaPqvWD/5kuGZjBG','Administrator',NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(2,2,'2016-12-11 00:36:21',NULL,'2016-12-11 00:36:21',NULL,NULL,'demo@pyrocms.com','demo','$2y$10$TYIVk/iOE2t3HZJ3uVvfNO4sorj1D5L8FqbYQ2yzci2o/gi279F.y','Demo User',NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `default_users_users` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table default_users_users_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `default_users_users_roles`;
CREATE TABLE `default_users_users_roles` (
`entry_id` int(11) NOT NULL,
`related_id` int(11) NOT NULL,
`sort_order` int(11) DEFAULT NULL,
PRIMARY KEY (`entry_id`,`related_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `default_users_users_roles` WRITE;
/*!40000 ALTER TABLE `default_users_users_roles` DISABLE KEYS */;
INSERT INTO `default_users_users_roles` (`entry_id`, `related_id`, `sort_order`)
VALUES
(1,1,NULL),
(2,2,NULL);
/*!40000 ALTER TABLE `default_users_users_roles` ENABLE KEYS */;
UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_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 */;
|
/* Welcome to the SQL mini project. For this project, you will use
Springboard' online SQL platform, which you can log into through the
following link:
https://sql.springboard.com/
Username: student
Password: learn_sql@springboard
The data you need is in the "country_club" database. This database
contains 3 tables:
i) the "Bookings" table,
ii) the "Facilities" table, and
iii) the "Members" table.
Note that, if you need to, you can also download these tables locally.
In the mini project, you'll be asked a series of questions. You can
solve them using the platform, but for the final deliverable,
paste the code for each solution into this script, and upload it
to your GitHub.
Before starting with the questions, feel free to take your time,
exploring the data, and getting acquainted with the 3 tables. */
/* Q1: Some of the facilities charge a fee to members, but some do not.
Please list the names of the facilities that do. */
SELECT *
FROM `Facilities`
WHERE membercost = 0
/* Q2: How many facilities do not charge a fee to members? */
SELECT COUNT( * )
FROM `Facilities`
WHERE membercost =0
print out 4
/* Q3: How can you produce a list of facilities that charge a fee to members,
where the fee is less than 20% of the facility's monthly maintenance cost?
Return the facid, facility name, member cost, and monthly maintenance of the
facilities in question. */
SELECT facid, name, membercost, monthlymaintenance
FROM `Facilities`
WHERE membercost >0
AND membercost < ( .20 * monthlymaintenance )
/* Q4: How can you retrieve the details of facilities with ID 1 and 5?
Write the query without using the OR operator. */
SELECT *
FROM `Facilities`
WHERE facid
IN ( 1, 5 )
LIMIT 0 , 30
/* Q5: How can you produce a list of facilities, with each labelled as
'cheap' or 'expensive', depending on if their monthly maintenance cost is
more than $100? Return the name and monthly maintenance of the facilities
in question. */
SELECT name, monthlymaintenance,
CASE WHEN (
monthlymaintenance >0
)
AND (
monthlymaintenance <=100
)
THEN 'CHEAP'
ELSE 'EXPENSIVE'
END AS CHEAP_OR_EXPENSIVE
/* Q6: You'd like to get the first and last name of the last member(s)
who signed up. Do not use the LIMIT clause for your solution. */
SELECT firstname, surname, joindate FROM `Members` Order by joindate DESC
/* Q7: How can you produce a list of all members who have used a tennis court?
Include in your output the name of the court, and the name of the member
formatted as a single column. Ensure no duplicate data, and order by
the member name. */
SELECT DISTINCT CONCAT( country_club.Members.firstname, country_club.Members.surname ) AS MembersFullName, country_club.Facilities.name AS FacilityName
FROM country_club.Members
JOIN country_club.Bookings ON country_club.Members.memid = country_club.Bookings.memid
JOIN country_club.Facilities ON country_club.Facilities.facid = country_club.Bookings.facid
ORDER BY MembersFullName
/* Q8: How can you produce a list of bookings on the day of 2012-09-14 which
will cost the member (or guest) more than $30? Remember that guests have
different costs to members (the listed costs are per half-hour 'slot'), and
the guest user's ID is always 0. Include in your output the name of the
facility, the name of the member formatted as a single column, and the cost.
Order by descending cost, and do not use any subqueries. */
select "name" as "facilityname", concat(firstname, ' ', surname) as personname, case when b.memid=0 then guestcost*slots
else membercost*slots end as cost, bookid
from Bookings as b
inner join Facilities as f on b.facid=f.facid
inner join Members as m on b.memid=m.memid
where starttime>='2012-09-14' and starttime<'2012-09-15' and
(case when b.memid=0 then guestcost*slots
else membercost*slots end)>30
order by cost desc
/* Q9: This time, produce the same result as in Q8, but using a subquery. */
select "name" as "facilityname", concat(firstname, ' ', surname) as personname, cost, bookid
from
(select memid, "name", guestcost*slots as "cost", bookid
from Bookings as b
inner join Facilities as f on b.facid=f.facid
where starttime>='2012-09-14' and starttime<'2012-09-15' and memid=0 and guestcost*slots>30
Union all
select memid, "name", membercost*slots as "cost", bookid
from Bookings as b
inner join Facilities as f on b.facid=f.facid
where starttime>='2012-09-14' and starttime<'2012-09-15' and memid<>0 and membercost*slots>30) as cost30
inner join Members on cost30.memid = Members.memid
order by cost desc
/* Q10: Produce a list of facilities with a total revenue less than 1000.
The output of facility name and total revenue, sorted by revenue. Remember
that there's a different cost for guests and members! */
select "name",
sum(case when memid=0 then guestcost*slots
else membercost*slots end) as revenue
from Bookings as b
inner join Facilities as f on b.facid=f.facid
group by "name"
having sum(case when memid=0 then guestcost*slots
else membercost*slots end)<1000
|
-- --------------------------------------------------------
-- Servidor: 127.0.0.1
-- Versão do servidor: 8.0.13 - MySQL Community Server - GPL
-- OS do Servidor: Win64
-- HeidiSQL Versão: 9.3.0.4984
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!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' */;
-- Copiando estrutura do banco de dados para tony-veiculos
DROP DATABASE IF EXISTS `tony-veiculos`;
CREATE DATABASE IF NOT EXISTS `tony-veiculos` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */;
USE `tony-veiculos`;
-- Copiando estrutura para tabela tony-veiculos.nomes
DROP TABLE IF EXISTS `nomes`;
CREATE TABLE IF NOT EXISTS `nomes` (
`NOM_CODIGO` int(11) NOT NULL AUTO_INCREMENT,
`NOM_NOME` varchar(250) DEFAULT NULL,
PRIMARY KEY (`NOM_CODIGO`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Copiando dados para a tabela tony-veiculos.nomes: ~0 rows (aproximadamente)
DELETE FROM `nomes`;
/*!40000 ALTER TABLE `nomes` DISABLE KEYS */;
INSERT INTO `nomes` (`NOM_CODIGO`, `NOM_NOME`) VALUES
(10, 'TESTE NUMERO UM'),
(11, 'TESTE NÚMERO DOIS'),
(12, 'TESTE NUMERO 3'),
(13, 'TESTE NÚMERO 4');
/*!40000 ALTER TABLE `nomes` ENABLE KEYS */;
-- Copiando estrutura para tabela tony-veiculos.telefones
DROP TABLE IF EXISTS `telefones`;
CREATE TABLE IF NOT EXISTS `telefones` (
`TEL_CODIGO` int(11) NOT NULL AUTO_INCREMENT,
`NOM_CODIGO` int(11) DEFAULT NULL,
`TEL_NUMERO` varchar(15) DEFAULT NULL,
PRIMARY KEY (`TEL_CODIGO`),
KEY `NOM_CODIGO` (`NOM_CODIGO`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Copiando dados para a tabela tony-veiculos.telefones: ~0 rows (aproximadamente)
DELETE FROM `telefones`;
/*!40000 ALTER TABLE `telefones` DISABLE KEYS */;
INSERT INTO `telefones` (`TEL_CODIGO`, `NOM_CODIGO`, `TEL_NUMERO`) VALUES
(2, 10, '(21) 31242-1412'),
(4, 10, '(12) 34322-3434'),
(6, 11, '(21) 32321-3231'),
(7, 12, '(11) 11111-1111'),
(8, 13, '(12) 31241-4352'),
(9, 13, '(45) 43534-5345');
/*!40000 ALTER TABLE `telefones` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
CREATE UNIQUE INDEX index_tbl_customer_details
ON tbl_customer_details (customer_id);
/
CREATE UNIQUE INDEX index_tbl_customer_address
ON tbl_customer_address (customer_id); |
/*ESPAÇOS*/
/*A3*/
insert into habitat values('A3', 'Quente e húmida', '1200');
/*A4*/
insert into habitat values('A4', 'Quente e húmida', '1100');
/*A5*/
insert into habitat values('A5', 'Quente e húmida', '1100');
/*A1*/
insert into habitat values('A1', 'Quente e húmida', '2000');
/*A2*/
insert into habitat values('A2', 'Fria e seca', '1500');
/*A6*/
insert into habitat values('A6', 'Quente e húmida', '500');
/*A7*/
insert into habitat values('A7', 'Quente e seca', '400');
/*Administrativoss*/
/*Manuel Ferreira*/
insert into funcionario values('123123129', 'Manuel Ferreira', '2004-02-01');
insert into administrativo values('123123129');
insert into funcionario_telefone values('123123129', '919999996');
insert into funcionario_telefone values('123123129', '266787806');
/*Manuela Torres*/
insert into funcionario values('123123130', 'Manuela Torres', '2004-04-01');
insert into administrativo values('123123130');
insert into funcionario_telefone values('123123130', '919999996');
insert into funcionario_telefone values('123123130', '266787806');
insert into funcionario_responsavel values('123123130', '123123129');
/*Manuel Ferreira*/
insert into funcionario_responsavel values('123123129', '123123130');
/*TRATADORES*/
/*Maria Gomes*/
insert into funcionario values('123123125', 'Maria Gomes', '2003-01-01');
insert into tratador values('123123125');
insert into funcionario_telefone values('123123125','919999997');
insert into funcionario_telefone values('123123125','266787807');
insert into funcionario_responsavel values('123123125', '123123130');
/*Joaquim Silva*/
insert into funcionario values('123123123', 'Joaquim Silva', '2003-02-01');
insert into tratador values('123123123');
insert into funcionario_telefone values('123123123','919999999');
insert into funcionario_telefone values('123123123','266787809');
insert into funcionario_responsavel values('123123123', '123123125');
/*Manuel Santos*/
insert into funcionario values('123123124', 'Manuel Santos', '2003-04-01');
insert into tratador values('123123124');
insert into funcionario_telefone values('123123124','919999998');
insert into funcionario_telefone values('123123124','266787808');
insert into funcionario_responsavel values('123123124', '123123125');
/*AUXILIARES*/
/*Mariana Silva*/
insert into funcionario values('123123126', 'Mariana Silva', '2004-02-01');
insert into auxiliar values('123123126');
insert into funcionario_telefone values('123123126','919999996');
insert into funcionario_telefone values('123123126','266787806');
insert into funcionario_responsavel values('123123126', '123123130');
insert into auxiliar_habitat values('A3', '123123126');
insert into auxiliar_habitat values('A4', '123123126');
insert into auxiliar_habitat values('A5', '123123126');
/*Jorge Gomes*/
insert into funcionario values('123123127', 'Jorge Gomes', '2004-03-01');
insert into auxiliar values('123123127');
insert into funcionario_telefone values('123123127','919999995');
insert into funcionario_telefone values('123123127','266787807');
insert into funcionario_responsavel values('123123127', '123123130');
insert into auxiliar_habitat values('A1', '123123127');
/*Francisco Jorge*/
insert into funcionario values('123123128', 'Francisco Jorge', '2004-03-01');
insert into auxiliar values('123123128');
insert into funcionario_telefone values('123123128','919999994');
insert into funcionario_telefone values('123123128','266787806');
insert into funcionario_responsavel values('123123128', '123123130');
insert into auxiliar_habitat values('A2', '123123128');
insert into auxiliar_habitat values('A7', '123123128');
/*Animais*/
/*TIGRES*/
insert into classificacao values('Tigre', 'Felinos', 'Carnivoros', 'Mamiferos');
/*Taji*/
insert into animais values('123456', 'Taji', 'M', '123123123', 'Tigre', 'A3');
insert into capturado values('123456', 'India, Agra', '2002-10-03','2003-12-20');
/*Mali*/
insert into animais values('222456', 'Mali', 'F', '123123123', 'Tigre', 'A3');
insert into capturado values('222456', 'India, Deli', '2003-11-05', '2004-11-30');
/*Aka*/
insert into animais values('322456', 'Aka', 'F', '123123123', 'Tigre', 'A3');
insert into cativeiro values('322456', '2005-12-12', '222456', '123456');
/*Táta*/
insert into animais values('422456', 'Táta', 'F', '123123123', 'Tigre', 'A4');
insert into cativeiro values('422456', '2006-01-20', '222456', '123456');
/*Cáta*/
insert into animais values('432456', 'Cáta', 'M', '123123123', 'Tigre', 'A5');
insert into capturado values('432456', 'India, Calcutá', '2004-10-01', '2005-01-01');
/*Kata*/
insert into animais values('522456', 'Kata', 'F', '123123123', 'Tigre', 'A5');
insert into cativeiro values('522456', '2007-03-02', '422456', '432456');
/*Mata*/
insert into animais values('622456', 'Mata', 'M', '123123123', 'Tigre', 'A4');
insert into cativeiro values('622456', '2008-02-02', '522456', '123456');
/*HIPOPOTAMOS*/
insert into classificacao values('Hipopótamo Comum', 'Hipopótamos', 'Artiodáctilos', 'Mamiferos');
/*Hipo*/
insert into animais values('123444', 'Hipo', 'M', '123123124', 'Hipopótamo Comum', 'A1');
insert into capturado values('123444', 'África, Madagascar', '2003-06-03', '2004-06-06');
/*Tapi*/
insert into animais values('223444', 'Tapi', 'F', '123123124', 'Hipopótamo Comum', 'A1');
insert into capturado values('223444', '2004-01-06', '2004-06-06');
/*Hita*/
insert into animais values('323444', 'Hita', 'F', '123123124', 'Hipopótamo Comum', 'A1');
insert into cativeiro values('323444', '2006-09-01', '223444', '123444');
/*VEADOS*/
insert into classificacao values('Veado', 'Cervídeos', 'Artiodáctilos', 'Mamiferos');
/*Kaki*/
insert into animais values('123666', 'Kaki', 'M', '123123124', 'Veado', 'A2');
insert into capturado values('123666', 'Europa, Pirenéus', '2004-06-01', '2004-12-06');
/*Kalu*/
insert into animais values('223666', 'Kalu', 'F', '123123124', 'Veado', 'A2');
insert into capturado values('223666', 'Europa, Ourense', '2004-01-13', '2004-12-07');
/*Kilu*/
insert into animais values('323666', 'Kilu', 'M', '123123124', 'Veado', 'A2');
insert into cativeiro values('323666', '2008-04-03', '223666', '123666');
/*Luka*/
insert into animais values('423666', 'Luka', 'F', '123123124', 'Veado', 'A2');
insert into capturado values('423666', 'Europa, Gerês', '2005-03-11', '2005-07-25');
/*Kuli*/
insert into animais values('524666', 'Kuli', 'M', '123123124', 'Veado', 'A2');
insert into cativeiro values('524666', '2008-03-04', '423666', '123666');
/*ARARAS*/
insert into classificacao values('Arara-azul-pequena', 'Psittacidae', 'Psittaciformes', 'Aves');
/*Ará*/
insert into animais values('123555', 'Ará', 'M', '123123125', 'Arara-azul-pequena', 'A7');
insert into capturado values('123555', 'América do sul, Paramá', '2005-02-25', '2005-08-03');
/*Zará*/
insert into animais values('133555', 'Zará', 'M', '123123125', 'Arara-azul-pequena', 'A7');
insert into capturado values('133555', 'América do sul, Paramá', '2005-04-21', '2005-08-03');
/*Rará*/
insert into animais values('223555', 'Rará', 'F', '123123125', 'Arara-azul-pequena', 'A7');
insert into capturado values('223555', 'América do sul, Uruguai', '2006-09-25', '2006-11-03');
/*Rara*/
insert into animais values('323555', 'Rara', 'M', '123123125', 'Arara-azul-pequena', 'A7');
insert into cativeiro values('323555', '2009-05-07', '223555', '123555');
/*Zula*/
insert into animais values('423555', 'Zula', 'F', '123123125', 'Arara-azul-pequena', 'A7');
insert into cativeiro values('423555', '2009-05-07', '223555', '123555');
/*Zura*/
insert into animais values('523555', 'Zura', 'F', '123123125', 'Arara-azul-pequena', 'A7');
insert into cativeiro values('523555', '2009-05-07', '223555', '123555');
/*VETERNARIOS*/
/*Pedro Vale*/
insert into funcionario values('123123131', 'Pedro Vale', '2004-05-01');
insert into veternario values('123123131');
insert into funcionario_telefone values('123123131','919999986');
insert into funcionario_telefone values('123123131','266787816');
insert into funcionario_responsavel values('123123131', '123123129');
/*Mali 12/8/2005*/
insert into consulta values('123123131','2005-08-12 10:00:00', 'Gab1', '222456');
insert into diagnostico values('123123131','2005-08-12 10:00:00', 'Gab1', 'Grávida');
/*Mali 12/9/2005*/
insert into consulta values('123123131', '2005-09-12 10:00:00', 'Gab1', '222456');
insert into tratamento values('123123131','2005-09-12 10:00:00', 'Gab1', 'Cálcio injectado');
/*Mali 12/12/2005*/
insert into consulta values('123123131', '2005-12-12 10:00:00', 'Gab1', '222456');
insert into tratamento values('123123131','2005-12-12 10:00:00', 'Gab1', 'Parto');
/*Mali 12/7/2006*/
insert into consulta values('123123131', '2006-07-12 10:00:00', 'Gab1', '222456');
insert into diagnostico values('123123131','2006-07-12 10:00:00', 'Gab1', 'Infecção');
/*Mali 12/7/2006*/
insert into consulta values('123123131', '2006-07-12 10:05:00', 'Gab1', '222456');
insert into tratamento values('123123131','2006-07-12 10:05:00', 'Gab1', 'Antibiótico injectado');
/*Kaki 12/5/2009*/
insert into consulta values('123123131', '2009-05-12 10:00:00', 'Gab1', '123666');
insert into diagnostico values('123123131','2009-05-12 10:00:00', 'Gab1', 'Infecção');
/*Kaki 12/5/2009*/
insert into consulta values('123123131', '2009-05-12 10:05:00', 'Gab1', '123666');
insert into tratamento values('123123131','2009-05-12 10:05:00', 'Gab1', 'Antibiótico injectado');
/*Ará 12/5/2009*/
insert into consulta values('123123131', '2009-05-12 10:10:00', 'Gab1', '123555');
insert into diagnostico values('123123131','2009-05-12 10:10:00', 'Gab1', 'Infecção');
/*Ará 12/5/2009*/
insert into consulta values('123123131', '2009-05-12 10:15:00', 'Gab1', '123555');
insert into tratamento values('123123131','2009-05-12 10:15:00', 'Gab1', 'Antibiótico injectado');
/*Zula 12/5/2009*/
insert into consulta values('123123131', '2009-05-12 10:20:00', 'Gab1', '423555');
insert into diagnostico values('123123131','2009-05-12 10:20:00', 'Gab1', 'Infecção');
/*Zula 12/5/2009*/
insert into consulta values('123123131', '2009-05-12 10:25:00', 'Gab1', '423555');
insert into tratamento values('123123131','2009-05-12 10:25:00', 'Gab1', 'Antibiótico injectado');
/*Tapi 12/8/2007*/
insert into consulta values('123123131', '2007-08-12 10:00:00', 'Gab1', '223444');
insert into diagnostico values('123123131','2007-08-12 10:00:00', 'Gab1', 'Infecção');
/*Tapi 12/8/2007*/
insert into consulta values('123123131', '2007-08-12 10:05:00', 'Gab1', '223444');
insert into tratamento values('123123131','2007-08-12 10:05:00', 'Gab1', 'Antibiótico injectado');
/*Isabel Soares*/
insert into funcionario values('123123132', 'Isabel Soares', '2004-06-01');
insert into veternario values('123123132');
insert into funcionario_telefone values('123123132','919999976');
insert into funcionario_telefone values('123123132','266787826');
insert into funcionario_responsavel values('123123132', '123123131');
/*Tapi 12/7/2006*/
insert into consulta values('123123132', '2006-07-12 10:00:00', 'Gab2', '223444');
insert into diagnostico values('123123132','2006-07-12 10:00:00', 'Gab2', 'Grávida');
/*Tapi 12/7/2006*/
insert into consulta values('123123132', '2006-07-12 10:05:00', 'Gab2', '223444');
insert into tratamento values('123123132','2006-07-12 10:05:00', 'Gab2', 'Cálcio injectado');
/*Tapi 12/9/2006*/
insert into consulta values('123123132', '2006-09-12 10:00:00', 'Gab2', '223444');
insert into tratamento values('123123132','2006-09-12 10:00:00', 'Gab2', 'Parto');
/*Tapi 12/7/2007*/
insert into consulta values('123123132', '2007-07-12 10:00:00', 'Gab2', '223444');
insert into diagnostico values('123123132','2007-07-12 10:00:00', 'Gab2', 'Infecção');
/*Tapi 12/7/2007*/
insert into consulta values('123123132', '2007-07-12 10:05:00', 'Gab2', '223444');
insert into tratamento values('123123132','2007-07-12 10:05:00', 'Gab2', 'Antibiótico injectado');
/*Tapi 12/7/2007*/
insert into consulta values('123123132', '2007-07-12 10:10:00', 'Gab2', '223444');
insert into diagnostico values('123123132','2007-07-12 10:10:00', 'Gab2', 'Grávida');
/*Tapi 12/7/2007*/
insert into consulta values('123123132', '2007-07-12 10:15:00', 'Gab2', '223444');
insert into tratamento values('123123132','2007-07-12 10:15:00', 'Gab2', 'Cálcio injectado');
/*Tapi 12/9/2007*/
insert into consulta values('123123132', '2007-09-12 10:00:00', 'Gab2', '223444');
insert into tratamento values('123123132','2007-09-12 10:00:00', 'Gab2', 'Parto');
/*Zula 12/6/2009*/
insert into consulta values('123123132', '2009-06-12 10:00:00', 'Gab2', '223444');
insert into diagnostico values('123123132','2009-06-12 10:00:00', 'Gab2', 'Infecção');
/*Zula 12/6/2009*/
insert into consulta values('123123132', '2009-06-12 10:05:00', 'Gab2', '223444');
insert into tratamento values('123123132','2009-06-12 10:05:00', 'Gab2', 'Antibiótico injectado');
|
set lines 150 pages 200
col USERNAME format a30
col GRANTED_ROLE format a30
col PRIVILEGE format a50
with privs (grantee
,granted_role
,lvl
)
as (select rp1.grantee
,rp1.granted_role
,1
from dba_role_privs rp1
join dba_users u
on rp1.grantee = u.username
union all
select privs.grantee
,rp2.granted_role
,privs.lvl+1
from dba_role_privs rp2
join privs
on privs.granted_role = rp2.grantee
)
select distinct u.username
,p.granted_role
,coalesce(up.privilege,rp.privilege) privilege
from dba_users u
join (select grantee
,granted_role
from privs
union all
select username
,'<user>'
from dba_users
) p
on u.username = p.grantee
left join dba_sys_privs up
on u.username = up.grantee
and p.granted_role ='<user>'
left join dba_sys_privs rp
on p.granted_role = rp.grantee
where u.username='&what_user'
and u.account_status = 'OPEN'
order by 1,2,3;
|
DROP TABLE IF EXISTS `XXX_umfrage`; ##b_dump##
DROP TABLE IF EXISTS `XXX_umfrage_antworten`; ##b_dump##
DROP TABLE IF EXISTS `XXX_umfrage_antworten_language`; ##b_dump##
DROP TABLE IF EXISTS `XXX_umfrage_language`; ##b_dump##
DROP TABLE IF EXISTS `XXX_umfrage_user`; ##b_dump## |
USE education;
CREATE TABLE role(
id INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
name VARCHAR(50) NOT NULL
)
CREATE TABLE users (
username VARCHAR(50) NOT NULL PRIMARY KEY,
password VARCHAR(100) NOT NULL
)
CREATE TABLE user_role(
username VARCHAR(50) NOT NULL FOREIGN KEY REFERENCES users(username),
role_id int NOT NULL FOREIGN KEY REFERENCES role(id)
)
|
CREATE USER 'read02'@'localhost' identified BY 'read02';
GRANT SELECT, EXECUTE ON *.* TO 'read02'@'localhost'; |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 12, 2017 at 11:03 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
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: `web3`
--
-- --------------------------------------------------------
--
-- Table structure for table `allusers`
--
CREATE TABLE `allusers` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`dob` date NOT NULL,
`Address` varchar(255) NOT NULL,
`tpnumber` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `allusers`
--
INSERT INTO `allusers` (`id`, `name`, `email`, `username`, `password`, `dob`, `Address`, `tpnumber`) VALUES
(4, 'test', 'test2@gmail.com', 'test', 'test', '1230-09-22', '', '32423424'),
(5, 'admin', 'test2@gmail.com', 'admin', 'admin', '1230-09-22', '', '32423424'),
(31, 'radi', 'radi@rocketmail.com', 'radi', 'a', '2017-09-26', 'a', '4');
-- --------------------------------------------------------
--
-- Table structure for table `feedback`
--
CREATE TABLE `feedback` (
`id` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`message` varchar(500) NOT NULL,
`date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `feedback`
--
INSERT INTO `feedback` (`id`, `email`, `message`, `date`) VALUES
(1, 'wq@ss.com', 'messafe', '2016-02-10 13:52:29'),
(2, 'rudra@gmail.com', 'need more products', '2017-08-24 19:28:56');
-- --------------------------------------------------------
--
-- Table structure for table `items`
--
CREATE TABLE `items` (
`id` int(100) NOT NULL,
`name` varchar(500) NOT NULL,
`image` varchar(500) NOT NULL,
`price` int(200) NOT NULL,
`category` varchar(500) NOT NULL,
`size` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `items`
--
INSERT INTO `items` (`id`, `name`, `image`, `price`, `category`, `size`) VALUES
(7, 'SHoe Limited', '789182.jpg', 12, 'Drinks', ''),
(13, 'Equipment2', '370259.jpg', 12, 'Equipment', ''),
(14, 'Equipment1', '416874.jpg', 13, 'Equipment', ''),
(15, 'Chelsea Jersey', '977166.jpg', 40, 'Jersey', ''),
(16, 'Shoe', '237518.jpg', 100, 'Shoe', ''),
(17, 'MU', '866254.jpg', 100, 'Jersey', '');
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE `orders` (
`id` int(11) NOT NULL,
`item_name` varchar(255) NOT NULL,
`item_price` varchar(255) NOT NULL,
`item_qty` int(255) NOT NULL,
`order_by` varchar(255) NOT NULL,
`date` datetime NOT NULL,
`status` varchar(20) NOT NULL DEFAULT 'Pending',
`size` text NOT NULL,
`category` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `orders`
--
INSERT INTO `orders` (`id`, `item_name`, `item_price`, `item_qty`, `order_by`, `date`, `status`, `size`, `category`) VALUES
(7, 'Chelsea Jersey', '40', 2, 'radi', '2017-09-12 22:23:58', 'Pending', 'XL', ''),
(8, 'Shoe', '100', 3, 'radi', '2017-09-12 22:28:05', 'Pending', '', ''),
(9, 'Shoe', '100', 3, 'radi', '2017-09-12 22:29:07', 'Pending', '', ''),
(10, 'Shoe', '100', 3, 'radi', '2017-09-12 22:29:50', 'Pending', '', ''),
(11, 'MU', '100', 4, 'radi', '2017-09-12 22:30:09', 'Pending', 'XXL', ''),
(12, 'Chelsea Jersey', '40', 2, 'firdaus', '2017-09-12 22:33:01', 'Pending', 'S', ''),
(13, 'Shoe', '100', 3, 'firdaus', '2017-09-12 22:33:09', 'Pending', '', ''),
(14, 'Equipment2', '12', 1, 'test', '2017-09-12 23:02:45', 'Pending', '', ''),
(15, 'Chelsea Jersey', '40', 2, 'test', '2017-09-12 23:02:59', 'Pending', 'L', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `allusers`
--
ALTER TABLE `allusers`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `feedback`
--
ALTER TABLE `feedback`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `items`
--
ALTER TABLE `items`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `allusers`
--
ALTER TABLE `allusers`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT for table `feedback`
--
ALTER TABLE `feedback`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `items`
--
ALTER TABLE `items`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
/*!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 DATABASE IF EXISTS javashopmodeldb;
CREATE DATABASE javashopmodeldb;
use javashopmodeldb;
#GRANT INSERT, SELECT, UPDATE ON javashopmodeldb.* TO shop_cashier;
#GRANT CREATE USER, GRANT OPTION ON *.* TO shop_manager;
#SET GLOBAL activate_all_roles_on_login = 1;
CREATE TABLE clients
(
clientId INT unsigned NOT NULL AUTO_INCREMENT,
eik VARCHAR(15) NOT NULL,
firstname VARCHAR(150) NOT NULL,
lastname VARCHAR(150) NOT NULL,
companyName VARCHAR(150) NOT NULL,
PRIMARY KEY(clientId)
);
CREATE TABLE shops
(
shopId INT unsigned NOT NULL AUTO_INCREMENT,
shopName VARCHAR(150) NOT NULL,
address VARCHAR(150) NOT NULL,
active TINYINT(1) unsigned NOT NULL,
PRIMARY KEY (shopId)
);
CREATE TABLE invoices
(
invoiceId INT unsigned NOT NULL AUTO_INCREMENT,
clientId INT unsigned NOT NULL,
orderDate TIMESTAMP,
PRIMARY KEY (invoiceId),
FOREIGN KEY (clientId) REFERENCES clients(clientId)
);
CREATE TABLE employees
(
employeeId INT unsigned NOT NULL AUTO_INCREMENT,
username VARCHAR(32) UNIQUE, /*same as mysql username*/
firstname VARCHAR(150) NOT NULL,
lastname VARCHAR(150) NOT NULL,
accessLvl TINYINT(1) unsigned NOT NULL,
active TINYINT(1) unsigned NOT NULL, /*we can't drop people who are not working anymore*/
shopId INT unsigned NOT NULL,
PRIMARY KEY (employeeId),
FOREIGN KEY (shopId) REFERENCES shops(shopId)
);
CREATE TABLE productCategories
(
productCategoriyId INT unsigned NOT NULL AUTO_INCREMENT,
categoryName VARCHAR(150) NOT NULL,
active TINYINT(1) unsigned NOT NULL,
description TEXT NULL,
PRIMARY KEY (productCategoriyId)
);
CREATE TABLE products
(
productId INT unsigned NOT NULL AUTO_INCREMENT,
productName VARCHAR(150) NOT NULL,
price DECIMAL(13,2) NOT NULL, /*max double ~16 digits, leaving 3 extra*/
categoryId INT unsigned NOT NULL,
active TINYINT(1) unsigned NOT NULL, /*we can't drop deleted products*/
description TEXT NULL,
PRIMARY KEY (productId),
FOREIGN KEY (categoryId) REFERENCES productCategories(productCategoriyId)
);
CREATE TABLE receipts
(
receiptId INT unsigned NOT NULL AUTO_INCREMENT,
invoice TINYINT(1) unsigned NOT NULL,
invoiceId INT unsigned,
employeeId INT unsigned,
buyDate TIMESTAMP,
PRIMARY KEY (receiptId),
FOREIGN KEY (invoiceId) REFERENCES invoices(invoiceId),
FOREIGN KEY (employeeId) REFERENCES employees(employeeId)
);
CREATE TABLE boughtProducts
(
productId INT unsigned NOT NULL,
receiptId INT unsigned NOT NULL,
productCount INT NOT NULL,
currentPrice DECIMAL(13,2) NOT NULL,
FOREIGN KEY (productId) REFERENCES products(productId),
FOREIGN KEY (receiptId) REFERENCES receipts(receiptId)
); |
CREATE DATABASE clinica;
\c clinica;
CREATE TABLE medicos (
crm INTEGER NOT NULL PRIMARY KEY,
nome VARCHAR(50) NOT NULL,
cpf VARCHAR(11) NOT NULL UNIQUE,
especialidades VARCHAR(20) NULL
);
CREATE TABLE pacientes (
id SERIAL NOT NULL PRIMARY KEY,
nome VARCHAR(50) NOT NULL,
cpf VARCHAR(11) NOT NULL UNIQUE,
genero SMALLINT,
tipo_sanguineo SMALLINT,
data_nascimento DATE
);
CREATE TABLE consultas (
id SERIAL NOT NULL PRIMARY KEY,
data_hora TIMESTAMP NOT NULL,
situacao SMALLINT NOT NULL DEFAULT 0,
crm INTEGER NOT NULL
REFERENCES medicos (crm),
id_paciente INTEGER NOT NULL
REFERENCES pacientes (id),
diagnostico TEXT NULL,
prescricao TEXT NULL
);
CREATE TABLE cancelamento (
id INTEGER NOT NULL PRIMARY KEY
REFERENCES consultas (id)
ON DELETE CASCADE,
motivo TEXT NOT NULL,
responsavel VARCHAR(20) NOT NULL
);
|
timing start edit_retro;
DECLARE
v_feed_id number := ###;
v_site_id NUMBER := ###;
v_hospital_id NUMBER := ####;
v_update_count number := #;
v_ticket_number NUMBER := #######;
v_split_time TIMESTAMP := to_timestamp('?');
v_username varchar#(##) := ?;
v_location_mapping_type_id NUMBER := #;
v_is_in_four_walls NUMBER := #;
v_is_non_sentinel NUMBER := #;
PROCEDURE split_time_frame(p_feed_id number, p_split_time timestamp)
AS
v_curr_timeframe_id number;
v_curr_start_time timestamp;
v_curr_end_time timestamp;
v_new_timeframe_id number;
BEGIN
-- get the current timeframe id and the end_time of the time frame record to be split
select location_mapping_timeframe_id, start_time, end_time
INTO v_curr_timeframe_id, v_curr_start_time, v_curr_end_time
from adt.location_mapping_timeframe
where feed_id = p_feed_id
and (start_time is null or start_time < p_split_time)
and (end_time is null or end_time > p_split_time);
-- update timeframe with the v_split_time as end_time.
UPDATE adt.location_mapping_timeframe
SET end_time = p_split_time
WHERE location_mapping_timeframe_id = v_curr_timeframe_id;
-- create new timeframe for v_split_time as start_time
INSERT INTO ADT.location_mapping_timeframe (feed_id, start_time, end_time)
VALUES (p_feed_id, p_split_time, v_curr_end_time)
RETURNING location_mapping_timeframe_id into v_new_timeframe_id;
-- Create the range record with the new timeframe id with the same values as the old time frame id from location_mapping_timeframe.
INSERT INTO adt.location_mapping_range (location_mapping_id,location_mapping_timeframe_id,feed_id, covered_entity_id,
pharmacy_id, location_mapping_type_id,hardcoded_patient_status, is_in_four_walls, is_non_sentinel_type)
SELECT location_mapping_id, v_new_timeframe_id, feed_id, covered_entity_id, pharmacy_id, location_mapping_type_id,
hardcoded_patient_status, is_in_four_walls, is_non_sentinel_type
FROM adt.location_mapping_range
WHERE feed_id = p_feed_id
AND location_mapping_timeframe_id = v_curr_timeframe_id;
-- commit;
END;
PROCEDURE update_covered_entity_id(p_feed_id number) AS
v_###b_ce_id number := #####;
BEGIN
FOR cur IN
(
select DISTINCT
lmt.location_mapping_timeframe_id,
lm.location_mapping_id,
lm.mapping_value,
case when lmr.feed_id is null then # else # end has_lmr
from adt.location_mapping_timeframe lmt
JOIN adt.location_mapping lm
on lm.feed_id = lmt.feed_id
and lm.mapping_value IN
(
select distinct location_code
FROM appsupport.TCS####_locations
)
left join adt.location_mapping_range lmr
ON lmr.feed_id = lmt.feed_id
AND lmr.LOCATION_MAPPING_TIMEFRAME_ID = lmt.LOCATION_MAPPING_TIMEFRAME_ID
AND lmr.location_mapping_id = lm.location_mapping_id
left join freedom.covered_entity ce
on ce.covered_entity_id = lmr.covered_entity_id
where lmt.feed_id = p_feed_id --###
and (ce.is_covered = # OR ce.covered_entity_id IS NULL)
and trunc(lmt.start_time) >= to_date('?')
order by lm.mapping_Value, lmt.location_mapping_timeframe_id
)
LOOP
-- Update timefrange if it exists:
IF cur.has_lmr = # THEN
update adt.location_mapping_range
set covered_entity_id = v_###b_ce_id
where feed_id = p_feed_id
and location_mapping_timeframe_id = cur.location_mapping_timeframe_id
and location_mapping_id = cur.location_mapping_id;
ELSE
-- Add the new range with the necessary timerame and mapping ids:
INSERT INTO adt.location_mapping_range
(
location_mapping_id,
location_mapping_timeframe_id,
feed_id,
covered_entity_id,
location_mapping_type_id,
is_in_four_walls,
is_non_sentinel_type
)
SELECT DISTINCT
cur.location_mapping_id,
cur.location_mapping_timeframe_id,
v_feed_id,
v_###b_ce_id,
v_location_mapping_type_id,
v_is_in_four_walls,
v_is_non_sentinel
FROM dual
;
END IF;
END LOOP;
END;
PROCEDURE reprocess_dispensations AS
TYPE rec_disp IS RECORD (dd_id number);
TYPE tt_disp IS TABLE OF rec_disp;
v_disp tt_disp;
v_user varchar#(###);
BEGIN
SELECT DISTINCT drug_dispensation_id
BULK COLLECT INTO v_disp
FROM appsupport.tcs####_disps
;
-- show_status('?');
v_update_count := #;
FOR i in v_disp.FIRST .. v_disp.LAST
LOOP
UPDATE ehr.drug_dispensation
SET location_id = NULL
WHERE drug_dispensation_id = v_disp(i).dd_id;
v_update_count := v_update_count + sql%rowcount;
END LOOP;
commit;
--show_status('?');
-- show_status('?');
ehr.loc_backfill_pkg.process_feed(
v_feed_id, -- feed_id
v_hospital_id, -- hospital_id/covered_entity_system_id
null, -- location_field (found in source.pyxis_feed and the charge portion of the parser, usually null)
#, -- use modified ucrn claim (found in the charges parser usually #)
#, -- use account number (found in source.pyxis_feed, and charges parser usually #)
#, -- uses ucrn (found in charges parser usually #)
#, -- use mrn fallback (found in source.pyxis_feed, and charges parser usually #)
#, -- use_acct_num_to_look_up_ce (default is #, this is not widely used, but you will find it when its set in the charges parser)
'?', -- pharmacy_id expression (used in the ce_id_queue, but almost always null)
v_ticket_number, -- ticket number
v_username, -- user_id
####, -- commit interval default ####
#, -- kick off ce_id_queue default # (this will run the ce_id_queue once the records have been loaded there, # means you will have to run it manually)
#, -- fix sentinel eligibility default # (this will compare the ehr eligibility to sentinel and update sentinel where necessary, # only updates the ehr)
#, -- only process null locations default # (only updates the records in your selection set with a null location_id, # updates ALL locations in your selection set)
#, -- override_skipping_sentrex default # (Until issues in ####### are resolved we do not want to reprocess ehr.event records. Set to # to override this and process Sentrex-related events. Used in conjunction with only_process_sentinel)
#, -- only_process_sentinel default # (Until issues in ####### are resolved we do not want to reprocess ehr.event records, only ehr.drug_dispensation records. Set to # to override this behavior and process events. Used in conjunction with override_skipping_sentrex)
#, -- override_processing_adt default # (Until issues in ####### are resolved we do not want to reprocess ehr.event records (including ADT). If there is a reason to update ADT events, set flag to #)
to_date('?'), -- earliest adt, or min date to process (you can go back further, but you will have to use the parameters that were used to pull in the data using UCRN, instead of ADT, and adjust your dates accordingly)
to_date('?')); -- or max date to process
END;
BEGIN
-- create new timeframe records
split_time_frame(v_feed_id, to_timestamp('?'));
commit;
update_covered_entity_id(v_feed_id);
commit;
-- process dispensations
reprocess_dispensations;
commit;
-- process pdap
-- sentinel.pull_drugs_and_patients(v_site_id);
END;
/
timing stop;
|
Select Dname,avg(salary) from employee,department
where Dno=Dnumber group by Dname; |
INSERT INTO TICKET_P
VALUES(101 , 1);
INSERT INTO TICKET_P
VALUES(102 , 2);
INSERT INTO TICKET_P
VALUES(103 , 3);
INSERT INTO TICKET_P
VALUES(104 , 4);
INSERT INTO TICKET_P
VALUES(105 , 5);
SELECT *
FROM TICKET_P;
|
SELECT
COUNT(1)
FROM
FCONTRACT_BASEINFO
WHERE
CONTRACT_NO = /*dto.contractNo*/'' --a.买卖关联号=引数.买卖关联号
AND CANCAL_STATE = /*dto.codeNotCancel*/'' --AND 买卖关联.撤销状态 = 1:未撤销
/*IF (dto.contractId != null)*/--IF 画面.买卖关联ID <> 空白
AND CONTRACT_ID <> /*dto.contractId*/''--AND 买卖关联.买卖关联ID <> 画面.买卖关联ID
/*END*/ --END IF
/*IF (dto.oldContractId != null)*/--IF 画面. 修改前买卖关联ID <> null
AND CONTRACT_ID <> /*dto.oldContractId*/''--买卖关联.买卖关联ID <> 画面.修改前买卖关联ID
/*END*/ --END IF |
-- 주민번호의 유효성 검증
-- 각 자리에 2,3,4,5,6,7,8,9,2,3,4,5 를 곱한값을 더해서
-- 11로 나눈 나머지를 구하고 11에서 뺀값을 10으로 나눈
--나머지를 구해 그 값이 주민번호의 마지막 숫자와 같다면
-- 유효 | 무효
create or replace function valid_ssn(ssn char)return varchar2
is
result_msg varchar2(6) := '무효';
temp_val number :=0; --연산결과를 저장할 변수
flag_num char(1); --주민번호의 끝자리
idx number :=2;
temp_ssn char( 12 );
begin
if check_ssn(ssn) = 'success' then
-- 880101-1234567
temp_ssn :=substr(ssn,1,6)||substr(ssn,8,6);
-- temp_ssn 880101123456
flag_num := substr(ssn,14,1);
for i in 1 .. length(temp_ssn) loop
temp_val := temp_val+substr(temp_ssn,i,1)*idx;
idx := idx+1;
if idx = 10 then
idx :=2;
end if;
end loop;
temp_val := mod(11-mod(temp_val,11),10);
if temp_val = flag_num then
result_msg :='유효';
end if;
end if;
return result_msg;
end;
/
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 14-10-2020 a las 21:51:32
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.2.31
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 */;
--
-- Base de datos: `senasoftt`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `bodegas`
--
CREATE TABLE `bodegas` (
`Id_Bodega` int(11) NOT NULL,
`Nombre` varchar(30) DEFAULT NULL,
`Celular` int(15) DEFAULT NULL,
`Telefono` int(15) DEFAULT NULL,
`Id_Producto` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `cliente`
--
CREATE TABLE `cliente` (
`Id_Cliente` int(11) NOT NULL,
`Nombre` varchar(30) DEFAULT NULL,
`Apellidos` varchar(30) DEFAULT NULL,
`Documento` int(15) DEFAULT NULL,
`Celular` int(15) DEFAULT NULL,
`Direccion` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalle_fc`
--
CREATE TABLE `detalle_fc` (
`Id_DetalleFc` int(11) NOT NULL,
`Cantidad` int(10) DEFAULT NULL,
`Valor_Pago` int(10) DEFAULT NULL,
`Impuesto` int(10) DEFAULT NULL,
`Id_Producto` int(11) DEFAULT NULL,
`Id_Proveedor` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalle_fv`
--
CREATE TABLE `detalle_fv` (
`Id_DetalleFv` int(11) NOT NULL,
`Cantidad` int(10) DEFAULT NULL,
`Pago` int(10) DEFAULT NULL,
`Devolucion` int(10) DEFAULT NULL,
`Impuesto` int(10) DEFAULT NULL,
`Id_Producto` int(11) DEFAULT NULL,
`Id_Tienda` int(11) DEFAULT NULL,
`Id_Cliente` int(11) DEFAULT NULL,
`Id_Empleado` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `empleado`
--
CREATE TABLE `empleado` (
`Id_Empleado` int(11) NOT NULL,
`Nombre` varchar(30) DEFAULT NULL,
`Apellidos` varchar(30) DEFAULT NULL,
`Cargo` varchar(30) DEFAULT NULL,
`Email` varchar(30) DEFAULT NULL,
`Edad` int(15) DEFAULT NULL,
`Ciudad` varchar(30) DEFAULT NULL,
`Documento` int(15) DEFAULT NULL,
`Usuario_Empleado` varchar(30) DEFAULT NULL,
`Contrasena_Empleado` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `empresa`
--
CREATE TABLE `empresa` (
`Id_Empresa` int(11) NOT NULL,
`Nombre` varchar(30) DEFAULT NULL,
`Usuario_Empresa` varchar(30) DEFAULT NULL,
`Contrasena_Empresa` varchar(30) DEFAULT NULL,
`Email` varchar(50) DEFAULT NULL,
`Nit_Empresa` varchar(15) DEFAULT NULL,
`Pais` varchar(30) DEFAULT NULL,
`Tipo_Empresa` varchar(30) DEFAULT NULL,
`Id_Bodega` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `factura_compra`
--
CREATE TABLE `factura_compra` (
`Id_FacturaC` int(11) NOT NULL,
`FechaC` date DEFAULT NULL,
`Id_DetalleFc` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `factura_venta`
--
CREATE TABLE `factura_venta` (
`Id_FacturaV` int(11) NOT NULL,
`Fecha` date DEFAULT NULL,
`Id_DetalleFv` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `producto`
--
CREATE TABLE `producto` (
`Id_Producto` int(11) NOT NULL,
`Nombre` varchar(30) DEFAULT NULL,
`Cantidad_Existencia` int(30) DEFAULT NULL,
`Precio` int(30) DEFAULT NULL,
`Id_Proveedor` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `proveedor`
--
CREATE TABLE `proveedor` (
`Id_Proveedor` int(11) NOT NULL,
`Nombre` varchar(30) DEFAULT NULL,
`Celular` int(15) DEFAULT NULL,
`Telefono` int(15) DEFAULT NULL,
`Documento` int(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tienda`
--
CREATE TABLE `tienda` (
`Id_Tienda` int(11) NOT NULL,
`Sede` varchar(30) DEFAULT NULL,
`Direccion` varchar(30) DEFAULT NULL,
`Celular` int(15) DEFAULT NULL,
`Telefono` int(15) DEFAULT NULL,
`Id_Empresa` int(11) DEFAULT NULL,
`Id_Empleado` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `bodegas`
--
ALTER TABLE `bodegas`
ADD PRIMARY KEY (`Id_Bodega`),
ADD KEY `Id_Producto` (`Id_Producto`);
--
-- Indices de la tabla `cliente`
--
ALTER TABLE `cliente`
ADD PRIMARY KEY (`Id_Cliente`);
--
-- Indices de la tabla `detalle_fc`
--
ALTER TABLE `detalle_fc`
ADD PRIMARY KEY (`Id_DetalleFc`),
ADD KEY `Id_Producto` (`Id_Producto`),
ADD KEY `Id_Proveedor` (`Id_Proveedor`);
--
-- Indices de la tabla `detalle_fv`
--
ALTER TABLE `detalle_fv`
ADD PRIMARY KEY (`Id_DetalleFv`),
ADD KEY `Id_Producto` (`Id_Producto`),
ADD KEY `Id_Tienda` (`Id_Tienda`),
ADD KEY `Id_Cliente` (`Id_Cliente`),
ADD KEY `Id_Empleado` (`Id_Empleado`);
--
-- Indices de la tabla `empleado`
--
ALTER TABLE `empleado`
ADD PRIMARY KEY (`Id_Empleado`);
--
-- Indices de la tabla `empresa`
--
ALTER TABLE `empresa`
ADD PRIMARY KEY (`Id_Empresa`),
ADD KEY `Id_Bodega` (`Id_Bodega`);
--
-- Indices de la tabla `factura_compra`
--
ALTER TABLE `factura_compra`
ADD PRIMARY KEY (`Id_FacturaC`),
ADD KEY `Id_DetalleFc` (`Id_DetalleFc`);
--
-- Indices de la tabla `factura_venta`
--
ALTER TABLE `factura_venta`
ADD PRIMARY KEY (`Id_FacturaV`),
ADD KEY `Id_DetalleFv` (`Id_DetalleFv`);
--
-- Indices de la tabla `producto`
--
ALTER TABLE `producto`
ADD PRIMARY KEY (`Id_Producto`),
ADD KEY `Id_Proveedor` (`Id_Proveedor`);
--
-- Indices de la tabla `proveedor`
--
ALTER TABLE `proveedor`
ADD PRIMARY KEY (`Id_Proveedor`);
--
-- Indices de la tabla `tienda`
--
ALTER TABLE `tienda`
ADD PRIMARY KEY (`Id_Tienda`),
ADD KEY `Id_Empresa` (`Id_Empresa`),
ADD KEY `Id_Empleado` (`Id_Empleado`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `bodegas`
--
ALTER TABLE `bodegas`
MODIFY `Id_Bodega` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `cliente`
--
ALTER TABLE `cliente`
MODIFY `Id_Cliente` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `detalle_fc`
--
ALTER TABLE `detalle_fc`
MODIFY `Id_DetalleFc` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `detalle_fv`
--
ALTER TABLE `detalle_fv`
MODIFY `Id_DetalleFv` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `empleado`
--
ALTER TABLE `empleado`
MODIFY `Id_Empleado` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `empresa`
--
ALTER TABLE `empresa`
MODIFY `Id_Empresa` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `factura_compra`
--
ALTER TABLE `factura_compra`
MODIFY `Id_FacturaC` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `factura_venta`
--
ALTER TABLE `factura_venta`
MODIFY `Id_FacturaV` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `producto`
--
ALTER TABLE `producto`
MODIFY `Id_Producto` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `proveedor`
--
ALTER TABLE `proveedor`
MODIFY `Id_Proveedor` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `tienda`
--
ALTER TABLE `tienda`
MODIFY `Id_Tienda` int(11) NOT NULL AUTO_INCREMENT;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `bodegas`
--
ALTER TABLE `bodegas`
ADD CONSTRAINT `bodegas_ibfk_1` FOREIGN KEY (`Id_Producto`) REFERENCES `producto` (`Id_Producto`);
--
-- Filtros para la tabla `detalle_fc`
--
ALTER TABLE `detalle_fc`
ADD CONSTRAINT `detalle_fc_ibfk_1` FOREIGN KEY (`Id_Producto`) REFERENCES `producto` (`Id_Producto`),
ADD CONSTRAINT `detalle_fc_ibfk_2` FOREIGN KEY (`Id_Proveedor`) REFERENCES `proveedor` (`Id_Proveedor`);
--
-- Filtros para la tabla `detalle_fv`
--
ALTER TABLE `detalle_fv`
ADD CONSTRAINT `detalle_fv_ibfk_1` FOREIGN KEY (`Id_Producto`) REFERENCES `producto` (`Id_Producto`),
ADD CONSTRAINT `detalle_fv_ibfk_2` FOREIGN KEY (`Id_Tienda`) REFERENCES `tienda` (`Id_Tienda`),
ADD CONSTRAINT `detalle_fv_ibfk_3` FOREIGN KEY (`Id_Cliente`) REFERENCES `cliente` (`Id_Cliente`),
ADD CONSTRAINT `detalle_fv_ibfk_4` FOREIGN KEY (`Id_Empleado`) REFERENCES `empleado` (`Id_Empleado`);
--
-- Filtros para la tabla `empresa`
--
ALTER TABLE `empresa`
ADD CONSTRAINT `empresa_ibfk_1` FOREIGN KEY (`Id_Bodega`) REFERENCES `bodegas` (`Id_Bodega`);
--
-- Filtros para la tabla `factura_compra`
--
ALTER TABLE `factura_compra`
ADD CONSTRAINT `factura_compra_ibfk_1` FOREIGN KEY (`Id_DetalleFc`) REFERENCES `detalle_fc` (`Id_DetalleFc`);
--
-- Filtros para la tabla `factura_venta`
--
ALTER TABLE `factura_venta`
ADD CONSTRAINT `factura_venta_ibfk_1` FOREIGN KEY (`Id_DetalleFv`) REFERENCES `detalle_fv` (`Id_DetalleFv`);
--
-- Filtros para la tabla `producto`
--
ALTER TABLE `producto`
ADD CONSTRAINT `producto_ibfk_1` FOREIGN KEY (`Id_Proveedor`) REFERENCES `proveedor` (`Id_Proveedor`);
--
-- Filtros para la tabla `tienda`
--
ALTER TABLE `tienda`
ADD CONSTRAINT `tienda_ibfk_1` FOREIGN KEY (`Id_Empresa`) REFERENCES `empresa` (`Id_Empresa`),
ADD CONSTRAINT `tienda_ibfk_2` FOREIGN KEY (`Id_Empleado`) REFERENCES `empleado` (`Id_Empleado`);
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 `amsterdamteam9`.`kvm` (
`key` varchar(32) NOT NULL,
`value` VARCHAR(240) NULL,
PRIMARY KEY (`key`),
UNIQUE INDEX `key_UNIQUE` (`key` ASC)); |
/* Retrieve the name and address of all customers who rented */
/* video on '15-Jan-98'. */
select c.fname, c.lname, c.street, c.city, c.state, c.zipcode
from customers c, rentals r
where date_out='15-Jan-98'
and c.cid=r.cid
/ |
/*
Warnings:
- You are about to drop the column `projectId` on the `Picture` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE "Picture" DROP CONSTRAINT "Picture_projectId_fkey";
-- AlterTable
ALTER TABLE "Picture" DROP COLUMN "projectId";
-- CreateTable
CREATE TABLE "_PictureToProject" (
"A" INTEGER NOT NULL,
"B" INTEGER NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "_PictureToProject_AB_unique" ON "_PictureToProject"("A", "B");
-- CreateIndex
CREATE INDEX "_PictureToProject_B_index" ON "_PictureToProject"("B");
-- AddForeignKey
ALTER TABLE "_PictureToProject" ADD FOREIGN KEY ("A") REFERENCES "Picture"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_PictureToProject" ADD FOREIGN KEY ("B") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
-- MySQL dump 10.13 Distrib 5.6.23, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: inikierp
-- ------------------------------------------------------
-- Server version 5.6.21
/*!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 `sellstore`
--
DROP TABLE IF EXISTS `sellstore`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sellstore` (
`sellStoreID` tinyint(5) NOT NULL COMMENT '賣場代碼',
`sellStoreName` varchar(20) NOT NULL COMMENT '賣場名稱',
`sellLangID` tinyint(5) NOT NULL COMMENT '賣場語系',
PRIMARY KEY (`sellStoreID`),
KEY `sellLangID` (`sellLangID`),
KEY `SELLSTORE` (`sellStoreID`),
CONSTRAINT `sellstore_ibfk_1` FOREIGN KEY (`sellLangID`) REFERENCES `lang` (`langID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sellstore`
--
LOCK TABLES `sellstore` WRITE;
/*!40000 ALTER TABLE `sellstore` DISABLE KEYS */;
INSERT INTO `sellstore` VALUES (1,'ebay',1),(2,'pchome',2),(3,'yahoo',2),(4,'露天Icshpping_com',2),(5,'露天ichome3689',2),(6,'露天59show',2),(7,'官網',2),(8,'Email',2),(9,'電話',2);
/*!40000 ALTER TABLE `sellstore` ENABLE KEYS */;
UNLOCK TABLES;
/*!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 2015-04-21 14:20:39
|
DELETE FROM USER_LOGIN_INFO
WHERE
SESSION_ID = /*SESSION_ID*/ |
CREATE PROCEDURE FindBorrowersWhoOwnsArticles
@discriminator varchar(10)
AS
BEGIN
SELECT e.id AS Id, e.prenom AS Firstname, e.nom AS Lastname, e.age
FROM emprunteur AS e,
article AS a,
pret AS p
WHERE e.id = p.emprunteur_id
AND a.id = p.article_id
AND a.entity_type = @discriminator
AND p.date_retour IS NULL
END |
DELIMITER //
CREATE TRIGGER user_delete BEFORE DELETE ON user
FOR EACH ROW
BEGIN
DELETE FROM event_guest
WHERE user_id = OLD.user_id;
DELETE FROM user_course
WHERE user_id = OLD.user_id;
DELETE FROM event
WHERE host_id = OLD.user_id;
UPDATE notes
SET author_id = NULL
WHERE author_id = OLD.user_id;
END
//
DELIMITER ;
|
### RETO 1 ###
# ¿Cuál es el nombre de los empleados cuyo sueldo es menor a $10,000?
USE tienda;
SELECT nombre
FROM empleado
WHERE id_puesto in
(SELECT id_puesto
FROM puesto
WHERE salario > 10000);
#¿Cuál es la cantidad mínima y máxima de ventas de cada empleado?
SELECT id_empleado, min(total), max(total)
FROM (SELECT clave, id_empleado, COUNT(*) AS total
FROM venta
GROUP BY clave, id_empleado) AS subconsulta
GROUP BY id_empleado;
SELECT clave, id_empleado, COUNT(*) AS total
FROM venta
GROUP BY clave, id_empleado;
#¿Cuáles claves de venta incluyen artículos cuyos precios son mayores a $5,000?
SELECT clave
FROM venta
WHERE id_articulo in
(SELECT id_articulo
FROM articulo
WHERE precio > 5000);
### RETO 2 ###
#¿Cuál es el nombre de los empleados que realizaron cada venta?
DESCRIBE venta;
SHOW KEYS FROM venta;
SELECT clave, nombre, apellido_paterno
FROM venta AS v
JOIN empleado AS e
ON v.id_empleado = e.id_empleado;
#¿Cuál es el nombre de los artículos que se han vendido?
SELECT nombre, id_venta, clave
FROM venta as v
JOIN articulo as a
ON v.id_articulo = a.id_articulo;
#¿Cuál es el total de cada venta?
SELECT clave, sum(precio) as TotalVenta
FROM articulo as a
JOIN venta as v
ON a.id_articulo = v.id_articulo
GROUP BY clave;
### RETO 3 ###
# Obtener el puesto de un empleado.
CREATE VIEW puestoEmpleado AS
(SELECT concat(e.nombre, ' ', e.apellido_paterno, ' ', e.apellido_materno) AS Empleado, p.nombre
FROM empleado AS e
JOIN puesto AS p
ON e.id_puesto = p.id_puesto);
SELECT *
FROM puestoEmpleado;
# Saber qué artículos ha vendido cada empleado.
CREATE VIEW articuloEmpleado AS
(SELECT concat(e.nombre,' ',e.apellido_paterno,' ',e.apellido_materno) AS Empleado, a.nombre AS Artículo
FROM venta AS v
JOIN empleado AS e
ON v.id_empleado = e.id_empleado
JOIN articulo AS a
ON v.id_articulo = v.id_articulo
ORDER BY v.clave);
SELECT *
FROM articuloEmpleado;
#Saber qué puesto ha tenido más ventas.
CREATE VIEW ventasPuesto AS
(SELECT p.nombre AS Puesto, count(*) AS Ventas
FROM venta AS v
JOIN empleado AS e
ON v.id_empleado = e.id_empleado
JOIN puesto AS p
ON e.id_puesto = p.id_puesto
GROUP BY p.nombre
ORDER BY Ventas DESC);
SELECT *
FROM ventasPuesto
LIMIT 1;
|
CREATE DATABASE IF NOT EXISTS kinetime;
USE kinetime;
CREATE TABLE zona_lesion(
id int(255) auto_increment not null,
nombre varchar(50) not null,
CONSTRAINT pk_zona_lesion PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE deportes(
id int(255) auto_increment not null,
nombre varchar(100) not null,
CONSTRAINT pk_deportes PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE hobbies(
id int(255) auto_increment not null,
nombre varchar(100) not null,
CONSTRAINT pk_hobbies PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE enfermedades(
id int(255) auto_increment not null,
nombre varchar(100) not null,
CONSTRAINT pk_enfermedades PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE examenes(
id int(255) auto_increment not null,
fecha datetime,
nombre varchar(200),
zona varchar(100),
realizado_por varchar(200),
hallazgo varchar(200),
conclusion varchar(200),
CONSTRAINT pk_examenes PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE pacientes(
id int(255) auto_increment not null,
rut char(12) not null,
nombre varchar(255),
edad int(2),
direccion varchar(200),
ocupacion varchar(200),
fumador char(2),
bebedor char(2),
CONSTRAINT pk_pacientes PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE antecedentes_clinicos(
id int(255) auto_increment not null,
paciente_id int(255) not null,
morbilidad varchar(255),
medico varchar(255),
zona_id int(255),
operacion varchar(200),
farmacos varchar(200),
factores_riesgo varchar(200),
cuando_episodio TIME,
CONSTRAINT pk_antecedentes_clinicos PRIMARY KEY (id),
CONSTRAINT fk_antecedentes_clinicos_pacientes FOREIGN KEY(paciente_id) REFERENCES pacientes(id),
CONSTRAINT fk_antecedentes_clinicos_zona FOREIGN KEY(zona_id) REFERENCES zona_lesion(id)
)ENGINE=InnoDB;
CREATE TABLE mecanismos(
id int(255) auto_increment not null,
paciente_id int(255) not null,
tipo_lesion varchar(200),
como_se_efectuo varchar(200),
CONSTRAINT pk_mecanismos PRIMARY KEY(id),
CONSTRAINT fk_mecanismos_pacientes FOREIGN KEY(paciente_id) REFERENCES pacientes(id)
)ENGINE=InnoDB;
CREATE TABLE deportes_has_pacientes(
id int(255) auto_increment not null,
deporte_id int(255) not null,
paciente_id int(255) not null,
CONSTRAINT pk_deportes_has_pacientes PRIMARY KEY(id),
CONSTRAINT fk_deportes_has_pacientes_deportes FOREIGN KEY(deporte_id) REFERENCES deportes(id),
CONSTRAINT fk_deportes_has_pacientes_pacientes FOREIGN KEY(paciente_id) REFERENCES pacientes(id)
)ENGINE=InnoDB;
CREATE TABLE pacientes_has_hobbies(
id int(255) auto_increment not null,
paciente_id int(255) not null,
hobbie_id int(255) not null,
CONSTRAINT pk_pacientes_has_hobbies PRIMARY KEY(id),
CONSTRAINT fk_pacientes_has_hobbies_pacientes FOREIGN KEY(paciente_id) REFERENCES pacientes(id),
CONSTRAINT fk_pacientes_has_hobbies_hobbies FOREIGN Key(hobbie_id) REFERENCES hobbies(id)
)ENGINE=InnoDB;
CREATE TABLE pacientes_has_examenes(
id int(255) auto_increment not null,
paciente_id int(255) not null,
examen_id int(255) not null,
CONSTRAINT pk_pacientes_has_examenes PRIMARY KEY(id),
CONSTRAINT fk_pacientes_has_examenes_pacientes FOREIGN KEY(paciente_id) REFERENCES pacientes(id),
CONSTRAINT fk_pacientes_has_examenes_examenes FOREIGN KEY(examen_id) REFERENCES examenes(id)
)ENGINE=InnoDB;
CREATE TABLE pacientes_has_enfermedades(
id int(255) auto_increment not null,
paciente_id int(255) not null,
enfermedad_id int(255) not null,
CONSTRAINT pk_pacientes_has_enfermedades PRIMARY KEY(id),
CONSTRAINT fk_pacientes_has_enfermedades_pacientes FOREIGN KEY(paciente_id) REFERENCES pacientes(id),
CONSTRAINT fk_pacientes_has_enfermedades_enfermedades FOREIGN KEY(enfermedad_id) REFERENCES enfermedades(id)
)ENGINE=InnoDB;
CREATE TABLE perfiles(
id int(255) auto_increment not null,
nombre varchar(100),
CONSTRAINT pk_perfiles_kinesiologo PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE areas_kinesiologo(
id int(255) auto_increment not null,
nombre varchar(100),
CONSTRAINT pk_areas_kinesiologo PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE kinesiologos(
id int(255) auto_increment not null,
rut char(12) not null,
nombre varchar(200),
password char(60),
especialidad varchar(200),
certificaciones int(255),
anos_experiencia int(255),
metas varchar(1000),
role varchar(20),
CONSTRAINT pk_kinesiologos PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE kinesiologos_has_perfiles(
id int(255) auto_increment not null,
kinesiologo_id int(255) not null,
perfil_id int(255) not null,
CONSTRAINT pk_kinesiologos_has_perfiles PRIMARY KEY(id),
CONSTRAINT fk_kinesiologos_has_perfiles_kinesiologos FOREIGN KEY(kinesiologo_id) REFERENCES kinesiologos(id),
CONSTRAINT fk_kinesiologos_has_perfiles_perfiles FOREIGN KEY(perfil_id) REFERENCES perfiles(id)
)ENGINE=InnoDB;
CREATE TABLE kinesiologos_has_areas(
id int(255) auto_increment not null,
kinesiologo_id int(255) not null,
area_id int(255) not null,
CONSTRAINT pk_kinesiolos_has_areas PRIMARY KEY(id),
CONSTRAINT fk_kinesiologos_has_areas_kinesiologos FOREIGN KEY(kinesiologo_id) REFERENCES kinesiologos(id),
CONSTRAINT fk_kinesiologos_has_areas_areas FOREIGN KEY(area_id) REFERENCES areas_kinesiologo(id)
)ENGINE=InnoDB;
CREATE TABLE tipo_ejercicios(
id int(255) auto_increment not null,
nombre varchar(50),
tipo varchar(50),
objetivo varchar(50),
url varchar(100),
CONSTRAINT pk_tipo_ejercicios PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE volumenes(
id int(255) auto_increment not null,
serie varchar(50),
total varchar(50),
CONSTRAINT pk_volumenes PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE ejercicios(
id int(255) auto_increment not null,
tiempo TIME,
volumen int(255) not null,
tipo_ejercicio int(255) not null,
descanso int(255),
CONSTRAINT pk_ejercicios PRIMARY KEY(id),
CONSTRAINT fk_ejecicio_volumenes FOREIGN KEY(volumen) REFERENCES volumenes(id),
CONSTRAINT fk_ejercicio_tipo_ejercicios FOREIGN KEY(tipo_ejercicio) REFERENCES tipo_ejercicios(id)
)ENGINE=InnoDB;
CREATE TABLE rutinas(
id int(255) auto_increment not null,
hora_inicio TIME,
hora_termino TIME,
CONSTRAINT pk_rutinas PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE pacientes_has_rutinas(
id int(255) auto_increment not null,
paciente_id int(255) not null,
rutina_id int(255) not null,
CONSTRAINT pk_pacientes_has_rutinas PRIMARY KEY(id),
CONSTRAINT fk_pacientes_has_rutinas_pacientes FOREIGN KEY(paciente_id) REFERENCES pacientes(id),
CONSTRAINT fk_pacientes_has_rutinas_rutinas FOREIGN KEY(rutina_id) REFERENCES rutinas(id)
)ENGINE=InnoDB;
CREATE TABLE rutinas_has_ejercicios(
id int(255) auto_increment not null,
rutina_id int(255) not null,
ejercicio_id int(255) not null,
CONSTRAINT pk_rutinas_has_ejercicios PRIMARY KEY(id),
CONSTRAINT fk_rutinas_has_ejercicios_rutinas FOREIGN KEY(rutina_id) REFERENCES rutinas(id),
CONSTRAINT fk_rutinas_has_ejercicios_ejercicios FOREIGN KEY(ejercicio_id) REFERENCES ejercicios(id)
)ENGINE=InnoDB;
CREATE TABLE prestaciones(
id int(255) auto_increment not null,
nombre varchar(100),
tipo varchar(100),
CONSTRAINT pk_prestaciones PRIMARY KEY(id)
)ENGINE=InnoDB;
CREATE TABLE atenciones(
id int(255) auto_increment not null,
prestacion_id int(255) not null,
duracion_atencion TIME,
fecha DATETIME,
como_llego varchar(200),
como_se_fue varchar(200),
se_realizo boolean,
paciente_id int(255) not null,
kinesiologo_id int(255) not null,
CONSTRAINT pk_atenciones PRIMARY KEY(id),
CONSTRAINT fk_atenciones_prestaciones FOREIGN KEY(prestacion_id) REFERENCES prestaciones(id),
CONSTRAINT fk_atenciones_pacientes FOREIGN KEY(paciente_id) REFERENCES pacientes(id),
CONSTRAINT fk_atenciones_kinesiologos FOREIGN KEY(kinesiologo_id) REFERENCES kinesiologos(id)
)ENGINE=InnoDB;
INSERT INTO kinesiologos VALUES (DEFAULT, "11.111.111-1", "admin", "$2y$12$mkQlG3pyfHwf0e12XX/RyusWaQgCLm4C4/fQDIdn2.vvlmCeQxlru", null, 0, 0, null, "ROLE_ADMIN");
INSERT INTO zona_lesion VALUES (DEFAULT, "Fractura de cubito");
INSERT INTO zona_lesion VALUES (DEFAULT, "Fractura de metatarso");
INSERT INTO zona_lesion VALUES (DEFAULT, "Fractura de tibia y perone");
INSERT INTO zona_lesion VALUES (DEFAULT, "Fractura de tobillo");
INSERT INTO deportes VALUES (DEFAULT, "Futbol");
INSERT INTO deportes VALUES (DEFAULT, "Voleibol");
INSERT INTO deportes VALUES (DEFAULT, "Tennis");
INSERT INTO deportes VALUES (DEFAULT, "Basketball");
INSERT INTO pacientes VALUES (DEFAULT, "20492942-4", "Alejandro Casas", 26, "Av. Concha Y Toro 2618", "Programador", "Si", "No");
INSERT INTO antecedentes_clinicos VALUES (DEFAULT, "1", "No se que es", "Kevin Pizarro", 1, "No", "Paracetamol", "no se", NOW());
INSERT INTO volumenes VALUES (DEFAULT, 3, 16);
INSERT INTO rutinas VALUES (DEFAULT, null, 1, null,null,null);
INSERT INTO rutinas_has_ejercicios VALUES (DEFAULT, 1,1);
INSERT INTO pacientes_has_rutinas VALUES (DEFAULT, 1, 1); |
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 03, 2012 at 07:09 PM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `autobay`
--
-- --------------------------------------------------------
--
-- Table structure for table `autos`
--
CREATE TABLE IF NOT EXISTS `autos` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`merk` varchar(15) NOT NULL,
`type` varchar(20) NOT NULL,
`brandstof` varchar(1) NOT NULL,
`motorinhoud` int(12) NOT NULL,
`vermogen` int(12) NOT NULL,
`bouwjaar` varchar(4) NOT NULL,
`kleur` varchar(15) NOT NULL,
`vraagprijs` int(10) NOT NULL,
`status` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=79 ;
--
-- Dumping data for table `autos`
--
INSERT INTO `autos` (`id`, `merk`, `type`, `brandstof`, `motorinhoud`, `vermogen`, `bouwjaar`, `kleur`, `vraagprijs`, `status`) VALUES
(1, 'Opel', 'Astra', 'D', 1700, 60, '2005', 'Zilver', 8700, 'aangeboden'),
(2, 'Opel', 'Astra', 'D', 1995, 60, '1999', 'Blauw', 5500, 'aangeboden'),
(3, 'Opel', 'Astra', 'D', 1910, 60, '2006', 'Zilver', 9800, 'aangeboden'),
(4, 'Opel', 'Astra', 'G', 1364, 60, '2006', 'Zilver', 8700, 'aangeboden'),
(5, 'Opel', 'Vectra', 'B', 1796, 88, '2002', 'Zwart', 10500, 'aangeboden'),
(6, 'Opel', 'Vectra', 'D', 74, 1985, '2004', 'Grijs', 9400, 'aangeboden'),
(7, 'Opel', 'Vectra', 'B', 2597, 126, '2001', 'Zilver', 12000, 'aangeboden'),
(8, 'Volkswagen', 'Golf', 'D', 1896, 72, '2005', 'Zwart', 7600, 'aangeboden'),
(9, 'Volkswagen', 'Golf', 'D', 1968, 72, '2005', 'Zilver', 7700, 'aangeboden'),
(10, 'Volkswagen', 'Golf', 'D', 1985, 66, '2004', 'Blauw', 6700, 'aangeboden'),
(11, 'Volkswagen', 'Golf', 'D', 1968, 66, '2005', 'Zwart', 6500, 'aangeboden'),
(12, 'Volkswagen', 'Golf', 'D', 1986, 74, '2005', 'Zwart', 7600, 'aangeboden'),
(13, 'Volkswagen', 'Passat', 'D', 1896, 100, '2005', 'Zwart', 11500, 'aangeboden'),
(14, 'Volkswagen', 'Passat', 'D', 1896, 100, '2006', 'Blauw', 12000, 'aangeboden'),
(15, 'Volkswagen', 'Passat', 'D', 2500, 150, '2005', 'Zwart', 14500, 'aangeboden'),
(16, 'Volkswagen', 'Passat', 'D', 1968, 103, '2006', 'Rood', 14000, 'aangeboden'),
(17, 'Ferrari', 'Maranello', 'B', 5474, 350, '1998', 'Rood', 76000, 'verkocht'),
(18, 'Ferrari', 'Maranello', 'B', 5474, 330, '1996', 'Blauw', 45000, 'verkocht'),
(19, 'Ferrari', 'Scuderia', 'B', 4308, 372, '2008', 'Rood', 180000, 'aangeboden'),
(20, 'Maserati', 'onbekend', 'B', 4244, 300, '2004', 'Zwart', 76000, 'verkocht'),
(21, 'Maserati', 'Gibli', 'B', 4600, 325, '1997', 'Zilver', 23000, 'verkocht'),
(22, 'Jaguar', 'E-type', 'B', 5343, 230, '1973', 'Groen', 55000, 'aangeboden'),
(23, 'Jaguar', 'E-type', 'B', 4534, 180, '1967', 'Groen', 45000, 'aangeboden'),
(24, 'Porsche', '911', 'B', 3600, 250, '1989', 'Rood', 23000, 'aangeboden'),
(25, 'Porsche', '911', 'B', 3600, 200, '1994', 'Zwart', 22000, 'aangeboden'),
(39, 'Koenigsegg', 'Agera R', 'B', 5000, 1100, '2011', 'Wit-Zwart', 1000000, 'aangeboden'),
(76, 'Maserati', 'GranTurismo', 'B', 5000, 380, '2008', 'Zwart', 100000, 'aangeboden'),
(77, 'Ferarri', '599GTO', 'B', 5000, 800, '2011', 'Rood', 500000, 'aangeboden');
/*!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 */;
|
-- cat plan empresa
CREATE TABLE IF NOT EXISTS `billez_billez`.`cat_plan_empresa` (
`id_cat_plan_empresa` INT NOT NULL AUTO_INCREMENT,
`clave_plan` VARCHAR(45) NULL,
`descripcion` VARCHAR(45) NULL,
PRIMARY KEY (`id_cat_plan_empresa`))
ENGINE = InnoDB;
-- empresa cobranza
CREATE TABLE IF NOT EXISTS `billez_billez`.`empresa_cobranza` (
`id_empresa_cobranza` INT NOT NULL AUTO_INCREMENT,
`id_empresa` INT NOT NULL,
`id_cat_plan_empresa` INT NOT NULL,
`ind_estatus` VARCHAR(1) NULL,
PRIMARY KEY (`id_empresa_cobranza`),
INDEX `fk_empresa_cobranza_empresa1_idx` (`id_empresa` ASC),
INDEX `fk_empresa_cobranza_cat_plan_empresa1_idx` (`id_cat_plan_empresa` ASC),
CONSTRAINT `fk_empresa_cobranza_empresa1`
FOREIGN KEY (`id_empresa`)
REFERENCES `billez_billez`.`empresa` (`id_empresa`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_empresa_cobranza_cat_plan_empresa1`
FOREIGN KEY (`id_cat_plan_empresa`)
REFERENCES `billez_billez`.`cat_plan_empresa` (`id_cat_plan_empresa`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- empresa cobranza detalle
CREATE TABLE IF NOT EXISTS `billez_billez`.`empresa_cobranza_detalle` (
`id_empresa_cobranza_detalle` INT NOT NULL AUTO_INCREMENT,s
`id_empresa_cobranza` INT NOT NULL,
`id_empresa` INT NOT NULL,
`secuencia_cobranza` DECIMAL(2) NULL,
`fecha_inicio` DATETIME NULL,
`fecha_fin` DATETIME NULL,
`total_timbres_plan` DECIMAL(3) NULL,
`total_timbres_usados` DECIMAL(3) NULL,
`ind_estatus` VARCHAR(1) NULL,
PRIMARY KEY (`id_empresa_cobranza_detalle`),
INDEX `fk_empresa_cobranza_detalle_empresa_cobranza1_idx` (`id_empresa_cobranza` ASC),
INDEX `fk_empresa_cobranza_detalle_empresa1_idx` (`id_empresa` ASC),
CONSTRAINT `fk_empresa_cobranza_detalle_empresa_cobranza1`
FOREIGN KEY (`id_empresa_cobranza`)
REFERENCES `billez_billez`.`empresa_cobranza` (`id_empresa_cobranza`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_empresa_cobranza_detalle_empresa1`
FOREIGN KEY (`id_empresa`)
REFERENCES `billez_billez`.`empresa` (`id_empresa`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- contiene el campo que habilitara en caso de que sean de paga
ALTER TABLE `billez_billez`.`empresa_cobranza`
ADD COLUMN `estatus_plan_pago` VARCHAR(1) NULL AFTER `ind_estatus`;
ALTER TABLE `billez_billez`.`empresa_cobranza_detalle`
ADD COLUMN `total_timbres_cancelados` VARCHAR(3) NULL AFTER `total_timbres_usados`;
ALTER TABLE `billez_billez`.`empresa_cobranza_detalle`
CHANGE COLUMN `fecha_inicio` `fecha_inicio_plan` DATETIME NULL DEFAULT NULL ,
CHANGE COLUMN `fecha_fin` `fecha_fin_plan` DATETIME NULL DEFAULT NULL ,
ADD COLUMN `fecha_registro` DATETIME NULL AFTER `secuencia_cobranza`;
ALTER TABLE `billez_billez`.`usuario_token`
CHANGE COLUMN `token` `token` VARCHAR(100) NULL DEFAULT NULL ;
ALTER TABLE `billez_billez`.`usuario_token`
ADD COLUMN `ind_estatus` VARCHAR(1) NULL AFTER `fecha_vigencia`;
|
/*
Warnings:
- The primary key for the `appointments` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `users` table will be changed. If it partially fails, the table could be left without primary key constraint.
- Added the required column `password` to the `users` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "appointments" DROP CONSTRAINT "appointments_user_id_fkey";
-- AlterTable
ALTER TABLE "appointments" DROP CONSTRAINT "appointments_pkey",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE TEXT,
ALTER COLUMN "start_time" SET DATA TYPE TIMESTAMP(3),
ALTER COLUMN "end_time" SET DATA TYPE TIMESTAMP(3),
ALTER COLUMN "user_id" DROP NOT NULL,
ALTER COLUMN "user_id" SET DATA TYPE TEXT,
ALTER COLUMN "created_at" SET DATA TYPE TIMESTAMP(3),
ALTER COLUMN "updated_at" SET DATA TYPE TIMESTAMP(3),
ADD CONSTRAINT "appointments_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "appointments_id_seq";
-- AlterTable
ALTER TABLE "users" DROP CONSTRAINT "users_pkey",
ADD COLUMN "password" TEXT NOT NULL,
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE TEXT,
ALTER COLUMN "first_name" DROP NOT NULL,
ALTER COLUMN "last_name" DROP NOT NULL,
ALTER COLUMN "created_at" SET DATA TYPE TIMESTAMP(3),
ALTER COLUMN "updated_at" SET DATA TYPE TIMESTAMP(3),
ADD CONSTRAINT "users_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "users_id_seq";
-- AddForeignKey
ALTER TABLE "appointments" ADD CONSTRAINT "appointments_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
#1) Creating managerial reports using OLAP tools: Complete the attached as- signment titled ‘MSTR9 AdventTechnologyAssignment.pdf’ on Canvas. It has three questions. Read the assignment for help with navigation on the Micros- trategy web interface. The reports required can be created by specifying the correct parameters on the OLAP tool.Once you create the desired reports, click Tools Report Details Page to view the SQL queries for each of the three questions. Copy these queries to a text editor to complete the next steps.
#1a. Make a list of any rep that is in the Southern USA office who has landed a deal that was large enough to be in the Top 10 deals in 2009 Q4 for the company. In the report, display Opportunity, Account, Sales Representative, Opportunity Close Date, Primary Competitor and Deal Size.
select a11.OPTY_ID OPTY_ID,
max(a14.OPTY_DESC) OPTY_DESC,
a11.ACCT_ID ACCT_ID,
max(a15.ACCT_DESC) ACCT_DESC,
a11.SALES_REP_ID SALES_REP_ID,
max(a16.SALES_REP_NAME) SALES_REP_NAME,
a14.OPTY_CLOSE_DATE OPTY_CLOSE_DATE,
a14.PRIMARY_COMP_ID PRIMARY_COMP_ID,
max(a17.COMPETITOR_NAME) COMPETITOR_NAME,
sum(a11.OPTY_SIZE) WJXBFS1
from F_OPTY_MNTH_HIST a11
join (select pa11.ACCT_ID ACCT_ID,
pa11.OPTY_ID OPTY_ID,
pa11.SALES_REP_ID SALES_REP_ID
from (select a11.ACCT_ID ACCT_ID,
a11.OPTY_ID OPTY_ID,
a11.SALES_REP_ID SALES_REP_ID,
rank () over( order by sum(a11.OPTY_SIZE) desc) WJXBFS1
from F_OPTY_MNTH_HIST a11
join L_CAL_MNTH a12
on (a11.MNTH_ID = a12.MNTH_ID)
where (a11.OPTY_STAT_ID in (5)
and a12.QTR_ID in (20094))
group by a11.ACCT_ID,
a11.OPTY_ID,
a11.SALES_REP_ID
) pa11
where (pa11.WJXBFS1 <= 10.0)
) pa12
on (a11.ACCT_ID = pa12.ACCT_ID and
a11.OPTY_ID = pa12.OPTY_ID and
a11.SALES_REP_ID = pa12.SALES_REP_ID)
join L_CAL_MNTH a13
on (a11.MNTH_ID = a13.MNTH_ID)
join L_OPTY a14
on (a11.OPTY_ID = a14.OPTY_ID)
join L_ACCT a15
on (a11.ACCT_ID = a15.ACCT_ID)
join L_SALES_REP a16
on (a11.SALES_REP_ID = a16.SALES_REP_ID)
join L_COMPETITOR a17
on (a14.PRIMARY_COMP_ID = a17.COMPETITOR_ID)
where (a13.QTR_ID in (20094)
and a11.OPTY_STAT_ID in (5))
and SALES_DIST_ID in (3)
group by a11.OPTY_ID,
a11.ACCT_ID,
a11.SALES_REP_ID,
a14.OPTY_CLOSE_DATE,
a14.PRIMARY_COMP_ID
#[Analytical engine calculation steps:
# 1. Perform dynamic aggregation over <Sales Region>
# 2. Perform cross-tabbing
#]
#1b. Generate a list of the projects in the current pipeline for Southern USA that shows who the rep working on the project is, as well as the customer and expected worth of the project (2010 Q1). In the report, display Current Opportunity Status, Sales Representative, Opportunities and Opportunity Size.
select pa11.OPTY_STAT_ID OPTY_STAT_ID,
max(a14.OPTY_STAT_DESC) OPTY_STAT_DESC,
pa11.SALES_REP_ID SALES_REP_ID,
max(a15.SALES_REP_NAME) SALES_REP_NAME,
pa11.OPTY_ID OPTY_ID,
max(a13.OPTY_DESC) OPTY_DESC,
pa11.QTR_ID QTR_ID,
max(a16.QTR_DESC) QTR_DESC,
max(pa11.WJXBFS1) WJXBFS1
from (select a11.SALES_REP_ID SALES_REP_ID,
a12.QTR_ID QTR_ID,
a11.OPTY_STAT_ID OPTY_STAT_ID,
a11.OPTY_ID OPTY_ID,
a11.MNTH_ID MNTH_ID,
sum(a11.OPTY_SIZE) WJXBFS1
from F_OPTY_MNTH_HIST a11
join L_CAL_MNTH a12
on (a11.MNTH_ID = a12.MNTH_ID)
join L_SALES_REP a13
on (a11.SALES_REP_ID = a13.SALES_REP_ID)
where (a13.SALES_DIST_ID in (3)
and a12.QTR_ID in (20101))
group by a11.SALES_REP_ID,
a12.QTR_ID,
a11.OPTY_STAT_ID,
a11.OPTY_ID,
a11.MNTH_ID
) pa11
join (select pc11.SALES_REP_ID SALES_REP_ID,
pc11.QTR_ID QTR_ID,
pc11.OPTY_STAT_ID OPTY_STAT_ID,
pc11.OPTY_ID OPTY_ID,
max(pc11.MNTH_ID) WJXBFS1
from (select a11.SALES_REP_ID SALES_REP_ID,
a12.QTR_ID QTR_ID,
a11.OPTY_STAT_ID OPTY_STAT_ID,
a11.OPTY_ID OPTY_ID,
a11.MNTH_ID MNTH_ID,
sum(a11.OPTY_SIZE) WJXBFS1
from F_OPTY_MNTH_HIST a11
join L_CAL_MNTH a12
on (a11.MNTH_ID = a12.MNTH_ID)
join L_SALES_REP a13
on (a11.SALES_REP_ID = a13.SALES_REP_ID)
where (a13.SALES_DIST_ID in (3)
and a12.QTR_ID in (20101))
group by a11.SALES_REP_ID,
a12.QTR_ID,
a11.OPTY_STAT_ID,
a11.OPTY_ID,
a11.MNTH_ID
) pc11
group by pc11.SALES_REP_ID,
pc11.QTR_ID,
pc11.OPTY_STAT_ID,
pc11.OPTY_ID
) pa12
on (pa11.MNTH_ID = pa12.WJXBFS1 and
pa11.OPTY_ID = pa12.OPTY_ID and
pa11.OPTY_STAT_ID = pa12.OPTY_STAT_ID and
pa11.QTR_ID = pa12.QTR_ID and
pa11.SALES_REP_ID = pa12.SALES_REP_ID)
join L_OPTY a13
on (pa11.OPTY_ID = a13.OPTY_ID)
join L_OPTY_STATUS a14
on (pa11.OPTY_STAT_ID = a14.OPTY_STAT_ID)
join L_SALES_REP a15
on (pa11.SALES_REP_ID = a15.SALES_REP_ID)
join L_CAL_QTR a16
on (pa11.QTR_ID = a16.QTR_ID)
group by pa11.OPTY_STAT_ID,
pa11.SALES_REP_ID,
pa11.OPTY_ID,
pa11.QTR_ID
[Analytical engine calculation steps:
1. Evaluate thresholds
2. Perform cross-tabbing
]
#1c. Generate a report that shows all districts’ Current Pipeline vs. Quota for US Region for easy comparison for (2010 Q1). In the report, display metrics relevant to this report, and columns as Northern, Central and Southern USA, and Tota
select coalesce(pa11.SALES_DIST_ID, pa12.SALES_DIST_ID, pa13.SALES_DIST_ID) SALES_DIST_ID,
max(a17.SALES_DIST_DESC) SALES_DIST_DESC,
a17.SALES_REGN_ID SALES_REGN_ID,
max(a17.SALES_REGN_DESC) SALES_REGN_DESC,
max(pa11.WJXBFS1) WJXBFS1,
max(pa12.WJXBFS1) WJXBFS2,
max(pa13.WJXBFS1) WJXBFS3,
max(pa13.WJXBFS2) WJXBFS4,
(ZEROIFNULL(max(pa11.WJXBFS1)) + ZEROIFNULL(max(pa13.WJXBFS3))) WJXBFS5,
((ZEROIFNULL(max(pa11.WJXBFS1)) + ZEROIFNULL(max(pa13.WJXBFS4))) - ZEROIFNULL(max(pa12.WJXBFS1))) WJXBFS6,
max(pa13.WJXBFS5) WJXBFS7,
max(pa14.WJXBFS1) WJXBFS8,
max(pa14.WJXBFS2) WJXBFS9,
max(pa14.WJXBFS3) WJXBFSa
from (select a13.SALES_DIST_ID SALES_DIST_ID,
sum(a11.OPTY_SIZE) WJXBFS1
from F_OPTY_MNTH_HIST a11
join L_CAL_MNTH a12
on (a11.MNTH_ID = a12.MNTH_ID)
join L_SALES_REP a13
on (a11.SALES_REP_ID = a13.SALES_REP_ID)
where (a12.QTR_ID in (20101)
and a13.SALES_DIST_ID in (1, 2, 3)
and a11.OPTY_STAT_ID in (5))
group by a13.SALES_DIST_ID
) pa11
full outer join (select a12.SALES_DIST_ID SALES_DIST_ID,
sum(a11.SALES_REP_QTA) WJXBFS1
from F_SALES_REP_QTA a11
join L_SALES_REP a12
on (a11.SALES_REP_ID = a12.SALES_REP_ID)
where (a11.QTR_ID in (20101)
and a12.SALES_DIST_ID in (1, 2, 3))
group by a12.SALES_DIST_ID
) pa12
on (pa11.SALES_DIST_ID = pa12.SALES_DIST_ID)
full outer join (select pa11.SALES_DIST_ID SALES_DIST_ID,
pa11.WJXBFS1 WJXBFS1,
pa11.WJXBFS2 WJXBFS2,
pa11.WJXBFS3 WJXBFS3,
pa11.WJXBFS4 WJXBFS4,
pa12.WJXBFS1 WJXBFS5
from (select pa11.SALES_DIST_ID SALES_DIST_ID,
sum(pa11.WJXBFS1) WJXBFS1,
sum(pa11.WJXBFS2) WJXBFS2,
sum(pa11.WJXBFS2) WJXBFS3,
sum(pa11.WJXBFS2) WJXBFS4
from (select a11.SALES_REP_ID SALES_REP_ID,
a14.SALES_DIST_ID SALES_DIST_ID,
a11.OPTY_STAT_ID OPTY_STAT_ID,
a11.OPTY_ID OPTY_ID,
a11.MNTH_ID MNTH_ID,
a11.LEAD_ID LEAD_ID,
a11.ACCT_ID ACCT_ID,
a11.OPTY_SIZE WJXBFS1,
a11.WGHT_OPTY_SIZE WJXBFS2,
a11.OPTY_ID WJXBFS3
from F_OPTY_MNTH_HIST a11
join L_OPTY a12
on (a11.OPTY_ID = a12.OPTY_ID)
join L_CAL_MNTH a13
on (a11.MNTH_ID = a13.MNTH_ID)
join L_SALES_REP a14
on (a11.SALES_REP_ID = a14.SALES_REP_ID)
where (a13.QTR_ID in (20101)
and a14.SALES_DIST_ID in (1, 2, 3)
and a12.CURR_OPTY_STAT_ID in (2, 1, 3))
) pa11
join (select pc11.SALES_DIST_ID SALES_DIST_ID,
max(pc11.MNTH_ID) WJXBFS1
from (select a11.SALES_REP_ID SALES_REP_ID,
a14.SALES_DIST_ID SALES_DIST_ID,
a11.OPTY_STAT_ID OPTY_STAT_ID,
a11.OPTY_ID OPTY_ID,
a11.MNTH_ID MNTH_ID,
a11.LEAD_ID LEAD_ID,
a11.ACCT_ID ACCT_ID,
a11.OPTY_SIZE WJXBFS1,
a11.WGHT_OPTY_SIZE WJXBFS2,
a11.OPTY_ID WJXBFS3
from F_OPTY_MNTH_HIST a11
join L_OPTY a12
on (a11.OPTY_ID = a12.OPTY_ID)
join L_CAL_MNTH a13
on (a11.MNTH_ID = a13.MNTH_ID)
join L_SALES_REP a14
on (a11.SALES_REP_ID = a14.SALES_REP_ID)
where (a13.QTR_ID in (20101)
and a14.SALES_DIST_ID in (1, 2, 3)
and a12.CURR_OPTY_STAT_ID in (2, 1, 3))
) pc11
group by pc11.SALES_DIST_ID
) pa12
on (pa11.MNTH_ID = pa12.WJXBFS1 and
pa11.SALES_DIST_ID = pa12.SALES_DIST_ID)
group by pa11.SALES_DIST_ID
) pa11
left outer join (select pa11.SALES_DIST_ID SALES_DIST_ID,
count(distinct pa11.WJXBFS3) WJXBFS1
from (select a11.SALES_REP_ID SALES_REP_ID,
a14.SALES_DIST_ID SALES_DIST_ID,
a11.OPTY_STAT_ID OPTY_STAT_ID,
a11.OPTY_ID OPTY_ID,
a11.MNTH_ID MNTH_ID,
a11.LEAD_ID LEAD_ID,
a11.ACCT_ID ACCT_ID,
a11.OPTY_SIZE WJXBFS1,
a11.WGHT_OPTY_SIZE WJXBFS2,
a11.OPTY_ID WJXBFS3
from F_OPTY_MNTH_HIST a11
join L_OPTY a12
on (a11.OPTY_ID = a12.OPTY_ID)
join L_CAL_MNTH a13
on (a11.MNTH_ID = a13.MNTH_ID)
join L_SALES_REP a14
on (a11.SALES_REP_ID = a14.SALES_REP_ID)
where (a13.QTR_ID in (20101)
and a14.SALES_DIST_ID in (1, 2, 3)
and a12.CURR_OPTY_STAT_ID in (2, 1, 3))
) pa11
group by pa11.SALES_DIST_ID
) pa12
on (pa11.SALES_DIST_ID = pa12.SALES_DIST_ID)
) pa13
on (coalesce(pa11.SALES_DIST_ID, pa12.SALES_DIST_ID) = pa13.SALES_DIST_ID)
left outer join (select a14.SALES_DIST_ID SALES_DIST_ID,
(Case when max((Case when a12.CURR_OPTY_STAT_ID in (2) then 1 else 0 end)) = 1 then count(distinct (Case when a12.CURR_OPTY_STAT_ID in (2) then a11.OPTY_ID else NULL end)) else NULL end) WJXBFS1,
(Case when max((Case when a12.CURR_OPTY_STAT_ID in (1) then 1 else 0 end)) = 1 then count(distinct (Case when a12.CURR_OPTY_STAT_ID in (1) then a11.OPTY_ID else NULL end)) else NULL end) WJXBFS2,
(Case when max((Case when a12.CURR_OPTY_STAT_ID in (3) then 1 else 0 end)) = 1 then count(distinct (Case when a12.CURR_OPTY_STAT_ID in (3) then a11.OPTY_ID else NULL end)) else NULL end) WJXBFS3
from F_OPTY_MNTH_HIST a11
join L_OPTY a12
on (a11.OPTY_ID = a12.OPTY_ID)
join L_CAL_MNTH a13
on (a11.MNTH_ID = a13.MNTH_ID)
join L_SALES_REP a14
on (a11.SALES_REP_ID = a14.SALES_REP_ID)
where (a13.QTR_ID in (20101)
and a14.SALES_DIST_ID in (1, 2, 3)
and (a12.CURR_OPTY_STAT_ID in (2)
or a12.CURR_OPTY_STAT_ID in (1)
or a12.CURR_OPTY_STAT_ID in (3)))
group by a14.SALES_DIST_ID
) pa14
on (coalesce(pa11.SALES_DIST_ID, pa12.SALES_DIST_ID, pa13.SALES_DIST_ID) = pa14.SALES_DIST_ID)
join L_SALES_REP a17
on (coalesce(pa11.SALES_DIST_ID, pa12.SALES_DIST_ID, pa13.SALES_DIST_ID) = a17.SALES_DIST_ID)
group by coalesce(pa11.SALES_DIST_ID, pa12.SALES_DIST_ID, pa13.SALES_DIST_ID),
a17.SALES_REGN_ID
#2. Next you will create the same reports using SQL by copying/pasting the SQL code from the Microstrategy DW to the SQL interface on TUN.
#(a) Register for Access to the SQL Web Interface for the Microstrategy DW:
#• On the main TUN webpage click Software ‘ Teradata Database
#• Click on Register to Use Teradata SQL Assistant/Web Edition in our Course tunweb.teradata.ws/tunstudent/register.aspx. The Course Password is wmc3317. Create a user ID and password for your- self. You could keep it the same as for the main TUN registration you completed above. Now you are ready to use SQL Assistant on TUN.
Done
#(b) Browse to tunweb.teradata.ws/tunstudent/. Click on Login to SQL Assistant. Click on Select default database as db samwh9 - do not click OK yet.
#1You may need to use a Student Access Password if it asks for one. The password is ‘DataDive’ 1
Done
#(c) Underneath click on Database Descriptions. Find db samwh9 and store the pdf manual on that link. Study the data model under Logical Data Model for 10 minutes with your group members. Observe the schema (tables, attributes and the relationships). You will see the model is huge and depicts a real database model.
Done
#(d) Go back to the browser and click OK to enter the SQL Assistant interface. You can query the data warehouse here called db samwh9. You can run simple queries to examine the data and the structure of the tables.
Done
#(e) Execute the three SQL queries you created in 1 on this interface to check the results. Confirm that the results are the same as in 1.
All 3 are same, please see attached screen shots
#(f) Click on the ‘+‘ sign on the left panel next to db samwh9 and inspect the table schemas. Take any one of the three queries and explain in plain English how it works to give you the desired result.
So I have taken the first query and am breaking it down to show via comment starting with the "#" on the same line. I have spaced out the query so its a bit earier to visualize, please full screen theis Document
# Query 1 Explanation --------------------------------------------------------------------
select a11.OPTY_ID OPTY_ID, #Select statement from using function to gather calculations, dates, and variables
max(a14.OPTY_DESC) OPTY_DESC, #Opportuntiy Description
a11.ACCT_ID ACCT_ID,
max(a15.ACCT_DESC) ACCT_DESC,
a11.SALES_REP_ID SALES_REP_ID,
max(a16.SALES_REP_NAME) SALES_REP_NAME,
a14.OPTY_CLOSE_DATE OPTY_CLOSE_DATE,
a14.PRIMARY_COMP_ID PRIMARY_COMP_ID,
max(a17.COMPETITOR_NAME) COMPETITOR_NAME,
sum(a11.OPTY_SIZE) WJXBFS1
from F_OPTY_MNTH_HIST a11 #the inital database table "Lead Generation Table"
#This next little bit is where it get confusing
#Main Joins ---------------------------------------------------------------------------
join ( # (Join 1)
select pa11.ACCT_ID ACCT_ID, #Pulls accounts IDs, Opportunities, and Sales Rep ID from Table A that match "pa11" (Table B)
pa11.OPTY_ID OPTY_ID,
pa11.SALES_REP_ID SALES_REP_ID
from (
select a11.ACCT_ID ACCT_ID, #Pulls the IDs for the accounts, opportunities, and salse rep, organized by order size rank (Table A)
a11.OPTY_ID OPTY_ID,
a11.SALES_REP_ID SALES_REP_ID,
rank () over( order by sum(a11.OPTY_SIZE) desc) WJXBFS1 #function rank order size of each opportunity and order by it, in the amouont
from F_OPTY_MNTH_HIST a11 # The from Table for Join 1
join L_CAL_MNTH a12 # (Join 2)
on (a11.MNTH_ID = a12.MNTH_ID) #join based on Month ID
where (a11.OPTY_STAT_ID in (5) #the restrictieon in thes query for the the Southern USA office
and a12.QTR_ID in (20094)) #the date restriction in thes query for Q4 2009
group by a11.ACCT_ID, #Group by via Account Id, Opportunity ID, Sales Rep ID
a11.OPTY_ID,
a11.SALES_REP_ID
)pa11
where (pa11.WJXBFS1 <= 10.0) #the 2nd where restriction for Join 1, asking for the top 10!
)pa12
on (a11.ACCT_ID = pa12.ACCT_ID and
a11.OPTY_ID = pa12.OPTY_ID and
a11.SALES_REP_ID = pa12.SALES_REP_ID)
#Additional Quick Joins -------------------------------------------------------------
join L_CAL_MNTH a13 #Join 3
on (a11.MNTH_ID = a13.MNTH_ID) #Joining Month IDs with a certain month ID
join L_OPTY a14 #Join 4
on (a11.OPTY_ID = a14.OPTY_ID) #Joining Opportunity IDs with a ceratin opportunity ID
join L_ACCT a15 #Join 5
on (a11.ACCT_ID = a15.ACCT_ID) #Joining Account Ids with a certain Account ID
join L_SALES_REP a16 #Join 6
on (a11.SALES_REP_ID = a16.SALES_REP_ID) #Joining Rep IDs with a certatin Sale ID
join L_COMPETITOR a17 #Join 7
on (a14.PRIMARY_COMP_ID = a17.COMPETITOR_ID) #Joining 14 Company Id with the Competitor ID
#Back to Main query ---------------------------------------------------------------------
where (a13.QTR_ID in (20094) #the date restriction in the main query for Q4 2009
and a11.OPTY_STAT_ID in (5)) #the restrictieon in thes query for the the Southern USA office
and SALES_DIST_ID in (3) #sales district is Southern USA office
group by a11.OPTY_ID, #group by statement to organize the data before, the final data is visualied in Order of Account, Rep, Close Date, Company
a11.ACCT_ID,
a11.SALES_REP_ID,
a14.OPTY_CLOSE_DATE,
a14.PRIMARY_COMP_ID
Conclusion: The query aggregate data from muliple table sources (including created tables in joins, there is like 7+ tables).
Where organizes the data first in the subquery befores its eleganant bring back the data up the query, sorting them before hand.
While placing the final restriction on thes main query, but also making sure the same restrcition are placed on the subquery, some
sub query have restriction not in thes main query. This a very complex query with a multitude of joins.
|
/*1.Kroz SQL kod, napraviti bazu podataka koja nosi ime vašeg broja dosijea sa default postavkama*/
/*2.
Unutar svoje baze podataka kreirati tabele sa sljedećem strukturom:
Autori
- AutorID, 11 UNICODE karaktera i primarni ključ
- Prezime, 25 UNICODE karaktera (obavezan unos)
- Ime, 25 UNICODE karaktera (obavezan unos)
- ZipKod, 5 UNICODE karaktera, DEFAULT je NULL
- DatumKreiranjaZapisa, datuma dodavanja zapisa (obavezan unos) DEFAULT je datum unosa zapisa
- DatumModifikovanjaZapisa, polje za unos datuma izmjene zapisa , DEFAULT je NULL
Izdavaci
- IzdavacID, 4 UNICODE karaktera i primarni ključ
- Naziv, 100 UNICODE karaktera (obavezan unos), jedinstvena vrijednost
- Biljeske, 1000 UNICODE karaktera, DEFAULT tekst je Lorem ipsum
- DatumKreiranjaZapisa, datuma dodavanja zapisa (obavezan unos) DEFAULT je datum unosa zapisa
- DatumModifikovanjaZapisa, polje za unos datuma izmjene zapisa , DEFAULT je NULL
Naslovi
- NaslovID, 6 UNICODE karaktera i primarni ključ
- IzdavacID, spoljni ključ prema tabeli „Izdavaci“
- Naslov, 100 UNICODE karaktera (obavezan unos)
- Cijena, monetarni tip podatka
- Biljeske, 200 UNICODE karaktera, DEFAULT tekst je The quick brown fox jumps over the lazy dog
- DatumIzdavanja, datum izdanja naslova (obavezan unos) DEFAULT je datum unosa zapisa
- DatumKreiranjaZapisa, datuma dodavanja zapisa (obavezan unos) DEFAULT je datum unosa zapisa
- DatumModifikovanjaZapisa, polje za unos datuma izmjene zapisa , DEFAULT je NULL
NasloviAutori (Više autora može raditi na istoj knjizi)
- AutorID, spoljni ključ prema tabeli „Autori“
- NaslovID, spoljni ključ prema tabeli „Naslovi“
- DatumKreiranjaZapisa, datuma dodavanja zapisa (obavezan unos) DEFAULT je datum unosa zapisa
- DatumModifikovanjaZapisa, polje za unos datuma izmjene zapisa , DEFAULT je NULL
*/
/*2b
Generisati testne podatake i obavezno testirati da li su podaci u tabelema za svaki korak zasebno :
- Iz baze podataka pubs tabela „authors“, a putem podupita u tabelu „Autori“ importovati sve slučajno sortirane
zapise. Vodite računa da mapirate odgovarajuće kolone.
- Iz baze podataka pubs i tabela („publishers“ i pub_info“), a putem podupita u tabelu „Izdavaci“ importovati sve
slučajno sortirane zapise. Kolonu pr_info mapirati kao bilješke i iste skratiti na 100 karaktera. Vodite računa da
mapirate odgovarajuće kolone i tipove podataka.
- Iz baze podataka pubs tabela „titles“, a putem podupita u tabelu „Naslovi“ importovati one naslove koji imaju
bilješke. Vodite računa da mapirate odgovarajuće kolone.
- Iz baze podataka pubs tabela „titleauthor“, a putem podupita u tabelu „NasloviAutori“ zapise. Vodite računa da
mapirate odgovarajuće kolone.
*/
/*2c
Kreiranje nove tabele, importovanje podataka i modifikovanje postojeće tabele:
Gradovi
- GradID, automatski generator vrijednosti koji generiše neparne brojeve, primarni ključ
- Naziv, 100 UNICODE karaktera (obavezan unos), jedinstvena vrijednost
- DatumKreiranjaZapisa, datuma dodavanja zapisa (obavezan unos) DEFAULT je datum unosa zapisa
- DatumModifikovanjaZapisa, polje za unos datuma izmjene zapisa , DEFAULT je NULL
- Iz baze podataka pubs tabela „authors“, a putem podupita u tabelu „Gradovi“ importovati nazive gradove bez
duplikata.
- Modifikovati tabelu Autori i dodati spoljni ključ prema tabeli Gradovi:
*/
/*2d
Kreirati dvije uskladištene proceduru koja će modifikovati podataka u tabeli Autori:
- Prvih pet autora iz tabele postaviti da su iz grada: Salt Lake City
- Ostalim autorima podesiti grad na: Oakland
Vodite računa da se u tabeli modifikuju sve potrebne kolone i obavezno testirati da li su podaci u tabeli za svaku proceduru
posebno.
*/
/*3.
Kreirati pogled sa sljedećom definicijom: Prezime i ime autora (spojeno), grad, naslov, cijena, bilješke o naslovu i naziv
izdavača, ali samo za one autore čije knjige imaju određenu cijenu i gdje je cijena veća od 5. Također, naziv izdavača u sredini
imena ne smije imati slovo „&“ i da su iz autori grada Salt Lake City
*/
/*4.
Modifikovati tabelu Autori i dodati jednu kolonu:
- Email, polje za unos 100 UNICODE karaktera, DEFAULT je NULL
*/
/*5.
Kreirati dvije uskladištene proceduru koje će modifikovati podatke u tabelu Autori i svim autorima generisati novu email
adresu:
- Prva procedura: u formatu: Ime.Prezime@fit.ba svim autorima iz grada Salt Lake City
- Druga procedura: u formatu: Prezime.Ime@fit.ba svim autorima iz grada Oakland
*/
/*6.
z baze podataka AdventureWorks2014 u lokalnu, privremenu, tabelu u vašu bazi podataka importovati zapise o osobama, a
putem podupita. Lista kolona je: Title, LastName, FirstName, EmailAddress, PhoneNumber i CardNumber. Kreirate
dvije dodatne kolone: UserName koja se sastoji od spojenog imena i prezimena (tačka se nalazi između) i kolonu Password
za lozinku sa malim slovima dugačku 24 karaktera. Lozinka se generiše putem SQL funkciju za slučajne i jedinstvene ID
vrijednosti. Iz lozinke trebaju biti uklonjene sve crtice „-“ i zamijenjene brojem „7“. Uslovi su da podaci uključuju osobe koje
imaju i nemaju kreditnu karticu, a NULL vrijednost u koloni Titula zamjeniti sa podatkom 'N/A'. Sortirati prema prezimenu i
imenu istovremeno. Testirati da li je tabela sa podacima kreirana.
*/
/*7.
Kreirati indeks koji će nad privremenom tabelom iz prethodnog koraka, primarno, maksimalno ubrzati upite koje koriste
kolone LastName i FirstName, a sekundarno nad kolonam UserName. Napisati testni upit.
*/
/*8.
Kreirati uskladištenu proceduru koja briše sve zapise iz privremene tabele koji imaju kreditnu karticu Obavezno testirati
funkcionalnost procedure.
*/
/*9. Kreirati backup vaše baze na default lokaciju servera i nakon toga obrisati privremenu tabelu*/
/*10a Kreirati proceduru koja briše sve zapise iz svih tabela unutar jednog izvršenja. Testirati da li su podaci obrisani*/
/*10b Uraditi restore rezervene kopije baze podataka i provjeriti da li su svi podaci u izvornom obliku*/ |
CREATE TABLE [crm].[destinos_origenes] (
[id_destino_origen] INT IDENTITY (1, 1) NOT NULL,
[id_destinatario_remitente] INT NOT NULL,
[codigo] VARCHAR (20) NOT NULL,
[nombre] VARCHAR (100) NOT NULL,
[id_uso_ubicacion] VARCHAR (20) NULL,
[contacto_email] VARCHAR (100) NOT NULL,
[contacto_nombres] VARCHAR (100) NOT NULL,
[contacto_telefonos] VARCHAR (50) NOT NULL,
[id_ciudad] INT NULL,
[direccion] VARCHAR (150) NOT NULL,
[indicaciones_direccion] VARCHAR (150) NOT NULL,
[direccion_estandarizada] VARCHAR (150) NOT NULL,
[longitud] NUMERIC (18, 15) NULL,
[latitud] NUMERIC (18, 15) NULL,
[activo] BIT NOT NULL,
[fecha_actualizacion] DATETIME2 (0) NOT NULL,
[usuario_actualizacion] VARCHAR (50) NOT NULL,
CONSTRAINT [PK_destinos_origenes] PRIMARY KEY CLUSTERED ([id_destino_origen] ASC) WITH (FILLFACTOR = 80),
CONSTRAINT [FK_destinos_origenes_01] FOREIGN KEY ([id_ciudad]) REFERENCES [geo].[ciudades] ([id_ciudad]),
CONSTRAINT [FK_destinos_origenes_02] FOREIGN KEY ([id_destinatario_remitente]) REFERENCES [crm].[destinatarios_remitentes] ([id_destinatario_remitente])
);
|
CREATE TABLE role(
id VARCHAR(32) NOT NULL,
role_name VARCHAR(128),
permission_product BIGINT,
created_time DATE,
updated_time DATE,
PRIMARY KEY (id)
);;
COMMENT ON TABLE role IS '用户管理角色信息';;
COMMENT ON COLUMN role.id IS '主键';;
COMMENT ON COLUMN role.role_name IS '角色名称';;
COMMENT ON COLUMN role.permission_product IS '素数权限的乘积';;
COMMENT ON COLUMN role.created_time IS '创建时间';;
COMMENT ON COLUMN role.updated_time IS '更新时间';;
|
-- DML
-- INSERT
INSERT INTO genel.tb_kutuphane
VALUES(1, 'Milli Kütüphane', 'Ankara', '03128379281');
INSERT INTO genel.tb_kutuphane (id,adi,adres,telefon)
VALUES(2,'Beşiktaş', 'İstanbul','02126565612');
INSERT INTO genel.tb_kutuphane (id,adi,adres,telefon)
VALUES(3,'Alsancak', 'İzmir','02312235467'),
(4,'Beşocak', 'Adana', '31232512345');
-- INSERT with subquery
INSERT INTO genel.tb_personel (ad,soyad, tel, cinsiyet, tckimlikno,gorevi)
(SELECT ad, soyad, tel, cinsiyet, tckimlikno, 'Personel' FROM genel.tb_uyeler WHERE id = 2);
-- UPDATE
UPDATE genel.tb_personel SET cinsiyet = TRUE, adres = 'İstanbul' WHERE id = 3;
-- DELETE
DELETE FROM genel.tb_personel WHERE gorevi = 'Personel';
---------------------------- |
/* Formatted on 17/06/2014 18:17:32 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.VTMCRE0_WRK_AL_DELIB_DACONF_BR
(
COD_SNDG,
COD_ABI,
COD_NDG,
VAL_ALERT,
COD_STATO,
VAL_CNT_DELIBERE,
VAL_CNT_RAPPORTI,
COD_PROTOCOLLO_DELIBERA
)
AS
SELECT cod_sndg,
cod_abi,
cod_ndg,
val_alert,
cod_stato,
val_num_delib val_cnt_delibere,
1 val_cnt_rapporti,
cod_protocollo_delibera
FROM (SELECT /*+ index(a pkt_mcre0_app_all_data) index(d IAM_T_MCREI_APP_DELIBERE) */
DISTINCT
d.cod_sndg AS cod_sndg,
d.cod_abi AS cod_abi,
d.cod_ndg AS cod_ndg,
CASE
WHEN (TRUNC (SYSDATE) - TRUNC (dta_conferma_pacchetto)) <=
30
THEN
'A'
ELSE
'R'
END
AS val_alert,
a.cod_stato AS cod_stato,
COUNT (d.cod_ndg) OVER (PARTITION BY d.cod_abi, d.cod_ndg)
AS val_num_delib,
d.cod_protocollo_delibera,
RANK ()
OVER (PARTITION BY d.cod_abi, d.cod_ndg
ORDER BY val_num_progr_delibera ASC)
AS rn
FROM t_mcrei_app_delibere PARTITION (inc_pattive) d,
vtmcre0_app_upd_fields a
WHERE d.cod_fase_pacchetto = 'CNF'
AND d.cod_fase_microtipologia = 'ATT'
AND cod_fase_Delibera NOT IN ('CA', 'CO')
AND d.cod_abi = a.cod_abi_cartolarizzato
AND d.cod_ndg = a.cod_ndg
AND d.flg_no_delibera = 0
AND d.flg_attiva = '1'
--AND a.cod_stato IN ('IN', 'RS')
AND a.flg_outsourcing = 'Y'
AND a.flg_target = 'Y')
WHERE rn = 1;
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE, ON COMMIT REFRESH, QUERY REWRITE, DEBUG, FLASHBACK ON MCRE_OWN.VTMCRE0_WRK_AL_DELIB_DACONF_BR TO MCRE_USR;
|
create or replace view v_geo_level as
select g1.geo_em_addr L_1_ID,
g1.g_cle L_1_key,
g1.g_desc L_1_desc,
g1.g_desc_court L_1_Shortdesc,
g2.geo_em_addr L_2_ID,
g2.g_cle L_2_key,
g2.g_desc L_2_desc,
g2.g_desc_court L_2_Shortdesc,
g3.geo_em_addr L_3_ID,
g3.g_cle L_3_key,
g3.g_desc L_3_desc,
g3.g_desc_court L_3_Shortdesc,
g4.geo_em_addr L_4_ID,
g4.g_cle L_4_key,
g4.g_desc L_4_desc,
g4.g_desc_court L_4_Shortdesc,
g5.geo_em_addr L_5_ID,
g5.g_cle L_5_key,
g5.g_desc L_5_desc,
g5.g_desc_court L_5_Shortdesc,
g6.geo_em_addr L_6_ID,
g6.g_cle L_6_key,
g6.g_desc L_6_desc,
g6.g_desc_court L_6_Shortdesc,
g7.geo_em_addr L_7_ID,
g7.g_cle L_7_key,
g7.g_desc L_7_desc,
g7.g_desc_court L_7_Shortdesc,
g8.geo_em_addr L_8_ID,
g8.g_cle L_8_key,
g8.g_desc L_8_desc,
g8.g_desc_court L_8_Shortdesc,
g9.geo_em_addr L_9_ID,
g9.g_cle L_9_key,
g9.g_desc L_9_desc,
g9.g_desc_court L_9_Shortdesc,
g10.geo_em_addr L_10_ID,
g10.g_cle L_10_key,
g10.g_desc L_10_desc,
g10.g_desc_court L_10_Shortdesc,
g11.geo_em_addr L_11_ID,
g11.g_cle L_11_key,
g11.g_desc L_11_desc,
g11.g_desc_court L_11_Shortdesc,
g12.geo_em_addr L_12_ID,
g12.g_cle L_12_key,
g12.g_desc L_12_desc,
g12.g_desc_court L_12_Shortdesc,
g13.geo_em_addr L_13_ID,
g13.g_cle L_13_key,
g13.g_desc L_13_desc,
g13.g_desc_court L_13_Shortdesc,
g14.geo_em_addr L_14_ID,
g14.g_cle L_14_key,
g14.g_desc L_14_desc,
g14.g_desc_court L_14_Shortdesc,
g15.geo_em_addr L_15_ID,
g15.g_cle L_15_key,
g15.g_desc L_15_desc,
g15.g_desc_court L_15_Shortdesc,
g16.geo_em_addr L_16_ID,
g16.g_cle L_16_key,
g16.g_desc L_16_desc,
g16.g_desc_court L_16_Shortdesc,
g17.geo_em_addr L_17_ID,
g17.g_cle L_17_key,
g17.g_desc L_17_desc,
g17.g_desc_court L_17_Shortdesc,
g18.geo_em_addr L_18_ID,
g18.g_cle L_18_key,
g18.g_desc L_18_desc,
g18.g_desc_court L_18_Shortdesc,
g19.geo_em_addr L_19_ID,
g19.g_cle L_19_key,
g19.g_desc L_19_desc,
g19.g_desc_court L_19_Shortdesc,
g20.geo_em_addr L_20_ID,
g20.g_cle L_20_key,
g20.g_desc L_20_desc,
g20.g_desc_court L_20_Shortdesc
from geo g1
left join geo g2
on g1.geo1_em_addr = g2.geo_em_addr
left join geo g3
on g2.geo1_em_addr = g3.geo_em_addr
left join geo g4
on g3.geo1_em_addr = g4.geo_em_addr
left join geo g5
on g4.geo1_em_addr = g5.geo_em_addr
left join geo g6
on g5.geo1_em_addr = g6.geo_em_addr
left join geo g7
on g6.geo1_em_addr = g7.geo_em_addr
left join geo g8
on g7.geo1_em_addr = g8.geo_em_addr
left join geo g9
on g8.geo1_em_addr = g9.geo_em_addr
left join geo g10
on g9.geo1_em_addr = g10.geo_em_addr
left join geo g11
on g10.geo1_em_addr = g11.geo_em_addr
left join geo g12
on g11.geo1_em_addr = g12.geo_em_addr
left join geo g13
on g12.geo1_em_addr = g13.geo_em_addr
left join geo g14
on g13.geo1_em_addr = g14.geo_em_addr
left join geo g15
on g14.geo1_em_addr = g15.geo_em_addr
left join geo g16
on g15.geo1_em_addr = g16.geo_em_addr
left join geo g17
on g16.geo1_em_addr = g17.geo_em_addr
left join geo g18
on g17.geo1_em_addr = g18.geo_em_addr
left join geo g19
on g18.geo1_em_addr = g19.geo_em_addr
left join geo g20
on g19.geo1_em_addr = g20.geo_em_addr
where g1.geo_em_addr not in (select geo1_em_addr from geo);
|
-- List record in Descending order
SELECT `score`, `name` FROM second_table WHERE score>=10 ORDER BY `score` DESC, `name`; |
-- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 29, 2013 at 01:32 PM
-- Server version: 5.5.31
-- PHP Version: 5.3.10-1ubuntu3.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `space-adventures`
--
CREATE DATABASE `space-adventures` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `space-adventures`;
-- --------------------------------------------------------
--
-- Table structure for table `subscript`
--
CREATE TABLE IF NOT EXISTS `subscript` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `subscript`
--
INSERT INTO `subscript` (`id`, `email`) VALUES
(1, 'test1@mail.com'),
(2, 'test2@mail.com'),
(3, 'test3@mail.com');
-- --------------------------------------------------------
--
-- Table structure for table `subscription`
--
CREATE TABLE IF NOT EXISTS `subscription` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`email` varchar(128) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `subscription`
--
INSERT INTO `subscription` (`id`, `email`) VALUES
(1, 'test10@mail.ru'),
(2, 'sldfjasldfkjasdlf');
/*!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 count(1), cd_elo_agendamento,
case when nvl(cd_tipo_agendamento, 22) in (22,23,24) then 22 else cd_tipo_agendamento end cd_tipo_agendamento,
CD_PRODUTO_SAP, nu_contrato_sap, CD_ITEM_CONTRATO, nu_ordem_venda,
sum(qt_programada) qt_programada, sum(qt_entregue) qt_entregue, sum(qt_saldo) qt_saldo, sum(qt_agendada) qt_agendada, sum(qt_agendada_confirmada) qt_agendada_confirmada
from vnd.elo_carteira where cd_elo_agendamento_item in
(
select item.cd_elo_agendamento_item from vnd.elo_agendamento age
inner join vnd.elo_agendamento_supervisor sup
on age.cd_elo_agendamento = sup.cd_elo_agendamento
inner join vnd.elo_agendamento_item item
on sup.cd_elo_agendamento_supervisor = item.cd_elo_agendamento_supervisor
inner join vnd.elo_agendamento_week wee
on
item.cd_elo_agendamento_item = wee.cd_elo_agendamento_item
inner join vnd.elo_agendamento_day da
on
wee.cd_elo_agendamento_week = da.cd_elo_agendamento_week
where
1=1
and (age.DT_WEEK_START > sysdate - 300)
and age.ic_ativo ='S'
AND item.ic_ativo = 'S'
and (nvl(cd_tipo_agendamento, 22) in (22,23,24) or (cd_tipo_agendamento = 25 and cd_status_replan = 32))
)
group by cd_elo_agendamento,
case when nvl(cd_tipo_agendamento, 22) in (22,23,24) then 22 else cd_tipo_agendamento end , CD_PRODUTO_SAP, nu_contrato_sap, CD_ITEM_CONTRATO, nu_ordem_venda--, qt_programada, qt_entregue, qt_saldo, qt_agendada, qt_agendada_confirmada
having count(1) > 1
;
SELECT * FROM VND.ELO_AGENDAMENTO WHERE CD_ELO_AGENDAMENTO = 170;
SELECT * FROM VND.ELO_CARTEIRA_SAp
WHERE 1=1
--AND CD_ELO_AGENDAMENTO = 170
AND NU_CARTEIRA_VERSION = '20180602233000'
AND CD_PRODUTO_SAP = '000000000000105606' AND NU_CONTRATO_SAP = '0040384453' AND CD_ITEM_CONTRATO = 10 AND NU_ORDEM_VENDA = '0002341307' ;
170 22 0040384453 10 0002341307
SELECT * FROM ALL_SOURCE
WHERE TEXT LIKE '%9999%';
|
select *
from krns_att_t
where file_nm like 'ABC%';
select * from
proposal_notepad
where proposal_number = '1717';
select * from KRNS_NTE_T
where
select * from attachment_file
where file_id = '1717';
select * from attachment_file
where obj_id ='FEF1DEDC-F1BA-CEC4-43EB-55A0279EFF3D';
select * from attachment_file
where obj_id ='FEF1DEDC-F1BA-CEC4-43EB-55A0279EFF3D';
|
create or replace view v_geo_coeff as
select g.geo39_em_addr,
p.annee_prm,
f_Convert_1E20(p.m_prm_1) m_prm_1,
f_Convert_1E20(p.m_prm_2) m_prm_2,
f_Convert_1E20(p.m_prm_3) m_prm_3,
f_Convert_1E20(p.m_prm_4) m_prm_4,
f_Convert_1E20(p.m_prm_5) m_prm_5,
f_Convert_1E20(p.m_prm_6) m_prm_6,
f_Convert_1E20(p.m_prm_7) m_prm_7,
f_Convert_1E20(p.m_prm_8) m_prm_8,
f_Convert_1E20(p.m_prm_9) m_prm_9,
f_Convert_1E20(p.m_prm_10) m_prm_10,
f_Convert_1E20(p.m_prm_11) m_prm_11,
f_Convert_1E20(p.m_prm_12) m_prm_12,
f_Convert_1E20(p.m_prm_13) m_prm_13,
f_Convert_1E20(p.m_prm_14) m_prm_14
from geodvs g, rpe r, prm p
where g.geo39_em_addr = 3
and g.n0_dvs = 0
and g.dvs38_em_addr <> 1
and r.dvs26_em_addr = g.dvs38_em_addr
and p.rpe29_em_addr = r.rpe_em_addr;
|
CREATE TABLE teachers(
teacher_id serial PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
homeroom_number INTEGER NOT NULL,
phone INTEGER UNIQUE NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
department VARCHAR(50) NOT NULL
); |
drop table SubqueryContent;
drop table SubqueryDeleted;
drop table SubqueryColors;
drop table SubqueryAddress;
|
-- set default value for new field
UPDATE PERSON_EXT_T
SET CITIZENSHIP_TYPE_CODE = (SELECT CITIZENSHIP_TYPE_CODE FROM CITIZENSHIP_TYPE_T WHERE DESCRIPTION = 'US CITIZEN OR NONCITIZEN NATIONAL');
-- make new field a non-null field
ALTER TABLE PERSON_EXT_T MODIFY CITIZENSHIP_TYPE_CODE DECIMAL(15,5) NOT NULL; |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 24-04-2020 a las 22:34:49
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.4
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 */;
--
-- Base de datos: `taskmanager`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `person`
--
CREATE TABLE `person` (
`id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`identification` varchar(25) NOT NULL,
`email` varchar(250) NOT NULL,
`phone` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `person`
--
INSERT INTO `person` (`id`, `name`, `identification`, `email`, `phone`) VALUES
(27, 'DUVAN ANGARITA', '1093758636', 'duvan_angarita_1001@hotmail.com', '3106507015'),
(30, 'NELSON GARZÓN', '123456780', 'nedagarmo@gmail.com', '3204449438'),
(31, 'DANIEL MENESES', '978654255', 'dmeneses55@yahoo.com', '3123496652');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `task`
--
CREATE TABLE `task` (
`id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`description` varchar(25) NOT NULL,
`state` int(1) NOT NULL,
`init_date` date NOT NULL,
`finish_date` date NOT NULL,
`person_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `task`
--
INSERT INTO `task` (`id`, `name`, `description`, `state`, `init_date`, `finish_date`, `person_id`) VALUES
(1, 'Desarrollo de vistas del sistema', 'Desarrollo', 1, '2020-04-24', '2020-04-25', 27);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `taskxperson`
--
CREATE TABLE `taskxperson` (
`id` int(11) NOT NULL,
`task_id` int(11) NOT NULL,
`person_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `taskxperson`
--
INSERT INTO `taskxperson` (`id`, `task_id`, `person_id`) VALUES
(2, 1, 27),
(3, 1, 31);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `user`
--
CREATE TABLE `user` (
`username` varchar(25) NOT NULL,
`password` varchar(100) NOT NULL,
`person_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `user`
--
INSERT INTO `user` (`username`, `password`, `person_id`) VALUES
('1', '123', 27);
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `person`
--
ALTER TABLE `person`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `identification` (`identification`);
--
-- Indices de la tabla `task`
--
ALTER TABLE `task`
ADD PRIMARY KEY (`id`),
ADD KEY `person_id` (`person_id`);
--
-- Indices de la tabla `taskxperson`
--
ALTER TABLE `taskxperson`
ADD PRIMARY KEY (`id`),
ADD KEY `task_id` (`task_id`),
ADD KEY `person_id` (`person_id`);
--
-- Indices de la tabla `user`
--
ALTER TABLE `user`
ADD UNIQUE KEY `username` (`username`),
ADD KEY `fk_user_person` (`person_id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `person`
--
ALTER TABLE `person`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT de la tabla `task`
--
ALTER TABLE `task`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `taskxperson`
--
ALTER TABLE `taskxperson`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `task`
--
ALTER TABLE `task`
ADD CONSTRAINT `task_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `user` (`person_id`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `taskxperson`
--
ALTER TABLE `taskxperson`
ADD CONSTRAINT `taskxperson_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `task` (`id`) ON UPDATE CASCADE,
ADD CONSTRAINT `taskxperson_ibfk_2` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `user`
--
ALTER TABLE `user`
ADD CONSTRAINT `fk_user_person` FOREIGN KEY (`person_id`) REFERENCES `person` (`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 */;
|
SHOW USER;
/
CREATE TABLE STARTUP_AUDIT (
EVENT_TYPE VARCHAR2(30),
EVENT_DATE DATE,
EVENT_TIME VARCHAR2(15)
);
/
-- the following was not accepted due to privilege
CREATE OR REPLACE TRIGGER TR_STARTUP_AUDIT
AFTER STARTUP ON DATABASE
BEGIN
INSERT INTO STARTUP_AUDIT VALUES(
ORA_SYSEVENT,
SYSDATE,
TO_CHAR(SYSDATE, 'hh24:mm:ss')
);
END;
/
|
create database websystique;
use websystique;
/*All User's gets stored in APP_USER table*/
create table websystique.APP_USER (
id BIGINT NOT NULL AUTO_INCREMENT,
sso_id VARCHAR(30) NOT NULL,
password VARCHAR(100) NOT NULL,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
email VARCHAR(30) NOT NULL,
dept_level VARCHAR(3) NOT NULL,
dept_code varchar(45) NOT NULL,
regtaxnum varchar(45) NOT NULL,
PRIMARY KEY (id),
UNIQUE (sso_id)
);
/* USER_PROFILE table contains all possible roles */
create table websystique.USER_PROFILE(
id BIGINT NOT NULL AUTO_INCREMENT,
type VARCHAR(30) NOT NULL,
PRIMARY KEY (id),
UNIQUE (type)
);
/* JOIN TABLE for MANY-TO-MANY relationship*/
CREATE TABLE websystique.APP_USER_USER_PROFILE (
user_id BIGINT NOT NULL,
user_profile_id BIGINT NOT NULL,
PRIMARY KEY (user_id, user_profile_id),
CONSTRAINT FK_APP_USER FOREIGN KEY (user_id) REFERENCES websystique.APP_USER (id),
CONSTRAINT FK_USER_PROFILE FOREIGN KEY (user_profile_id) REFERENCES websystique.USER_PROFILE (id)
);
/* Create persistent_logins Table used to store rememberme related stuff*/
CREATE TABLE websystique.persistent_logins (
username VARCHAR(64) NOT NULL,
series VARCHAR(64) NOT NULL,
token VARCHAR(64) NOT NULL,
last_used TIMESTAMP NOT NULL,
PRIMARY KEY (series)
);
/* Populate USER_PROFILE Table */
INSERT INTO websystique.USER_PROFILE(type)
VALUES ('USER');
INSERT INTO websystique.USER_PROFILE(type)
VALUES ('ADMIN');
INSERT INTO websystique.USER_PROFILE(type)
VALUES ('DBA');
/* Populate one Admin User which will further create other users for the application using GUI */
INSERT INTO websystique.APP_USER(sso_id, password, first_name, last_name, email, dept_level)
VALUES ('admin','$2a$10$txtsrvA82fYGrUD/Vp/fpe7V1ULYJtFm6pa3E7eIHFRPUacZnrmpm', 'Admin','Smith','JerryHuang@Symphox.net', '1');
INSERT INTO websystique.APP_USER(sso_id, password, first_name, last_name, email, dept_level)
VALUES ('sam','$2a$10$4eqIF5s/ewJwHK1p8lqlFOEm2QIA0S8g6./Lok.pQxqcxaBZYChRm', 'Sam','Smith','samy@xyz.com', '2');
INSERT INTO websystique.APP_USER(sso_id, password, first_name, last_name, email, dept_level)
VALUES ('joe','$2a$10$4eqIF5s/ewJwHK1p8lqlFOEm2QIA0S8g6./Lok.pQxqcxaBZYChRm', 'Joe','Smith','joe@xyz.com', '3');
INSERT INTO websystique.APP_USER(sso_id, password, first_name, last_name, email, dept_level)
VALUES ('00780','$2a$10$XL1NYXURV.gmr1rhwiiDkeD8zisEr/10PUq8C/wBQoik/i1XNuzoi', 'Jerry','Huang','JerryHuang@symphox.net', '7');
/* Populate JOIN Table */
INSERT INTO websystique.APP_USER_USER_PROFILE (user_id, user_profile_id)
SELECT user.id, profile.id FROM websystique.app_user user, websystique.user_profile profile
where user.sso_id='admin' and profile.type='ADMIN';
INSERT INTO websystique.APP_USER_USER_PROFILE (user_id, user_profile_id)
SELECT user.id, profile.id FROM websystique.app_user user, websystique.user_profile profile
where user.sso_id='sam' and profile.type='DBA';
INSERT INTO websystique.APP_USER_USER_PROFILE (user_id, user_profile_id)
SELECT user.id, profile.id FROM websystique.app_user user, websystique.user_profile profile
where user.sso_id='joe' and profile.type='USER';
INSERT INTO websystique.APP_USER_USER_PROFILE (user_id, user_profile_id)
SELECT user.id, profile.id FROM websystique.app_user user, websystique.user_profile profile
where user.sso_id='00780' and profile.type='USER';
# 專案內容
CREATE TABLE websystique.project_main_data (
proid BIGINT NOT NULL AUTO_INCREMENT, # 專案ID
project_pronum VARCHAR(64) NOT NULL, # 專案號碼
project_classes VARCHAR(64) NULL, # 類別
project_status VARCHAR(64) NULL, # 專案燈號
project_name VARCHAR(64) NULL, # 重要專案工作計畫
project_main_person VARCHAR(64) NULL, # 專案窗口
project_sub_person VARCHAR(64) NULL, # 代理人
project_notes VARCHAR(1000) NULL, # 專案內容說明
project_create_user VARCHAR(64) NULL, # 專案起單人
project_start_date TIMESTAMP NULL, # 專案開始日期
project_ended_date TIMESTAMP NULL, # 專案結束日期
project_finish_date TIMESTAMP NULL, # 專案完成日期
project_create_date TIMESTAMP NULL, # 專案建立日期
project_ori_proid VARCHAR(500) NULL, # 原始專案ID
PRIMARY KEY (proid, project_pronum),
CONSTRAINT FK_PROJECT_MAIN_DATA FOREIGN KEY (project_create_user) REFERENCES websystique.app_user (sso_id) ON UPDATE CASCADE ON DELETE CASCADE
);
# 專案執行時程
CREATE TABLE websystique.project_schedule (
scheduleid BIGINT NOT NULL AUTO_INCREMENT,# 進度ID
proid BIGINT NOT NULL, # 專案ID
project_item VARCHAR(64) NULL, # 子專案內容(KPI執行內容)
project_control VARCHAR(64) NULL, # 子專案控管 / 產出文件 (KPI指標)
project_notes VARCHAR(1000) NULL, # 子專案內容說明
project_start_date TIMESTAMP NULL, # 子專案開始日期
project_ended_date TIMESTAMP NULL, # 子專案結束日期
project_finish_date TIMESTAMP NULL, # 子專案完成日期
project_create_date TIMESTAMP NULL, # 子專案建立日期
PRIMARY KEY (scheduleid, proid)
);
# red: #FF0000, yellow: #FFE153, green: #28FF28, white: #FFFFFF
create table websystique.PROJECT_STATUS (
pro_status BIGINT NOT NULL,
pro_desc VARCHAR(100) NOT NULL,
pro_color VARCHAR(10) NOT NULL,
PRIMARY KEY (pro_status)
);
create table websystique.DEPT_CODE (
dept_code VARCHAR(30) NOT NULL,
dept_desc VARCHAR(100) NOT NULL,
company VARCHAR(10) NOT NULL,
PRIMARY KEY (dept_code)
);
# 專案修改歷史紀錄
CREATE TABLE websystique.project_data_log_list (
logid BIGINT NOT NULL AUTO_INCREMENT, # 流水號ID
proid BIGINT NOT NULL, # 專案ID
project_notes VARCHAR(1000) Not NULL, # 專案內容說明
project_modify_user VARCHAR(20) Not NULL, # 專案修改者
project_modify_date TIMESTAMP Not NULL, # 專案修改日期
PRIMARY KEY (logid, proid)
);
INSERT INTO websystique.project_main_data(project_pronum, project_classes, project_status, project_name, project_main_person, project_sub_person, project_notes, project_create_user, project_start_date, project_ended_date, project_create_date)
VALUES ('PRO2016050026', '集團內', '#28FF28', 'EIM & 雲端總機', '王家權', 'MAX', '藉由', '00780', '2016-05-21 15:24:52','2016-06-01 15:24:52', '2016-05-31 14:59:21');
INSERT INTO websystique.project_main_data(project_pronum, project_classes, project_status, project_name, project_main_person, project_sub_person, project_notes, project_create_user, project_start_date, project_ended_date, project_create_date)
VALUES ('PRO2016050026', '集團內', '#28FF28', 'EIM & 雲端總機', '王家權', 'MAX', '藉由', 'admin', '2016-05-21 15:24:52','2016-06-01 15:24:52', '2016-05-31 14:59:21');
INSERT INTO websystique.PROJECT_STATUS(pro_status, pro_desc, pro_color)
VALUES ('1','無狀態', '#FFFFFF');
INSERT INTO websystique.PROJECT_STATUS(pro_status, pro_desc, pro_color)
VALUES ('2','已完成', '#28FF28');
INSERT INTO websystique.PROJECT_STATUS(pro_status, pro_desc, pro_color)
VALUES ('3','尚未開始', '#FFFFFF');
INSERT INTO websystique.PROJECT_STATUS(pro_status, pro_desc, pro_color)
VALUES ('4','執行中', '#28FF28');
INSERT INTO websystique.PROJECT_STATUS(pro_status, pro_desc, pro_color)
VALUES ('5','逼近時限', '#FFE153');
INSERT INTO websystique.PROJECT_STATUS(pro_status, pro_desc, pro_color)
VALUES ('6','超過時限', '#FF0000');
INSERT INTO websystique.DEPT_CODE(dept_code, dept_desc, company)
VALUES ('sym001','網路雲端產品部', '007');
INSERT INTO websystique.app_user_project_data_mapping(user_id, data_id)
VALUES ('4', '1');
# 以下沒用
CREATE TABLE websystique.project_data_schedule_mapping (
data_id BIGINT NOT NULL, # 專案ID
schedule_id BIGINT NOT NULL, # 進度ID
PRIMARY KEY (data_id, schedule_id),
CONSTRAINT FK_PROJECT_MAIN_DATA FOREIGN KEY (data_id) REFERENCES websystique.PROJECT_MAIN_DATA (proid),
CONSTRAINT FK_PROJECT_SCHEDULE FOREIGN KEY (schedule_id) REFERENCES websystique.PROJECT_SCHEDULE (scheduleid)
);
CREATE TABLE websystique.app_user_project_data_mapping (
user_id BIGINT NOT NULL, # user id
data_id BIGINT NOT NULL, # 專案ID
PRIMARY KEY (user_id, data_id),
CONSTRAINT FK_APP_USER2 FOREIGN KEY (user_id) REFERENCES websystique.app_user (id),
CONSTRAINT FK_PROJECT_MAIN_DATA2 FOREIGN KEY (data_id) REFERENCES websystique.PROJECT_MAIN_DATA (proid)
);
create table websystique.PROJECT_DATA (
pro_id BIGINT NOT NULL AUTO_INCREMENT,
pro_name VARCHAR(100) NOT NULL,
pro_user VARCHAR(100) NOT NULL,
pro_status VARCHAR(30) NOT NULL,
pro_start_date TIMESTAMP NOT NULL,
pro_end_date TIMESTAMP NOT NULL,
pro_dept_code VARCHAR(30) NOT NULL,
PRIMARY KEY (pro_id)
);
create table websystique.PROJECT_DATA_DETAIL (
id BIGINT NOT NULL AUTO_INCREMENT,
pro_id BIGINT NOT NULL,
pro_sub_detail VARCHAR(100) NOT NULL,
pro_sub_status VARCHAR(30) NOT NULL,
pro_sub_start_date TIMESTAMP NOT NULL,
pro_sub_end_date TIMESTAMP NOT NULL,
PRIMARY KEY (id)
);
create table websystique.PROJECT_DATA_PROJECT_DATA_DETAIL (
id BIGINT NOT NULL AUTO_INCREMENT,
pro_id BIGINT NOT NULL,
PRIMARY KEY (id, pro_id),
CONSTRAINT FK_PROJECT_DATA FOREIGN KEY (pro_id) REFERENCES websystique.PROJECT_DATA(pro_id),
CONSTRAINT FK_PROJECT_DATA_DETAIL FOREIGN KEY (id) REFERENCES websystique.PROJECT_DATA_DETAIL(id)
);
INSERT INTO websystique.PROJECT_DATA(pro_name, pro_user, pro_status, pro_start_date, pro_end_date, pro_dept_code)
VALUES ('Test Project1','Jerry', '2','2016-05-21 15:24:52','2016-06-01 15:24:52', 'sym001');
INSERT INTO websystique.PROJECT_DATA(pro_name, pro_user, pro_status, pro_start_date, pro_end_date, pro_dept_code)
VALUES ('Test Project2','Jerry', '2','2016-05-22 15:24:52','2016-06-02 15:24:52', 'sym001');
INSERT INTO websystique.PROJECT_DATA(pro_name, pro_user, pro_status, pro_start_date, pro_end_date, pro_dept_code)
VALUES ('Test Project3','Jerry', '2','2016-05-23 15:24:52','2016-06-03 15:24:52', 'sym001');
INSERT INTO websystique.PROJECT_DATA(pro_name, pro_user, pro_status, pro_start_date, pro_end_date, pro_dept_code)
VALUES ('Test Project4','Jerry', '2','2016-05-24 15:24:52','2016-06-04 15:24:52', 'sym001');
INSERT INTO websystique.PROJECT_DATA(pro_name, pro_user, pro_status, pro_start_date, pro_end_date, pro_dept_code)
VALUES ('Test Project5','Jerry', '2','2016-05-25 15:24:52','2016-06-05 15:24:52', 'sym001');
INSERT INTO websystique.PROJECT_DATA_DETAIL(pro_id, pro_sub_detail, pro_sub_status, pro_sub_start_date, pro_sub_end_date)
VALUES ('1','Test Project Sub1', '2', '2016-05-21 15:24:52','2016-06-01 15:24:52');
INSERT INTO websystique.PROJECT_DATA_DETAIL(pro_id, pro_sub_detail, pro_sub_status, pro_sub_start_date, pro_sub_end_date)
VALUES ('1','Test Project Sub2', '2', '2016-05-21 15:24:52','2016-06-01 15:24:52');
INSERT INTO websystique.PROJECT_DATA_DETAIL(pro_id, pro_sub_detail, pro_sub_status, pro_sub_start_date, pro_sub_end_date)
VALUES ('1','Test Project Sub3', '2', '2016-05-21 15:24:52','2016-06-01 15:24:52');
INSERT INTO websystique.PROJECT_DATA_DETAIL(pro_id, pro_sub_detail, pro_sub_status, pro_sub_start_date, pro_sub_end_date)
VALUES ('2','Test Project Sub1', '2', '2016-05-22 15:24:52','2016-06-02 15:24:52');
INSERT INTO websystique.PROJECT_DATA_DETAIL(pro_id, pro_sub_detail, pro_sub_status, pro_sub_start_date, pro_sub_end_date)
VALUES ('2','Test Project Sub2', '2', '2016-05-22 15:24:52','2016-06-02 15:24:52');
INSERT INTO websystique.PROJECT_DATA_PROJECT_DATA_DETAIL(id, pro_id)
VALUES ('1', '1');
INSERT INTO websystique.PROJECT_DATA_PROJECT_DATA_DETAIL(id, pro_id)
VALUES ('2', '1');
INSERT INTO websystique.PROJECT_DATA_PROJECT_DATA_DETAIL(id, pro_id)
VALUES ('3', '1');
INSERT INTO websystique.PROJECT_DATA_PROJECT_DATA_DETAIL(id, pro_id)
VALUES ('4', '2');
INSERT INTO websystique.PROJECT_DATA_PROJECT_DATA_DETAIL(id, pro_id)
VALUES ('5', '2'); |
USE regalonatural; DELETE FROM regalonatural.ps_message_readed;
|
USE finance;
CREATE TABLE Account
(
id INTEGER,
name CHAR(50) NOT NULL,
balance FLOAT,
PRIMARY KEY(id)
);
CREATE TABLE AccountOwnedStocks
(
account_id INTEGER,
symbol CHAR(10) NOT NULL,
type CHAR(10) NOT NULL,
num_shares FLOAT,
purchase_price FLOAT,
PRIMARY KEY(account_id, symbol),
FOREIGN KEY (account_id) REFERENCES Account(id)
);
|
ALTER TABLE user_pledge_leaderboards ADD (username VARCHAR(80) NOT NULL);
ALTER TABLE user_pledge_leaderboards ADD (name VARCHAR(80) NOT NULL);
ALTER TABLE user_pledge_leaderboards_loading ADD (username VARCHAR(80) NOT NULL);
ALTER TABLE user_pledge_leaderboards_loading ADD (name VARCHAR(80) NOT NULL);
ALTER TABLE user_recruit_leaderboards ADD (username VARCHAR(80) NOT NULL);
ALTER TABLE user_recruit_leaderboards ADD (name VARCHAR(80) NOT NULL);
ALTER TABLE user_recruit_leaderboards_loading ADD (username VARCHAR(80) NOT NULL);
ALTER TABLE user_recruit_leaderboards_loading ADD (name VARCHAR(80) NOT NULL);
|
create table Users(
id INT PRIMARY KEY,
login VARCHAR(50),
password VARCHAR(50),
token text
);
insert into Users (id, login, password, token) values (1, 'jpattinson0', 'bVlQfImzm', '');
insert into Users (id, login, password, token) values (2, 'lgroves1', 'lZuwCD', '');
insert into Users (id, login, password, token) values (3, 'tbrain2', 'tOj6R1y', '');
insert into Users (id, login, password, token) values (4, 'eleifer3', 'DjwqZDde', '');
insert into Users (id, login, password, token) values (5, 'kmccart4', 'pAkhnfB', ''); |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Client : localhost:3306
-- Généré le : Dim 02 Août 2020 à 16:58
-- Version du serveur : 5.7.31-0ubuntu0.18.04.1
-- Version de PHP : 7.2.24-0ubuntu0.18.04.6
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 : `projet3j`
--
-- --------------------------------------------------------
--
-- Structure de la table `account`
--
CREATE TABLE `account` (
`id_user` int(11) NOT NULL,
`nom` varchar(20) NOT NULL,
`prenom` varchar(20) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(275) NOT NULL,
`question` varchar(100) NOT NULL,
`reponse` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `account`
--
INSERT INTO `account` (`id_user`, `nom`, `prenom`, `username`, `password`, `question`, `reponse`) VALUES
(38, 'd', 'd', 'd', 'mdqYBDxlywSU.', 'Quel est votre film préféré ?', 'd'),
(39, 'test', 'test', 'test', 'md5t8oxzFpyOQ', 'Quel est votre film préféré ?', 'test'),
(37, 'c', 'c', 'c', '$2y$10$R3T.wBBuQLmyNt1gxOYnVunJlI8n91IaPoK8m3wO7zjzGNztGvf4G', 'Quel est votre film préféré ?', 'c'),
(36, 'b', 'b', 'b', '$2y$10$gWcArMUtOfp.qEuIqIMjTO43aEofMivttIVQEBhQ4gWhGjMtzbGIC', 'Quel est votre film préféré ?', 'b'),
(35, 'a', 'a', 'a', '$2y$10$boxXFYl9KcDKhYsWLuvhW.ev/Zl5iqB6.eDGpQn/FnMCRDNSxAjwC', 'Quel est votre film préféré ?', 'a');
-- --------------------------------------------------------
--
-- Structure de la table `acteur`
--
CREATE TABLE `acteur` (
`id_acteur` int(11) NOT NULL,
`acteur` varchar(20) NOT NULL,
`description` text NOT NULL,
`logo` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `acteur`
--
INSERT INTO `acteur` (`id_acteur`, `acteur`, `description`, `logo`) VALUES
(1, 'Formation&co', 'Formation&co est une association française présente sur tout le territoire.\r\nNous proposons à des personnes issues de tout milieu de devenir entrepreneur grâce à un crédit et un accompagnement professionnel et personnalisé.\r\nNotre proposition : \r\n- un financement jusqu’à 30 000€ ;\r\n- un suivi personnalisé et gratuit ;\r\n- une lutte acharnée contre les freins sociétaux et les stéréotypes.\r\n\r\nLe financement est possible, peu importe le métier : coiffeur, banquier, éleveur de chèvres… . Nous collaborons avec des personnes talentueuses et motivées.\r\nVous n’avez pas de diplômes ? Ce n’est pas un problème pour nous ! Nos financements s’adressent à tous.\r\n', 'formation_co.png'),
(2, 'Protectpeople', 'Protectpeople finance la solidarité nationale.\r\nNous appliquons le principe édifié par la Sécurité sociale française en 1945 : permettre à chacun de bénéficier d’une protection sociale.\r\n\r\nChez Protectpeople, chacun cotise selon ses moyens et reçoit selon ses besoins.\r\nProectecpeople est ouvert à tous, sans considération d’âge ou d’état de santé.\r\nNous garantissons un accès aux soins et une retraite.\r\nChaque année, nous collectons et répartissons 300 milliards d’euros.\r\nNotre mission est double :\r\nsociale : nous garantissons la fiabilité des données sociales ;\r\néconomique : nous apportons une contribution aux activités économiques.\r\n', 'protectpeople.png'),
(3, 'Dsa France', 'Dsa France accélère la croissance du territoire et s’engage avec les collectivités territoriales.\r\nNous accompagnons les entreprises dans les étapes clés de leur évolution.\r\nNotre philosophie : s’adapter à chaque entreprise.\r\nNous les accompagnons pour voir plus grand et plus loin et proposons des solutions de financement adaptées à chaque étape de la vie des entreprises.\r\n', 'Dsa_france.png'),
(4, 'CDE', 'La CDE (Chambre Des Entrepreneurs) accompagne les entreprises dans leurs démarches de formation. \r\nSon président est élu pour 3 ans par ses pairs, chefs d’entreprises et présidents des CDE.\r\n', 'CDE.png');
-- --------------------------------------------------------
--
-- Structure de la table `post`
--
CREATE TABLE `post` (
`id_post` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`id_acteur` int(11) NOT NULL,
`date_add` date NOT NULL,
`post` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `post`
--
INSERT INTO `post` (`id_post`, `id_user`, `id_acteur`, `date_add`, `post`) VALUES
(5, 10, 1, '2020-06-24', 'Un premier commentaire'),
(6, 36, 1, '2020-07-29', 'wqwwq'),
(7, 36, 1, '2020-07-29', 'szzssz'),
(8, 36, 2, '2020-07-29', 'un comment sur l\'acteur 2'),
(9, 36, 3, '2020-07-29', 'wqwqqw'),
(10, 36, 3, '2020-07-29', 'wqwqqw'),
(11, 36, 3, '2020-07-29', 'qqqwwq'),
(12, 36, 1, '2020-07-29', 'wqwqqwx'),
(13, 36, 1, '2020-07-29', 'qqq'),
(14, 36, 1, '2020-07-29', 'wqwqqw'),
(15, 36, 1, '2020-07-29', 'un test'),
(16, 36, 1, '2020-07-29', 'wq'),
(17, 36, 1, '2020-07-29', 'wq'),
(18, 36, 1, '2020-07-29', 'et maintenant !!!'),
(19, 36, 1, '2020-07-29', 'wwqqwq'),
(20, 36, 1, '2020-07-29', 'ouiap'),
(21, 35, 1, '2020-07-30', 'wqqwqw'),
(22, 35, 1, '2020-07-30', 'wqqqw'),
(23, 35, 1, '2020-07-30', 'xxsxs'),
(24, 35, 1, '2020-07-30', 'wqqw'),
(25, 35, 1, '2020-07-30', 'wqqw'),
(26, 35, 1, '2020-07-30', 'wqqw'),
(27, 35, 1, '2020-07-30', 'wqqw'),
(28, 35, 1, '2020-07-30', 'wqqw');
-- --------------------------------------------------------
--
-- Structure de la table `vote`
--
CREATE TABLE `vote` (
`id_user` int(11) NOT NULL,
`id_acteur` int(11) NOT NULL,
`vote` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `vote`
--
INSERT INTO `vote` (`id_user`, `id_acteur`, `vote`) VALUES
(10, 1, 'dislike'),
(10, 2, 'dislike'),
(35, 3, 'like'),
(35, 2, 'dislike'),
(36, 1, 'like');
--
-- Index pour les tables exportées
--
--
-- Index pour la table `account`
--
ALTER TABLE `account`
ADD PRIMARY KEY (`id_user`);
--
-- Index pour la table `acteur`
--
ALTER TABLE `acteur`
ADD PRIMARY KEY (`id_acteur`);
--
-- Index pour la table `post`
--
ALTER TABLE `post`
ADD PRIMARY KEY (`id_post`);
--
-- Index pour la table `vote`
--
ALTER TABLE `vote`
ADD PRIMARY KEY (`id_user`,`id_acteur`);
--
-- AUTO_INCREMENT pour les tables exportées
--
--
-- AUTO_INCREMENT pour la table `account`
--
ALTER TABLE `account`
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
--
-- AUTO_INCREMENT pour la table `acteur`
--
ALTER TABLE `acteur`
MODIFY `id_acteur` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT pour la table `post`
--
ALTER TABLE `post`
MODIFY `id_post` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
/*!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 */;
|
-- loadInitData.sql
-- Create Users
insert into users_view (first_name, last_name, email, username, password, dep, div)
values ('admin1','control1','ac1@mail.com','admin1','apassword','ad1','ad1');
insert into users_view (first_name, last_name, email, username, password, dep, div)
values ('admin2','control2','ac2@mail.com','admin2','apassword','ad2','ad2');
insert into users_view (first_name, last_name, email, username, password, dep, div)
values ('user1','using1','uu1@mail.com','user1','upassword','dep4','div1');
insert into users_view (first_name, last_name, email, username, password, dep, div)
values ('user2','using2','uu2@mail.com','user2','upassword','dep3','div2');
insert into users_view (first_name, last_name, email, username, password, dep, div)
values ('user3','using3','uu3@mail.com','user3','upassword','dep2','div3');
insert into users_view (first_name, last_name, email, username, password, dep, div)
values ('user4','using4','uu4@mail.com','user4','upassword','dep1','div4');
-- Create Suggestions
insert into suggestions (suggest, created, updated)
values ('SuggestExample1','2011-03-22 11:29:36.231112','2011-03-27 15:52:56.05206');
insert into suggestions (suggest, created, updated)
values ('SuggestExample2','2011-03-22 11:29:36.231112','2011-03-27 15:52:56.05206');
insert into suggestions (suggest, created, updated)
values ('SuggestExample3','2011-03-22 11:29:36.231112','2011-03-27 15:52:56.05206');
insert into suggestions (suggest, created, updated)
values ('SuggestExample4','2011-03-22 11:29:36.231112','2011-03-27 15:52:56.05206');
insert into suggestions (suggest, created, updated)
values ('SuggestExample5','2011-03-22 11:29:36.231112','2011-03-27 15:52:56.05206');
insert into suggestions (suggest, created, updated)
values ('SuggestExample6','2011-03-22 11:29:36.231112','2011-03-27 15:52:56.05206');
insert into suggestions (suggest, created, updated)
values ('SuggestExample7','2011-03-22 11:29:36.231112','2011-03-27 15:52:56.05206');
-- Create user_suggestion pairs
insert into user_suggestion (user_id, suggestion_id)
values ('7','1');
insert into user_suggestion (user_id, suggestion_id)
values ('6','2');
insert into user_suggestion (user_id, suggestion_id)
values ('5','3');
insert into user_suggestion (user_id, suggestion_id)
values ('4','4');
insert into user_suggestion (user_id, suggestion_id)
values ('3','5');
insert into user_suggestion (user_id, suggestion_id)
values ('2','6');
insert into user_suggestion (user_id, suggestion_id)
values ('1','7');
|
/* Formatted on 21/07/2014 18:43:46 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRES_FEN_MAIN_SOFF_STK_IC
(
COD_ABI,
VAL_ANNOMESE,
COD_NDG,
COD_SNDG,
VAL_GBV,
VAL_NBV,
DTA_DECORRENZA_STATO,
FLG_DA_CONTABILIZZARE,
RN_IDC,
RN_STK
)
AS
SELECT COD_ABI,
VAL_ANNOMESE,
COD_NDG,
COD_SNDG,
VAL_GBV,
VAL_NBV,
DTA_DECORRENZA_STATO,
FLG_DA_CONTABILIZZARE,
RN_IDC,
RN_STK
FROM (SELECT A.*,
ROW_NUMBER ()
OVER (
PARTITION BY COD_ABI,
VAL_ANNOMESE,
FLG_DA_CONTABILIZZARE
ORDER BY VAL_GBV DESC)
RN_IDC,
ROW_NUMBER ()
OVER (PARTITION BY COD_ABI, VAL_ANNOMESE
ORDER BY VAL_GBV DESC)
RN_STK
FROM ( SELECT CP.COD_ABI,
TO_CHAR (CP.DTA_SISBA_CP, 'YYYYMM') VAL_ANNOMESE,
CP.COD_NDG,
CP.COD_SNDG,
SUM (CP.VAL_UTI_RET) VAL_GBV,
SUM (CP.VAL_ATT) VAL_NBV,
MIN (CP.DTA_DECORRENZA_STATO) DTA_DECORRENZA_STATO,
CASE
WHEN MIN (CP.DTA_DECORRENZA_STATO) BETWEEN TO_DATE (
TO_CHAR (
DTA_SISBA_CP,
'YYYY')
|| '0101',
'YYYYMMDD')
AND DTA_SISBA_CP
THEN
1
ELSE
0
END
FLG_DA_CONTABILIZZARE
FROM T_MCRES_APP_SISBA_CP CP
WHERE CP.VAL_FIRMA != 'FIRMA' AND COD_STATO_RISCHIO = 'S'
GROUP BY CP.COD_ABI,
CP.COD_NDG,
CP.COD_SNDG,
CP.DTA_SISBA_CP) A)
WHERE (RN_IDC <= 50 AND FLG_DA_CONTABILIZZARE = 1) OR RN_STK <= 50;
|
--Trigger que verifica que el material a insertar en la relacion libro sea una tesis
CREATE OR REPLACE TRIGGER tgInsertaTesis
BEFORE INSERT ON tesis
FOR EACH ROW
DECLARE
vTipoMat tipoMaterial.tipoMaterial%TYPE;
BEGIN
SELECT tipoMaterial
INTO vTipoMat
FROM tipoMaterial
WHERE idMaterial=:NEW.idMaterial;
IF vTipoMat != 'tesis' THEN
RAISE_APPLICATION_ERROR(-20021,'El material que desea registrar no es una tesis');
END IF;
END tgInsertaTesis;
/
SHOW ERRORS
|
CREATE EXTENSION pgcrypto; --Allows PostgreSQL to understand UUIDs. Only have to create the extension once for a database.
--DROP TABLE product;
CREATE TABLE product (
id uuid NOT NULL DEFAULT gen_random_uuid(), --The record ID. Stored in the edu.uark.dataaccess.entities:BaseEntity#id property. See also the named constant defined in edu.uark.dataaccess.entities:BaseFieldNames that is used for Java <-> SQL mappings.
lookupcode character varying(32) NOT NULL DEFAULT(''), --Stored in the edu.uark.models.entities:ProductEntity#lookupCode property. See also the named constant defined in edu.uark.models.entities.fieldnames:ProductFieldNames that is used for Java <-> SQL mappings.
count int NOT NULL DEFAULT(0), --Stored in the edu.uark.models.entities:ProductEntity#count property. See also the named constant defined in edu.uark.models.entities.fieldnames:ProductFieldNames that is used for Java <-> SQL mappings.
createdon timestamp without time zone NOT NULL DEFAULT now(), --Stored in the edu.uark.dataaccess.entities:BaseEntity#createdOn property. See also the named constant defined in edu.uark.dataaccess.entities:BaseFieldNames that is used for Java <-> SQL mappings.
CONSTRAINT product_pkey PRIMARY KEY (id)
) WITH (
OIDS=FALSE
);
--DROP INDEX ix_product_lookupcode;
CREATE INDEX ix_product_lookupcode --An index on the product table lookupcode column
ON product
USING btree
(lower(lookupcode::text) COLLATE pg_catalog."default"); --Index on the lower case of the lookup code. Queries for product by lookupcode should search using the lower case of the lookup code.
INSERT INTO product (lookupcode, count) VALUES ( --id and createdon are generated by default.
'lookupcode1'
, 100)
RETURNING id, createdon;
INSERT INTO product (lookupcode, count) VALUES (
'lookupcode2'
, 125)
RETURNING id, createdon;
INSERT INTO product (lookupcode, count) VALUES (
'lookupcode3'
, 150)
RETURNING id, createdon;
--SELECT * FROM product;
--DELETE FROM product;
|
-- alter tables
ALTER TABLE emp ADD CONSTRAINT pk_emp PRIMARY KEY (empno);
ALTER TABLE dept ADD CONSTRAINT pk_dept PRIMARY KEY (deptno);
ALTER TABLE dept ADD CONSTRAINT fk_emp_dept FOREIGN KEY (deptno) REFERENCES dept(deptno);
-- create view
CREATE OR REPLACE
VIEW emp_dept_v
AS
SELECT d.deptno
, d.dname
, d.loc
, e.empno
, e.ename
, e.job
, e.deptno emp_deptno
FROM dept d, emp e
WHERE d.deptno = e.deptno;
UPDATE emp_dept_v SET dname = 'RESEARCH' WHERE ename = 'ALLEN';
SELECT column_name, insertable, updatable, deletable
FROM user_updatable_columns
WHERE table_name = 'EMP_DEPT_V';
-- create instead of trigger
CREATE OR REPLACE
TRIGGER emp_dept_v_trg
INSTEAD OF UPDATE ON emp_dept_v
BEGIN
UPDATE emp
SET ename = :NEW.ename
, job = :NEW.job
, deptno = :NEW.emp_deptno
WHERE empno = :OLD.empno;
UPDATE dept
SET dname = :NEW.dname
, loc = :NEW.loc
WHERE deptno = :OLD.deptno;
END emp_dept_v_trg;
/
SELECT column_name, insertable, updatable, deletable
FROM user_updatable_columns
WHERE table_name = 'EMP_DEPT_V';
UPDATE emp_dept_v SET dname = 'RESEARCH' WHERE ename = 'ALLEN';
DROP VIEW emp_dept_v; |
select
wo_id,
cl_id,
zo_id,
wo_orderedby,
wo_attention,
rfq_id,
wo_process,
wo_release,
wo_po,
wo_line,
wo_linetotal,
prse_id,
wo_status,
wo_commitmentdate,
wo_previousid,
wo_previousdate,
sh_id,
sh_date,
wo_trackingno,
wo_shippingdate,
wo_deliverydate,
wo_invoiceno,
wo_invoicedate,
wo_notes,
wo_date
from wo,
jsonb_to_record(wo_jsonb) as x (
cl_id int,
zo_id int,
wo_orderedby text,
wo_attention text,
rfq_id int,
wo_process int,
wo_release text,
wo_po text,
wo_line int,
wo_linetotal int,
prse_id int,
wo_status int,
wo_commitmentdate timestamp,
wo_previousid int,
wo_previousdate timestamp,
sh_id int,
sh_date timestamp,
wo_trackingno text,
wo_shippingdate timestamp,
wo_deliverydate timestamp,
wo_invoiceno text,
wo_invoicedate timestamp,
wo_notes text
); |
/* Returns the connections among all shows in the selection.
*
* {show_list}: list of shows to restrict the query to
* {least_threshold}: minimum number of episodes in connection must be at least this value
* {greatest_threshold}: maximum number of episodes in connection must be at least this value
*/
select a.show_id show_a, b.show_id show_b, count(1) as actors
from played_in a
cross join played_in b
on a.show_id > b.show_id
and a.show_id in ({show_list})
and b.show_id in ({show_list})
and a.actor_id = b.actor_id
and least(a.episodes, b.episodes) >= {least_threshold}
and greatest(a.episodes, b.episodes) >= {greatest_threshold}
group by a.show_id, b.show_id;
|
/**
* SQL for insert view shisetsu history
* @author BaoNQ4
* @version $Id: AddViewShisetsuHistoryService_addNewViewShisetsuHistory_Ins_01.sql 15046 2014-07-17 10:46:14Z p_guen_bao01 $
*/
INSERT
INTO
FR_CUSTOMER_VIEW_HISTORY(
CUSTOMER_IDENTIFY_ID
,SHISETSU_CD
,VIEW_DATE
,CREATE_DATE
,CREATE_MODULE_ID
,UPDATE_DATE
,UPDATE_MODULE_ID
)
VALUES
(
/*customerId*/''
,
/*shisetsuCd*/''
,
/*viewDate*/''
,
/*createDate*/'14-06-20'
,
/*createModuleId*/'kaigo'
,
/*updateDate*/'14-06-20'
,
/*updateModuleId*/'kaigo'
)
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 22, 2020 at 02:03 PM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.6
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: `micro`
--
-- --------------------------------------------------------
--
-- Table structure for table `tbl_ans`
--
CREATE TABLE `tbl_ans` (
`id` int(11) NOT NULL,
`quesNo` int(11) NOT NULL,
`rightAns` int(11) NOT NULL DEFAULT 0,
`ans` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_ans`
--
INSERT INTO `tbl_ans` (`id`, `quesNo`, `rightAns`, `ans`) VALUES
(1, 1, 0, 'Personal Home Page'),
(2, 1, 1, 'Hypertext Preprocessor'),
(3, 1, 0, 'Pretext Hypertext Processor'),
(4, 1, 0, 'Preprocessor Home Page'),
(5, 2, 0, 'Willam Makepiece'),
(6, 2, 1, ' Rasmus Lerdorf'),
(7, 2, 0, 'Drek Kolkevi'),
(8, 2, 0, 'List Barely'),
(9, 3, 0, '.html'),
(10, 3, 0, '.ph'),
(11, 3, 1, '.php'),
(12, 3, 0, '.xml'),
(13, 4, 0, '\\r'),
(14, 4, 1, '\\n'),
(15, 4, 0, '/n'),
(16, 4, 0, '/r'),
(17, 5, 0, 'error'),
(18, 5, 1, '5'),
(19, 5, 0, '1'),
(20, 5, 0, '12'),
(21, 6, 0, '$add = $add'),
(22, 6, 0, '$add = $add + 1'),
(23, 6, 1, '$add = $add +$add'),
(24, 6, 0, '$add = $add + $add + 1');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_ques`
--
CREATE TABLE `tbl_ques` (
`id` int(11) NOT NULL,
`quesNo` int(11) NOT NULL,
`ques` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_ques`
--
INSERT INTO `tbl_ques` (`id`, `quesNo`, `ques`) VALUES
(1, 1, 'What does PHP stand for?'),
(2, 2, 'Who is the father of PHP?'),
(3, 3, 'PHP files have a default file extension of.'),
(4, 4, 'Which of the below symbols is a newline character?'),
(5, 5, 'If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?'),
(6, 6, 'Which of the below statements is equivalent to $add += $add ?');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_user`
--
CREATE TABLE `tbl_user` (
`userid` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`username` varchar(30) NOT NULL,
`password` varchar(32) NOT NULL,
`email` varchar(255) NOT NULL,
`status` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_user`
--
INSERT INTO `tbl_user` (`userid`, `name`, `username`, `password`, `email`, `status`) VALUES
(13, 'shubham', '8147345501', 'e10adc3949ba59abbe56e057f20f883e', 'shubhampatil1102@gmail.com', 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tbl_ans`
--
ALTER TABLE `tbl_ans`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_ques`
--
ALTER TABLE `tbl_ques`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_user`
--
ALTER TABLE `tbl_user`
ADD PRIMARY KEY (`userid`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tbl_ans`
--
ALTER TABLE `tbl_ans`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT for table `tbl_ques`
--
ALTER TABLE `tbl_ques`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `tbl_user`
--
ALTER TABLE `tbl_user`
MODIFY `userid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
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 GB_CATEGORY_T (ID bigint not null auto_increment, VERSION integer not null, GRADEBOOK_ID bigint not null, NAME varchar(255) not null, WEIGHT double precision, DROP_LOWEST integer, REMOVED bit, primary key (ID));
alter table GB_GRADABLE_OBJECT_T add CATEGORY_ID bigint;
alter table GB_GRADEBOOK_T add GRADE_TYPE integer not null;
alter table GB_GRADEBOOK_T add CATEGORY_TYPE integer not null;
alter table GB_CATEGORY_T add index FKCD333737325D7986 (GRADEBOOK_ID), add constraint FKCD333737325D7986 foreign key (GRADEBOOK_ID) references GB_GRADEBOOK_T (ID);
alter table GB_GRADABLE_OBJECT_T add index FK759996A7F09DEFAE (CATEGORY_ID), add constraint FK759996A7F09DEFAE foreign key (CATEGORY_ID) references GB_CATEGORY_T (ID);
create index GB_CATEGORY_GB_IDX on GB_CATEGORY_T (GRADEBOOK_ID);
create index GB_GRADABLE_OBJ_CT_IDX on GB_GRADABLE_OBJECT_T (CATEGORY_ID);
update GB_GRADEBOOK_T set GRADE_TYPE = 1, CATEGORY_TYPE = 1;
|
/*
HackerRank
https://www.hackerrank.com/domains/sql/
*/
/* Example 1 Revising select query*/
SELECT * FROM CITY
WHERE POPULATION > 100000
AND COUNTRYCODE = 'USA';
/* Example 2 Revising the select query II*/
SELECT NAME FROM CITY WHERE POPULATION > 120000 AND COUNTRYCODE = 'USA';
/* Example 3 Select all*/
SELECT * FROM CITY;
/* Example 4 Select by ID*/
SELECT * FROM CITY WHERE ID = 1661;
/* Example 5 Japanese cities' attributes*/
SELECT * FROM CITY WHERE COUNTRYCODE = 'JPN';
/* Example 6 Japanese cities' names*/
SELECT NAME FROM CITY WHERE COUNTRYCODE = 'JPN';
/* Example 7 Weather Observer Station 1*/
SELECT CITY,STATE FROM STATION;
/* Example 8 */ |
CREATE TABLE message (
id SERIAL NOT NULL PRIMARY KEY,
sender_id INTEGER NOT NULL,
content TEXT NOT NULL,
timestamp TIMESTAMP,
FOREIGN KEY (sender_id) REFERENCES chat_user(id)
); |
/*
Navicat Premium Data Transfer
Source Server : aliyun
Source Server Type : MySQL
Source Server Version : 50728
Source Host : rm-uf6jtd86t80rf8de90o.mysql.rds.aliyuncs.com:3306
Source Schema : campuservice
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 14/12/2020 10:19:13
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for my_order
-- ----------------------------
DROP TABLE IF EXISTS `my_order`;
CREATE TABLE `my_order` (
`order_id` int(11) NOT NULL AUTO_INCREMENT,
`start` int(5) NULL DEFAULT NULL,
`destination` int(5) NULL DEFAULT NULL,
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`size` int(5) NULL DEFAULT NULL,
`price` int(10) NULL DEFAULT NULL,
`poster_id` int(11) NULL DEFAULT NULL,
`accepter_id` int(11) NULL DEFAULT NULL,
`post_time` datetime(0) NULL DEFAULT NULL,
`accept_time` datetime(0) NULL DEFAULT NULL,
`confirm_time` datetime(0) NULL DEFAULT NULL,
`finish_time` datetime(0) NULL DEFAULT NULL,
`refuse_time` datetime(0) NULL DEFAULT NULL,
`status` int(5) NULL DEFAULT NULL,
`poster_photo` varchar(2083) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`accepter_photo` varchar(2083) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`order_id`) USING BTREE,
INDEX `poster_id`(`poster_id`) USING BTREE,
INDEX `accepter_id`(`accepter_id`) USING BTREE,
CONSTRAINT `my_order_ibfk_1` FOREIGN KEY (`poster_id`) REFERENCES `user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `my_order_ibfk_2` FOREIGN KEY (`accepter_id`) REFERENCES `user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of my_order
-- ----------------------------
INSERT INTO `my_order` VALUES (1, 0, 1, 'description', 0, 3, 2, 1, '2020-12-02 00:00:00', NULL, NULL, NULL, NULL, 0, NULL, NULL);
INSERT INTO `my_order` VALUES (2, 0, 1, 'description', 0, 3, 2, 1, '2020-12-02 14:23:35', NULL, NULL, NULL, NULL, 0, NULL, NULL);
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`user_name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`password` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`balance` int(10) NOT NULL DEFAULT -1,
`student_id` int(11) NOT NULL,
`student_name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`is_admin` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, 'u1', '123123', -1, 1, 's1', b'0');
INSERT INTO `user` VALUES (2, 'user1', '123123', -1, 1111111111, 's1', b'0');
SET FOREIGN_KEY_CHECKS = 1;
|
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.6.21-log : Database - db_account
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`db_account` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `db_account`;
/*Table structure for table `t_admin` */
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin` (
`admin_id` smallint(6) NOT NULL AUTO_INCREMENT,
`admin_name` varchar(20) NOT NULL,
`admin_password` varchar(20) NOT NULL,
PRIMARY KEY (`admin_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*Data for the table `t_admin` */
insert into `t_admin`(`admin_id`,`admin_name`,`admin_password`) values (1,'joe101019','joe101019');
/*Table structure for table `t_luence` */
DROP TABLE IF EXISTS `t_luence`;
CREATE TABLE `t_luence` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(40) NOT NULL,
`author` varchar(20) NOT NULL,
`content` varchar(225) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `t_luence` */
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 23, 2020 at 08:29 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
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: `dormitory_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `customers`
--
CREATE TABLE `customers` (
`id` bigint(20) UNSIGNED NOT NULL,
`customer_IDcard` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`customer_firstname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`customer_lastname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`customer_gender` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`customer_phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`customer_email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`customer_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`room_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`booking_deposit` int(11) NOT NULL,
`roomcost` int(11) NOT NULL,
`booking_statusResidence` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`booking_statusPayment` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`booking_timeperiod` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `customers`
--
INSERT INTO `customers` (`id`, `customer_IDcard`, `customer_firstname`, `customer_lastname`, `customer_gender`, `customer_phone`, `customer_email`, `customer_address`, `room_id`, `booking_deposit`, `roomcost`, `booking_statusResidence`, `booking_statusPayment`, `booking_timeperiod`, `created_at`, `updated_at`) VALUES
(1, '1100024800326', 'admin', 'system', 'M', '0910000555', 'admin@gmail.com', '11', '101', 6000, 3900, '1', 'P', '6M', '2020-10-23 10:32:59', '2020-10-23 10:32:59'),
(2, '1900024800999', 'test', 'system', 'M', '0954500853', 'test@gmail.com', '11', '102', 6000, 3900, '1', 'P', '6M', '2020-10-23 10:33:21', '2020-10-23 10:33:21'),
(3, '1100024800326', 'hon', 'nage', 'M', '0910000555', 'honnage.x@gmail.com', '11', '109', 6000, 3900, '1', 'P', '6M', '2020-10-23 10:33:37', '2020-10-23 10:33:37'),
(4, '1900024800888', 'มาลี', 'มาแล้ว', 'F', '0910000555', 'admin@gmail.com', '11', '209', 6000, 3900, '1', 'P', '6M', '2020-10-23 10:57:03', '2020-10-23 10:57:03');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
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 */;
|
-- ----------------------------
-- Table structure for t_amount
-- ----------------------------
CREATE TABLE `t_amount` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`status` int(1) NOT NULL COMMENT '0:正常,1欠费',
`money` double(20, 0) NOT NULL,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for t_amount_detail
-- ----------------------------
CREATE TABLE `t_amount_detail` (
`id` int(11) NOT NULL,
`amount_id` int(11) NOT NULL,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
`status` int(1) NOT NULL,
`money` double(20, 0) NOT NULL,
`type` int(1) NOT NULL COMMENT '0: 收入 1:支出',
`discription` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for t_score
-- ----------------------------
CREATE TABLE `t_score` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`status` int(1) NOT NULL,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
`score` bigint(20) NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `index_id`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for t_score_detail
-- ----------------------------
CREATE TABLE `t_score_detail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`score_id` int(11) NOT NULL,
`score` bigint(255) NOT NULL,
`status` int(1) NOT NULL,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
`type` int(1) NOT NULL COMMENT '0: 收入 , 1:支出',
`discription` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
CREATE TABLE `t_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`status` int(1) UNSIGNED ZEROFILL NOT NULL COMMENT '0:正常,1:封停',
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `index_id`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1; |
SELECT res_id, grp_id, res_type_id, RTRIM(res_desc) as roomname, RTRIM(res_hdr) as title, capacity
FROM RedESoft.dbo.tbl_res WHERE grp_id IN ??
ORDER BY roomname
|
SELECT * FROM `photo album`.photo_post order by creation_date; |
/*
-- Query: SELECT * FROM guestone.departamentos
LIMIT 0, 1000
-- Date: 2015-05-06 14:51
*/
INSERT INTO `departamentos` (`iddepartamento`,`descPortugues`,`descIngles`,`descEspanhol`,`descFrances`,`idrede`,`flgativo`,`dtinclusao`) VALUES (2,'Recepção','Front Desk','Mostrador','Réception',1,'S','2015-04-06 20:36:16');
INSERT INTO `departamentos` (`iddepartamento`,`descPortugues`,`descIngles`,`descEspanhol`,`descFrances`,`idrede`,`flgativo`,`dtinclusao`) VALUES (3,'Governança','Housekeeping','Servicio de Limpieza','Ménagère',1,'S','2015-04-06 20:38:42');
INSERT INTO `departamentos` (`iddepartamento`,`descPortugues`,`descIngles`,`descEspanhol`,`descFrances`,`idrede`,`flgativo`,`dtinclusao`) VALUES (4,'Café da Manhã','Breakfast','El Desayuno','Déjeneur',1,'S','2015-04-06 20:39:38');
|
; WITH LookupMetadata_CTE (Id, LookupId, Metadata) AS (
SELECT 1, 600, '[Badge("label-success")]'
UNION SELECT 2, 601, '[Badge("label-warning")]'
UNION SELECT 3, 602, '[Badge("label-info")]'
UNION SELECT 4, 603, '[Badge("label-inverse")]'
UNION SELECT 5, 604, '[Badge("label-default")]'
)
MERGE INTO dbo.LookupMetadata
USING LookupMetadata_CTE as cte
ON dbo.LookupMetadata.Id = cte.Id
WHEN MATCHED THEN
UPDATE SET LookupId = cte.LookupId,
Metadata = cte.Metadata
WHEN NOT MATCHED BY TARGET THEN
INSERT (Id, LookupId, Metadata) VALUES (cte.Id, cte.LookupId, cte.Metadata)
WHEN NOT MATCHED BY SOURCE THEN
DELETE; |
ALTER TABLE reviews ADD COLUMN issystemreview BOOL NOT NULL DEFAULT true;
ALTER TABLE reviews RENAME COLUMN lecturerreview TO islecturerreview;
ALTER TABLE reviews RENAME COLUMN submitted TO issubmitted;
ALTER TABLE audits RENAME COLUMN resolved TO isresolved;
|
SELECT * FROM user WHERE address = "9028 Sed Street";
SELECT distinct user.userName FROM user INNER JOIN bodyMeasurements ON user.userName = bodyMeasurements.userName;
SELECT AVG(chest) FROM bodyMeasurements;
SELECT bodyMeasurements.userName, chest, biceps, FROM bodyMeasurements LEFT OUTER JOIN user ON bodyMeasurments.username = user.userName;
SELECT * FROM user WHERE dOfBirth BETWEEN '1985/01/01' and '2002/09/27';
SELECT * FROM user WHERE lname LIKE 'l_e';
|
CREATE PROCEDURE [tSQLt].[RunTest]
@TestName NVARCHAR(MAX)
AS
BEGIN
RAISERROR('tSQLt.RunTest has been retired. Please use tSQLt.Run instead.', 16, 10);
END;
|
-- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `levels` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`rows` int(11) NOT NULL,
`speed` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `levels` (`id`, `name`, `rows`, `speed`) VALUES
(1, 'Easy', 0, 1000),
(2, 'Medium', 2, 800),
(3, 'Hard', 4, 500),
(4, 'Super hard', 5, 200);
CREATE TABLE `scores` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`score` int(11) NOT NULL,
`level_id` int(11) NOT NULL,
`datatime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `vHighscores` (
`username` varchar(50)
,`score` int(11)
,`levelname` varchar(50)
);
DROP TABLE IF EXISTS `vHighscores`;
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `vHighscores` AS select `users`.`name` AS `username`,`scores`.`score` AS `score`,`levels`.`name` AS `levelname` from ((`scores` join `users` on(`scores`.`user_id` = `users`.`id`)) join `levels` on(`scores`.`level_id` = `levels`.`id`)) ;
ALTER TABLE `levels`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`);
ALTER TABLE `scores`
ADD PRIMARY KEY (`id`),
ADD KEY `users` (`user_id`),
ADD KEY `levels` (`level_id`);
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
ALTER TABLE `levels`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
ALTER TABLE `scores`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
ALTER TABLE `scores`
ADD CONSTRAINT `levels` FOREIGN KEY (`level_id`) REFERENCES `levels` (`id`),
ADD CONSTRAINT `users` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
COMMIT; |
CREATE TABLE products
(
product_id SERIAL PRIMARY KEY,
name VARCHAR(64) NOT NULL,
price FLOAT NOT NULL,
img_url TEXT
); |
drop table IF exists envios;
drop table IF exists lineaventa;
drop table IF exists ventas;
drop table IF exists clientes;
drop table IF exists producto;
drop table IF exists personal;
CREATE TABLE clientes(
ID int NOT NULL unique AUTO_INCREMENT ,
DNI varchar(9) unique ,
Nombre varchar(30),
Direccion varchar(50),
Telefono integer(9),
Activo bit,
PRIMARY KEY (ID)
);
CREATE TABLE personal (
ID int(11) NOT NULL unique AUTO_INCREMENT,
PASS varchar(50) DEFAULT NULL,
Activo int(11) DEFAULT NULL,
Salario double DEFAULT NULL,
Telefono int(9) DEFAULT NULL,
Nombre varchar(30) DEFAULT NULL,
PRIMARY KEY (ID)
);
CREATE TABLE ventas(
ID int(11) NOT NULL unique AUTO_INCREMENT,
precio float DEFAULT NULL,
fecha Date DEFAULT NULL,
pagado bit DEFAULT NULL,
IDCliente int DEFAULT NULL,
IDPersonal int default null,
PRIMARY KEY(ID),
constraint foreign key (IDCliente) references clientes(ID),
constraint foreign key (IDPersonal) references personal(ID) ON DELETE CASCADE
);
CREATE TABLE envios (
ID int(11) NOT NULL unique AUTO_INCREMENT,
Direccion varchar(50),
Activo int(11),
IDVenta int (11),
PRIMARY KEY (ID),
constraint foreign key (IDVenta) references ventas(ID) ON DELETE CASCADE
);
create table producto(
ID int (11) not null auto_increment,
Nombre varchar(50) unique,
Descripcion varchar (50),
precio float,
stock int,
primary key (ID)
);
CREATE TABLE lineaventa (
IDVenta int(11) NOT NULL,
IDProducto int(11) NOT NULL,
cantidad int(11) NOT NULL,
constraint FOREIGN KEY (IDVenta) REFERENCES ventas (ID) ON DELETE CASCADE,
constraint FOREIGN KEY (IDProducto) REFERENCES producto (ID) ON DELETE CASCADE
);
INSERT INTO personal (pass, activo, salario, telefono, nombre)
VALUES ('admin', 1, 0, 0, 'admin');
INSERT INTO clientes (dni, nombre, direccion, telefono, activo)
VALUES ('00000000A', 'admin', null, null, 1); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.