sql
stringlengths
6
1.05M
<gh_stars>0 create table if not exists exceptions ( sensor_id INTEGER, exception_time INTEGER, exception_text TEXT NULL, stacktrace TEXT NULL, cleared INTEGER )
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table item ( id bigint not null, name varchar(255), quantity integer, constraint pk_item primary key (id)) ; create sequence item_seq; # --- !Downs SET REFERENTIAL_INTEGRITY FALSE; drop table if exists item; SET REFERENTIAL_INTEGRITY TRUE; drop sequence if exists item_seq;
<filename>db/migrations/sqlite/000026_create_tokenaccount_table.down.sql DROP TABLE IF EXISTS tokenaccount;
<filename>internal/post/sql/get/publicPosts/ForUser/Total.sql<gh_stars>1-10 SELECT COUNT(postId) FROM Posts WHERE userId IN ( SELECT followUserId FROM ( SELECT followUserId FROM UserFollows WHERE userId = ? AND accepted = 1 ) tmp ) AND published != 0 OR userId = ?
-- start_ignore ! gpconfig -c gp_vmem_limit_per_query -v '0' --skipvalidation ! gpconfig -c gp_vmem_protect_limit -v '8192' ! gpconfig -c runaway_detector_activation_percent -v 0 ! gpstop -rai; -- end_ignore
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 09, 2017 at 04:31 AM -- Server version: 5.7.20-0ubuntu0.16.04.1 -- PHP Version: 7.0.22-0ubuntu0.16.04.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `cinema` -- -- -------------------------------------------------------- -- -- Table structure for table `halls` -- CREATE TABLE `halls` ( `id` int(10) UNSIGNED NOT NULL, `rows` int(11) NOT NULL, `seats_in_row` int(11) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `halls` -- INSERT INTO `halls` (`id`, `rows`, `seats_in_row`, `created_at`) VALUES (1, 10, 8, '2017-11-09 01:08:20'), (2, 20, 15, '2017-11-09 04:08:27'); -- -------------------------------------------------------- -- -- Table structure for table `movies` -- CREATE TABLE `movies` ( `id` int(10) UNSIGNED NOT NULL, `hall_id` int(11) NOT NULL, `title` varchar(64) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `movies` -- INSERT INTO `movies` (`id`, `hall_id`, `title`, `created_at`) VALUES (1, 1, 'Interstellar', '2017-11-09 01:08:56'), (2, 1, 'Dark Knight', '2017-11-09 04:04:23'), (3, 2, 'Inception\r\n', '2017-11-09 04:08:41'); -- -------------------------------------------------------- -- -- Table structure for table `reserves` -- CREATE TABLE `reserves` ( `id` int(10) UNSIGNED NOT NULL, `hall_id` int(11) NOT NULL, `movie_id` int(11) NOT NULL, `row` int(11) NOT NULL, `seat` int(11) NOT NULL, `inactive` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `reserves` -- INSERT INTO `reserves` (`id`, `hall_id`, `movie_id`, `row`, `seat`, `inactive`) VALUES (2, 1, 1, 2, 6, 0), (14, 1, 1, 9, 5, 0), (27, 1, 2, 4, 7, 0), (28, 1, 2, 2, 4, 0), (44, 1, 1, 5, 6, 0), (46, 1, 1, 4, 5, 0), (47, 1, 1, 4, 8, 0), (51, 2, 3, 3, 2, 0), (52, 2, 3, 3, 10, 0), (53, 2, 3, 8, 10, 0), (54, 2, 3, 12, 12, 0), (55, 2, 3, 13, 9, 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `halls` -- ALTER TABLE `halls` ADD PRIMARY KEY (`id`); -- -- Indexes for table `movies` -- ALTER TABLE `movies` ADD PRIMARY KEY (`id`); -- -- Indexes for table `reserves` -- ALTER TABLE `reserves` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `halls` -- ALTER TABLE `halls` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `movies` -- ALTER TABLE `movies` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `reserves` -- ALTER TABLE `reserves` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56; /*!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 */;
<filename>pdf-driver/spec/ISOCodes.ddl -- ISO 3166 country codes def CountryCode = Choose { afghanistan = @"AF" ; alandIslands = @"AX" ; albania = @"AL" ; algeria = @"DZ" ; americanSamoa = @"AS" ; andorra = @"AD" ; angola = @"AO" ; anguilla = @"AI" ; antarctica = @"AQ" ; antiguaAndBarbuda = @"AG" ; argentina = @"AR" ; armenia = @"AM" ; aruba = @"AW" ; australia = @"AU" ; austria = @"AT" ; azerbaijan = @"AZ" ; bahamas = @"BS" ; bahrain = @"BH" ; bangladesh = @"BD" ; barbados = @"BB" ; belarus = @"BY" ; belgium = @"BE" ; belize = @"BZ" ; benin = @"BJ" ; bermuda = @"BM" ; bhutan = @"BT" ; bolivia = @"BO" ; bonaire = @"BQ" ; bosniaAndHerzegovina = @"BA" ; botswana = @"BW" ; bouvetIsland = @"BV" ; brazil = @"BR" ; britishIndianOceanTerritory = @"IO" ; bruneiDarussalam = @"BN" ; bulgaria = @"BG" ; burkinaFaso = @"BF" ; burundi = @"BI" ; cambodia = @"KH" ; cameroon = @"CM" ; canada = @"CA" ; capeVerde = @"CV" ; caymanIslands = @"KY" ; centralAfricanRepublic = @"CF" ; chad = @"TD" ; chile = @"CL" ; china = @"CN" ; christmasIsland = @"CX" ; cocosIslands = @"CC" ; colombia = @"CO" ; comoros = @"KM" ; congoThe = @"CG" ; congoTheDemocraticRepublicOf = @"CD" ; cookIslands = @"CK" ; costaRica = @"CR" ; cotedIvoire = @"CI" ; croatia = @"HR" ; cuba = @"CU" ; curacao = @"CW" ; cyprus = @"CY" ; czechRepublic = @"CZ" ; denmark = @"DK" ; djibouti = @"DJ" ; dominica = @"DM" ; dominicanRepublic = @"DO" ; ecuador = @"EC" ; egypt = @"EG" ; elSalvador = @"SV" ; equatorialGuinea = @"GQ" ; eritrea = @"ER" ; estonia = @"EE" ; ethiopia = @"ET" ; falklandIslands = @"FK" ; faroeIslands = @"FO" ; fiji = @"FJ" ; finland = @"FI" ; france = @"FR" ; frenchGuiana = @"GF" ; frenchPolynesia = @"PF" ; frenchSouthernTerritories = @"TF" ; gabon = @"GA" ; gambia = @"GM" ; georgia = @"GE" ; germany = @"DE" ; ghana = @"GH" ; gibraltar = @"GI" ; greece = @"GR" ; greenland = @"GL" ; grenada = @"GD" ; guadeloupe = @"GP" ; guam = @"GU" ; guatemala = @"GT" ; guernsey = @"GG" ; guinea = @"GN" ; guineaBissau = @"GW" ; guyana = @"GY" ; haiti = @"HT" ; heardIslandandMcDonaldIslands = @"HM" ; holySee = @"VA" ; honduras = @"HN" ; hongKong = @"HK" ; hungary = @"HU" ; iceland = @"IS" ; india = @"IN" ; indonesia = @"ID" ; iranIslamicRepublicOf = @"IR" ; iraq = @"IQ" ; ireland = @"IE" ; isleofMan = @"IM" ; israel = @"IL" ; italy = @"IT" ; jamaica = @"JM" ; japan = @"JP" ; jersey = @"JE" ; jordan = @"JO" ; kazakhstan = @"KZ" ; kenya = @"KE" ; kiribati = @"KI" ; koreaDemocraticPeoplesRepublicof = @"KP" ; koreaRepublicof = @"KR" ; kuwait = @"KW" ; kyrgyzstan = @"KG" ; laoPeoplesDemocraticRepublic = @"LA" ; latvia = @"LV" ; lebanon = @"LB" ; lesotho = @"LS" ; liberia = @"LR" ; libya = @"LY" ; liechtenstein = @"LI" ; lithuania = @"LT" ; luxembourg = @"LU" ; macao = @"MO" ; macedoniaTheFormerYugoslavRepublicof = @"MK" ; madagascar = @"MG" ; malawi = @"MW" ; malaysia = @"MY" ; maldives = @"MV" ; mali = @"ML" ; malta = @"MT" ; marshallIslands = @"MH" ; martinique = @"MQ" ; mauritania = @"MR" ; mauritius = @"MU" ; mayotte = @"YT" ; mexico = @"MX" ; micronesiaFederatedStatesof = @"FM" ; moldovaRepublicof = @"MD" ; monaco = @"MC" ; mongolia = @"MN" ; montenegro = @"ME" ; montserrat = @"MS" ; morocco = @"MA" ; mozambique = @"MZ" ; myanmar = @"MM" ; namibia = @"NA" ; nauru = @"NR" ; nepal = @"NP" ; netherlands = @"NL" ; newCaledonia = @"NC" ; newZealand = @"NZ" ; nicaragua = @"NI" ; niger = @"NE" ; nigeria = @"NG" ; niue = @"NU" ; norfolkIsland = @"NF" ; northernMarianaIslands = @"MP" ; norway = @"NO" ; oman = @"OM" ; pakistan = @"PK" ; palau = @"PW" ; palestineStateOf = @"PS" ; panama = @"PA" ; papuaNewGuinea = @"PG" ; paraguay = @"PY" ; peru = @"PE" ; philippines = @"PH" ; pitcairn = @"PN" ; poland = @"PL" ; portugal = @"PT" ; puertoRico = @"PR" ; qatar = @"QA" ; reunion = @"RE" ; romania = @"RO" ; russianFederation = @"RU" ; rwanda = @"RW" ; saintBarthelemy = @"BL" ; saintHelenaAscensionandTristandaCunha = @"SH" ; saintKittsandNevis = @"KN" ; saintLucia = @"LC" ; saintMartin = @"MF" ; saintPierreandMiquelon = @"PM" ; saintVincentandtheGrenadines = @"VC" ; samoa = @"WS" ; sanMarino = @"SM" ; saoTomeandPrincipe = @"ST" ; saudiArabia = @"SA" ; senegal = @"SN" ; serbia = @"RS" ; seychelles = @"SC" ; sierraLeone = @"SL" ; singapore = @"SG" ; sintMaarten = @"SX" ; slovakia = @"SK" ; slovenia = @"SI" ; solomonIslands = @"SB" ; somalia = @"SO" ; southAfrica = @"ZA" ; southGeorgiaandtheSouthSandwichIslands = @"GS" ; southSudan = @"SS" ; spain = @"ES" ; sriLanka = @"LK" ; sudan = @"SD" ; suriname = @"SR" ; svalbardandJanMayen = @"SJ" ; swaziland = @"SZ" ; sweden = @"SE" ; switzerland = @"CH" ; syrianArabRepublic = @"SY" ; taiwanProvinceofChina = @"TW" ; tajikistan = @"TJ" ; tanzaniaUnitedRepublicof = @"TZ" ; thailand = @"TH" ; timorLeste = @"TL" ; togo = @"TG" ; tokelau = @"TK" ; tonga = @"TO" ; trinidadandTobago = @"TT" ; tunisia = @"TN" ; turkey = @"TR" ; turkmenistan = @"TM" ; turksandCaicosIslands = @"TC" ; tuvalu = @"TV" ; uganda = @"UG" ; ukraine = @"UA" ; unitedArabEmirates = @"AE" ; unitedKingdom = @"GB" ; unitedStates = @"US" ; unitedStatesMinorOutlyingIslands = @"UM" ; uruguay = @"UY" ; uzbekistan = @"UZ" ; vanuatu = @"VU" ; venezuelaBolivarianRepublicof = @"VE" ; vietNam = @"VN" ; virginIslandsBritish = @"VG" ; virginIslandsUS = @"VI" ; wallisandFutuna = @"WF" ; westernSahara = @"EH" ; yemen = @"YE" ; zambia = @"ZM" ; zimbabwe = @"ZW" ; } -- ISO 639-1 language codes: def LanguageCode = Choose { abkhazian = @"ab" ; afar = @"aa" ; afrikaans = @"af" ; akan = @"ak" ; albanian = @"sq" ; amharic = @"am" ; arabic = @"ar" ; aragonese = @"an" ; armenaian = @"hy" ; assamese = @"as"; avaric = @"av"; avestan = @"ae"; aymara = @"ay"; azerbaijani = @"az"; bambara = @"bm"; bashkir = @"ba"; basque = @"eu"; belarusian = @"be"; bengali = @"bn"; bihari = @"bh"; bislama = @"bi"; bosnian = @"bs"; breton = @"br"; bulgarian = @"bg"; burmese = @"my"; catalan = @"ca"; chamorro = @"ch"; chechen = @"ce"; chichewa = @"ny"; chinese = @"zh"; chuvash = @"cv"; cornish = @"kw"; corsican = @"co"; cree = @"cr"; croatian = @"hr"; czech = @"cs"; danish = @"da"; divehi = @"dv"; dutch = @"nl"; dzongkha = @"dz"; english = @"en"; esperanto = @"eo"; estonian = @"et"; ewe = @"ee"; faroese = @"fo"; fijian = @"fj"; finnish = @"fi"; french = @"fr"; fulah = @"ff"; galician = @"gl"; georgian = @"ka"; german = @"de"; greek = @"el"; guarani = @"gn"; gujarati = @"gu"; haitian = @"ht"; hausa = @"ha"; hebrew = @"he"; herero = @"hz"; hindi = @"hi"; hiriMotu = @"ho"; hungarian = @"hu"; interlingua = @"ia"; indonesian = @"id"; interlingue = @"ie"; irish = @"ga"; igbo = @"ig"; inupiaq = @"ik"; ido = @"io"; icelandic = @"is"; italian = @"it"; inuktitut = @"iu"; japanese = @"ja"; javanese = @"jv"; kalaallisut = @"kl"; kannada = @"kn"; kanuri = @"kr"; kashmiri = @"ks"; kazakh = @"kk"; centralKhmer = @"km"; kikuyu = @"ki"; kinyarwanda = @"rw"; kirghiz = @"ky"; komi = @"kv"; kongo = @"kg"; korean = @"ko"; kurdish = @"ku"; kuanyama = @"kj"; latin = @"la"; luxembourgish = @"lb"; ganda = @"lg"; limburgan = @"li"; lingala = @"ln"; lao = @"lo"; lithuanian = @"lt"; lubaKatanga = @"lu"; latvian = @"lv"; manx = @"gv"; macedonian = @"mk"; malagasy = @"mg"; malay = @"ms"; malayalam = @"ml"; maltese = @"mt"; maori = @"mi"; marathi = @"mr"; marshallese = @"mh"; mongolian = @"mn"; nauru = @"na"; navajo = @"nv"; northNdebele = @"nd"; nepali = @"ne"; ndonga = @"ng"; norwegianBokmal = @"nb"; norwegianNynorsk = @"nn"; norwegian = @"no"; sichuanYi = @"ii"; southNdebele = @"nr"; occitan = @"oc"; ojibwa = @"oj"; churchSlavic = @"cu"; oromo = @"om"; oriya = @"or"; ossetian = @"os"; punjabi = @"pa"; pali = @"pi"; persian = @"fa"; polish = @"pl"; pashto = @"ps"; portugese = @"pt"; quechua = @"qu"; romansh = @"rm"; rundi = @"rn"; romanian = @"ro"; russian = @"ru"; sanskrit = @"sa"; sardinian = @"sc"; sindhi = @"sd"; northernSami = @"se"; samoan = @"sm"; sango = @"sg"; serbian = @"sr"; gaelic = @"gd"; shona = @"sn"; sinhala = @"si"; slovak = @"sk"; slovenian = @"sl"; somali = @"so"; southernSotho = @"st"; spanish = @"es"; sundanese = @"su"; swahili = @"sw"; swati = @"ss"; swedish = @"sv"; tamil = @"ta"; telugu = @"te"; tajik = @"tg"; thai = @"th"; tigrinya = @"ti"; tibetan = @"bo"; turkmen = @"tk"; tagalog = @"tl"; tswana = @"tn"; tonga = @"to"; turkish = @"tr"; tsonga = @"ts"; tatar = @"tt"; twi = @"tw"; tahitian = @"ty"; uighur = @"ug"; ukranian = @"uk"; urdu = @"ur"; uzbek = @"uz"; venda = @"ve"; vietnamese = @"vi"; volapuk = @"vo"; walloon = @"wa"; welsh = @"cy"; wolof = @"wo"; westernFrisian = @"fy"; xhosa = @"xh"; yiddish = @"yi"; yoruba = @"yo"; zhuang = @"za"; zulu = @"zu"; }
<filename>sql/000-DropAll.sql DROP TABLE IF EXISTS comment; DROP TABLE IF EXISTS photo_draft; DROP TABLE IF EXISTS tag_draft; DROP TABLE IF EXISTS post; DROP TABLE IF EXISTS draft; DROP TABLE IF EXISTS photo; DROP TABLE IF EXISTS image; DROP TABLE IF EXISTS category; DROP TABLE IF EXISTS tag; DROP TABLE IF EXISTS author; DROP TABLE IF EXISTS user_;
/****** Object: StoredProcedure [etl].[SharePoint_PhysicalLocations] Script Date: 8/10/2020 12:34:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /*select * from frps.PhysicalLocations select * from ETL.OperatingUnit*/ CREATE proc [etl].[SharePoint_PhysicalLocations] as insert into etl.SharePoint_BatchCheck select getdate() , 'Starting' , (select min(sp_id) from etl.OperatingUnit) begin try SELECT SUBSTRING( ( SELECT ',' + a.DealName AS [text()] FROM frps.PhysicalLocations_Deal as a JOIN etl.PhysicalLocations as b ON a.PhysicalLocation_ID = b.SP_ID ORDER BY a.PhysicalLocation_ID FOR XML PATH ('') ), 2, 1000) as Deal declare @Result as nvarchar(400) set @Result = 'Nothing Updated or Loaded!!!' /*Critical errror - more than 2 records in etl table*/ if (select count(*) from etl.PhysicalLocations) > 1 begin insert into etl.PhysicalLocations_error select * from etl.PhysicalLocations set @Result = 'Critital Error more than one record in ETL' end /*SharePoint List is updated*/ else if (select count(*) from frps.PhysicalLocations where ID in (select SP_ID from etl.PhysicalLocations)) = 1 begin insert into frps.PhysicalLocations_history select SUBSTRING( ( SELECT ',' + a.DealName AS [text()] FROM frps.PhysicalLocations_Deal as a JOIN etl.PhysicalLocations as b ON a.PhysicalLocation_ID = b.SP_ID ORDER BY a.PhysicalLocation_ID FOR XML PATH ('') ), 2, 1000), SUBSTRING( ( SELECT ',' + a.BusinessUnit AS [text()] FROM frps.PhysicalLocations_BusinessUnit as a JOIN etl.PhysicalLocations as b ON a.PhysicalLocation_ID = b.SP_ID ORDER BY a.PhysicalLocation_ID FOR XML PATH ('') ), 2, 1000), a.*, 'Update' from frps.PhysicalLocations as a join etl.PhysicalLocations as b on a.ID = b.SP_ID --where ID in (select SP_ID from etl.PhysicalLocations) update frps.PhysicalLocations set [Address Line] = (select AddressLine from etl.PhysicalLocations) , [Address Line 2] = (select [AddressLine2] from etl.PhysicalLocations) , City = (Select City from etl.PhysicalLocations) , [State/Territory] = (Select [State/Territory] from etl.PhysicalLocations ) , Zip = (Select Zip from etl.PhysicalLocations ) , [Mailing Address] = (Select MailingAddress from etl.PhysicalLocations ) , [Site Description] = (Select SiteDescription from etl.PhysicalLocations ) , ActiveInactive = (Select ActiveInactive from etl.PhysicalLocations ) , BU_Code = (Select BU_Code from etl.PhysicalLocations ) , [ModifiedBy] = (select ModifiedBy from etl.PhysicalLocations) , ModifiedDate = (select ModifiedDate from etl.PhysicalLocations) , EffectiveDate = (select EffectiveDate from etl.PhysicalLocations) , ExpirationDate = (select ExpirationDate from etl.PhysicalLocations) where ID in (select SP_ID from etl.PhysicalLocations) delete from frps.PhysicalLocations_Deal where ID in (select SP_ID from etl.PhysicalLocations) insert into frps.PhysicalLocations_Deal select OtherId, cs.Value from etl.PhysicalLocations cross apply (select Deal from dbo.Split(t.Data,',') ) cs -- update frps.PhysicalLocations_Deal -- set [DealName] = (select AddressLine from etl.PhysicalLocations) -- where ID in (select SP_ID from etl.PhysicalLocations) set @Result = 'Updated Record' end /*New Record added that replaces another*/ --else if -- (select count(*) from frps.PhysicalLocations where ID in (select SP_ID from etl.PhysicalLocations)) = 0 -- and -- (select count(*) -- from frps.PhysicalLocations as a -- join etl.PhysicalLocations as b -- on a.Name = b.Name) > 0 -- and -- (select count(*) from frps.PhysicalLocations_history where ID in (select SP_ID from etl.PhysicalLocations)) = 0 --begin -- /*Move previous record to history*/ -- insert into frps.PhysicalLocations_history -- select a.*, 'Replace', b.SP_ID -- from frps.PhysicalLocations as a -- join etl.PhysicalLocations as b -- on a.Name = b.Name -- /*where ID in (select a.ID -- from frps.PhysicalLocations as a -- join etl.PhysicalLocations as b -- on a.Name = b.Name) */ -- -------------------------------------------------------------------- -- ---check from Hisotrical records with Active SPs that need to be updated -- Update frps.PhysicalLocations_history -- set Active_SP = b.SP_ID -- from frps.PhysicalLocations as a -- join etl.PhysicalLocations as b -- on a.Name = b.Name -- --where a.Code in (Select Code from etl.DataSource) -- /*Drop previous record*/ -- delete frps.PhysicalLocations -- where ID in (select a.ID -- from frps.PhysicalLocations as a -- join etl.PhysicalLocations as b -- on a.Name = b.Name) -- /*Insert change*/ -- insert into frps.PhysicalLocations -- select BusinessUnitID -- , Name -- , ModifiedBy -- , ModifiedDate -- from etl.PhysicalLocations -- set @Result = 'Record has been replaced' --end /*New Record added */ else if (select count(*) from frps.PhysicalLocations where ID in (select SP_ID from etl.PhysicalLocations)) = 0 and (select count(*) from frps.PhysicalLocations_history where ID in (select SP_ID from etl.PhysicalLocations)) = 0 begin insert into frps.PhysicalLocations select Sp_ID , AddressLine , [AddressLine2] , City , [State/Territory] , Zip , MailingAddress , SiteDescription , ActiveInactive , BU_Code , ModifiedBy , ModifiedDate , EffectiveDate , ExpirationDate from etl.PhysicalLocations set @Result = 'Loaded Record' end /*Update to a record in history*/ --else if -- (select count(*) from frps.PhysicalLocations where ID in (select SP_ID from etl.PhysicalLocations)) = 0 -- and -- (select count(*) from frps.PhysicalLocations_history where ID in (select SP_ID from etl.PhysicalLocations)) > 0 --begin -- insert into frps.PhysicalLocations_history -- select a.*, 'Update', b.SP_ID -- from frps.PhysicalLocations as a -- join etl.PhysicalLocations as b -- on a.ID = b.SP_ID -- update frps.PhysicalLocations -- set BusinessUnitID = (select BusinessUnitID from etl.PhysicalLocations) -- , Name = (select Name from etl.PhysicalLocations) -- , ModifiedBy = (select ModifiedBy from etl.PhysicalLocations) -- , ModifiedDate = (select ModifiedDate from etl.PhysicalLocations) -- where ID in (select Active_SP from frps.PhysicalLocations_history) -- set @Result = 'Updated The New record.' --end truncate table etl.PhysicalLocations insert into etl.SharePoint_BatchCheck select getdate() , @Result , (select min(sp_id) from etl.PhysicalLocations) select @Result as Result return end try begin catch set @Result = 'FAILURE - ' + ERROR_MESSAGE() insert into etl.SharePoint_BatchCheck select getdate() , @Result , (select min(sp_id) from etl.PhysicalLocations) select @Result as Result return end catch GO
/******************************************************************************* PoC Web-Application-Framwork http://poc-online.net/ Copyright (c) 2013, PoC - <NAME> Released under the MIT license http://poc-online.net/license -- pocPackage: pocCore *******************************************************************************/ CREATE TABLE pocUser ( id BIGINT NOT NULL auto_increment, name varchar(64) NOT NULL, pw varchar(64) NOT NULL, content text NOT NULL, PRIMARY KEY (id), UNIQUE KEY name (name) ) ENGINE InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci; -- INSERT INTO pocUser VALUES (1, 'admin', SHA1('admin'), ''); INSERT INTO pocUser VALUES (2, 'user', SHA1('user'), '');
CREATE VIEW V_EmployeeNameJobTitle AS SELECT FirstName + ' ' + ISNULL( MiddleName , '') + ' ' + LastName AS [Full Name], JobTitle FROM Employees
USE todo; CREATE TABLE users( id int(3) NOT NULL AUTO_INCREMENT, first_name varchar(20) DEFAULT NULL, last_name varchar(20) DEFAULT NULL, username varchar(250) DEFAULT NULL, password varchar(20) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB; CREATE TABLE todos( id bigint(20) NOT NULL AUTO_INCREMENT, description varchar(255) DEFAULT NULL, is_dne bit(1) NOT NULL, target_date datetime(6) DEFAULT NULL, username varchar(255) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=8;
CREATE TABLE [dbo].[rx_tx_20110401] ( [TitleCode] VARCHAR (50) NULL, [EffectiveDate] VARCHAR (50) NULL, [Rep] VARCHAR (50) NULL, [Steps] VARCHAR (50) NULL, [PayInterval_Shift] VARCHAR (50) NULL, [Annual] VARCHAR (50) NULL, [Monthly] VARCHAR (50) NULL, [Hourly] VARCHAR (50) NULL, [StepNum] INT NULL, [StepMultiplier] DECIMAL (3, 1) NULL );
<gh_stars>0 INSERT INTO `caso_spotify`.`pais` (`idPais`, `Nombre_Pais`)VALUES (57,"Colombia"), (54,"Argentina"), (1,"Estados Unidos"); INSERT INTO `caso_spotify`.`discografica` (`idDiscografica`, `Nombre`, `Pais_idPais`) VALUES (1, "Columbia Records", 1); INSERT INTO `caso_spotify`.`artista` (`idartista`, `nombre_Artista`, `imagen_Art`) VALUES (1, "Foster the people", "shorturl.at/drwLQ"); -- INSERT INTO `caso_spotify`.`albumnes` (`idAlbumnes`, `Titulo`, `anio_publicacion`, `Imagen`, `artista_idartista`, `Discografica_idDiscografica`) VALUES (1, "Torches", 2011, "shorturl.at/ftFYZ",1, 1); INSERT INTO `caso_spotify`.`suscripcion` (`idSuscripcion`, `Fecha_suscripcion`, `Fecha_renovacion`, `Forma_pago`, `tipo_suscripcion`) VALUES (1, "2021-04-08", "2021-05-08", 1, 1); INSERT INTO `caso_spotify`.`usuario` (`idUSUARIO`, `email`, `password`, `fecha_nacimiento`, `sexo`, `codigo_pastal`, `Pais`, `Suscripcion_idSuscripcion`) VALUES (1, "<EMAIL>", "holamundo", "1998-09-10", "Masculino", 23523, "Argentina", 1); INSERT INTO `caso_spotify`.`play_list` (`idPlay_list`, `Titulo_play_list`, `Num_canciones`, `fecha_creacion`, `USUARIO_idUSUARIO`, `Estado_play_list`) VALUES (1, "Inde", 1, "2021-02-15", 1, 1); -- INSERT INTO `caso_spotify`.`canciones` (`idCANCIONES`, `titulo`, `duracion`, `numero_vec_escuchada`, `num_likes`, `Play_list_idPlay_list`, `Albumnes_idAlbumnes`) VALUES (1, "Hudini",210, 20, 18, 1, 1); INSERT INTO `caso_spotify`.`generos` (`idGENEROS`, `Titulo`, `CANCIONES_idCANCIONES`) VALUES (1, "Rock-Alternativo", 1); -- ya insertado arriba-- INSERT INTO `caso_spotify`.`tajeta` (`idTajeta`, `Marca_tarjeta`, `ultimo_dig`, `Fecha_vencimiento`, `USUARIO_idUSUARIO`) VALUES (1, "Visa", 1234, "2026-09-01", 1); INSERT INTO `caso_spotify`.`tranferencia` (`idTranferencia`, `CBU`, `Alias`, `USUARIO_idUSUARIO`) VALUES (1, 987654321, "<NAME>", 1);
SELECT INSTITUTION , ACAD_PLAN , EFFDT , EFF_STATUS , DESCR , DESCRSHORT , ACAD_PLAN_TYPE , ACAD_PROG , PLN_REQTRM_DFLT , DEGREE , DIPLOMA_DESCR , TRNSCR_DESCR , FIRST_TERM_VALID , CIP_CODE , HEGIS_CODE , ACAD_CAREER , TRANSCRIPT_LEVEL , DESCRLONG FROM PS_ACAD_PLAN_TBL WHERE 1=1 AND INSTITUTION = '' ORDER BY ACAD_PLAN, EFFDT
-- WHERE Kullanımı
CREATE TABLE IF NOT EXISTS "people" ( "id" INTEGER not NULL, "first_name" TEXT not NULL, "last_name" TEXT not NULL, "email" TEXT not NULL, "ip_address" TEXT not NULL, PRIMARY KEY("id" AUTOINCREMENT) );
<filename>db/seeds.sql -- inserting departments into departments table INSERT INTO departments (department) VALUES ("Engineering"),("Sales"),("Marketing"),("Accounting"),("Human Resources"); -- inserting roles into roles table INSERT INTO roles (title, department_id, salary) VALUES ("Front-End Developer",1,50000),("Sales Associate",2,35000),("Social Media Director",3,50000),("Financer",4,80000),("HR Representative",5,60000); -- inserting employees into employees table INSERT INTO employees (first_name, last_name, manager, department_id, role_id) VALUES ("Molly", "Callahan", "<NAME>", 3, 3),("Rebecca", "Labow", "<NAME>", 2, 2),("Noah", "Berry", "Fraiser", 1, 1),("Ryan", "Stanczyk", "<NAME>", 4, 4),("Ava", "Kane", "<NAME>", 5, 5);
DROP VIEW vAdministrateurs; DROP VIEW vEtudiants; DROP VIEW vEnseignants; DROP VIEW vNonArchive; DROP VIEW vArchives; DROP TABLE Document; DROP TABLE Licence; DROP TABLE Personne; DROP TABLE Interne_UTC; DROP TYPE TInterne_UTC; DROP TYPE CollPersonne; DROP TYPE RefPersonne; DROP TYPE TPersonne; DROP TYPE CollLicence; DROP TYPE RefLicence; DROP TYPE TLicence; /*création de type et table de Licence*/ CREATE OR REPLACE TYPE TLicence AS OBJECT ( nom varchar2(15) ); / CREATE TABLE Licence OF TLicence ( PRIMARY KEY (nom) ); / CREATE OR REPLACE TYPE RefLicence AS OBJECT ( refLicence REF TLicence ); / CREATE OR REPLACE TYPE CollLicence AS TABLE OF RefLicence; / /*création de type et table de Personne*/ CREATE OR REPLACE TYPE TPersonne AS OBJECT ( email varchar2(50), nom varchar2(30), prenom varchar2(30) ) NOT FINAL; / CREATE TABLE Personne OF TPersonne ( PRIMARY KEY(email), CHECK (email LIKE '%@%') ); / CREATE OR REPLACE TYPE RefPersonne AS OBJECT ( refPersonne REF TPersonne ); / CREATE OR REPLACE TYPE CollPersonne AS TABLE OF RefPersonne; / /*création de type et table Interne_UTC*/ CREATE OR REPLACE TYPE TInterne_UTC UNDER TPersonne ( login varchar2(8), mdp varchar2(30), rol varchar2(10), is_admin number(1) ); / CREATE TABLE Interne_UTC OF TInterne_UTC( PRIMARY KEY (login), UNIQUE (email), CHECK (rol IN ('etudiant', 'enseignant')), is_admin NOT NULL, mdp NOT NULL, CHECK (is_admin=1 OR is_admin=0) ); / /*création de type et table de Document*/ CREATE TABLE Document ( lien varchar2(100) PRIMARY KEY, titre varchar2(50), date_publication date, semestre CHAR(3), archivage number(1), proprietaire REF TInterne_UTC, contributeurs CollPersonne, licences CollLicence, CHECK (archivage=1 OR archivage=0), SCOPE FOR (proprietaire) IS Interne_UTC ) NESTED TABLE contributeurs STORE AS Document_contributeurs NESTED TABLE licences STORE AS Document_licences; /* Remplissage Personnes*/ INSERT INTO Personne VALUES ('<EMAIL>','harry','potter'); INSERT INTO Personne VALUES ('<EMAIL>','luroy','jenkings'); INSERT INTO Personne VALUES ('<EMAIL>','harry','potter'); INSERT INTO Personne VALUES ('<EMAIL>','justin','tiberlake'); INSERT INTO Personne VALUES ('<EMAIL>','pisckle','nemo'); INSERT INTO Personne VALUES ('<EMAIL>','sacker','fredon'); INSERT INTO Personne VALUES ('<EMAIL>','smeagold','golum'); INSERT INTO Personne VALUES ('<EMAIL>','chu','pika'); INSERT INTO Personne VALUES ('<EMAIL>', 'Brasseur', 'Alexandre'); INSERT INTO Personne VALUES ('<EMAIL>', 'Sodki', 'Eva'); INSERT INTO Personne VALUES ('<EMAIL>', 'Hénaux', 'Mélanie'); INSERT INTO Personne VALUES ('<EMAIL>', 'Béranger', 'Aurélien'); INSERT INTO Personne VALUES ('<EMAIL>', 'Hédou', 'Véronique'); INSERT INTO Personne VALUES ('<EMAIL>', 'Crozat', 'Stéphane'); INSERT INTO Personne VALUES ('<EMAIL>', 'Carnino', 'Guillaume'); /*Remplissage Interne_UTC*/ INSERT INTO Interne_UTC VALUES ('<EMAIL>',(SELECT nom FROM Personne WHERE email='<EMAIL>'),(SELECT prenom FROM Personne WHERE email='<EMAIL>'),'abrasseu','12345678','etudiant',0); INSERT INTO Interne_UTC VALUES ('<EMAIL>',(SELECT nom FROM Personne WHERE email='<EMAIL>'),(SELECT prenom FROM Personne WHERE email='<EMAIL>'),'esodkie','12345678','etudiant',1); INSERT INTO Interne_UTC VALUES ('<EMAIL>', (SELECT nom FROM Personne WHERE email='<EMAIL>'),(SELECT prenom FROM Personne WHERE email='<EMAIL>'),'henauxme','12345678','etudiant',0); INSERT INTO Interne_UTC VALUES ('<EMAIL>',(SELECT nom FROM Personne WHERE email='<EMAIL>'),(SELECT prenom FROM Personne WHERE email='<EMAIL>'),'aberange','12345678','etudiant',0); INSERT INTO Interne_UTC VALUES ('<EMAIL>', (SELECT nom FROM Personne WHERE email='<EMAIL>'),(SELECT prenom FROM Personne WHERE email='<EMAIL>'), 'verhedou','12345678','enseignant',0); INSERT INTO Interne_UTC VALUES ('<EMAIL>',(SELECT nom FROM Personne WHERE email='<EMAIL>'),(SELECT prenom FROM Personne WHERE email='<EMAIL>'),'stcrozat', '12345678','enseignant',1); INSERT INTO Interne_UTC VALUES ('<EMAIL>',(SELECT nom FROM Personne WHERE email='<EMAIL>'),(SELECT prenom FROM Personne WHERE email='<EMAIL>'),'gcarnino', '12345678','enseignant',0); /*Remplissage de Licence*/ INSERT INTO Licence VALUES ('CC BY-SA 4.0'); INSERT INTO Licence VALUES ('GNU GPL'); INSERT INTO Licence VALUES ('GFDL'); /* Remplissage de Document */ DECLARE refP REF TInterne_UTC; refC1 REF TPersonne; refC2 REF TPersonne; refC3 REF TPersonne; refL REF TLicence; BEGIN SELECT REF(Interne) INTO refP FROM Interne_UTC Interne WHERE login='abrasseu'; SELECT REF(Per) INTO refC1 FROM Personne Per WHERE email='<EMAIL>'; SELECT REF(Per) INTO refC2 FROM Personne Per WHERE email='<EMAIL>'; SELECT REF(Per) INTO refC3 FROM Personne Per WHERE email='<EMAIL>'; SELECT REF(Lic) INTO refL FROM Licence Lic WHERE nom='CC BY-SA 4.0'; INSERT INTO Document VALUES ('/document/abrasseu/rendu_TN09.pdf', 'rendu TN09',TO_DATE('2015/10/05','YYYY/MM/DD'),'A15',0,refP,CollPersonne(RefPersonne(refC1),RefPersonne(refC2),RefPersonne(refC3)),CollLicence(RefLicence(refL))); END; / DECLARE refP REF TInterne_UTC; refC1 REF TPersonne; refL REF TLicence; BEGIN SELECT REF(Interne) INTO refP FROM Interne_UTC Interne WHERE login='aberange'; SELECT REF(Per) INTO refC1 FROM Personne Per WHERE email='<EMAIL>'; SELECT REF(Lic) INTO refL FROM Licence Lic WHERE nom='GNU GPL'; INSERT INTO Document VALUES ('/document/aberange/memoire_HT04.pdf', 'memoire HT04',TO_DATE('2017/01/05','YYYY/MM/DD'), 'A16',0,refP,CollPersonne(RefPersonne(refC1)),CollLicence(RefLicence(refL))); END; / DECLARE refP REF TInterne_UTC; refC1 REF TPersonne; refL REF TLicence; BEGIN SELECT REF(Interne) INTO refP FROM Interne_UTC Interne WHERE login='aberange'; SELECT REF(Per) INTO refC1 FROM Personne Per WHERE email='<EMAIL>'; SELECT REF(Lic) INTO refL FROM Licence Lic WHERE nom='GFDL'; INSERT INTO Document VALUES ('/document/aberange/rendu_LO01.pdf', 'rendu LO01',TO_DATE('2014/05/20','YYYY/MM/DD'),'A14',1,refP,collPersonne(RefPersonne(refC1)),CollLicence(RefLicence(refL))); END; / DECLARE refP REF TInterne_UTC; refC1 REF TPersonne; refL REF TLicence; BEGIN SELECT REF(Interne) INTO refP FROM Interne_UTC Interne WHERE login='esodkie'; SELECT REF(Per) INTO refC1 FROM Personne Per WHERE email='<EMAIL>'; SELECT REF(Lic) INTO refL FROM Licence Lic WHERE nom='CC BY-SA 4.0'; INSERT INTO Document VALUES ('/document/sodkie/projetNA17.pdf', 'projet NA17',TO_DATE('2014/11/18','YYYY/MM/DD'),'A14', 0, refP,CollPersonne(RefPersonne(refC1)),CollLicence(RefLicence(refL))); END; / /* Vues liées à l'héritage */ CREATE VIEW vAdministrateurs AS SELECT login,nom,prenom,email FROM Interne_UTC WHERE is_admin=1; CREATE VIEW vEtudiants AS SELECT login,nom,prenom,email FROM Interne_UTC WHERE rol='etudiant'; CREATE VIEW vEnseignants AS SELECT login,nom,prenom,email FROM Interne_UTC WHERE rol='enseignant'; /* Vues liées aux document */ CREATE VIEW vNonArchive AS SELECT * FROM Document WHERE archivage=0; CREATE VIEW vArchives AS SELECT * FROM Document WHERE archivage=1; /* REQUETES DE TEST */ /*affichage du nom, prenom et login du proprietaire du document nommé 'projet NA17'*/ SELECT d.proprietaire.login, d.proprietaire.nom, d.proprietaire.prenom FROM document d WHERE d.TITRE='projet NA17'; /*affichage de l'email et du nom des contributeurs du document nommé 'rendu LO01' */ SELECT c.refPersonne.email,c.refPersonne.nom FROM document d, table(d.contributeurs) c WHERE d.titre='rendu LO01'; /*affichage du titre, de la date de publication et de l'état de document qui est déposé par une personne ayant pour login abrasseu*/ SELECT d.titre,d.date_publication,d.archivage FROM document d WHERE d.proprietaire.login='abrasseu'; /*affichage du titre, de la date de publication et du nom du proprietaire des documents auxquels a contribué la personne ayant pour email <EMAIL> */ SELECT d.titre, d.date_publication,d.proprietaire.nom FROM document d, table(d.contributeurs) c WHERE c.refPersonne.email='<EMAIL>'; /* Affiche le nom et le propriétaire des documents déposés sous licence CC BY-SA 4.0*/ SELECT d.titre, d.proprietaire.nom FROM document d, Licence l WHERE l.nom ='CC BY-SA 4.0' ; /* Affiche les documents rédigés en A14 */ SELECT d.titre, d.proprietaire.nom FROM document d WHERE d.semestre='A14'; /*affiche les logins tous les administrateurs, grâce à la vue d'héritage.*/ SELECT login FROM vAdministrateurs ; /*Affiche les titres des documents non-archivés*/ SELECT titre FROM vNonArchive ; /*Affiche les informations de "Interne_UTC" où le login est verhedou*/ SELECT * FROM Interne_UTC i WHERE i.login = 'verhedou';
CREATE SCHEMA IF NOT EXISTS metadatos; ----MODELLING DROP TABLE IF EXISTS metadatos.models; CREATE TABLE metadatos.models( fecha VARCHAR, objetivo VARCHAR, model_name VARCHAR, hyperparams VARCHAR, AUROC VARCHAR, AUPR VARCHAR, precision VARCHAR, recall VARCHAR, f1 VARCHAR, train_time VARCHAR, test_split VARCHAR, train_nrows VARCHAR );
<reponame>getwasim/egov-smartcity-suites-test Insert into eg_roleaction (roleid, actionid) values ((select id from eg_role where name = 'Works Creator'),(select id from eg_action where name ='SaveMilestone' and contextroot = 'egworks')); Insert into eg_roleaction (roleid, actionid) values ((select id from eg_role where name = 'Works Creator'),(select id from eg_action where name ='ViewMilestoneTemplateDetails' and contextroot = 'egworks')); Insert into eg_roleaction (roleid, actionid) values ((select id from eg_role where name = 'Works Creator'),(select id from eg_action where name ='CreateMilestoneForm' and contextroot = 'egworks')); Insert into eg_roleaction (roleid, actionid) values ((select id from eg_role where name = 'Works Creator'),(select id from eg_action where name ='AjaxSearchMilestoneTemplateCode' and contextroot = 'egworks')); Insert into eg_roleaction (roleid, actionid) values ((select id from eg_role where name = 'Works Creator'),(select id from eg_action where name ='SearchMilestoneTemplateDetails' and contextroot = 'egworks')); Insert into eg_roleaction (roleid, actionid) values ((select id from eg_role where name = 'Works Creator'),(select id from eg_action where name ='AjaxSearchMilestoneTemplate' and contextroot = 'egworks')); Insert into eg_roleaction (roleid, actionid) values ((select id from eg_role where name = 'Works Creator'),(select id from eg_action where name ='AddMilestoneTemplateActivity' and contextroot = 'egworks')); --rollback delete from eg_roleaction where roleid = (select id from eg_role where name = 'Works Administrator') and actionid in(select id from eg_action where name in('SaveMilestone','AddMilestoneTemplateActivity','ViewMilestoneTemplateDetails','CreateMilestoneForm','AjaxSearchMilestoneTemplateCode','SearchMilestoneTemplateDetails','AjaxSearchMilestoneTemplate') and contextroot = 'egworks');
-- Create the 2019 tables while we are messing around here create table hourly_2019( CONSTRAINT __hourly_2019_check CHECK(valid >= '2019-01-01 00:00+00'::timestamptz and valid < '2020-01-01 00:00+00'::timestamptz)) INHERITS (hourly); CREATE INDEX hourly_2019_idx on hourly_2019(station, network, valid); CREATE INDEX hourly_2019_valid_idx on hourly_2019(valid); GRANT SELECT on hourly_2019 to nobody,apache; CREATE RULE replace_hourly_2019 as ON INSERT TO hourly_2019 WHERE (EXISTS ( SELECT 1 FROM hourly_2019 WHERE hourly_2019.station::text = new.station::text AND hourly_2019.network::text = new.network::text AND hourly_2019.valid = new.valid)) DO INSTEAD UPDATE hourly_2019 SET phour = new.phour WHERE hourly_2019.station::text = new.station::text AND hourly_2019.network::text = new.network::text AND hourly_2019.valid = new.valid; create table summary_2019( CONSTRAINT __summary_2019_check CHECK(day >= '2019-01-01'::date and day < '2020-01-01'::date)) INHERITS (summary); CREATE INDEX summary_2019_day_idx on summary_2019(day); CREATE UNIQUE INDEX summary_2019_iemid_day_idx on summary_2019(iemid, day); GRANT SELECT on summary_2019 to nobody,apache; alter table summary_2019 add foreign key(iemid) references stations(iemid) ON DELETE CASCADE;
<reponame>GunnerJnr/_CodeInstitute /** * Select multiple columns using CONCAT */ SELECT CONCAT(first_name, ' ', last_name) AS full_name FROM `mydb`.`people`; /** * Using the DISTINCT keyword * retrieve only single instances of the values in a column (no duplicate values) */ SELECT DISTINCT(amount) FROM mydb.orders;
<gh_stars>1-10 CREATE TABLE movies( movieID SERIAL PRIMARY KEY, title VARCHAR, genresTemp VARCHAR ); CREATE TABLE users( userID SERIAL PRIMARY KEY, email VARCHAR, password VARCHAR, name VARCHAR, emailVerified BOOLEAN ); CREATE TABLE links( movieID SERIAL PRIMARY KEY, imdbID INTEGER, tmdbID INTEGER, FOREIGN KEY (movieID) REFERENCES movies ); CREATE TABLE ratings( userID INTEGER, movieID INTEGER, rating NUMERIC, PRIMARY KEY (userID, movieID), FOREIGN KEY (userID) REFERENCES users, FOREIGN KEY (movieID) REFERENCES movies ); CREATE TABLE recommendations( userID INTEGER, movieID INTEGER, tmdbID INTEGER, PRIMARY KEY (userID, movieID), FOREIGN KEY (userID) REFERENCES users, FOREIGN KEY (movieID) REFERENCES movies ); -- Movies \COPY movies(movieID, title, genresTemp) FROM '/var/lib/postgresql/data/ml-25m/movies.csv' CSV HEADER; -- Converts genres to array ALTER TABLE movies ADD genres TEXT[]; UPDATE movies SET genres = string_to_array(genresTemp, '|'); ALTER TABLE movies DROP COLUMN genresTemp; -- Increment new IDs for new movies ALTER SEQUENCE movies_movieid_seq RESTART WITH 209172; -- Have user ID's start at 170000 (above training/test data) ALTER SEQUENCE users_userid_seq RESTART WITH 170000; -- Links \COPY links(movieID, imdbID, tmdbID) FROM '/var/lib/postgresql/data/ml-25m/links.csv' CSV HEADER; -- Increment new IDs for new movies ALTER SEQUENCE links_movieid_seq RESTART WITH 209172; -- For presentation purposes -- Adding in fake ratings for the first user (Hans' email) INSERT INTO users VALUES (DEFAULT, '<EMAIL>', 'this-should-be-encrypted-but-its-not', '<NAME>', 't'); -- Family movies (should get recommendations similar to these...) INSERT INTO ratings VALUES (170000, 1, 1); INSERT INTO ratings VALUES (170000, 48, 1); INSERT INTO ratings VALUES (170000, 107, 1); INSERT INTO ratings VALUES (170000, 169, 1); INSERT INTO ratings VALUES (170000, 344, 0);
<gh_stars>1-10 INSERT INTO ACCOUNT_CODES (REC_ACCOUNT_CODE, ACCOUNT_CODE, ACCOUNT_NAME, POSTING_STATUS_FLAG, ACCOUNT_TYPE, SUB_ACCOUNT_TYPE, TXN_POSTING_TYPE, ALL_CASELOAD_FLAG,MODIFY_USER_ID,MODIFY_DATE,LIST_SEQ,CASELOAD_TYPE,PARENT_ACCOUNT_CODE) VALUES (null, 2000, 'LIABILITIES', 'N', 'L', null, null, 'Y','OMS_OWNER',TO_DATE('2006-07-24', 'YYYY-MM-DD'),99,'INST',null); INSERT INTO ACCOUNT_CODES (REC_ACCOUNT_CODE,ACCOUNT_CODE,ACCOUNT_NAME,POSTING_STATUS_FLAG,ACCOUNT_TYPE,SUB_ACCOUNT_TYPE,TXN_POSTING_TYPE,ALL_CASELOAD_FLAG,MODIFY_USER_ID,MODIFY_DATE,LIST_SEQ,CASELOAD_TYPE,PARENT_ACCOUNT_CODE) VALUES (null,2100,'Prisoner Accounts','N','L',null,null,'Y','OMS_OWNER',TO_DATE('2006-07-24', 'YYYY-MM-DD'),99,'INST',2000); INSERT INTO ACCOUNT_CODES (REC_ACCOUNT_CODE,ACCOUNT_CODE,ACCOUNT_NAME,POSTING_STATUS_FLAG,ACCOUNT_TYPE,SUB_ACCOUNT_TYPE,TXN_POSTING_TYPE,ALL_CASELOAD_FLAG,MODIFY_USER_ID,MODIFY_DATE,LIST_SEQ,CASELOAD_TYPE,PARENT_ACCOUNT_CODE) VALUES (null,2101,'Private Cash','Y','L','REG','CR','Y','OMS_OWNER',TO_DATE('2006-07-24', 'YYYY-MM-DD'),99,'INST',2100); INSERT INTO ACCOUNT_CODES (REC_ACCOUNT_CODE,ACCOUNT_CODE,ACCOUNT_NAME,POSTING_STATUS_FLAG,ACCOUNT_TYPE,SUB_ACCOUNT_TYPE,TXN_POSTING_TYPE,ALL_CASELOAD_FLAG,MODIFY_USER_ID,MODIFY_DATE,LIST_SEQ,CASELOAD_TYPE,PARENT_ACCOUNT_CODE) VALUES (null,2102,'Spends','Y','L','SPND','CR','Y','OMS_OWNER',TO_DATE('2006-07-24', 'YYYY-MM-DD'),99,'INST',2100); INSERT INTO ACCOUNT_CODES (REC_ACCOUNT_CODE,ACCOUNT_CODE,ACCOUNT_NAME,POSTING_STATUS_FLAG,ACCOUNT_TYPE,SUB_ACCOUNT_TYPE,TXN_POSTING_TYPE,ALL_CASELOAD_FLAG,MODIFY_USER_ID,MODIFY_DATE,LIST_SEQ,CASELOAD_TYPE,PARENT_ACCOUNT_CODE) VALUES (null,2103,'Savings','Y','L','SAV','CR','Y','OMS_OWNER',TO_DATE('2006-07-24', 'YYYY-MM-DD'),99,'INST',2100);
<filename>src/FirebirdDbComparer.Tests/Compare/ComparerTestsData/Creating/TriggerExternalEngine_30.Source.sql<gh_stars>10-100 create table t (id int); create trigger new_ee_trigger after update on t external name 'FooBar!new_ee_trigger' engine FbNetExternalEngine;
<reponame>jkvetina/BUG<gh_stars>1-10 prompt --install @@application/set_environment.sql @@application/delete_application.sql @@application/create_application.sql @@application/shared_components/navigation/lists/desktop_navigation_menu.sql @@application/shared_components/navigation/lists/desktop_navigation_bar.sql @@application/shared_components/navigation/lists/application_configuration.sql @@application/shared_components/navigation/lists/user_interface.sql @@application/shared_components/navigation/lists/activity_reports.sql @@application/shared_components/navigation/lists/access_control.sql @@application/shared_components/navigation/lists/nav_top.sql @@application/shared_components/files/app_css.sql @@application/shared_components/files/app_js.sql @@application/shared_components/files/fonts_css.sql @@application/shared_components/files/logo_png.sql @@application/plugin_settings.sql @@application/shared_components/security/authorizations/nobody_hidden.sql @@application/shared_components/security/authorizations/is_developer.sql @@application/shared_components/navigation/navigation_bar.sql @@application/shared_components/logic/application_items/g_date.sql @@application/shared_components/logic/application_settings.sql @@application/shared_components/navigation/tabs/standard.sql @@application/shared_components/navigation/tabs/parent.sql @@application/shared_components/user_interface/lovs/email_username_format.sql @@application/shared_components/user_interface/lovs/login_remember_username.sql @@application/shared_components/user_interface/lovs/lov_roles.sql @@application/shared_components/user_interface/lovs/lov_users.sql @@application/shared_components/user_interface/lovs/lov_yn.sql @@application/shared_components/user_interface/lovs/user_theme_preference.sql @@application/pages/page_groups.sql @@application/comments.sql @@application/shared_components/navigation/breadcrumbs/breadcrumb.sql @@application/shared_components/navigation/breadcrumbentry.sql @@application/shared_components/user_interface/templates/page/master_detail.sql @@application/shared_components/user_interface/templates/page/modal_dialog.sql @@application/shared_components/user_interface/templates/page/login.sql @@application/shared_components/user_interface/templates/page/wizard_modal_dialog.sql @@application/shared_components/user_interface/templates/page/left_side_column.sql @@application/shared_components/user_interface/templates/page/right_side_column.sql @@application/shared_components/user_interface/templates/page/left_and_right_side_columns.sql @@application/shared_components/user_interface/templates/page/minimal_no_navigation.sql @@application/shared_components/user_interface/templates/page/standard.sql @@application/shared_components/user_interface/templates/page/standard_q.sql @@application/shared_components/user_interface/templates/button/icon.sql @@application/shared_components/user_interface/templates/button/text.sql @@application/shared_components/user_interface/templates/button/text_with_icon.sql @@application/shared_components/user_interface/templates/region/login_q.sql @@application/shared_components/user_interface/templates/region/alert.sql @@application/shared_components/user_interface/templates/region/blank_with_attributes.sql @@application/shared_components/user_interface/templates/region/blank_with_attributes_no_grid.sql @@application/shared_components/user_interface/templates/region/carousel_container.sql @@application/shared_components/user_interface/templates/region/hero.sql @@application/shared_components/user_interface/templates/region/buttons_container.sql @@application/shared_components/user_interface/templates/region/collapsible.sql @@application/shared_components/user_interface/templates/region/content_block.sql @@application/shared_components/user_interface/templates/region/inline_dialog.sql @@application/shared_components/user_interface/templates/region/inline_popup.sql @@application/shared_components/user_interface/templates/region/interactive_report.sql @@application/shared_components/user_interface/templates/region/login.sql @@application/shared_components/user_interface/templates/region/standard.sql @@application/shared_components/user_interface/templates/region/tabs_container.sql @@application/shared_components/user_interface/templates/region/title_bar.sql @@application/shared_components/user_interface/templates/region/wizard_container.sql @@application/shared_components/user_interface/templates/region/interactive_report_q.sql @@application/shared_components/user_interface/templates/list/top_navigation_tabs.sql @@application/shared_components/user_interface/templates/list/wizard_progress.sql @@application/shared_components/user_interface/templates/list/menu_bar.sql @@application/shared_components/user_interface/templates/list/badge_list.sql @@application/shared_components/user_interface/templates/list/media_list.sql @@application/shared_components/user_interface/templates/list/side_navigation_menu.sql @@application/shared_components/user_interface/templates/list/top_navigation_menu.sql @@application/shared_components/user_interface/templates/list/navigation_bar.sql @@application/shared_components/user_interface/templates/list/cards.sql @@application/shared_components/user_interface/templates/list/tabs.sql @@application/shared_components/user_interface/templates/list/menu_popup.sql @@application/shared_components/user_interface/templates/list/links_list.sql @@application/shared_components/user_interface/templates/list/navigation_bar_q.sql @@application/shared_components/user_interface/templates/report/alerts.sql @@application/shared_components/user_interface/templates/report/badge_list.sql @@application/shared_components/user_interface/templates/report/comments.sql @@application/shared_components/user_interface/templates/report/media_list.sql @@application/shared_components/user_interface/templates/report/standard.sql @@application/shared_components/user_interface/templates/report/value_attribute_pairs_column.sql @@application/shared_components/user_interface/templates/report/value_attribute_pairs_row.sql @@application/shared_components/user_interface/templates/report/timeline.sql @@application/shared_components/user_interface/templates/report/cards.sql @@application/shared_components/user_interface/templates/report/search_results.sql @@application/shared_components/user_interface/templates/label/hidden.sql @@application/shared_components/user_interface/templates/label/optional.sql @@application/shared_components/user_interface/templates/label/optional_above.sql @@application/shared_components/user_interface/templates/label/optional_floating.sql @@application/shared_components/user_interface/templates/label/required.sql @@application/shared_components/user_interface/templates/label/required_above.sql @@application/shared_components/user_interface/templates/label/required_floating.sql @@application/shared_components/user_interface/templates/breadcrumb/breadcrumb.sql @@application/shared_components/user_interface/templates/popuplov.sql @@application/shared_components/user_interface/templates/calendar/calendar.sql @@application/shared_components/user_interface/themes.sql @@application/shared_components/user_interface/theme_style.sql @@application/shared_components/user_interface/theme_files.sql @@application/shared_components/user_interface/theme_display_points.sql @@application/shared_components/user_interface/template_opt_groups.sql @@application/shared_components/user_interface/template_options.sql @@application/shared_components/globalization/language.sql @@application/shared_components/globalization/translations.sql @@application/shared_components/logic/build_options.sql @@application/shared_components/globalization/messages.sql @@application/shared_components/globalization/dyntranslations.sql @@application/shared_components/user_interface/shortcuts/delete_confirm_msg.sql @@application/shared_components/security/authentications/apex_accounts.sql @@application/shared_components/security/authentications/open_door_testing_only.sql @@application/user_interfaces.sql @@application/user_interfaces/combined_files.sql @@application/pages/page_00000.sql @@application/pages/page_00100.sql @@application/pages/page_00199.sql @@application/pages/page_00200.sql @@application/pages/page_00300.sql @@application/pages/page_00800.sql @@application/pages/page_00802.sql @@application/pages/page_00805.sql @@application/pages/page_00850.sql @@application/pages/page_00900.sql @@application/pages/page_00901.sql @@application/pages/page_00902.sql @@application/pages/page_00910.sql @@application/pages/page_00920.sql @@application/pages/page_00930.sql @@application/pages/page_00935.sql @@application/pages/page_00940.sql @@application/pages/page_00950.sql @@application/pages/page_00951.sql @@application/pages/page_00952.sql @@application/pages/page_00955.sql @@application/pages/page_09999.sql @@application/deployment/definition.sql @@application/deployment/checks.sql @@application/deployment/buildoptions.sql @@application/end_environment.sql
<gh_stars>0 -- https://leetcode.com/problems/exchange-seats/ USE [sql_training] GO CREATE TABLE seat ( id INT NOT NULL IDENTITY(1,1) CONSTRAINT pk_seat PRIMARY KEY, student NVARCHAR(MAX) ); INSERT INTO seat(student) VALUES('Abbot'); INSERT INTO seat(student) VALUES('Doris '); INSERT INTO seat(student) VALUES('Emerson '); INSERT INTO seat(student) VALUES('Green '); INSERT INTO seat(student) VALUES('Jeames '); SELECT id, CASE WHEN id % 2 <> 0 THEN LEAD(student, 1, student) OVER(ORDER BY id) WHEN id % 2 = 0 THEN LAG(student, 1, student) OVER(ORDER BY id) ELSE NULL END AS student FROM seat; DECLARE @numRows AS INT = (SELECT COUNT(id) FROM seat); SELECT CASE WHEN id = @numRows AND id % 2 <> 0 THEN id WHEN id % 2 <> 0 THEN id + 1 WHEN id % 2 = 0 THEN id - 1 ELSE id END AS id, student FROM seat ORDER BY id; DROP TABLE IF EXISTS seat;
-- This script uses sqlcmd scripting variables. They are in the form -- $(MyVariable). For information about how to use scripting variables -- on the command line and in SQL Server Management Studio, see the -- "Executing Replication Scripts" section in the topic -- "Programming Replication Using System Stored Procedures". -- This batch is executed at the Subscriber to remove -- a merge pull subscription. DECLARE @publication AS sysname; DECLARE @publisher AS sysname; DECLARE @publication_db AS sysname; SET @publication = N'AdvWorksSalesOrdersMerge'; SET @publisher = $(PubServer); SET @publication_db = N'AdventureWorks2012'; USE [AdventureWorks2012Replica] EXEC sp_dropmergepullsubscription @publisher = @publisher, @publisher_db = @publication_db, @publication = @publication; GO
<gh_stars>0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; -- ----------------------------------------------------- -- Schema codingcoveragedb -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `codingcoveragedb` ; -- ----------------------------------------------------- -- Schema codingcoveragedb -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `codingcoveragedb` DEFAULT CHARACTER SET utf8 ; USE `codingcoveragedb` ; -- ----------------------------------------------------- -- Table `user` -- ----------------------------------------------------- DROP TABLE IF EXISTS `user` ; CREATE TABLE IF NOT EXISTS `user` ( `id` INT NOT NULL AUTO_INCREMENT, `username` VARCHAR(60) NOT NULL, `password` VARCHAR(200) NOT NULL, `first_name` VARCHAR(100) NULL, `last_name` VARCHAR(100) NULL, `enabled` TINYINT(1) NULL DEFAULT 1, `role` VARCHAR(45) NULL, `bio` TEXT NULL, `image` VARCHAR(3000) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `language` -- ----------------------------------------------------- DROP TABLE IF EXISTS `language` ; CREATE TABLE IF NOT EXISTS `language` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NULL, `image_url` VARCHAR(3000) NULL, `description` TEXT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `post` -- ----------------------------------------------------- DROP TABLE IF EXISTS `post` ; CREATE TABLE IF NOT EXISTS `post` ( `id` INT NOT NULL AUTO_INCREMENT, `subject` VARCHAR(500) NOT NULL, `content` TEXT NOT NULL, `date_created` DATETIME NULL, `last_update` DATETIME NULL, `user_id` INT NOT NULL, `is_blog` TINYINT(1) NULL, `is_forum_visable` TINYINT NULL, `is_expert` TINYINT NULL, `language_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_post_user1_idx` (`user_id` ASC), INDEX `fk_post_language1_idx` (`language_id` ASC), CONSTRAINT `fk_post_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_post_language1` FOREIGN KEY (`language_id`) REFERENCES `language` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `resource` -- ----------------------------------------------------- DROP TABLE IF EXISTS `resource` ; CREATE TABLE IF NOT EXISTS `resource` ( `id` INT NOT NULL AUTO_INCREMENT, `link` VARCHAR(3000) NOT NULL, `description` TEXT NOT NULL, `date_added` DATETIME NULL, `difficulty` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `comment` -- ----------------------------------------------------- DROP TABLE IF EXISTS `comment` ; CREATE TABLE IF NOT EXISTS `comment` ( `id` INT NOT NULL AUTO_INCREMENT, `content` TEXT NOT NULL, `date_created` DATETIME NULL, `date_updated` DATETIME NULL, `post_id` INT NOT NULL, `user_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_comment_post1_idx` (`post_id` ASC), INDEX `fk_comment_user1_idx` (`user_id` ASC), CONSTRAINT `fk_comment_post1` FOREIGN KEY (`post_id`) REFERENCES `post` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_comment_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `roadmap` -- ----------------------------------------------------- DROP TABLE IF EXISTS `roadmap` ; CREATE TABLE IF NOT EXISTS `roadmap` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(200) NULL, `language_id` INT NOT NULL, `description` TEXT NULL, PRIMARY KEY (`id`), INDEX `fk_roadmap_language1_idx` (`language_id` ASC), CONSTRAINT `fk_roadmap_language1` FOREIGN KEY (`language_id`) REFERENCES `language` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `code_concept` -- ----------------------------------------------------- DROP TABLE IF EXISTS `code_concept` ; CREATE TABLE IF NOT EXISTS `code_concept` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(200) NULL, `roadmap_id` INT NOT NULL, `description` TEXT NULL, PRIMARY KEY (`id`), INDEX `fk_code_concept_roadmap1_idx` (`roadmap_id` ASC), CONSTRAINT `fk_code_concept_roadmap1` FOREIGN KEY (`roadmap_id`) REFERENCES `roadmap` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `task` -- ----------------------------------------------------- DROP TABLE IF EXISTS `task` ; CREATE TABLE IF NOT EXISTS `task` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(100) NOT NULL, `description` VARCHAR(500) NOT NULL, `code_concept_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_task_code_concept1_idx` (`code_concept_id` ASC), CONSTRAINT `fk_task_code_concept1` FOREIGN KEY (`code_concept_id`) REFERENCES `code_concept` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `user_has_roadmap` -- ----------------------------------------------------- DROP TABLE IF EXISTS `user_has_roadmap` ; CREATE TABLE IF NOT EXISTS `user_has_roadmap` ( `user_id` INT NOT NULL, `roadmap_id` INT NOT NULL, PRIMARY KEY (`user_id`, `roadmap_id`), INDEX `fk_user_has_roadmap_roadmap1_idx` (`roadmap_id` ASC), INDEX `fk_user_has_roadmap_user1_idx` (`user_id` ASC), CONSTRAINT `fk_user_has_roadmap_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_user_has_roadmap_roadmap1` FOREIGN KEY (`roadmap_id`) REFERENCES `roadmap` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `user_roadmap_task` -- ----------------------------------------------------- DROP TABLE IF EXISTS `user_roadmap_task` ; CREATE TABLE IF NOT EXISTS `user_roadmap_task` ( `id` INT NOT NULL AUTO_INCREMENT, `user_id` INT NOT NULL, `task_id` INT NOT NULL, `completed` TINYINT(1) NOT NULL DEFAULT 0, `start_date` DATETIME NULL, `end_date` DATETIME NULL, PRIMARY KEY (`id`), INDEX `fk_user_roadmap_tasklist_user1_idx` (`user_id` ASC), INDEX `fk_user_roadmap_tasklist_task1_idx` (`task_id` ASC), CONSTRAINT `fk_user_roadmap_tasklist_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_user_roadmap_tasklist_task1` FOREIGN KEY (`task_id`) REFERENCES `task` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `post_vote` -- ----------------------------------------------------- DROP TABLE IF EXISTS `post_vote` ; CREATE TABLE IF NOT EXISTS `post_vote` ( `id` INT NOT NULL AUTO_INCREMENT, `date_voted` DATETIME NULL, `vote` TINYINT NULL, `post_id` INT NOT NULL, `user_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_post_vote_post1_idx` (`post_id` ASC), INDEX `fk_post_vote_user1_idx` (`user_id` ASC), CONSTRAINT `fk_post_vote_post1` FOREIGN KEY (`post_id`) REFERENCES `post` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_post_vote_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `comment_vote` -- ----------------------------------------------------- DROP TABLE IF EXISTS `comment_vote` ; CREATE TABLE IF NOT EXISTS `comment_vote` ( `id` INT NOT NULL AUTO_INCREMENT, `date_voted` DATETIME NULL, `vote` TINYINT NULL, `comment_id` INT NOT NULL, `user_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_comment_vote_comment1_idx` (`comment_id` ASC), INDEX `fk_comment_vote_user1_idx` (`user_id` ASC), CONSTRAINT `fk_comment_vote_comment1` FOREIGN KEY (`comment_id`) REFERENCES `comment` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_comment_vote_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `task_has_resource` -- ----------------------------------------------------- DROP TABLE IF EXISTS `task_has_resource` ; CREATE TABLE IF NOT EXISTS `task_has_resource` ( `task_id` INT NOT NULL, `resource_id` INT NOT NULL, PRIMARY KEY (`task_id`, `resource_id`), INDEX `fk_task_has_resource_resource1_idx` (`resource_id` ASC), INDEX `fk_task_has_resource_task1_idx` (`task_id` ASC), CONSTRAINT `fk_task_has_resource_task1` FOREIGN KEY (`task_id`) REFERENCES `task` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_task_has_resource_resource1` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `resource_has_language` -- ----------------------------------------------------- DROP TABLE IF EXISTS `resource_has_language` ; CREATE TABLE IF NOT EXISTS `resource_has_language` ( `resource_id` INT NOT NULL, `language_id` INT NOT NULL, PRIMARY KEY (`resource_id`, `language_id`), INDEX `fk_resource_has_language_language1_idx` (`language_id` ASC), INDEX `fk_resource_has_language_resource1_idx` (`resource_id` ASC), CONSTRAINT `fk_resource_has_language_resource1` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_resource_has_language_language1` FOREIGN KEY (`language_id`) REFERENCES `language` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; SET SQL_MODE = ''; DROP USER codeuser@localhost; SET SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; CREATE USER 'codeuser'@'localhost' IDENTIFIED BY 'codeuser'; GRANT SELECT, INSERT, TRIGGER, UPDATE, DELETE ON TABLE * TO 'codeuser'@'localhost'; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; -- ----------------------------------------------------- -- Data for table `user` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `user` (`id`, `username`, `password`, `first_name`, `last_name`, `enabled`, `role`, `bio`, `image`) VALUES (1, 'admin', 'admin', 'admin', 'admin', 1, 'admin', 'admin', NULL); INSERT INTO `user` (`id`, `username`, `password`, `first_name`, `last_name`, `enabled`, `role`, `bio`, `image`) VALUES (2, 'thwebel', 'password', 'Thomas', 'Webel', 1, 'admin', 'The Best Skiier on the Mountian', NULL); INSERT INTO `user` (`id`, `username`, `password`, `first_name`, `last_name`, `enabled`, `role`, `bio`, `image`) VALUES (3, 'BryceShearn', 'Founder', 'Bryce', 'Shearn', 1, 'admin', 'One of the three original founders of Coding Coverage', NULL); INSERT INTO `user` (`id`, `username`, `password`, `first_name`, `last_name`, `enabled`, `role`, `bio`, `image`) VALUES (4, 'TylorShearn', 'World01!', 'Tylor', 'Shearn', 1, 'admin', 'One of the three original founders of Coding Coverage', NULL); INSERT INTO `user` (`id`, `username`, `password`, `first_name`, `last_name`, `enabled`, `role`, `bio`, `image`) VALUES (5, 'student', 'student', 'Olivia', 'Garton', 1, 'student', 'Makes amazing bread sticks, and better code.', NULL); INSERT INTO `user` (`id`, `username`, `password`, `first_name`, `last_name`, `enabled`, `role`, `bio`, `image`) VALUES (6, 'expert', 'expert', 'Tahra', 'Dactyl', 1, 'expert', 'Old school coding expert. Especially capable in the Jurassic Framework.', NULL); COMMIT; -- ----------------------------------------------------- -- Data for table `language` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `language` (`id`, `name`, `image_url`, `description`) VALUES (1, 'Java', NULL, 'Best lang ever'); INSERT INTO `language` (`id`, `name`, `image_url`, `description`) VALUES (2, 'HTML', NULL, 'layouts '); INSERT INTO `language` (`id`, `name`, `image_url`, `description`) VALUES (3, 'CSS', NULL, 'makes layouts pretty'); INSERT INTO `language` (`id`, `name`, `image_url`, `description`) VALUES (4, 'SQL', NULL, 'Hey DB give me '); COMMIT; -- ----------------------------------------------------- -- Data for table `post` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `post` (`id`, `subject`, `content`, `date_created`, `last_update`, `user_id`, `is_blog`, `is_forum_visable`, `is_expert`, `language_id`) VALUES (1, 'DB design', 'DB design is an essential aspect of full stack applications', '2020-01-01T20:40:20', '2021-01-01T20:40:20', 2, 1, 0, 0, 1); INSERT INTO `post` (`id`, `subject`, `content`, `date_created`, `last_update`, `user_id`, `is_blog`, `is_forum_visable`, `is_expert`, `language_id`) VALUES (2, 'Java Variables', 'It is extremely important to know java variables', '2020-01-01T20:40:20', '2021-01-01T20:40:20', 2, 0, 1, 0, 1); INSERT INTO `post` (`id`, `subject`, `content`, `date_created`, `last_update`, `user_id`, `is_blog`, `is_forum_visable`, `is_expert`, `language_id`) VALUES (3, 'Expert test', 'experts know enought to know they know how to google what they don\'t know, no?', '2020-01-01T20:40:20', '2021-01-01T20:40:20', 2, 0, 0, 1, 1); INSERT INTO `post` (`id`, `subject`, `content`, `date_created`, `last_update`, `user_id`, `is_blog`, `is_forum_visable`, `is_expert`, `language_id`) VALUES (4, 'Personal Test', 'This should display once per page', '2020-01-01T20:40:20', '2021-01-01T20:40:20', 2, 1, 0, 0, 1); COMMIT; -- ----------------------------------------------------- -- Data for table `resource` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (1, 'https://www.tutorialspoint.com/java/java_environment_setup.htm', 'basic tutorial', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (2, 'https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html', 'Download Java 8 here!', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (3, 'https://www.geeksforgeeks.org/differences-jdk-jre-jvm/', 'Desc: JDK, JRE, and JVM described', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (4, 'https://www.freecodecamp.org/news/best-java-8-tutorial/', 'Detailed JDK download guide, along with terminal commands', '2021-03-22T20:40:20', 'intermediate'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (5, 'https://atom.io/', 'Download Atom here!', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (6, 'https://www.codecademy.com/articles/what-is-an-ide', 'What an IDE brings to the table', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (7, 'https://www.infoworld.com/article/3114167/choosing-your-java-ide.html', 'Compares and contrasts three advanced Java IDEs', '2021-03-22T20:40:20', 'Advanced'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (8, 'https://www.vogella.com/tutorials/Eclipse/article.html', 'In-depth Eclipse (an advanced IDE) download and setup guide', '2021-03-22T20:40:20', 'Intermediate'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (9, 'https://medium.com/@grace.m.nolan/terminal-for-beginners-e492ba10902a', 'Quick guide to the common commands', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (10, 'https://ubuntu.com/tutorials/command-line-for-beginners#4-creating-folders-and-files', 'In depth introduction to the Linux command line interface', '2021-03-22T20:40:20', 'Intermediate'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (11, 'https://www.codecademy.com/articles/command-line-commands#:~:text=The%20command%20line%20is%20a,or%20Finder%20on%20Mac%20OS', 'List of useful Commands', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (12, 'https://www.geeksforgeeks.org/beginning-java-programming-with-hello-world-example/', 'Basic description of HelloWorld and the terminal commands to compile and run a java program.', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (13, 'https://en.wikiversity.org/wiki/Java_Tutorial/Hello_World', 'Clear guide for writing, compiling, and running HelloWorld', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (14, 'https://docs.oracle.com/javase/tutorial/getStarted/cupojava/unix.html', 'Step-by-step guide for making a new directory and running your HelloWorld program!', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (15, 'https://www.w3schools.com/java/java_data_types.asp', 'Information on data types.', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (16, 'https://www.javatpoint.com/java-variables', 'More info on data types.', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (17, 'http://tutorials.jenkov.com/java/math-operators-and-math-class.html', 'Math with variables.', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (18, 'http://www.functionx.com/java/Lesson17.htm', 'Explains interaction of numeric types', '2021-03-22T20:40:20', 'Advanced'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (19, 'https://www.w3schools.com/java/java_strings.asp', 'Basics of Strings', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (20, 'https://www.w3schools.com/java/java_booleans.asp', 'Basics of Booleans', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (21, 'https://www.w3schools.com/java/java_conditions.asp', 'Basics of If Statements', '2021-03-22T20:40:20', 'easy'); INSERT INTO `resource` (`id`, `link`, `description`, `date_added`, `difficulty`) VALUES (22, 'https://www.w3schools.com/java/java_conditions.asp', 'How to add Else', '2021-03-22T20:40:20', 'Intermediate'); COMMIT; -- ----------------------------------------------------- -- Data for table `comment` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `comment` (`id`, `content`, `date_created`, `date_updated`, `post_id`, `user_id`) VALUES (1, 'That is a ridiculous statement!', '2020-01-01T20:40:20', '2021-01-01T20:40:20', 1, 2); COMMIT; -- ----------------------------------------------------- -- Data for table `roadmap` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `roadmap` (`id`, `name`, `language_id`, `description`) VALUES (1, 'Java Fundementals', 1, 'Learn the fundemental aspect of Java! This roadmap will guide you through your first Java program while establishing key concepts along the way.'); INSERT INTO `roadmap` (`id`, `name`, `language_id`, `description`) VALUES (2, 'HTML Fundementals', 2, 'Interested in web design? Start here with the fundementals of HTML. Our HTML road map will have you creating webpages in no time!'); INSERT INTO `roadmap` (`id`, `name`, `language_id`, `description`) VALUES (3, 'CSS Fundementals', 3, 'Got an eye for design and have the basics of HTML down? Let\'s spruce up those dreary webpages with some CSS! Follow this roadmap for easy CSS setup and essentail CSS concepts.'); INSERT INTO `roadmap` (`id`, `name`, `language_id`, `description`) VALUES (4, 'SQL Fundementals', 4, 'Storing massive amounts of information and retrieving pinpoint accurate results is easy with SQL. This roadmap will make setup a breeze and have you querying for data in no time!'); COMMIT; -- ----------------------------------------------------- -- Data for table `code_concept` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `code_concept` (`id`, `name`, `roadmap_id`, `description`) VALUES (1, 'Java Setup and First Steps', 1, 'Description: Setup your coding environment and download necessary dependencies, i.e. make sure your tire has wheels before trying to drive.'); INSERT INTO `code_concept` (`id`, `name`, `roadmap_id`, `description`) VALUES (2, 'Java Variables', 1, 'Become familiar with fundemental variables'); INSERT INTO `code_concept` (`id`, `name`, `roadmap_id`, `description`) VALUES (3, 'Java if statements', 1, 'If interested in coding, learn about if statements!'); INSERT INTO `code_concept` (`id`, `name`, `roadmap_id`, `description`) VALUES (4, 'Java Loops', 1, 'Learn about the power of loops!'); COMMIT; -- ----------------------------------------------------- -- Data for table `task` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (1, 'Download Java 8 and research the JDK.', 'Download Java 8. Then describe the JRE, Java, Javac, Jar, and Javadoc.', 1); INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (2, 'Download an IDE', 'Download an IDE (we recommend Atom or Eclipse). Be able to describe what IDEs are and the benefits they bring.', 1); INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (3, 'Demystify The Terminal', 'Navigate, examine, and manipulate your file system with simple terminal commands. Describe what a directory is, make one, make a new terminal window and navigate to that directory.', 1); INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (4, 'Write HelloWorld', 'Create, compile, and run your first java program! So IDEs will allow you to run your programs within them, but we suggest you compile and run your first programs through the command line.', 1); INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (5, 'Hello Variables!', 'Define what a variable is and make a list of all the different variables you can find.', 2); INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (6, 'Using Number Variables', 'Declare and assign different numeric variable, try to add them together and print them out. Record what happens when mixing different numeric types.', 2); INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (7, 'Strings and Booleans', 'Declare and assing a String Variable, then print it. Also, declare and assign two booleans, what happens when you try and print them?', 2); INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (8, 'Write an If Statement', 'Research conditional statements and use them to buid if statements', 3); INSERT INTO `task` (`id`, `name`, `description`, `code_concept_id`) VALUES (9, 'Add an else If ', 'Grow your logic by adding else ifs', 3); COMMIT; -- ----------------------------------------------------- -- Data for table `user_has_roadmap` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (2, 1); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (2, 2); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (2, 3); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (2, 4); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (3, 1); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (3, 2); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (3, 3); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (3, 4); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (4, 1); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (4, 2); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (4, 3); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (4, 4); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (5, 1); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (5, 2); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (5, 3); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (5, 4); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (6, 1); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (6, 2); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (6, 3); INSERT INTO `user_has_roadmap` (`user_id`, `roadmap_id`) VALUES (6, 4); COMMIT; -- ----------------------------------------------------- -- Data for table `user_roadmap_task` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `user_roadmap_task` (`id`, `user_id`, `task_id`, `completed`, `start_date`, `end_date`) VALUES (1, 2, 1, 1, '2021-03-22T20:40:20', '2021-03-23T1:40:20'); COMMIT; -- ----------------------------------------------------- -- Data for table `post_vote` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `post_vote` (`id`, `date_voted`, `vote`, `post_id`, `user_id`) VALUES (1, '2020-01-01T20:40:20', 1, 1, 2); COMMIT; -- ----------------------------------------------------- -- Data for table `comment_vote` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `comment_vote` (`id`, `date_voted`, `vote`, `comment_id`, `user_id`) VALUES (1, '2020-01-01T20:40:20', 1, 1, 2); COMMIT; -- ----------------------------------------------------- -- Data for table `task_has_resource` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (1, 1); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (1, 2); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (1, 3); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (1, 4); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (2, 5); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (2, 6); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (2, 7); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (2, 8); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (3, 9); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (3, 10); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (3, 11); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (4, 12); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (4, 13); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (4, 14); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (5, 15); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (5, 16); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (6, 17); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (6, 18); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (7, 19); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (7, 20); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (8, 21); INSERT INTO `task_has_resource` (`task_id`, `resource_id`) VALUES (9, 22); COMMIT; -- ----------------------------------------------------- -- Data for table `resource_has_language` -- ----------------------------------------------------- START TRANSACTION; USE `codingcoveragedb`; INSERT INTO `resource_has_language` (`resource_id`, `language_id`) VALUES (1, 1); INSERT INTO `resource_has_language` (`resource_id`, `language_id`) VALUES (1, 2); COMMIT;
version https://git-lfs.github.com/spec/v1 oid sha256:8d51c9db1fddd18d08014bd24aef3958c46c1861bf799a7661fc111c8c506c99 size 446
<reponame>Jozefiel/Dockerized-MRBS-1.9.0 -- Add the max length of bookings fields ALTER TABLE %DB_TBL_PREFIX%area ADD COLUMN max_secs_per_day_enabled smallint DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_day int DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_week_enabled smallint DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_week int DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_month_enabled smallint DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_month int DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_year_enabled smallint DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_year int DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_future_enabled smallint DEFAULT 0 NOT NULL, ADD COLUMN max_secs_per_future int DEFAULT 0 NOT NULL;
<filename>oscm-devruntime/javares/sql/upd_postgresql_02_00_22.sql --add a column which stores how ofter the userid of the specific row was used ALTER TABLE "platformuser" ADD COLUMN "useridcnt" BIGINT; ALTER TABLE "platformuser" ADD COLUMN "olduserid" VARCHAR(255); UPDATE platformuser AS pl SET olduserid = userid; --fill the new column e.g.: --row#|userid|useridcnt --1|userA|1 --2|userB|1 --3|userB|2 --Since the ordering is done by tkey, it's ensured that the initial platformuser (tkey=1) will ever --have a rowcount different from 1, which means it'll be never changed UPDATE platformuser p1 SET "useridcnt" = ( SELECT COALESCE((SELECT count(*) FROM platformuser p2 WHERE p1.userid = p2.userid AND p2.tkey < p1.tkey) + 1, 1)); --change the userid by following the scheme: --IF (!UNIQUE(user.userid)){ -- IF (!UNIQUE(user.email)){use "userid@orgid" as new userid} -- ELSE {use email as new userid} --} --The changes will be not applied on the first data record of non unique user ids UPDATE platformuser AS pl SET userid = ( SELECT CASE WHEN ( SELECT COUNT(userid) FROM platformuser AS p2 WHERE p2.userid=p.userid GROUP BY userid HAVING ( COUNT(userid) > 1 ) ) > 1 AND p.useridcnt > 1 THEN ( CASE WHEN ( ( SELECT COUNT(email) FROM platformuser AS p3 WHERE p3.email=p.email GROUP BY email HAVING ( COUNT(email) > 1 ) ) > 1 OR ( SELECT COUNT(userid) FROM platformuser AS p4 WHERE p4.userid=p.email GROUP BY userid HAVING ( COUNT(userid) > 0 ) ) > 0 ) THEN p.userid || '@' || ( SELECT organizationid FROM organization AS o WHERE o.tkey = p.organizationkey ) ELSE p.email END ) ELSE p.userid END FROM platformuser AS p WHERE pl.tkey = p.tkey); --updates the unique index (replaces old definition) DROP INDEX platformuser_bk_idx; CREATE UNIQUE INDEX "platformuser_bk_idx" ON "platformuser" ("userid" asc); --Note: if there are problems setting the unique constraint because the table contains duplicate values after the migration --uncomment the two lines below and comment out the UPDATE above. --UPDATE platformuser AS p SET userid = (p.userid|| '@' || (SELECT organizationid FROM organization AS o WHERE o.tkey = p.organizationkey)); --UPDATE platformuser AS p SET useridcnt = 2; --increase version of the changed records UPDATE platformuser AS pl SET version = (version+1) where useridcnt > 1; --create a temp table, thhe tkey starts with 1 and will be auto incremented CREATE TABLE "platformuserhistory_temp" ( "tkey" SERIAL PRIMARY KEY, "additionalname" VARCHAR(255), "address" VARCHAR(255), "creationdate" BIGINT NOT NULL, "email" VARCHAR(255), "failedlogincounter" INTEGER NOT NULL, "firstname" VARCHAR(255), "lastname" VARCHAR(255), "locale" VARCHAR(255) NOT NULL, "organizationadmin" BOOLEAN NOT NULL, "phone" VARCHAR(255), "salutation" VARCHAR(255), "status" VARCHAR(255) NOT NULL, "passwordsalt" BIGINT NOT NULL DEFAULT 0, "passwordhash" <PASSWORD>, "userid" VARCHAR(255) NOT NULL, "moddate" TIMESTAMP NOT NULL, "modtype" VARCHAR(255) NOT NULL, "moduser" VARCHAR(255) NOT NULL, "objkey" BIGINT NOT NULL, "objversion" BIGINT NOT NULL, "organizationobjkey" BIGINT NOT NULL ); --create history entries in the temp table INSERT INTO platformuserhistory_temp ("additionalname","address","creationdate","email","failedlogincounter","firstname","lastname","locale","organizationadmin","phone","salutation","status","passwordsalt","passwordhash","userid","moddate","modtype","moduser","objkey","objversion","organizationobjkey") SELECT additionalname, address, creationdate, email, failedlogincounter, firstname, lastname, locale, organizationadmin, phone, salutation, status, passwordsalt, passwordhash, userid, now(),'MODIFY', 'ANONYMOUS', tkey, version, organizationkey FROM platformuser AS p WHERE useridcnt > 1; --copy into the real table INSERT INTO platformuserhistory ("tkey", "additionalname","address","creationdate","email","failedlogincounter","firstname","lastname","locale","organizationadmin","phone","salutation","status","passwordsalt","passwordhash","userid","moddate","modtype","moduser","objkey","objversion","organizationobjkey") SELECT (temp.tkey + (SELECT COALESCE((SELECT max(tkey) FROM platformuserhistory),0))),temp.additionalname, temp.address, temp.creationdate, temp.email, temp.failedlogincounter, temp.firstname, temp.lastname, temp.locale, temp.organizationadmin, temp.phone, temp.salutation, temp.status, temp.passwordsalt, temp.passwordhash, temp.userid, now(),'MODIFY', 'ANONYMOUS', temp.objkey, temp.objversion, temp.organizationobjkey FROM platformuserhistory_temp as temp; DROP TABLE platformuserhistory_temp; --Add columns which are reqired when using a third party realm ALTER TABLE "platformuser" ADD COLUMN "realmuserid" VARCHAR(255); UPDATE platformuser SET realmuserid = userid; ALTER TABLE "platformuserhistory" ADD COLUMN "realmuserid" VARCHAR(255); UPDATE platformuserhistory SET realmuserid = userid;
<filename>dbv/sdb/setup/08_config_dbv.sql ---------------------------------------------------------------------------- -- Trivadis AG, Infrastructure Managed Services -- Saegereistrasse 29, 8152 Glattbrugg, Switzerland ---------------------------------------------------------------------------- -- Name......: 09_config_dbv.sql -- Author....: <NAME> (oes) <EMAIL> -- Editor....: <NAME> -- Date......: 2020.07.01 -- Revision..: -- Purpose...: Script to install DB Vault and Label Security -- Notes.....: -- Reference.: SYS (or grant manually to a DBA) -- License...: Licensed under the Universal Permissive License v 1.0 as -- shown at http://oss.oracle.com/licenses/upl. ---------------------------------------------------------------------------- -- Modified..: -- see git revision history for more information on changes/updates ---------------------------------------------------------------------------- -- conn / as sysdba -- create security role level C1 CREATE ROLE sec_access_c1; GRANT CREATE SESSION TO sec_access_c1; GRANT tvd_hr_ro TO sec_access_c1; -- create security role level C2 CREATE ROLE sec_access_c2; GRANT sec_access_c1 TO sec_access_c2; GRANT tvd_hr_rw TO sec_access_c2; -- create security role level C3 CREATE ROLE sec_access_c3; GRANT sec_access_c2 TO sec_access_c3; -- create security role level C3+ CREATE ROLE sec_access_c3p; GRANT sec_access_c3 TO sec_access_c3p; conn tvd_dv_accmgr/tvd_dv_accmgr -- create security users level C1-C3+ CREATE USER user_c1 identified by user_c1; CREATE USER user_c2 identified by user_c2; CREATE USER user_c3 identified by user_c3; CREATE USER user_c3p identified by user_c3p; -- grant roles conn / as sysdba GRANT sec_access_c1 TO user_c1; GRANT sec_access_c2 TO user_c2; GRANT sec_access_c3 TO user_c3; GRANT sec_access_c3p TO user_c3p; -- create realms conn tvd_dv_owner/tvd_dv_owner EXEC DBMS_MACADM.DELETE_REALM('TVD HR Security Realm'); BEGIN DBMS_MACADM.CREATE_REALM( realm_name => 'TVD HR Security Realm', description => 'Limit Access to TVD HR', enabled => DBMS_MACUTL.G_YES, audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL + DBMS_MACUTL.G_REALM_AUDIT_SUCCESS, realm_type => 1, pl_sql_stack => TRUE); END; / -- add schema owner to realm BEGIN DBMS_MACADM.ADD_AUTH_TO_REALM( realm_name => 'TVD HR Security Realm', grantee => 'TVD_HR', auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER); END; / -- add role auth to realm EXEC DBMS_MACADM.ADD_AUTH_TO_REALM( 'TVD HR Security Realm', 'SEC_ACCESS_C1'); EXEC DBMS_MACADM.ADD_AUTH_TO_REALM( 'TVD HR Security Realm', 'SEC_ACCESS_C2'); EXEC DBMS_MACADM.ADD_AUTH_TO_REALM( 'TVD HR Security Realm', 'SEC_ACCESS_C3'); EXEC DBMS_MACADM.ADD_AUTH_TO_REALM( 'TVD HR Security Realm', 'SEC_ACCESS_C3P'); -- add all objects from TVD_HR to realm BEGIN DBMS_MACADM.ADD_OBJECT_TO_REALM( realm_name => 'TVD HR Security Realm', object_owner => 'tvd_hr', object_name => '%', object_type => '%'); END; / -- add role sec_access_c1 to realm BEGIN DBMS_MACADM.ADD_OBJECT_TO_REALM( realm_name => 'TVD HR Security Realm', object_owner => '%', object_name => 'SEC_ACCESS_C1', object_type => 'ROLE'); END; / -- add role sec_access_c2 to realm BEGIN DBMS_MACADM.ADD_OBJECT_TO_REALM( realm_name => 'TVD HR Security Realm', object_owner => '%', object_name => 'SEC_ACCESS_C2', object_type => 'ROLE'); END; / -- add role sec_access_c3 to realm BEGIN DBMS_MACADM.ADD_OBJECT_TO_REALM( realm_name => 'TVD HR Security Realm', object_owner => '%', object_name => 'SEC_ACCESS_C3', object_type => 'ROLE'); END; / -- add role sec_access_c3p to realm BEGIN DBMS_MACADM.ADD_OBJECT_TO_REALM( realm_name => 'TVD HR Security Realm', object_owner => '%', object_name => 'SEC_ACCESS_C3P', object_type => 'ROLE'); END; / conn user_c1/user_c1 SELECT count(*) FROM tvd_hr.employees; -- Levels -- EMPLOYEE_ID => C2 -- FIRST_NAME => C1 -- LAST_NAME => C1 -- EMAIL => C2 -- PHONE_NUMBER => C2 -- HIRE_DATE => C2 -- JOB_ID => C1 -- SALARY => C3+ -- COMMISSION_PCT => C3 -- MANAGER_ID => C2 -- DEPARTMENT_ID => C2 -- -- check as app user -- CONN app01/app01 -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- -- check as schema owner -- CONN tvd_hr/tvd_hr -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- -- enable mandatory realm -- conn tvd_dv_owner/tvd_dv_owner -- BEGIN -- DBMS_MACADM.UPDATE_REALM( -- realm_name => 'TVD_HR C3 Access', -- description => 'Limit Access for C3 Objects', -- enabled => DBMS_MACUTL.G_YES, -- audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL + DBMS_MACUTL.G_REALM_AUDIT_SUCCESS, -- realm_type => 1, -- pl_sql_stack => TRUE); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_AUTH_TO_REALM( -- realm_name => 'TVD_HR C3 Access', -- grantee => 'TVD_HR', -- auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_AUTH_TO_REALM( -- realm_name => 'TVD_HR C3 Access', -- grantee => 'APP01_C3_VIEW'); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_AUTH_TO_REALM( -- realm_name => 'TVD_HR C3 Access', -- grantee => 'APP02_C3_VIEW'); -- END; -- / -- -- check as app user -- CONN app01/app01 -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- -- check as schema owner -- CONN tvd_hr/tvd_hr -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- conn tvd_dv_owner/tvd_dv_owner -- EXEC DBMS_MACADM.DELETE_REALM('TVD_HR C3+ Access'); -- BEGIN -- DBMS_MACADM.CREATE_REALM( -- realm_name => 'TVD_HR C3+ Access', -- description => 'Limit Access for C3+ Objects', -- enabled => DBMS_MACUTL.G_YES, -- audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL + DBMS_MACUTL.G_REALM_AUDIT_SUCCESS, -- realm_type => 0, -- pl_sql_stack => TRUE); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_OBJECT_TO_REALM( -- realm_name => 'TVD_HR C3+ Access', -- object_owner => 'tvd_hr', -- object_name => 'EMPLOYEES_C3P', -- object_type => 'TABLE'); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_OBJECT_TO_REALM( -- realm_name => 'TVD_HR C3+ Access', -- object_owner => 'tvd_hr', -- object_name => 'DEPARTMENTS_C3P', -- object_type => 'TABLE'); -- END; -- / -- -- check as app user -- CONN app01/app01 -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- -- check as schema owner -- CONN tvd_hr/tvd_hr -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- conn tvd_dv_owner/tvd_dv_owner -- BEGIN -- DBMS_MACADM.UPDATE_REALM( -- realm_name => 'TVD_HR C3+ Access', -- description => 'Limit Access for C3+ Objects', -- enabled => DBMS_MACUTL.G_YES, -- audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL + DBMS_MACUTL.G_REALM_AUDIT_SUCCESS, -- realm_type => 1, -- pl_sql_stack => TRUE); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_AUTH_TO_REALM( -- realm_name => 'TVD_HR C3+ Access', -- grantee => 'TVD_HR', -- auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_AUTH_TO_REALM( -- realm_name => 'TVD_HR C3+ Access', -- grantee => 'APP01_C3P_VIEW'); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_AUTH_TO_REALM( -- realm_name => 'TVD_HR C3+ Access', -- grantee => 'APP02_C3P_VIEW'); -- END; -- / -- -- check as app user -- CONN app01/app01 -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- -- check as app01c3 user -- CONN app01c3/app01c3 -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- -- check as app01c3 user -- CONN app01c3p/app01c3p -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- -- check as schema owner -- CONN tvd_hr/tvd_hr -- SELECT count(*) FROM tvd_hr.employees; -- SELECT count(*) FROM tvd_hr.employees_c3; -- SELECT count(*) FROM tvd_hr.employees_c3p; -- conn tvd_dv_owner/tvd_dv_owner -- EXEC DBMS_MACADM.DELETE_REALM('TVD_HR Secure Access'); -- BEGIN -- DBMS_MACADM.CREATE_REALM( -- realm_name => 'TVD_HR Secure Access', -- description => 'Configure security for TVD_HR realms', -- enabled => DBMS_MACUTL.G_YES, -- audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL + DBMS_MACUTL.G_REALM_AUDIT_SUCCESS, -- realm_type => 0, -- pl_sql_stack => TRUE); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_AUTH_TO_REALM( -- realm_name => 'TVD_HR Secure Access', -- grantee => 'TVD_HR', -- auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_OBJECT_TO_REALM( -- realm_name => 'TVD_HR Secure Access', -- object_owner => '%', -- object_name => 'APP01_C3_VIEW', -- object_type => 'ROLE'); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_OBJECT_TO_REALM( -- realm_name => 'TVD_HR Secure Access', -- object_owner => '%', -- object_name => 'APP01_C3P_VIEW', -- object_type => 'ROLE'); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_OBJECT_TO_REALM( -- realm_name => 'TVD_HR Secure Access', -- object_owner => '%', -- object_name => 'APP02_C3_VIEW', -- object_type => 'ROLE'); -- END; -- / -- BEGIN -- DBMS_MACADM.ADD_OBJECT_TO_REALM( -- realm_name => 'TVD_HR Secure Access', -- object_owner => '%', -- object_name => 'APP02_C3P_VIEW', -- object_type => 'ROLE'); -- END; -- / -- EOF --------------------------------------------------------------------- select * from unified_audit_trail; BEGIN DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL( audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED, use_last_arch_timestamp => FALSE); END; / select * from AUDITABLE_SYSTEM_ACTIONS where component='Database Vault'; DROP AUDIT POLICY dv_audit; CREATE AUDIT POLICY dv_audit ACTIONS COMPONENT = DV REALM VIOLATION on "TVD_HR C3 Access", REALM SUCCESS on "TVD_HR C3 Access", REALM ACCESS on "TVD_HR C3 Access", REALM VIOLATION on "TVD_HR C3+ Access", REALM SUCCESS on "TVD_HR C3+ Access", REALM ACCESS on "TVD_HR C3+ Access", REALM VIOLATION on "TVD_HR Secure Access", REALM SUCCESS on "TVD_HR Secure Access", REALM ACCESS on "TVD_HR Secure Access"; AUDIT POLICY dv_audit; SELECT name FROM auditable_system_actions WHERE component = 'Database Vault';
/* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -- +goose Up -- SQL in section 'Up' is executed when this migration is applied ALTER TABLE deliveryservice ADD tenant_id BIGINT, ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) MATCH FULL, ALTER COLUMN tenant_id SET DEFAULT NULL; CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree (tenant_id); -- +goose Down -- SQL section 'Down' is executed when this migration is rolled back ALTER TABLE deliveryservice DROP COLUMN tenant_id;
-- $Horde: horde/scripts/sql/horde_groups.oci8.sql,v 1.1.2.3 2009/10/19 10:54:33 jan Exp $ CREATE TABLE horde_groups ( group_uid NUMBER(16) NOT NULL, group_name VARCHAR2(255) NOT NULL UNIQUE, group_parents VARCHAR2(255) NOT NULL, group_email VARCHAR2(255), PRIMARY KEY (group_uid) ); CREATE TABLE horde_groups_members ( group_uid NUMBER(16) NOT NULL, user_uid VARCHAR2(255) NOT NULL ); CREATE INDEX group_uid_idx ON horde_groups_members (group_uid); CREATE INDEX user_uid_idx ON horde_groups_members (user_uid);
UPDATE scheduled_reports SET report_time = '00:00', report_on = '{"day_no":1}', report_period = '{"no":1,"period_id":"3"}' WHERE period_id = 3 AND report_on IS NULL; UPDATE scheduled_reports SET report_time = '00:00', report_on = '[{"day":1}]', report_period = '{"no":1,"period_id":"1"}' WHERE period_id = 1 AND report_on IS NULL; UPDATE scheduled_reports SET report_time = '00:00', report_on = '{"day_no":"1","day":"1"}', report_period = '{"no":1,"period_id":"2"}' WHERE period_id = 2 AND report_on IS NULL;
<reponame>nikhilbhatewara/Leetcode # Write your MySQL query statement below select a.user_id as buyer_id, a.join_date, ifnull(count(b.order_id),0) as orders_in_2019 from users a left join orders b on a.user_id = b.buyer_id and year(b.order_date) = 2019 group by a.user_id
DROP DATABASE IF EXISTS burgers_db; CREATE DATABASE burgers_db; USE burgers_db; CREATE TABLE burgers ( id int AUTO_INCREMENT NOT NULL, burger_name varchar(30) NOT NULL, eaten BOOLEAN DEFAULT false, primary key (id) );
CREATE SCHEMA [driver]
/* SQLyog Community v13.1.7 (64 bit) MySQL - 10.3.22-MariaDB : Database - test-bookstore ********************************************************************* */ /*!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*/`test-bookstore` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `test-bookstore`; /*Table structure for table `bookstores` */ DROP TABLE IF EXISTS `bookstores`; CREATE TABLE `bookstores` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `isbn` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `author` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `year_of_publication` year(4) NOT NULL, `publisher` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `image_url_s` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `image_url_m` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `image_url_l` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `price` double(8,2) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `bookstores` */ insert into `bookstores`(`id`,`isbn`,`title`,`author`,`year_of_publication`,`publisher`,`image_url_s`,`image_url_m`,`image_url_l`,`price`,`created_at`,`updated_at`) values (1,'006015781X','Why Do Clocks Run Clockwise? and Other Imponderables: Mysteries of Everyday Life Explained','<NAME>',1987,'Harpercollins','http://images.amazon.com/images/P/006015781X.01.THUMBZZZ.jpg','http://images.amazon.com/images/P/006015781X.01.MZZZZZZZ.jpg','http://images.amazon.com/images/P/006015781X.01.LZZZZZZZ.jpg',17.05,NULL,NULL), (2,'006017143X','The Night Listener','<NAME>',2000,'HarperCollins Publishers','http://images.amazon.com/images/P/006017143X.01.THUMBZZZ.jpg','http://images.amazon.com/images/P/006017143X.01.MZZZZZZZ.jpg','http://images.amazon.com/images/P/006017143X.01.LZZZZZZZ.jpg',48.95,NULL,'2021-08-24 14:06:15'), (3,'006052779X','Charlotte\'s Web Book and Charm (Charming Classics)','<NAME>',2003,'HarperFestival','http://images.amazon.com/images/P/006052779X.01.THUMBZZZ.jpg','http://images.amazon.com/images/P/006052779X.01.MZZZZZZZ.jpg','http://images.amazon.com/images/P/006052779X.01.LZZZZZZZ.jpg',92.59,NULL,NULL), (5,'001213232323','Moving Pictures (Discworld Novels (Paperback))','<NAME>',2002,'HarperTorch','http://images.amazon.com/images/P/006102063X.01.THUMBZZZ.jpg','http://images.amazon.com/images/P/006102063X.01.MZZZZZZZ.jpg','http://images.amazon.com/images/P/006102063X.01.LZZZZZZZ.jpg',24.70,NULL,'2021-08-24 13:47:36'), (6,'014023828X','The Tortilla Curtain','<NAME>',1996,'Penguin Books','http://images.amazon.com/images/P/014023828X.01.THUMBZZZ.jpg','http://images.amazon.com/images/P/014023828X.01.MZZZZZZZ.jpg','http://images.amazon.com/images/P/014023828X.01.LZZZZZZZ.jpg',49.24,NULL,NULL), (7,'015600710X','Strange Fits of Passion: A Novel','<NAME>',1999,'Harvest Books','http://images.amazon.com/images/P/015600710X.01.THUMBZZZ.jpg','http://images.amazon.com/images/P/015600710X.01.MZZZZZZZ.jpg','http://images.amazon.com/images/P/015600710X.01.LZZZZZZZ.jpg',71.11,NULL,NULL), (8,'030720152X','Comic Characters','<NAME>',1983,'Golden Books','http://images.amazon.com/images/P/030720152X.01.THUMBZZZ.jpg','http://images.amazon.com/images/P/030720152X.01.MZZZZZZZ.jpg','http://images.amazon.com/images/P/030720152X.01.LZZZZZZZ.jpg',10.81,NULL,NULL), (11,'038076654X','Petals on the River','<NAME>',1997,'Avon Trade','http://images.amazon.com/images/P/038076654X.01.THUMBZZZ.jpg','http://images.amazon.com/images/P/038076654X.01.MZZZZZZZ.jpg','http://images.amazon.com/images/P/038076654X.01.LZZZZZZZ.jpg',33.98,NULL,NULL), (16,'54432','Serebro','Igor',1999,'ozon','http://images.amazon.com/images/P/038078243X.01.LZZZZZZZ.jpg','http://images.amazon.com/images/P/038078243X.01.LZZZZZZZ.jpg','http://images.amazon.com/images/P/038078243X.01.LZZZZZZZ.jpg',52.00,'2021-08-24 17:19:44','2021-08-24 17:19:44'); /*Table structure for table `failed_jobs` */ DROP TABLE IF EXISTS `failed_jobs`; CREATE TABLE `failed_jobs` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `failed_jobs` */ /*Table structure for table `migrations` */ DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `migrations` */ insert into `migrations`(`id`,`migration`,`batch`) values (1,'2014_10_12_000000_create_users_table',1), (2,'2014_10_12_100000_create_password_resets_table',1), (3,'2019_08_19_000000_create_failed_jobs_table',1), (4,'2019_12_14_000001_create_personal_access_tokens_table',1), (5,'2021_08_24_043929_create_bookstores_table',1); /*Table structure for table `password_resets` */ DROP TABLE IF EXISTS `password_resets`; CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `password_resets` */ /*Table structure for table `personal_access_tokens` */ DROP TABLE IF EXISTS `personal_access_tokens`; CREATE TABLE `personal_access_tokens` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `tokenable_id` bigint(20) unsigned NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `abilities` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `last_used_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `personal_access_tokens_token_unique` (`token`), KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `personal_access_tokens` */ /*Table structure for table `users` */ DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `users` */ /*!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.5.5 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jun 07, 2016 at 12:36 PM -- Server version: 10.0.25-MariaDB -- PHP Version: 5.6.22 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: `nova` -- -- -------------------------------------------------------- -- -- Table structure for table `weydey_videos` -- CREATE TABLE `weydey_videos` ( `id` int(11) NOT NULL, `fileID` varchar(100) NOT NULL, `filename` varchar(100) NOT NULL, `fileDesc` varchar(255) NOT NULL, `fileImg` varchar(255) DEFAULT 0, `file` varchar(255) DEFAULT 0, `fileExt` varchar(30) DEFAULT 0, `rating` varchar(255) DEFAULT 0, `fileViews` varchar(255) DEFAULT 100, `username` varchar(100) NOT NULL, `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Indexes for dumped tables -- -- -- Indexes for table `weydey_videos` -- ALTER TABLE `weydey_videos` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `weydey_videos` -- ALTER TABLE `weydey_videos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<reponame>VndrGrhrd/cms-basic-admin<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost:8889 -- Tempo de geração: 07/10/2021 às 13:00 -- Versão do servidor: 5.7.34 -- Versão do PHP: 7.4.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Banco de dados: `admin_composer` -- -- -------------------------------------------------------- -- -- Estrutura para tabela `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `email` varchar(249) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `username` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` tinyint(2) UNSIGNED NOT NULL DEFAULT '0', `verified` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', `resettable` tinyint(1) UNSIGNED NOT NULL DEFAULT '1', `roles_mask` int(10) UNSIGNED NOT NULL DEFAULT '0', `registered` int(10) UNSIGNED NOT NULL, `last_login` int(10) UNSIGNED DEFAULT NULL, `force_logout` mediumint(7) UNSIGNED NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estrutura para tabela `users_confirmations` -- CREATE TABLE `users_confirmations` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `email` varchar(249) COLLATE utf8mb4_unicode_ci NOT NULL, `selector` varchar(16) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `token` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `expires` int(10) UNSIGNED NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estrutura para tabela `users_remembered` -- CREATE TABLE `users_remembered` ( `id` bigint(20) UNSIGNED NOT NULL, `user` int(10) UNSIGNED NOT NULL, `selector` varchar(24) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `token` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `expires` int(10) UNSIGNED NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estrutura para tabela `users_resets` -- CREATE TABLE `users_resets` ( `id` bigint(20) UNSIGNED NOT NULL, `user` int(10) UNSIGNED NOT NULL, `selector` varchar(20) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `token` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `expires` int(10) UNSIGNED NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estrutura para tabela `users_throttling` -- CREATE TABLE `users_throttling` ( `bucket` varchar(44) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `tokens` float UNSIGNED NOT NULL, `replenished_at` int(10) UNSIGNED NOT NULL, `expires_at` int(10) UNSIGNED NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Índices para tabelas despejadas -- -- -- Índices de tabela `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`); -- -- Índices de tabela `users_confirmations` -- ALTER TABLE `users_confirmations` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `selector` (`selector`), ADD KEY `email_expires` (`email`,`expires`), ADD KEY `user_id` (`user_id`); -- -- Índices de tabela `users_remembered` -- ALTER TABLE `users_remembered` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `selector` (`selector`), ADD KEY `user` (`user`); -- -- Índices de tabela `users_resets` -- ALTER TABLE `users_resets` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `selector` (`selector`), ADD KEY `user_expires` (`user`,`expires`); -- -- Índices de tabela `users_throttling` -- ALTER TABLE `users_throttling` ADD PRIMARY KEY (`bucket`), ADD KEY `expires_at` (`expires_at`); -- -- AUTO_INCREMENT para tabelas despejadas -- -- -- AUTO_INCREMENT de tabela `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de tabela `users_confirmations` -- ALTER TABLE `users_confirmations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de tabela `users_remembered` -- ALTER TABLE `users_remembered` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de tabela `users_resets` -- ALTER TABLE `users_resets` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<reponame>RosenDev/SoftuniLearning<filename>C#DbFundamentals/C#DB Basics/Joins, Subqueries, CTE and Indices/14. Countries With or Without Rivers.sql SELECT TOP 5 CountryName, RiverName FROM Countries AS C LEFT JOIN CountriesRivers AS CR ON C.CountryCode= CR.CountryCode LEFT JOIN Rivers AS R ON CR.RiverId=R.Id WHERE C.ContinentCode='AF' ORDER BY CountryName
<filename>src/SFA.DAS.Commitments.Database/Tables/Standard.sql CREATE TABLE [dbo].[Standard] ( [Id] INT NOT NULL, [Title] VARCHAR(500) NOT NULL, [Level] TINYINT NOT NULL, [Duration] INT NOT NULL, [MaxFunding] INT NOT NULL, [EffectiveFrom] DATETIME NULL, [EffectiveTo] DATETIME NULL, CONSTRAINT [PK_Standards] PRIMARY KEY CLUSTERED ([Id] ASC) )
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 1172.16.31.10 -- Generation Time: Aug 13, 2020 at 03:07 PM -- Server version: 10.4.13-MariaDB -- PHP Version: 7.4.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `magang` -- -- -------------------------------------------------------- -- -- Table structure for table `tbl_bagian` -- CREATE TABLE `tbl_bagian` ( `id_bagian` int(11) NOT NULL, `nama_bagian` varchar(25) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `tbl_jabatan` -- CREATE TABLE `tbl_jabatan` ( `id_jabatan` int(11) NOT NULL, `nama_jabatan` varchar(30) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `tbl_kegiatan_magang` -- CREATE TABLE `tbl_kegiatan_magang` ( `id_kegiatan` int(11) NOT NULL, `id_magang` int(11) NOT NULL, `nama_kegiatan` varchar(20) NOT NULL, `deskripsi` varchar(100) NOT NULL, `alat` varchar(30) NOT NULL, `bahan` varchar(30) NOT NULL, `verif` varchar(1) NOT NULL, `tgl_kegiatan` date NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `tbl_magang` -- CREATE TABLE `tbl_magang` ( `id_magang` int(11) NOT NULL, `id_mhs` int(11) NOT NULL, `id_bagian` int(11) NOT NULL, `kode_pegawai` varchar(10) NOT NULL, `n_kedis` varchar(3) DEFAULT NULL, `n_keakt` varchar(3) DEFAULT NULL, `n_motiv` varchar(3) DEFAULT NULL, `n_kemam` varchar(3) DEFAULT NULL, `n_kerja` varchar(3) DEFAULT NULL, `n_kehad` varchar(3) DEFAULT NULL, `n_kesop` varchar(2) DEFAULT NULL, `n_kerap` varchar(3) DEFAULT NULL, `status_magang` varchar(1) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `tbl_mhs_magang` -- CREATE TABLE `tbl_mhs_magang` ( `id_mhs` int(11) NOT NULL, `id_user` int(11) NOT NULL, `nama` varchar(25) NOT NULL, `tmp_lahir` varchar(20) NOT NULL, `tgl_lahir` date NOT NULL, `jk` varchar(1) NOT NULL, `asal_ptn` varchar(50) DEFAULT NULL, `npm` varchar(8) DEFAULT NULL, `alamat` varchar(100) DEFAULT NULL, `no_hp` varchar(13) DEFAULT NULL, `surat_tugas` varchar(90) DEFAULT NULL, `status` enum('t','f','p') NOT NULL DEFAULT 'p', `foto` varchar(100) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `tbl_pegawai` -- CREATE TABLE `tbl_pegawai` ( `kode_pegawai` varchar(10) NOT NULL, `id_user` int(11) NOT NULL, `nama_pegawai` varchar(25) NOT NULL, `tmp_lahir` varchar(20) NOT NULL, `tgl_lahir` date NOT NULL, `jk` varchar(1) NOT NULL, `alamat` varchar(50) NOT NULL, `foto` varchar(30) NOT NULL, `id_bagian` int(11) NOT NULL, `id_jabatan` int(11) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `tbl_user` -- CREATE TABLE `tbl_user` ( `id_user` int(11) NOT NULL, `email` varchar(50) NOT NULL, `password` varchar(100) NOT NULL, `role` varchar(1) NOT NULL, `aktif` varchar(1) NOT NULL, `last_login` datetime DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbl_user` -- INSERT INTO `tbl_user` (`id_user`, `email`, `password`, `role`, `aktif`, `last_login`, `created_at`, `updated_at`) VALUES (1, '<EMAIL>', <PASSWORD>', '1', 't', '2020-08-13 20:05:43', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `user_token` -- CREATE TABLE `user_token` ( `id` int(11) NOT NULL, `email` varchar(50) NOT NULL, `token` varchar(128) NOT NULL, `created_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `tbl_bagian` -- ALTER TABLE `tbl_bagian` ADD PRIMARY KEY (`id_bagian`); -- -- Indexes for table `tbl_jabatan` -- ALTER TABLE `tbl_jabatan` ADD PRIMARY KEY (`id_jabatan`); -- -- Indexes for table `tbl_kegiatan_magang` -- ALTER TABLE `tbl_kegiatan_magang` ADD PRIMARY KEY (`id_kegiatan`), ADD KEY `kegiatan_magang` (`id_magang`); -- -- Indexes for table `tbl_magang` -- ALTER TABLE `tbl_magang` ADD PRIMARY KEY (`id_magang`), ADD KEY `magang_mhs` (`id_mhs`), ADD KEY `magang_pegawai` (`kode_pegawai`), ADD KEY `magang_bagian` (`id_bagian`); -- -- Indexes for table `tbl_mhs_magang` -- ALTER TABLE `tbl_mhs_magang` ADD PRIMARY KEY (`id_mhs`), ADD KEY `mhs_user` (`id_user`); -- -- Indexes for table `tbl_pegawai` -- ALTER TABLE `tbl_pegawai` ADD PRIMARY KEY (`kode_pegawai`), ADD KEY `pegawai_jabatan` (`id_jabatan`), ADD KEY `pegawai_user` (`id_user`), ADD KEY `pegawai_bagian` (`id_bagian`); -- -- Indexes for table `tbl_user` -- ALTER TABLE `tbl_user` ADD PRIMARY KEY (`id_user`); -- -- Indexes for table `user_token` -- ALTER TABLE `user_token` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tbl_bagian` -- ALTER TABLE `tbl_bagian` MODIFY `id_bagian` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tbl_jabatan` -- ALTER TABLE `tbl_jabatan` MODIFY `id_jabatan` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tbl_kegiatan_magang` -- ALTER TABLE `tbl_kegiatan_magang` MODIFY `id_kegiatan` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tbl_magang` -- ALTER TABLE `tbl_magang` MODIFY `id_magang` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tbl_mhs_magang` -- ALTER TABLE `tbl_mhs_magang` MODIFY `id_mhs` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tbl_user` -- ALTER TABLE `tbl_user` MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `user_token` -- ALTER TABLE `user_token` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- Constraints for dumped tables -- -- -- Constraints for table `tbl_kegiatan_magang` -- ALTER TABLE `tbl_kegiatan_magang` ADD CONSTRAINT `kegiatan_magang` FOREIGN KEY (`id_magang`) REFERENCES `tbl_magang` (`id_magang`); -- -- Constraints for table `tbl_magang` -- ALTER TABLE `tbl_magang` ADD CONSTRAINT `magang_bagian` FOREIGN KEY (`id_bagian`) REFERENCES `tbl_bagian` (`id_bagian`), ADD CONSTRAINT `magang_mhs` FOREIGN KEY (`id_mhs`) REFERENCES `tbl_mhs_magang` (`id_mhs`), ADD CONSTRAINT `magang_pegawai` FOREIGN KEY (`kode_pegawai`) REFERENCES `tbl_pegawai` (`kode_pegawai`); -- -- Constraints for table `tbl_mhs_magang` -- ALTER TABLE `tbl_mhs_magang` ADD CONSTRAINT `mhs_user` FOREIGN KEY (`id_user`) REFERENCES `tbl_user` (`id_user`); -- -- Constraints for table `tbl_pegawai` -- ALTER TABLE `tbl_pegawai` ADD CONSTRAINT `pegawai_bagian` FOREIGN KEY (`id_bagian`) REFERENCES `tbl_bagian` (`id_bagian`), ADD CONSTRAINT `pegawai_jabatan` FOREIGN KEY (`id_jabatan`) REFERENCES `tbl_jabatan` (`id_jabatan`), ADD CONSTRAINT `pegawai_user` FOREIGN KEY (`id_user`) REFERENCES `tbl_user` (`id_user`); 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 */;
INSERT INTO twitter_posts (content, verification_text) VALUES ( 'Nice, @fundrequest_io can now be tracked on @BlockfolioApp! #opensource', 'can now be tracked on'); INSERT INTO twitter_posts (content, verification_text) VALUES ( 'Nice, @fundrequest_io can now be tracked on @get_delta! #opensource', 'can now be tracked on');
-- https://leetcode.com/problems/department-highest-salary/ -- -- The Employee table holds all employees. Every employee has an Id, a salary, -- and there is also a column for the department Id. -- -- +----+-------+--------+--------------+ -- | Id | Name | Salary | DepartmentId | -- +----+-------+--------+--------------+ -- | 1 | Joe | 70000 | 1 | -- | 2 | Henry | 80000 | 2 | -- | 3 | Sam | 60000 | 2 | -- | 4 | Max | 90000 | 1 | -- +----+-------+--------+--------------+ -- -- The Department table holds all departments of the company. -- -- +----+----------+ -- | Id | Name | -- +----+----------+ -- | 1 | IT | -- | 2 | Sales | -- +----+----------+ -- -- Write a SQL query to find employees who have the highest salary in each of -- the departments. For the above tables, Max has the highest salary in the IT -- department and Henry has the highest salary in the Sales department. -- -- +------------+----------+--------+ -- | Department | Employee | Salary | -- +------------+----------+--------+ -- | IT | Max | 90000 | -- | Sales | Henry | 80000 | -- +------------+----------+--------+ SELECT Department.Name, Employee.Name, Employee.Salary FROM Employee INNER JOIN Department ON Employee.DepartmentId = Department.Id WHERE (DepartmentId, Salary) IN (SELECT DepartmentId, MAX(Salary) FROM Employee GROUP BY DepartmentId);
<reponame>bencarlson/Sitecore-v902-XP1-Scaled-Installation<filename>clean_db_xp1.sql USE [master] GO If Exists (select name from master.sys.server_principals where name = 'collectionuser') BEGIN DROP LOGIN [collectionuser] END GO DROP DATABASE [xp902_MarketingAutomation] GO DROP DATABASE [xp902_Messaging] GO DROP DATABASE [xp902_Processing.Pools] GO DROP DATABASE [xp902_Xdb.Collection.Shard0] GO DROP DATABASE [xp902_Xdb.Collection.Shard1] GO DROP DATABASE [xp902_Xdb.Collection.ShardMapManager] GO
<gh_stars>1-10 DROP TABLE IF EXISTS genre CASCADE; DROP TABLE IF EXISTS author CASCADE; DROP TABLE IF EXISTS book; CREATE TABLE IF NOT EXISTS genre ( id INTEGER PRIMARY KEY, name VARCHAR(64), description VARCHAR(64) ); CREATE TABLE IF NOT EXISTS author ( id INTEGER PRIMARY KEY, last_name VARCHAR(64) NOT NULL, first_name VARCHAR(64) NOT NULL ); CREATE TABLE IF NOT EXISTS book ( isbn VARCHAR(32) PRIMARY KEY, title VARCHAR(64) NOT NULL, publish_year INTEGER, genre_id INT NOT NULL, author_id INT NOT NULL, FOREIGN KEY (genre_id) REFERENCES genre (id), FOREIGN KEY (author_id) REFERENCES author (id) );
<reponame>mehsoy/jaws delete from administrators; delete from project_managers; delete from workers; delete from workers_has_storages; delete from jobs; delete from storages; delete from managers_has_members; delete from users; delete from workspaces;
<filename>db/patches/0790_related_org_fix.sql alter table organization_map drop constraint organization_map_organization_identifier_fkey, add constraint organization_map_organization_identifier_fkey foreign key (organization_identifier) references organization(identifier) on update cascade on delete cascade; alter table organization_map drop constraint organization_map_other_organization_identifier_fkey, add constraint organization_map_other_organization_identifier_fkey foreign key (other_organization_identifier) references organization(identifier) on update cascade on delete cascade; select audit.audit_table('organization_map'); select audit.audit_table('organization_relationship');
INSERT INTO IACUC_CORRESPONDENT_TYPE ( CORRESPONDENT_TYPE_CODE, DESCRIPTION, QUALIFIER, UPDATE_TIMESTAMP, UPDATE_USER, VER_NBR, OBJ_ID ) VALUES ( '1', 'IACUC correspondent', 'P', sysdate, 'admin', 1, SYS_GUID() ) / INSERT INTO IACUC_CORRESPONDENT_TYPE ( CORRESPONDENT_TYPE_CODE, DESCRIPTION, QUALIFIER, UPDATE_TIMESTAMP, UPDATE_USER, VER_NBR, OBJ_ID ) VALUES ( '2', 'Administrative contact', 'U', sysdate, 'admin', 1, SYS_GUID() ) / INSERT INTO IACUC_CORRESPONDENT_TYPE ( CORRESPONDENT_TYPE_CODE, DESCRIPTION, QUALIFIER, UPDATE_TIMESTAMP, UPDATE_USER, VER_NBR, OBJ_ID ) VALUES ( '3', 'Organization contact', 'O', sysdate, 'admin', 1, SYS_GUID() ) /
<filename>sql/seed.sql USE company_db; INSERT INTO department(name) VALUES ('Sales'),('Engineering'),('HR'); USE company_db; SELECT * FROM department; USE company_db; INSERT INTO role(title,salary,department_id) VALUES('Account Executive',85000,1),('Sales Intern',40000,1), ('Senior Engineer',120000,2),('Junior Engineer',80000,2), ('VP of HR',200000,3),('Payroll Specialist',55000,3); USE company_db; SELECT * FROM role; USE company_db; INSERT INTO employee(first_name,last_name,role_id,manager_id) VALUES('John','Worthington',1,null), ('Taylor','Lopez',3,null), ('Stella','McDowell',5,null); USE company_db; SELECT * FROM employee; USE company_db; INSERT INTO employee(first_name,last_name,role_id,manager_id) VALUES('Fabian','MacArthur',2,1), ('Courteney','Willis',4,2), ('Agatha','Barnard',6,3); USE company_db; SELECT * FROM employee;
CREATE PROCEDURE [dbo].[pe_NL_GP_Accs] @AccType int AS Select AccIndex, AccNum, AccDesc, AccType FROM pe_view_NL_Accounts WHERE AccType = @AccType ORDER BY AccDesc
DROP TABLE IF EXISTS `account_role`; CREATE TABLE `account_role` ( `account_id` bigint(20) unsigned NOT NULL COMMENT '账户Id', `role_id` bigint(20) unsigned NOT NULL COMMENT '角色Id', PRIMARY KEY (`account_id`,`role_id`), KEY `fk_ref_role` (`role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='账户角色表'; INSERT INTO `account_role` VALUES (1,2), (1,3), (2,1);
<filename>src/main/resources/scripts/class_queries/medical_record/surgical_intervention/save.sql INSERT INTO residence.surgical_intervention VALUES (?, ?, ?, ?, ?);
CREATE INDEX idx_application_id ON applications(id);
<filename>openGaussBase/testcase/SQL/DDL/partition/Opengauss_Function_DDL_Partition_List_Case0068.sql -- @testpoint: List分区表结合列约束not null,部分测试点合理报错 --step1:创建list分区表,结合列约束;expect:成功 drop table if exists t_partition_list_0068; create table t_partition_list_0068 (id int, age int not null, number int, text VARCHAR2(2000)) partition by list(id) (partition p1 values(10), partition p2 values(20)); --step2:插入数据;expect:合理报错 insert into t_partition_list_0068 values(10,10,10,'hahahahah'); insert into t_partition_list_0068(id,number,text) values(10,10,'hahahahah'); --step3:查看数据 select * from t_partition_list_0068; --step4:清理环境 drop table if exists t_partition_list_0068;
<reponame>trra/codevault-sql-logging<gh_stars>0 {%- set function = {name: 'formatMessage'} -%} {%- set table = tables.records -%} {%- set tableName = table.tableName -%} PRINT '--- TEST FUNCTION [{{schemaName}}].[formatMessage] ---' DECLARE @test varchar(150) = '' DECLARE @expect varchar(max) = '' DECLARE @actual varchar(max) = '' -- Test SET @test = 'message' SET @expect = 'test message' SET @actual = JSON_VALUE({{schemaName}}.formatMessage('test message'), '$.message') PRINT '--- ' + CASE WHEN @expect = @actual THEN 'PASSED' ELSE 'FAILED' END + ' [' + @test + ']: Expected: [' + @expect + '] Actual: [' + @actual +']' -- Test SET @test = 'message object' SET @expect = 'valid' SET @actual = JSON_VALUE({{schemaName}}.formatMessage('{"code":"valid", "message": "test message"}'), '$.message.code') PRINT '--- ' + CASE WHEN @expect = @actual THEN 'PASSED' ELSE 'FAILED' END + ' [' + @test + ']: Expected: [' + @expect + '] Actual: [' + @actual +']' -- Test error messages BEGIN TRY PRINT 1/0 END TRY BEGIN CATCH -- Test SET @test = 'error number' SET @actual = JSON_VALUE({{schemaName}}.formatMessage('test error message'), '$.error.number') SET @expect = '8134' PRINT '--- ' + CASE WHEN @expect = @actual THEN 'PASSED' ELSE 'FAILED' END + ' [' + @test + ']: Expected: [' + @expect + '] Actual: [' + @actual +']' -- Test SET @test = 'error user message' SET @actual = JSON_VALUE({{schemaName}}.formatMessage('test error message'), '$.message') SET @expect = 'test error message' PRINT '--- ' + CASE WHEN @expect = @actual THEN 'PASSED' ELSE 'FAILED' END + ' [' + @test + ']: Expected: [' + @expect + '] Actual: [' + @actual +']' END CATCH GO
USE [master] GO /* For security reasons the login is created disabled and with a random password. */ /****** Object: Login [AppAccess] Script Date: 09/01/2015 13:48:14 ******/ CREATE LOGIN [AppAccess] WITH PASSWORD=N'<PASSWORD>', DEFAULT_DATABASE=[App4Learn], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON GO ALTER LOGIN [AppAccess] DISABLE GO
<reponame>francois/elm-scoutges<gh_stars>0 -- Revert scoutges:extensions/unaccent from pg SET client_min_messages TO 'warning'; BEGIN; DROP EXTENSION unaccent; COMMIT; -- vim: expandtab shiftwidth=2
<reponame>vgalaktionov/snaql-migration {% sql 'create_roles' %} CREATE TABLE roles ( id INT NOT NULL, title VARCHAR(100), PRIMARY KEY (id) ) {% endsql %}
-- A veces, solo queremos combinar todas las filas de una tabla con todas las filas de otra tabla. -- si tuviéramos una tabla shirtsy una tabla de pants, podríamos querer conocer todas las combinaciones posibles para crear diferentes conjuntos. SELECT shirts.shirt_color, pants.pants_color FROM shirts CROSS JOIN pants; /* Use COUNT(*)para contar el número de filas y una WHEREcláusula para restringir a dos condiciones: start_month <= 3 end_month >= 3 */ SELECT COUNT(*) FROM newspaper WHERE start_month <= 3 AND end_month >= 3; -- Nuestra base de datos contiene otra tabla llamada monthsque contiene los números entre 1 y 12. -- Seleccione todas las columnas de la unión cruzada de newspapery months. SELECT * FROM newspaper CROSS JOIN months; /* Cree una tercera consulta donde agregue una WHERE declaración a su unión cruzada para restringir a dos condiciones: start_month <= month end_month >= month */ SELECT * FROM newspaper CROSS JOIN months WHERE start_month <= month AND end_month >= month; -- Cree una consulta final donde agregue cada mes para contar la cantidad de suscriptores. SELECT month, COUNT(*) AS 'subscribers' FROM newspaper CROSS JOIN months WHERE start_month <= month AND end_month >= month GROUP BY month;
CREATE TABLE `reports` ( `ID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `ReportType` VARCHAR(16) NOT NULL COLLATE 'utf8_bin', `ReportContent` TEXT NOT NULL COLLATE 'utf8_bin', `ReportedTimestamp` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`ID`) ) COLLATE='utf8_bin';
<gh_stars>1-10 create table geoTable ( userId INT, country VARCHAR(50), postalCode VARCHAR(50), college VARCHAR(50) ); insert into geoTable (userId, country, postalCode, college) values (1, 'Madagascar', null, 'Université de Fianarantsoa'); insert into geoTable (userId, country, postalCode, college) values (2, 'Argentina', '2624', 'Universidad Nacional de San Luis'); insert into geoTable (userId, country, postalCode, college) values (3, 'Jordan', null, 'Jordan Academy of Music / Higher Institute of Music'); insert into geoTable (userId, country, postalCode, college) values (4, 'Czech Republic', '788 32', 'University of Veterinary and Pharmaceutical Science'); insert into geoTable (userId, country, postalCode, college) values (5, 'Tajikistan', null, 'Tajik Agrarian University'); insert into geoTable (userId, country, postalCode, college) values (6, 'China', null, 'China University of Geosciences Wuhan'); insert into geoTable (userId, country, postalCode, college) values (7, 'Japan', '349-0218', 'Nippon Dental University'); insert into geoTable (userId, country, postalCode, college) values (8, 'Belarus', null, 'Minsk State Linguistic University'); insert into geoTable (userId, country, postalCode, college) values (9, 'Indonesia', null, 'Universitas Merdeka Madiun'); insert into geoTable (userId, country, postalCode, college) values (10, 'Philippines', '3322', 'Adamson University'); insert into geoTable (userId, country, postalCode, college) values (11, 'Albania', null, 'Academy of Sports and Physical Training'); insert into geoTable (userId, country, postalCode, college) values (12, 'Russia', '363621', 'Kazan State Music Conservatory'); insert into geoTable (userId, country, postalCode, college) values (13, 'Croatia', '31214', 'University of Dubrovnik'); insert into geoTable (userId, country, postalCode, college) values (14, 'Portugal', '2705-750', 'Universidade Atlântica'); insert into geoTable (userId, country, postalCode, college) values (15, 'Russia', '678080', 'Kabardino-Balkarian State University'); insert into geoTable (userId, country, postalCode, college) values (16, 'China', null, 'Nanjing University of Traditional Chinese Medicine'); insert into geoTable (userId, country, postalCode, college) values (17, 'Turkmenistan', null, 'International Turkmen Turkish University'); insert into geoTable (userId, country, postalCode, college) values (18, 'Indonesia', null, 'Universitas Bhayangkara Jakarta Raya'); insert into geoTable (userId, country, postalCode, college) values (19, 'Indonesia', null, 'Universitas Swadaya Gunung Djati'); insert into geoTable (userId, country, postalCode, college) values (20, 'China', null, 'Luzhou Medical College'); insert into geoTable (userId, country, postalCode, college) values (21, 'United States', '33994', 'Drake University'); insert into geoTable (userId, country, postalCode, college) values (22, 'Poland', '36-040', 'Gdansk Management College'); insert into geoTable (userId, country, postalCode, college) values (23, 'Thailand', '57210', 'Suan Dusit Rajabhat University'); insert into geoTable (userId, country, postalCode, college) values (24, 'Czech Republic', '618 00', 'University of Economics Prague'); insert into geoTable (userId, country, postalCode, college) values (25, 'Tonga', null, 'University of the South Pacific Centre'); insert into geoTable (userId, country, postalCode, college) values (26, 'Indonesia', null, 'Universitas Dr. R. Moestopo'); insert into geoTable (userId, country, postalCode, college) values (27, 'Russia', '607580', 'Siberian State University of Telecommunications and Informatics'); insert into geoTable (userId, country, postalCode, college) values (28, 'Indonesia', null, 'Politeknik Negeri Lhokseumawe'); insert into geoTable (userId, country, postalCode, college) values (29, 'Myanmar', null, 'Technological University (Dawei)'); insert into geoTable (userId, country, postalCode, college) values (30, 'China', null, 'Logistics Engineering University of PLA'); insert into geoTable (userId, country, postalCode, college) values (31, 'China', null, 'Dalian University of Foreign Language'); insert into geoTable (userId, country, postalCode, college) values (32, 'Mongolia', null, 'Mongolian State University of Agriculture'); insert into geoTable (userId, country, postalCode, college) values (33, 'Ecuador', null, 'Universidad Politécnica Salesiana'); insert into geoTable (userId, country, postalCode, college) values (34, 'Mexico', '95749', 'Centro Universitario Ixtlahuaca'); insert into geoTable (userId, country, postalCode, college) values (35, 'Greece', null, 'Yorker International University, Athens'); insert into geoTable (userId, country, postalCode, college) values (36, 'Colombia', '662037', 'Universidad del Norte'); insert into geoTable (userId, country, postalCode, college) values (37, 'China', null, 'Ningbo University of Technology'); insert into geoTable (userId, country, postalCode, college) values (38, 'China', null, 'Harbin University of Science and Technology'); insert into geoTable (userId, country, postalCode, college) values (39, 'China', null, 'West China University of Medical Sciences'); insert into geoTable (userId, country, postalCode, college) values (40, 'United States', '21229', 'Knoxville College'); insert into geoTable (userId, country, postalCode, college) values (41, 'Burundi', null, 'Hope Africa University'); insert into geoTable (userId, country, postalCode, college) values (42, 'Denmark', '1823', 'Technical University of Denmark'); insert into geoTable (userId, country, postalCode, college) values (43, 'Mongolia', null, 'Health sciences University of Mongolia'); insert into geoTable (userId, country, postalCode, college) values (44, 'China', null, 'Liaoning Technical University'); insert into geoTable (userId, country, postalCode, college) values (45, 'China', null, 'Suzhou University'); insert into geoTable (userId, country, postalCode, college) values (46, 'Indonesia', null, 'Universitas Jambi'); insert into geoTable (userId, country, postalCode, college) values (47, 'Mexico', '84015', 'Universidad Autónoma de Fresnillo'); insert into geoTable (userId, country, postalCode, college) values (48, 'Albania', null, 'American University of Tirana'); insert into geoTable (userId, country, postalCode, college) values (49, 'Brazil', '61900-000', 'Universidade Camilo Castelo Branco'); insert into geoTable (userId, country, postalCode, college) values (50, 'Venezuela', null, 'Universidad Centro Occidental Lisandro Alvarado'); insert into geoTable (userId, country, postalCode, college) values (51, 'China', null, 'Shenzhen University'); insert into geoTable (userId, country, postalCode, college) values (52, 'Mexico', '37861', 'Universidad de Guanajuato, Campus León'); insert into geoTable (userId, country, postalCode, college) values (53, 'United States', '30316', 'Alfred University'); insert into geoTable (userId, country, postalCode, college) values (54, 'Philippines', '6417', 'University of Southern Mindanao'); insert into geoTable (userId, country, postalCode, college) values (55, 'Ukraine', null, 'Kiev National Economic University Named after <NAME>'); insert into geoTable (userId, country, postalCode, college) values (56, 'China', null, 'Huizhou University'); insert into geoTable (userId, country, postalCode, college) values (57, 'Syria', null, 'Yarmouk Private University '); insert into geoTable (userId, country, postalCode, college) values (58, 'France', '47020 CEDEX 9', 'Université de Technologie de Compiègne'); insert into geoTable (userId, country, postalCode, college) values (59, 'Japan', '203-0044', 'Toyama Medical and Pharmaceutical University'); insert into geoTable (userId, country, postalCode, college) values (60, 'Brazil', '58928-000', 'Universidade de Brasília'); insert into geoTable (userId, country, postalCode, college) values (61, 'China', null, 'Yanbian University of Science and Technology'); insert into geoTable (userId, country, postalCode, college) values (62, 'Mexico', '47253', 'Universidad de las Américas - Puebla'); insert into geoTable (userId, country, postalCode, college) values (63, 'Estonia', null, 'Estonian Academy of Security Sciences'); insert into geoTable (userId, country, postalCode, college) values (64, 'China', null, 'Shanghai International Studies University'); insert into geoTable (userId, country, postalCode, college) values (65, 'Indonesia', null, 'Universitas Slamet Riyadi Surakarta'); insert into geoTable (userId, country, postalCode, college) values (66, 'China', null, 'Tianjin Academy of Fine Art'); insert into geoTable (userId, country, postalCode, college) values (67, 'Dominica', null, 'Ballsbridge University '); insert into geoTable (userId, country, postalCode, college) values (68, 'Brazil', '94400-000', 'Universidade Regional do Cariri'); insert into geoTable (userId, country, postalCode, college) values (69, 'Brazil', '11990-000', 'Universidade do Vale do Itajaí'); insert into geoTable (userId, country, postalCode, college) values (70, 'Brazil', '57200-000', 'Universidade Católica Dom Bosco'); insert into geoTable (userId, country, postalCode, college) values (71, 'Sweden', '106 65', 'University College of Gävle'); insert into geoTable (userId, country, postalCode, college) values (72, 'Indonesia', null, 'Universitas Atma Jaya Yogyakarta'); insert into geoTable (userId, country, postalCode, college) values (73, 'Indonesia', null, 'Universitas Terbuka Indonesia'); insert into geoTable (userId, country, postalCode, college) values (74, 'Palestinian Territory', null, 'Bethlehem University'); insert into geoTable (userId, country, postalCode, college) values (75, 'Albania', null, 'Epoka University'); insert into geoTable (userId, country, postalCode, college) values (76, 'United States', '78278', 'Glendale University College of Law'); insert into geoTable (userId, country, postalCode, college) values (77, 'Panama', null, 'Universidad Especializada de Las Americas'); insert into geoTable (userId, country, postalCode, college) values (78, 'China', null, 'Beijing Institute of Technology'); insert into geoTable (userId, country, postalCode, college) values (79, 'Yemen', null, 'Yemenia University'); insert into geoTable (userId, country, postalCode, college) values (80, 'Poland', '76-002', 'Lazarski School of Commerce and Law'); insert into geoTable (userId, country, postalCode, college) values (81, 'Ethiopia', null, 'Aksum University'); insert into geoTable (userId, country, postalCode, college) values (82, 'Belarus', null, 'Belarussian State Pedagogical University M. Tanka'); insert into geoTable (userId, country, postalCode, college) values (83, 'Mongolia', null, 'Mongolian State University of Agriculture'); insert into geoTable (userId, country, postalCode, college) values (84, 'Burkina Faso', null, 'Université de Ouagadougou'); insert into geoTable (userId, country, postalCode, college) values (85, 'Guadeloupe', '97182 CEDEX', 'Université des Antilles et de la Guyane'); insert into geoTable (userId, country, postalCode, college) values (86, 'Japan', '869-1237', 'Okinawa International University'); insert into geoTable (userId, country, postalCode, college) values (87, 'Croatia', '21485', 'Zagreb School of Economics and Management'); insert into geoTable (userId, country, postalCode, college) values (88, 'Portugal', '2740-023', 'Universidade do Porto'); insert into geoTable (userId, country, postalCode, college) values (89, 'Portugal', '8150-105', 'Instituto Politécnico de Portalegre'); insert into geoTable (userId, country, postalCode, college) values (90, 'Indonesia', null, 'Universitas Merdeka Madiun'); insert into geoTable (userId, country, postalCode, college) values (91, 'United States', '30358', 'Pacific Lutheran University'); insert into geoTable (userId, country, postalCode, college) values (92, 'Russia', '143015', 'Perm State Technical University'); insert into geoTable (userId, country, postalCode, college) values (93, 'Ukraine', null, 'National Medical University O.O. Bogomolets'); insert into geoTable (userId, country, postalCode, college) values (94, 'China', null, 'Wuhan University of Hydraulic and Electric Engineering'); insert into geoTable (userId, country, postalCode, college) values (95, 'China', null, 'China youth college for political science'); insert into geoTable (userId, country, postalCode, college) values (96, 'Poland', '88-230', 'University of Bialystok'); insert into geoTable (userId, country, postalCode, college) values (97, 'France', '59304 CEDEX', 'Ecole Nationale de l''Aviation Civile'); insert into geoTable (userId, country, postalCode, college) values (98, 'Cambodia', null, 'Royal University of Fine Arts'); insert into geoTable (userId, country, postalCode, college) values (99, 'Serbia', null, 'University of Fine Arts Belgrade'); insert into geoTable (userId, country, postalCode, college) values (100, 'Indonesia', null, 'Universitas Sarjanawiyata Tamansiswa'); insert into geoTable (userId, country, postalCode, college) values (101, 'Czech Republic', '503 12', 'University of South Bohemia'); insert into geoTable (userId, country, postalCode, college) values (102, 'Poland', '37-723', 'University of Information Technology and Management in Rzeszow'); insert into geoTable (userId, country, postalCode, college) values (103, 'Vietnam', null, 'Vietnam National University Ho Chi Minh City'); insert into geoTable (userId, country, postalCode, college) values (104, 'Taiwan', null, 'National United University'); insert into geoTable (userId, country, postalCode, college) values (105, 'Philippines', '9318', 'Xavier University'); insert into geoTable (userId, country, postalCode, college) values (106, 'Argentina', '5383', 'Instituto Nacional de Educación Física "<NAME>"'); insert into geoTable (userId, country, postalCode, college) values (107, 'China', null, 'Huizhou University'); insert into geoTable (userId, country, postalCode, college) values (108, 'Philippines', '1110', 'Palawan State University'); insert into geoTable (userId, country, postalCode, college) values (109, 'Ukraine', null, 'Crimea State Medical University'); insert into geoTable (userId, country, postalCode, college) values (110, 'Indonesia', null, 'Universitas Negeri Malang'); insert into geoTable (userId, country, postalCode, college) values (111, 'Indonesia', null, 'Universitas Kristen Duta Wacana'); insert into geoTable (userId, country, postalCode, college) values (112, 'Japan', '981-4121', 'Osaka University of Commerce'); insert into geoTable (userId, country, postalCode, college) values (113, 'Spain', '15899', 'Universidad Complutense de Madrid'); insert into geoTable (userId, country, postalCode, college) values (114, 'China', null, 'Huaihua Medical College'); insert into geoTable (userId, country, postalCode, college) values (115, 'Russia', '629733', 'St. Petersburg State University'); insert into geoTable (userId, country, postalCode, college) values (116, 'Dominican Republic', '11506', 'Universidad Federico Henríquez y Carvajal'); insert into geoTable (userId, country, postalCode, college) values (117, 'China', null, 'University of International Business and Economics'); insert into geoTable (userId, country, postalCode, college) values (118, 'Norway', '0760', 'Norway''s Information Technology University College'); insert into geoTable (userId, country, postalCode, college) values (119, 'Philippines', '4124', 'San Beda College'); insert into geoTable (userId, country, postalCode, college) values (120, 'China', null, 'University of Jinan'); insert into geoTable (userId, country, postalCode, college) values (121, 'China', null, 'Dalian Medical University'); insert into geoTable (userId, country, postalCode, college) values (122, 'China', null, 'Yantai Education Institute & Yantai Television University'); insert into geoTable (userId, country, postalCode, college) values (123, 'Malaysia', '75720', 'Perdana University'); insert into geoTable (userId, country, postalCode, college) values (124, 'South Africa', '3887', 'University of South Africa'); insert into geoTable (userId, country, postalCode, college) values (125, 'Pakistan', '30001', 'Mooreland University'); insert into geoTable (userId, country, postalCode, college) values (126, 'Czech Republic', '678 01', 'Tiffin University Prague'); insert into geoTable (userId, country, postalCode, college) values (127, 'North Korea', null, 'Pyongyang University of Science and Technology'); insert into geoTable (userId, country, postalCode, college) values (128, 'Greece', null, 'Technological Education Institute of Kavala'); insert into geoTable (userId, country, postalCode, college) values (129, 'Belarus', null, 'Gomel State University Francisk Scarnia'); insert into geoTable (userId, country, postalCode, college) values (130, 'Pakistan', '67190', 'Gandhara Institute of Medical Sciences'); insert into geoTable (userId, country, postalCode, college) values (131, 'Bangladesh', '8130', 'Patuakhali Science and Technology University'); insert into geoTable (userId, country, postalCode, college) values (132, 'Portugal', '2755-163', 'Universidade Internacional Lisboa'); insert into geoTable (userId, country, postalCode, college) values (133, 'Sweden', '231 68', 'Mälardalen University'); insert into geoTable (userId, country, postalCode, college) values (134, 'Sweden', '302 40', 'Stockholm University'); insert into geoTable (userId, country, postalCode, college) values (135, 'Portugal', '3405-077', 'Universidade Moderna de Lisboa'); insert into geoTable (userId, country, postalCode, college) values (136, 'China', null, 'International Business University of Beijing'); insert into geoTable (userId, country, postalCode, college) values (137, 'China', null, 'East China Normal University'); insert into geoTable (userId, country, postalCode, college) values (138, 'China', null, 'Guangdong Polytechnic Normal University'); insert into geoTable (userId, country, postalCode, college) values (139, 'Indonesia', null, 'Universitas Kristen Petra'); insert into geoTable (userId, country, postalCode, college) values (140, 'Sweden', '545 30', 'Lund University'); insert into geoTable (userId, country, postalCode, college) values (141, 'Peru', null, 'Universidad Privada Los Andes'); insert into geoTable (userId, country, postalCode, college) values (142, 'Belarus', null, 'Belarussian National Technical University'); insert into geoTable (userId, country, postalCode, college) values (143, 'Colombia', '051858', 'Universidad de Ciencias Aplicadas y Ambientales (UDCA)'); insert into geoTable (userId, country, postalCode, college) values (144, 'Nigeria', null, 'Gombe State University'); insert into geoTable (userId, country, postalCode, college) values (145, 'China', null, 'Chongqing Telecommunication College'); insert into geoTable (userId, country, postalCode, college) values (146, 'Colombia', '503068', 'Universidad Autónoma de Manizales'); insert into geoTable (userId, country, postalCode, college) values (147, 'China', null, 'Zhengzhou Grain University'); insert into geoTable (userId, country, postalCode, college) values (148, 'China', null, 'Hebei Academy of Fine Art'); insert into geoTable (userId, country, postalCode, college) values (149, 'Russia', '238402', 'Togliatti State University'); insert into geoTable (userId, country, postalCode, college) values (150, 'Russia', '181280', 'Yakutsk State University'); insert into geoTable (userId, country, postalCode, college) values (151, 'Czech Republic', '375 01', 'Brno University of Technology'); insert into geoTable (userId, country, postalCode, college) values (152, 'Pakistan', '76000', 'University of Sargodha'); insert into geoTable (userId, country, postalCode, college) values (153, 'Brazil', '68721-000', 'Universidade de Nova Iguaçu'); insert into geoTable (userId, country, postalCode, college) values (154, 'China', null, 'Southern Medial University'); insert into geoTable (userId, country, postalCode, college) values (155, 'Philippines', '4207', 'Virgen Milagrosa University Foundation'); insert into geoTable (userId, country, postalCode, college) values (156, 'Indonesia', null, 'Universitas Paramadina Mulya'); insert into geoTable (userId, country, postalCode, college) values (157, 'Sweden', '137 24', 'Dalarna University College'); insert into geoTable (userId, country, postalCode, college) values (158, 'China', null, 'Xi''an University of Technology'); insert into geoTable (userId, country, postalCode, college) values (159, 'Brazil', '39470-000', 'Universidade de Passo Fundo'); insert into geoTable (userId, country, postalCode, college) values (160, 'Honduras', null, 'Universidad Pedagógica Nacional "Francisco Morazán"'); insert into geoTable (userId, country, postalCode, college) values (161, 'South Korea', null, 'Chungnam National University'); insert into geoTable (userId, country, postalCode, college) values (162, 'Greece', null, 'University of Crete'); insert into geoTable (userId, country, postalCode, college) values (163, 'Sweden', '167 37', 'Linköping University'); insert into geoTable (userId, country, postalCode, college) values (164, 'Poland', '82-505', 'Nicolaus Copernicus University of Torun'); insert into geoTable (userId, country, postalCode, college) values (165, 'United States', '94089', 'Minot State University'); insert into geoTable (userId, country, postalCode, college) values (166, 'China', null, 'National University of Defense Technology'); insert into geoTable (userId, country, postalCode, college) values (167, 'Canada', 'J4B', 'Trent University'); insert into geoTable (userId, country, postalCode, college) values (168, 'China', null, 'Xi''an Jiaotong University'); insert into geoTable (userId, country, postalCode, college) values (169, 'Norway', '5119', 'Norwegian College of Veterinary Medicine'); insert into geoTable (userId, country, postalCode, college) values (170, 'Indonesia', null, 'Universitas Madura'); insert into geoTable (userId, country, postalCode, college) values (171, 'Philippines', '6808', 'Saint Louis University'); insert into geoTable (userId, country, postalCode, college) values (172, 'Philippines', '4010', 'Central Philippine University'); insert into geoTable (userId, country, postalCode, college) values (173, 'Indonesia', null, 'Universitas Paramadina Mulya'); insert into geoTable (userId, country, postalCode, college) values (174, 'China', null, 'Hebei Normal University'); insert into geoTable (userId, country, postalCode, college) values (175, 'Brazil', '19700-000', 'Universidade para o Desenvolvimento do Alto Vale do Itajaí'); insert into geoTable (userId, country, postalCode, college) values (176, 'China', null, 'China Foreign Affairs University'); insert into geoTable (userId, country, postalCode, college) values (177, 'Indonesia', null, 'Universitas Wijaya Kusuma Purwokerto'); insert into geoTable (userId, country, postalCode, college) values (178, 'China', null, 'Guangxi University for Nationalities'); insert into geoTable (userId, country, postalCode, college) values (179, 'Indonesia', null, 'Universitas Bojonegoro'); insert into geoTable (userId, country, postalCode, college) values (180, 'Russia', '171275', 'Kazan State University of Medicine'); insert into geoTable (userId, country, postalCode, college) values (181, 'Indonesia', null, 'Universitas Kristen Indonesia Tomohon'); insert into geoTable (userId, country, postalCode, college) values (182, 'Laos', null, 'Soutsaka Institute of management and Technology'); insert into geoTable (userId, country, postalCode, college) values (183, 'Kyrgyzstan', null, 'Kyrgyz National Agrarian University'); insert into geoTable (userId, country, postalCode, college) values (184, 'Jordan', null, 'The World Islamic Sciences & Education University'); insert into geoTable (userId, country, postalCode, college) values (185, 'East Timor', null, 'Shandong University of Triaditional Chinese Medicine'); insert into geoTable (userId, country, postalCode, college) values (186, 'Philippines', '4328', 'Colegio de San Juan de Letran'); insert into geoTable (userId, country, postalCode, college) values (187, 'China', null, 'Jiangsu University of Science and Technology'); insert into geoTable (userId, country, postalCode, college) values (188, 'Japan', '181-0012', 'Eichi University'); insert into geoTable (userId, country, postalCode, college) values (189, 'Greece', null, 'Technological Education Institute of Mesologgi'); insert into geoTable (userId, country, postalCode, college) values (190, 'Guatemala', '07023', 'Universidad del Istmo'); insert into geoTable (userId, country, postalCode, college) values (191, 'Philippines', '4022', 'University of Manila'); insert into geoTable (userId, country, postalCode, college) values (192, 'Norway', '3255', 'Norwegian College of Veterinary Medicine'); insert into geoTable (userId, country, postalCode, college) values (193, 'Nigeria', null, 'University of Nigeria'); insert into geoTable (userId, country, postalCode, college) values (194, 'Indonesia', null, 'Universitas Islam Syekh-Yusuf '); insert into geoTable (userId, country, postalCode, college) values (195, 'Indonesia', null, 'Universitas Nasional Jakarta'); insert into geoTable (userId, country, postalCode, college) values (196, 'Russia', '606084', 'Irkutsk State Technical University'); insert into geoTable (userId, country, postalCode, college) values (197, 'Greece', null, 'European University, Athens Campus'); insert into geoTable (userId, country, postalCode, college) values (198, 'Indonesia', null, 'Universitas Gadjah Mada'); insert into geoTable (userId, country, postalCode, college) values (199, 'Uganda', null, 'Makerere University'); insert into geoTable (userId, country, postalCode, college) values (200, 'Russia', '613594', 'Dagestan State University');
grant select, insert, update, delete on data."user" to api; alter table data.user enable row level security; -- Define the RLS policy controlling what rows are visible to a -- particular user. create policy user_access_policy on data.user to api using ( -- The student users can see on her or his user. (request.user_role() = 'student' and request.user_id() = id) or -- faculty and tas can see all users (request.user_role() = ANY('{faculty,ta}'::text[])) OR -- The authapp can view users ( request.user_role() = 'app' AND request.app_name() = 'authapp' ) ); -- student users can select from this view. The RLS will -- limit them to viewing their own users. grant select on api.users to student, ta, app; -- faculty have CRUD privileges grant select, insert, update, delete on api.users to faculty;
INSERT INTO batch (id, kjoredato) VALUES (nextval('batch_seq'), TO_TIMESTAMP('05-01-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('28-01-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('25-02-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('25-03-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('26-04-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('27-05-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('29-06-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('29-07-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('30-08-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('29-09-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('28-10-2022', 'DD-MM-YYYY SS:MS')), (nextval('batch_seq'), TO_TIMESTAMP('21-11-2022', 'DD-MM-YYYY SS:MS'));
-- 27.06.2016 15:37 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_SysConfig SET Description='By setting this configuration you can switch on and off the automatical closing of invoice candidates when they are set to be cleared. Closing invoice candidates means setting their Process_Override to "Yes". If this behaviour is needed, set the value on "Y" otherwise on "N".',Updated=TO_TIMESTAMP('2016-06-27 15:37:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SysConfig_ID=540996 ; -- 27.06.2016 15:38 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_SysConfig SET Description='By setting this configuration you can switch on and off the automatical closing of invoice candidates if they were partially invoiced. Closing invoice candidates means setting their Process_Override to "Yes"> Note that the linked shipment/receipt schedules are also closed. If this behaviour is needed, set the value on "Y" otherwise on "N".', Value='Y',Updated=TO_TIMESTAMP('2016-06-27 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SysConfig_ID=540997 ;
<filename>atd-vzd/schema/atd_txdot__rural_urban_type_lkp.sql -- -- PostgreSQL database dump -- -- Dumped from database version 10.6 -- Dumped by pg_dump version 10.10 -- Started on 2019-10-15 13:56:34 CDT SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; SET default_with_oids = false; -- -- TOC entry 320 (class 1259 OID 2346125) -- Name: atd_txdot__rural_urban_type_lkp; Type: TABLE; Schema: public; Owner: atd_vz_data -- CREATE TABLE public.atd_txdot__rural_urban_type_lkp ( rural_urban_type_id integer NOT NULL, rural_urban_type_desc character varying(128), eff_beg_date character varying(32), eff_end_date character varying(32) ); ALTER TABLE public.atd_txdot__rural_urban_type_lkp OWNER TO atd_vz_data; -- -- TOC entry 5618 (class 2606 OID 2346660) -- Name: atd_txdot__rural_urban_type_lkp atd_txdot__rural_urban_type_lkp_pk; Type: CONSTRAINT; Schema: public; Owner: atd_vz_data -- ALTER TABLE ONLY public.atd_txdot__rural_urban_type_lkp ADD CONSTRAINT atd_txdot__rural_urban_type_lkp_pk PRIMARY KEY (rural_urban_type_id); -- Completed on 2019-10-15 13:56:37 CDT -- -- PostgreSQL database dump complete --
UPDATE creature_template SET ScriptName='npc_kingdom_of_dalaran_quests' WHERE entry IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162);
<gh_stars>1-10 --- This SQL schema was extracted excatly as is documented on --- https://iso639-3.sil.org/code_tables/download_tables (date: 2021-05-08) --- so was not inferred. --- https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso639-3_table_definition.txt CREATE TABLE [ISO_639-3] ( Id char(3) NOT NULL, -- The three-letter ISO 639-3 identifier Part2B char(3) NULL, -- Equivalent ISO 639-2 identifier of the bibliographic applications code set, if there is one Part2T char(3) NULL, -- Equivalent ISO 639-2 identifier of the terminology applications code set, if there is one Part1 char(2) NULL, -- Equivalent ISO 639-1 identifier, if there is one Scope char(1) NOT NULL, -- I(ndividual), M(acrolanguage), S(pecial) Type char(1) NOT NULL, -- A(ncient), C(onstructed), E(xtinct), H(istorical), L(iving), S(pecial) Ref_Name varchar(150) NOT NULL, -- Name in the reference language (probably English or French and in the Latin script) Comment varchar(150) NULL) -- Comment relating to one or more of the columns --- https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso639-3_names_table_definition.txt CREATE TABLE [ISO_639-3_Names] ( Id char(3) NOT NULL, -- The three-letter ISO 639-3 identifier Print_Name varchar(75) NOT NULL, -- One of the names associated with this identifier Inverted_Name varchar(75) NOT NULL) -- The inverted form of this Print_Name form --- https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso639-3_macrolanguages_table_definition.txt CREATE TABLE [ISO_639-3_Macrolanguages] ( M_Id char(3) NOT NULL, -- The ISO 639-3 identifier for a macrolanguage I_Id char(3) NOT NULL, -- The ISO 639-3 identifier for an individual language that is a member of the macrolanguage I_Status char(1) NOT NULL) -- A (active) or R (retired) indicating the status of the individual code element --- https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso639-3_retirements_table_definition.txt CREATE TABLE [ISO_639-3_Retirements] ( Id char(3) NOT NULL, -- The three-letter ISO 639-3 identifier Ref_Name varchar(150) NOT NULL, -- reference name of language Ret_Reason char(1) NOT NULL, -- code for retirement: C (change), D (duplicate), -- N (non-existent), S (split), M (merge) Change_To char(3) NULL, -- in the cases of C, D, and M, the identifier -- to which all instances of this Id should be changed Ret_Remedy varchar(300) NULL, -- The instructions for updating an instance -- of the retired (split) identifier Effective date NOT NULL) -- The date the retirement became effective
-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: ianus -- ------------------------------------------------------ -- Server version 5.5.46-0ubuntu0.14.04.2 /*!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 `Location` -- DROP TABLE IF EXISTS `Location`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `Location` ( `id` bigint(20) NOT NULL, `creation_time` datetime DEFAULT NULL, `last_change` datetime DEFAULT NULL, `absolutePath` varchar(255) DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `purpose` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `Location` -- LOCK TABLES `Location` WRITE; /*!40000 ALTER TABLE `Location` DISABLE KEYS */; INSERT INTO `Location` VALUES (1,'2016-01-20 14:14:27','2016-01-20 14:14:27','/data/ianus/aip_storage','','AIP_STORAGE'),(2,'2016-01-20 14:14:44','2016-01-20 14:14:44','/data/ianus/dip_storage','','DIP_STORAGE'),(3,'2016-01-20 14:14:55','2016-01-20 14:14:55','/data/ianus/sip_storage','','SIP_STORAGE'),(4,'2016-01-20 14:15:34','2016-01-20 14:15:34','/data/ianus/tp_storage','','TIP_STORAGE'),(5,'2016-01-20 14:16:09','2016-01-20 14:16:09','/data/ianus/working_storage','','PROCESSING_STORAGE'); /*!40000 ALTER TABLE `Location` 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 2016-01-20 14:24:47
<filename>subscribe.sql /* Navicat MySQL Data Transfer Source Server : MySQL Source Server Version : 50505 Source Host : 127.0.0.1:3306 Source Database : dbalv Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2016-07-27 11:28:59 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for subscribe -- ---------------------------- DROP TABLE IF EXISTS `subscribe`; CREATE TABLE `subscribe` ( `subscribe_id` int(11) NOT NULL AUTO_INCREMENT, `email` varchar(255) DEFAULT NULL, PRIMARY KEY (`subscribe_id`) ) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=latin1;
<reponame>leongold/ovirt-engine<gh_stars>0 update vm_static set numatune_mode ='interleave';
<reponame>uoregon-libraries/newspaper-curation-app -- +goose Up ALTER TABLE `jobs` ADD COLUMN `retry_count` INT(11) COLLATE utf8_bin; -- +goose Down ALTER TABLE `jobs` DROP COLUMN `retry_count`;
<gh_stars>1-10 drop table scenes;
<gh_stars>100-1000 -- Inspired by https://blog.ethereum.org/2015/08/18/frontier-first-100k-blocks/ -- The following SQL queries capture partially what was depicted in that post. -- The first 50 block times (in seconds): SELECT b.bn, (b.block_timestamp - a.block_timestamp) AS delta FROM (SELECT block_number AS bn, block_timestamp FROM block WHERE block_number>=1 AND block_number<=50) AS a JOIN (SELECT (block_number-1) AS bn, block_timestamp FROM block WHERE block_number>=2 AND block_number<=51) AS b ON a.bn=b.bn ORDER BY b.bn; -- Average block time (every 200th block from genesis to block 10000) WITH X AS (SELECT b.bn, (b.block_timestamp - a.block_timestamp) AS delta FROM (SELECT block_number AS bn, block_timestamp FROM block WHERE block_number>=1 AND block_number<=10000) AS a JOIN (SELECT (block_number-1) AS bn, block_timestamp FROM block WHERE block_number>=2 AND block_number<=10001) AS b ON a.bn=b.bn ORDER BY b.bn) SELECT min(bn) AS chunkStart, avg(delta) FROM (SELECT ntile(10000/200) OVER (ORDER BY bn) AS chunk, * FROM X) AS T GROUP BY chunk ORDER BY chunkStart; -- Biggest miners in first 100k blocks (address, blocks, %): SELECT block_miner, count(*) AS num, count(*)/100000.0 AS PERCENT FROM block WHERE block_number<=100000 GROUP BY block_miner ORDER BY num DESC LIMIT 15;
<gh_stars>10-100 SET search_path = pg_catalog; DROP OPERATOR public.||++(text, text); CREATE OPERATOR public.||++ ( PROCEDURE = public.nonull_append_strings, LEFTARG = text, RIGHTARG = text, COMMUTATOR = OPERATOR(public.||+-+), NEGATOR = OPERATOR(public.||+++), MERGES ); ALTER OPERATOR public.||++(text, text) OWNER TO shamsutdinov_lr; COMMENT ON OPERATOR public.||++(text, text) IS 'Тестовый комментарий';
CREATE OR REPLACE FUNCTION os.fn_queue(p_id integer) RETURNS void AS $$ DECLARE v_function_name text := 'os.fn_queue'; v_location int; BEGIN v_location := 1000; INSERT INTO os.ao_queue(status, queue_date, id, refresh_type, target_schema_name, target_table_name, target_append_only, target_compressed, target_row_orientation, source_type, source_server_name, source_instance_name, source_port, source_database_name, source_schema_name, source_table_name, source_user_name, source_pass, column_name, sql_text, snapshot) SELECT 'queued' as status, clock_timestamp()::timestamp as queue_date, j.id, j.refresh_type, j.target_schema_name, j.target_table_name, j.target_append_only, j.target_compressed, j.target_row_orientation, j.source_type, j.source_server_name, j.source_instance_name, j.source_port, j.source_database_name, j.source_schema_name, j.source_table_name, j.source_user_name, j.source_pass, j.column_name, j.sql_text, j.snapshot FROM os.job j left join (SELECT queue_id, id FROM os.queue WHERE status in ('processing', 'queued')) q on j.id = q.id WHERE q.queue_id IS NULL AND j.id = p_id; EXCEPTION WHEN OTHERS THEN RAISE EXCEPTION '(%:%:%)', v_function_name, v_location, sqlerrm; END; $$ LANGUAGE plpgsql;
<gh_stars>0 -- codd:no-txn CREATE TABLE other_table();
<reponame>kpehl/week-in-view DROP DATABASE IF EXISTS week_in_view_draft_db; CREATE DATABASE week_in_view_draft_db; DROP USER IF EXISTS 'wiv_admin'@'localhost'; CREATE USER 'wiv_admin'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON week_in_view_draft_db.* TO 'wiv_admin'@'localhost';
<filename>queries/grade/delete_uc.sql DELETE FROM uc WHERE id_uc = ${id_uc}
#SUBSTR() => Extrai uma substring de uma string (Começando em qualquer posição). #SUBSTR(string, start, length) ou SUBSTR(string from start for length) #Parâmetros: # string: Obrigatório. String para extração # start: Obrigatório. Pode ser número positivo ou negativo. Se for positico, a função extrai do início da string. Se for negativo, # a função extrai do final da string. # length: Opcional.Número de caracteres a serem extraidos. Se omitido, tada a string será retornada(da posição inicial). SELECT SUBSTR('The number of characters to extract. If omitted', 5, 6) AS substring; SELECT SUBSTR('The number of characters to extract. If omitted', -7,7) AS SUBSTRING; #substr() e length() SELECT c_codiprodu, c_descprodu FROM comprodu WHERE SUBSTR(c_codiprodu,1,3) = '123' AND LENGTH(c_codiprodu) <= 6; SELECT SUBSTR(c_razaclien,1,5) Razao_Social, LENGTH(c_codiclien) Tamanho_Cod FROM comclien WHERE n_numeclien = 1; #SUBSTRING_INDEX => Extrai uma substring de uma string antes que um número especificado de delimitador ocorra. #SUBSTRING_INDEX(string, delimiter, number) #Parâmetros: #string: Obrigatório. A string a ser extraida. #delimiter: Obrigatório. O delimitador a ser pesquisado. #number: Obrigatório. O número de vezes para pesqusisar o delimitador. Pode ser um número positivo ou negativo. Se for um número positivo, esta função # retorna tudo à esquerda do delimitador. Se for um número negativo, esta função retorna tudo à direita do delimitador. SELECT SUBSTRING_INDEX("www.w3schools.com", ".", 2); #concat() SELECT CONCAT(c_codiclien, ' ', c_razaclien ,' ', c_nomeclien) FROM comclien WHERE c_razaclien LIKE 'Kik%'; #concat_WS() SELECT CONCAT_WS(';',c_codiclien, c_razaclien, c_nomeclien) FROM comclien WHERE c_razaclien LIKE 'Kik%'; #lcase -> Letras minúsculas SELECT LCASE(c_razaclien) FROM comclien; #ucase - Letras maiúsculas SELECT UCASE(c_razaclien) FROM comclien; #LOCATE() => Retorna a posição da primeira ocorrência de uma substring em uma string. Retorna zero caso a substring não seja encontrada. #não diferencia maiúsculas de minúsculas. #LOCATE(substring, string) #Parâmetros: #substring: Obrigatório. A substring a ser pesquisada. #string: Obrigatório. A string que será pesquisada. #start: Opcional. Posição inicial para a pesquisa. Posição 1 é o padrão. SELECT LOCATE("com", "W3Schools.com") AS posicao
SELECT a.employeeid, a.lastname, totallateorders = count(b.orderid) FROM employees AS a INNER JOIN orders AS b ON a.employeeid = b.employeeid WHERE b.shippeddate >= b.requireddate GROUP BY a.employeeid, a.lastname ORDER BY totallateorders DESC;
<reponame>Shuttl-Tech/antlr_psql -- file:identity.sql ln:86 expect:true SELECT * FROM itest2
CREATE FUNCTION grest.native_script_list () RETURNS TABLE ( script_hash text, creation_tx_hash text, type scripttype, script jsonb ) LANGUAGE PLPGSQL AS $$ BEGIN RETURN QUERY SELECT ENCODE(script.hash, 'hex'), ENCODE(tx.hash, 'hex'), script.type, script.json FROM script INNER JOIN tx ON tx.id = script.tx_id WHERE script.type IN ('timelock', 'multisig'); END; $$; COMMENT ON FUNCTION grest.native_script_list IS 'Get a list of all native(multisig/timelock) script hashes with creation tx hash, type and script in json format.';
INSERT INTO categories_category ( id, name, name_ru, name_uk, description, description_ru, description_uk, logo, grid, grid_ru, grid_uk, title, code, icon, level, lft, rght, tree_id, age, sex ) SELECT id, name, name_ru, name_uk, description, description_ru, description_uk, logo, '', '', '', '', '', '', 1, 1, 1, 1, '', '' FROM products_productcategory
CREATE TABLE [dbo].[tbDemo] ( [ID] NVARCHAR (5) NOT NULL, [Code] INT NOT NULL, [Name] NVARCHAR (256) NULL, [Note] NVARCHAR (1024) NULL, CONSTRAINT [PK_tbDemo] PRIMARY KEY CLUSTERED ([ID] ASC, [Code] ASC) );
<reponame>ElderResearch/DAPM /* This module reads in the ip base table, determines which users have have frequently shared IP addresses over a certain time period and inserts risk scores into the entity score table indicating the severity of the sharing behavior for the most recent bus_perd_end_dt. The (quantile) scores are calculated using ip sharing behavior from the entire date range, but only the last bus_perd_end_dt is kept. The following variables/parameters are set at the beginning of the script: -IP_MIN_USERS: The minimum # of users sharing an IP address within the same week required for those to be eligible for a risk score. -IP_DECAY_FACTOR: The factor to be used for a time decay of scores (in e^(-kt), k = decay factor) NOTE: This module also uses IP location to complement its score. If a user's ip is shared and it's coming from outside The states listed in the claimant's file, it's more risky */ /*Get minimum amount of time between any two users filing in the same week Returns all pairwise combinations of users filing from same ip in same week along with the number of seconds between their submissions */ DROP TABLE IF EXISTS tmp.ip_share_claimantdiffs; CREATE TABLE tmp.ip_share_claimantdiffs AS SELECT c.orig_ip_addr, c.bus_perd_end_dt, c.claimt_id as firstclaimant, s.claimt_id as secondclaimant, ABS(date_part('epoch',(c.claimt_sessn_tmstmp - s.claimt_sessn_tmstmp))) as diffseconds FROM aggr_claimt_sessn c JOIN aggr_claimt_sessn s ON s.orig_ip_addr = c.orig_ip_addr AND s.bus_perd_end_dt = c.bus_perd_end_dt AND s.claimt_id <> c.claimt_id; -- Get a table with the minimum number of seconds per week/claimant DROP TABLE IF EXISTS tmp.ip_share_claimantweek; CREATE TABLE tmp.ip_share_claimantweek AS SELECT firstclaimant, bus_perd_end_dt, MIN(diffseconds) as min_seconds FROM tmp.ip_share_claimantdiffs GROUP BY firstclaimant, bus_perd_end_dt; --Use previous table to get the minimum time difference between two different claimants. DROP TABLE IF EXISTS tmp.ip_share_claimantweek2; CREATE TABLE tmp.ip_share_claimantweek2 AS SELECT t1.firstclaimant, array_agg(DISTINCT t1.secondclaimant) as matched_claimants, array_agg(DISTINCT t1.orig_ip_addr) as shared_ips, t1.bus_perd_end_dt, t1.diffseconds FROM tmp.ip_share_claimantdiffs t1 JOIN tmp.ip_share_claimantweek t2 ON t1.firstclaimant = t2.firstclaimant AND t1.bus_perd_end_dt = t2.bus_perd_end_dt AND t1.diffseconds = t2.min_seconds GROUP BY t1.firstclaimant, t1.bus_perd_end_dt, t1.diffseconds; -- Using the original table, calculate the number of unique users for each orig_ip_addr for a given bus_perd_end_dt -- Only keep IPs that have been shared by at least IP_MIN_USERS users DROP TABLE IF EXISTS tmp.ip_share_all_users1; CREATE TABLE tmp.ip_share_all_users1 AS SELECT t1.bus_perd_end_dt, t1.orig_ip_addr, COUNT(DISTINCT(t2.claimt_id)) as prev_unique_users FROM aggr_claimt_sessn t1 LEFT JOIN ( SELECT claimt_sessn_tmstmp, orig_ip_addr, claimt_id FROM aggr_claimt_sessn ) t2 ON t2.orig_ip_addr = t1.orig_ip_addr AND t2.claimt_sessn_tmstmp <= t1.claimt_sessn_tmstmp GROUP BY t1.bus_perd_end_dt, t1.orig_ip_addr HAVING COUNT(DISTINCT(t2.claimt_id)) >= (SELECT CAST((SELECT parm_val FROM ref.parm WHERE parm_cd = 'IP_MIN_USERS') AS INTEGER)); -- Join the above table on the table that already contains the minimum difference in seconds for each user/week DROP TABLE IF EXISTS tmp.ip_share_claimantweek3; CREATE TABLE tmp.ip_share_claimantweek3 AS SELECT t1.firstclaimant as claimt_id, t1.matched_claimants, t1.shared_ips[1] as shared_ip, t1.bus_perd_end_dt, t1.diffseconds, t2.prev_unique_users FROM tmp.ip_share_claimantweek2 t1 LEFT JOIN tmp.ip_share_all_users1 t2 ON t1.shared_ips[1] = t2.orig_ip_addr AND t1.bus_perd_end_dt = t2.bus_perd_end_dt; -- Obtain the number of unique users with each ip in the week DROP TABLE IF EXISTS tmp.ip_share_claimantweek4; CREATE TABLE tmp.ip_share_claimantweek4 AS SELECT t1.*, t2.unique_users_in_week FROM tmp.ip_share_claimantweek3 t1 LEFT JOIN (SELECT orig_ip_addr, bus_perd_end_dt, COUNT(DISTINCT claimt_id) as unique_users_in_week FROM aggr_claimt_sessn GROUP BY orig_ip_addr, bus_perd_end_dt) t2 ON t1.shared_ip = t2.orig_ip_addr AND t1.bus_perd_end_dt = t2.bus_perd_end_dt; -- Add IP location from original table DROP TABLE IF EXISTS tmp.ip_share_claimantweek5; CREATE TABLE tmp.ip_share_claimantweek5 AS SELECT t1.*, t2.ip_outsd_local_st_flag, t2.ip_outsd_cntry_flag FROM tmp.ip_share_claimantweek4 t1 LEFT JOIN ( SELECT DISTINCT claimt_id, orig_ip_addr, ip_outsd_local_st_flag, ip_outsd_cntry_flag FROM aggr_claimt_sessn) t2 ON t1.claimt_id = t2.claimt_id AND t1.shared_ip = t2.orig_ip_addr; -- Apply exponential decay and quantile scoring of to obtain different score components DROP TABLE IF EXISTS tmp.ip_share_claimantweek6; CREATE TABLE tmp.ip_share_claimantweek6 AS SELECT *, NTILE(20) OVER (ORDER BY unique_users_in_week) * 5 as weekly_users_score, NTILE(20) OVER (ORDER BY prev_unique_users) * 5 as all_time_users_score, ROUND(EXP(diffseconds * -1 * (SELECT CAST((SELECT parm_val FROM ref.parm WHERE parm_cd = 'IP_DECAY_FACTOR') AS FLOAT))) --decay_factor (chosen such that a score of 100 is received up to 15 minutes in between submissions) * 100) as time_between_submissions_score FROM tmp.ip_share_claimantweek5; --Create the final table with the overall score from these variables and subset down to only include scores from the most recent bus_perd_end_dt DROP TABLE IF EXISTS tmp.precursor_claimant_sharing_ips; CREATE TABLE tmp.precursor_claimant_sharing_ips AS SELECT t1.claimt_id, t1.matched_claimants, t1.shared_ip, t1.bus_perd_end_dt, t1.diffseconds, t1.prev_unique_users, t1.unique_users_in_week, t1.weekly_users_score, t1.all_time_users_score, t1.time_between_submissions_score, t1.adj_final_score, CASE WHEN t1.adj_final_score > 100 THEN 100 ELSE t1.adj_final_score END AS final_score FROM ( SELECT *, CASE WHEN ip_outsd_local_st_flag IS TRUE AND ip_outsd_local_st_flag IS NOT NULL THEN weekly_users_score * 0.4 + time_between_submissions_score * 0.4 + all_time_users_score * 0.2 + 20 ELSE weekly_users_score * 0.4 + time_between_submissions_score * 0.4 + all_time_users_score * 0.2 END AS adj_final_score FROM tmp.ip_share_claimantweek6 WHERE bus_perd_end_dt = (SELECT MAX(bus_perd_end_dt) FROM tmp.ip_share_claimantdiffs)) t1; -- Insert Score attributes into claimant sharing attributes table DELETE FROM nrd.ipa_ship_ds WHERE cycl_dt = '${APM_CYCL_DT}'::date; INSERT INTO nrd.ipa_ship_ds (cycl_dt, claimt_id, orig_ip_addr, matchd_claimt_id_array, uniq_claimt_cnt, cuml_uniq_claimt_cnt, min_sessn_gap_cnt, crt_tmstmp) SELECT '${APM_CYCL_DT}'::date, claimt_id, shared_ip, matched_claimants, unique_users_in_week, prev_unique_users, diffseconds, CURRENT_TIMESTAMP FROM tmp.precursor_claimant_sharing_ips; /* Insert subscores into scoring table */ DELETE FROM nrd.enty_score WHERE cycl_dt = '${APM_CYCL_DT}'::date AND score_cd IN ('IPA_SHIP_PERD','IPA_SHIP_ALL','IPA_SHIP_TIME','IPA_SHIP_RAW','IPA_SHIP'); --Inserting weekly users score INSERT INTO nrd.enty_score (cycl_dt, enty_type_cd, enty_id, score_cd, score_val, crt_tmstmp) SELECT '${APM_CYCL_DT}'::date, 'CLAIMT', claimt_id, 'IPA_SHIP_PERD', weekly_users_score, CURRENT_TIMESTAMP FROM tmp.precursor_claimant_sharing_ips; --Inserting all-time users score INSERT INTO nrd.enty_score (cycl_dt, enty_type_cd, enty_id, score_cd, score_val, crt_tmstmp) SELECT '${APM_CYCL_DT}'::date, 'CLAIMT', claimt_id, 'IPA_SHIP_ALL', all_time_users_score, CURRENT_TIMESTAMP FROM tmp.precursor_claimant_sharing_ips; --Inserting time between claims score INSERT INTO nrd.enty_score (cycl_dt, enty_type_cd, enty_id, score_cd, score_val, crt_tmstmp) SELECT '${APM_CYCL_DT}'::date, 'CLAIMT', claimt_id, 'IPA_SHIP_TIME', time_between_submissions_score, CURRENT_TIMESTAMP FROM tmp.precursor_claimant_sharing_ips; --Inserting the adjusted final score (before flooring any scores above 100 back down to 100) INSERT INTO nrd.enty_score (cycl_dt, enty_type_cd, enty_id, score_cd, score_val, crt_tmstmp) SELECT '${APM_CYCL_DT}'::date, 'CLAIMT', claimt_id, 'IPA_SHIP_RAW', adj_final_score, CURRENT_TIMESTAMP FROM tmp.precursor_claimant_sharing_ips; --Basic Insert of final scores INSERT INTO nrd.enty_score (cycl_dt, enty_type_cd, enty_id, score_cd, score_val, crt_tmstmp) SELECT '${APM_CYCL_DT}'::date, 'CLAIMT', claimt_id, 'IPA_SHIP', final_score, CURRENT_TIMESTAMP FROM tmp.precursor_claimant_sharing_ips; DROP TABLE IF EXISTS tmp.precursor_claimant_sharing_ips; DROP TABLE IF EXISTS tmp.ip_share_claimantweek6; DROP TABLE IF EXISTS tmp.ip_share_claimantweek5; DROP TABLE IF EXISTS tmp.ip_share_claimantweek4; DROP TABLE IF EXISTS tmp.ip_share_claimantweek3; DROP TABLE IF EXISTS tmp.ip_share_all_users1; DROP TABLE IF EXISTS tmp.ip_share_claimantweek2; DROP TABLE IF EXISTS tmp.ip_share_claimantweek; DROP TABLE IF EXISTS tmp.ip_share_claimantdiffs;
<filename>sql/titv-by-genomic-window-fail.sql<gh_stars>0 # Select variant ids for which the ti/tv ratio for a given window is outside a defined range. SELECT var.variant_id AS variant_id, titv, "titv_by_genomic_window" AS failure_reason, FROM ( SELECT variant_id, reference_name, start, end, INTEGER(FLOOR(start / 100000)) AS window, FROM [_THE_EXPANDED_TABLE_] OMIT call IF EVERY(call.genotype <= 0) # Optionally add clause here to limit the query to a particular # region of the genome. #_WHERE_ ) AS var JOIN ( SELECT reference_name, window, window_start, transitions, transversions, titv, num_variants_in_window, FROM ( SELECT reference_name, window, window * 100000 AS window_start, transitions, transversions, transitions/transversions AS titv, num_variants_in_window, FROM ( SELECT reference_name, window, SUM(mutation IN ('A->G', 'G->A', 'C->T', 'T->C')) AS transitions, SUM(mutation IN ('A->C', 'C->A', 'G->T', 'T->G', 'A->T', 'T->A', 'C->G', 'G->C')) AS transversions, COUNT(mutation) AS num_variants_in_window FROM ( SELECT reference_name, INTEGER(FLOOR(start / 100000)) AS window, CONCAT(reference_bases, CONCAT(STRING('->'), alternate_bases)) AS mutation, COUNT(alternate_bases) WITHIN RECORD AS num_alts, alternate_bases, reference_bases, FROM [_THE_EXPANDED_TABLE_] # Optionally add clause here to limit the query to a particular # region of the genome. WHERE reference_name = 'chr22' HAVING # Skip 1/2 genotypes _and non-SNP variants num_alts = 1 AND reference_bases IN ('A','C','G','T') AND alternate_bases IN ('A','C','G','T')) GROUP BY reference_name, window)) WHERE titv > _MAX_ OR titv < _MIN_) as win ON var.window = win.window GROUP BY variant_id, var.reference_name, win.window_start, titv, #_ORDER_BY_
<reponame>santedb/openiz<filename>OpenIZ.Warehouse.ADO/Data/SQL/PSQL/Updates/20200618-PSQL.sql -- TABLE FOR MESSAGES TO BE SENT CREATE TABLE MSG_QUEUE_TBL ( MSG_ID UUID NOT NULL DEFAULT uuid_generate_v1(), -- UNIQUE IDENTIFIER FOR THE MESSAGE CRT_UTC TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, -- CREATION TIME OF THE MESSAGE TO_ADDR VARCHAR(256) NOT NULL, -- THE PATIENT/ADDRESS WHO THE MESSAGE IS ADDRESSED TO SUB_TXT TEXT NOT NULL, -- TEXT IN THE SUBJECT BODY_TXT TEXT NOT NULL, -- TEXT IN THE BODY SCHDL_UTC DATE NOT NULL DEFAULT CURRENT_DATE, -- DATE WHEN THE MESSAGE SHOULD BE SENT SENT_UTC TIMESTAMPTZ, -- THE TIME THAT THE MESSAGE WAS SENT OUTC_CS VARCHAR(32), -- THE OUTCOME / STATUS TEXT CONSTRAINT PK_MSG_QUEUE_TBL PRIMARY KEY (MSG_ID) ); CREATE TABLE APPT_SLOT_TBL ( APPT_SLOT_ID UUID NOT NULL DEFAULT uuid_generate_v1(), -- UUID FOR APPT SLOT MSG_ID UUID NOT NULL, -- UNIQUE IDENTIFIER FOR THE MESSAGE PAT_ID UUID NOT NULL, -- PATIENT ID APPT_DT TIMESTAMP NOT NULL, -- SENT PROPOSAL TIME PLC_ID UUID NOT NULL, -- LOCATION CONSTRAINT PK_APPT_SLOT_TBL PRIMARY KEY (APPT_SLOT_ID), CONSTRAINT FK_APPT_SLOT_MSG_TBL FOREIGN KEY (MSG_ID) REFERENCES MSG_QUEUE_TBL (MSG_ID), CONSTRAINT FK_APPT_SLOT_PAT_TBL FOREIGN KEY (PAT_ID) REFERENCES PAT_TBL(PAT_ID), CONSTRAINT FK_APPT_SLOT_PLC_TBL FOREIGN KEY (PLC_ID) REFERENCES FAC_TBL(FAC_ID) ); CREATE TABLE MSG_QUEUE_LOG_TBL ( LOG_ID UUID NOT NULL DEFAULT uuid_generate_v1(), MSG_ID UUID NOT NULL, -- THE MESSAGE ASSOCIATED PAT_ID UUID NOT NULL, -- THE PATIENT ASSOCIATED REF_ID UUID NOT NULL, -- ANY REFERENCE ID YOU LIKE PROC_NAME VARCHAR(32) NOT NULL, -- THE PROCESS THAT SENT THE MESSAGE CONSTRAINT PK_MSG_QUEUE_LOG_TBL PRIMARY KEY (LOG_ID), CONSTRAINT FK_MSG_QUEUE_PAT_TBL FOREIGN KEY (PAT_ID) REFERENCES PAT_TBL(PAT_ID), CONSTRAINT FK_MSG_QUEUE_MSG_TBL FOREIGN KEY (MSG_ID) REFERENCES MSG_QUEUE_TBL(MSG_ID) ); CREATE INDEX MSG_QUEUE_LOG_REF_IDX ON MSG_QUEUE_LOG_TBL (REF_ID); CREATE SEQUENCE REF_AGE_RG_SEQ START WITH 1 INCREMENT BY 1; CREATE TABLE REF_AGE_RG_TBL ( AGE_CAT_ID INT NOT NULL DEFAULT nextval('REF_AGE_RG_SEQ'), FROM_DAY INT NOT NULL, TO_DAY INT NOT NULL, AGE_NAME VARCHAR(32) NOT NULL, CONSTRAINT PK_AGE_CAT_ID PRIMARY KEY (AGE_CAT_ID), CONSTRAINT CK_AGE_DATE_RG CHECK (TO_DAY > FROM_DAY) ); INSERT INTO REF_AGE_RG_TBL (FROM_DAY, TO_DAY, AGE_NAME) VALUES (0, 42, '< 6 WKS'); INSERT INTO REF_AGE_RG_TBL (FROM_DAY, TO_DAY, AGE_NAME) VALUES (42, 279, '6 WKS - 9 MO'); INSERT INTO REF_AGE_RG_TBL (FROM_DAY, TO_DAY, AGE_NAME) VALUES (279, 36500, '> 9 MO'); CREATE TABLE act_list_mat_tbl ( act_id UUID NOT NULL, mmat_id UUID NOT NULL, qty INT NOT NULL, vvm_cs VARCHAR(32), CONSTRAINT pk_act_list_mat_tbl PRIMARY KEY (act_id, mmat_id), CONSTRAINT fk_act_list_mat_list FOREIGN KEY (act_id) REFERENCES act_list_tbl(act_id), CONSTRAINT fk_act_list_mat_mat FOREIGN KEY (mmat_id) REFERENCES mmat_tbl(mmat_id) );
<filename>blog/src/main/resources/sql/create-table.sql -- use lfz; -- set NAMES utf8mb4; -- pxc5.7.22 CREATE TABLE IF NOT EXISTS blog ( id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', title varchar(50) NOT NULL DEFAULT '' COMMENT '博客标题', real_content TEXT NOT NULL COMMENT '文章的实际内容,md', show_content TEXT NOT NULL COMMENT '文章显示的内容,html', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`), index idx_title(title) )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='博客表'; CREATE TABLE IF NOT EXISTS `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', `user_name` varchar(10) NOT NULL DEFAULT '' COMMENT '用户名', `password` varchar(50) NOT NULL DEFAULT '' COMMENT '用户密码,用户名为盐,<PASSWORD>', `roles` varchar(20) NOT NULL DEFAULT '' COMMENT '用户角色,逗号分隔', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`), UNIQUE KEY `uniq_idx_user_name` (`user_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
/* Navicat MySQL Data Transfer Source Server : MySQL-local Source Server Type : MySQL Source Server Version : 50722 Source Host : localhost:3306 Source Schema : authority_db Target Server Type : MySQL Target Server Version : 50722 File Encoding : 65001 Date: 21/06/2018 16:09:52 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for account_groups -- ---------------------------- DROP TABLE IF EXISTS `account_groups`; CREATE TABLE `account_groups` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `account_id` int(11) NULL DEFAULT NULL, `group_id` int(11) NULL DEFAULT NULL, `create_at` datetime(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for accounts -- ---------------------------- DROP TABLE IF EXISTS `accounts`; CREATE TABLE `accounts` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `password` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `create_at` datetime(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for action_groups -- ---------------------------- DROP TABLE IF EXISTS `action_groups`; CREATE TABLE `action_groups` ( `id` int(11) NOT NULL, `action_id` int(11) NULL DEFAULT NULL, `group_id` int(11) NULL DEFAULT NULL, `create_at` datetime(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for actions -- ---------------------------- DROP TABLE IF EXISTS `actions`; CREATE TABLE `actions` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `lable` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `create_at` datetime(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for groups -- ---------------------------- DROP TABLE IF EXISTS `groups`; CREATE TABLE `groups` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `lable` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `create_at` datetime(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for menus -- ---------------------------- DROP TABLE IF EXISTS `menus`; CREATE TABLE `menus` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源名称', `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源 URL', `icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单图标', `type` int(11) NULL DEFAULT NULL COMMENT '类型 1:菜单, 2:按钮/链接', `sort` int(11) NULL DEFAULT NULL COMMENT '排序', `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', `parent_id` int(11) NULL DEFAULT NULL COMMENT '父菜单ID, 一级菜单未0', `permission` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '授权(如:role:create)', `create_user` int(11) NULL DEFAULT NULL COMMENT '创建用户', `update_user` int(11) NULL DEFAULT NULL COMMENT '修改用户', `create_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for migration -- ---------------------------- DROP TABLE IF EXISTS `migration`; CREATE TABLE `migration` ( `version` varchar(180) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `apply_time` int(11) NULL DEFAULT NULL, PRIMARY KEY (`version`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `phone` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, `auth_key` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `password_hash` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `password_reset_token` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, `status` smallint(6) NOT NULL DEFAULT 10, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `username`(`username`) USING BTREE, UNIQUE INDEX `email`(`email`) USING BTREE, UNIQUE INDEX `password_reset_token`(`<PASSWORD>`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 4.3.13.3 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: 2016-05-08 12:29:59 -- 服务器版本: 5.6.26 -- PHP Version: 5.5.31 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: `blogdemo2db` -- -- -------------------------------------------------------- -- -- 表的结构 `adminuser` -- CREATE TABLE IF NOT EXISTS `adminuser` ( `id` int(11) NOT NULL, `username` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `nickname` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `profile` text COLLATE utf8_unicode_ci ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `adminuser` -- INSERT INTO `adminuser` (`id`, `username`, `nickname`, `password`, `email`, `profile`) VALUES (1, 'weixi', '魏曦', <PASSWORD>', '<EMAIL>', 'hello,this is my profile'), (2, 'chengcheng', '程城', <PASSWORD>20K81ZdERPDyFq2EM31e6KjmmdNRtGmCC6Fq9NST3hWhcgoPqUy', '<EMAIL>', 'a testing user'), (3, 'heyx', '何永兴', '$2y$13$RZ20K81ZdERPDyFq2EM31e6KjmmdNRtGmCC6Fq9NST3hWhcgoPqUy', '<EMAIL>', 'a testing user'); -- -------------------------------------------------------- -- -- 表的结构 `comment` -- CREATE TABLE IF NOT EXISTS `comment` ( `id` int(11) NOT NULL, `content` text COLLATE utf8_unicode_ci NOT NULL, `status` int(11) NOT NULL, `create_time` int(11) DEFAULT NULL, `userid` int(11) NOT NULL, `email` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `url` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `post_id` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=96 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `comment` -- INSERT INTO `comment` (`id`, `content`, `status`, `create_time`, `userid`, `email`, `url`, `post_id`) VALUES (88, '假设你想通过 RESTful 风格的 API 来展示用户数据。用户数据被存储在用户DB表, 你已经创建了 yii\\db\\ActiveRecord 类 app\\models\\User 来访问该用户数据.', 2, 1443004317, 1, '<EMAIL>', '', 41), (89, 'yii\\db\\Query::one() 方法只返回查询结果当中的第一条数据, 条件语句中不会加上 LIMIT 1 条件。如果你清楚的知道查询将会只返回一行或几行数据 (例如, 如果你是通过某些主键来查询的),这很好也提倡这样做。但是,如果查询结果 有机会返回大量的数据时,那么你应该显示调用 limit(1) 方法,以改善性能。 例如, (new \\yii\\db\\Query())->from(''user'')->limit(1)->one()。', 2, 1443004455, 1, '<EMAIL>', '', 39), (90, '传说中的沙发。', 2, 1443004561, 1, '<EMAIL>', '', 34), (91, '当你在调用 yii\\db\\Query::all() 方法时,它将返回一个以连续的整型数值为索引的数组。 而有时候你可能希望使用一个特定的字段或者表达式的值来作为索引结果集数组。那么你可以在调用 yii\\db\\Query::all() 之前使用 yii\\db\\Query::indexBy() 方法来达到这个目的。', 2, 1443047988, 1, '<EMAIL>', '', 39), (92, '如需使用表达式的值做为索引,那么只需要传递一个匿名函数给 yii\\db\\Query::indexBy() 方法即可', 2, 1443049673, 1, '<EMAIL>', '', 39), (93, 'yii\\db\\Query::one() 方法只返回查询结果当中的第一条数据, 条件语句中不会加上 LIMIT 1 条', 2, 1443927141, 1, '<EMAIL>', '', 39), (94, '你应该在 响应格式 部分中过滤掉这些字段。', 1, 1444267750, 1, '<EMAIL>', 'www.wj.com', 41), (95, '适合用常规格式显示一个模型(例如在一个表格的一行中显示模型的每个属性)。', 1, 1444377054, 1, '<EMAIL>', 'www.baidu.<EMAIL>', 36); -- -------------------------------------------------------- -- -- 表的结构 `commentstatus` -- CREATE TABLE IF NOT EXISTS `commentstatus` ( `id` int(11) NOT NULL, `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `position` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `commentstatus` -- INSERT INTO `commentstatus` (`id`, `name`, `position`) VALUES (1, '待审核', 1), (2, '已审核', 2); -- -------------------------------------------------------- -- -- 表的结构 `migration` -- CREATE TABLE IF NOT EXISTS `migration` ( `version` varchar(180) COLLATE utf8_unicode_ci NOT NULL, `apply_time` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `migration` -- INSERT INTO `migration` (`version`, `apply_time`) VALUES ('m000000_000000_base', 1462597684), ('m130524_201442_init', 1462597693); -- -------------------------------------------------------- -- -- 表的结构 `post` -- CREATE TABLE IF NOT EXISTS `post` ( `id` int(11) NOT NULL, `title` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `content` text COLLATE utf8_unicode_ci NOT NULL, `tags` text COLLATE utf8_unicode_ci, `status` int(11) NOT NULL, `create_time` int(11) DEFAULT NULL, `update_time` int(11) DEFAULT NULL, `author_id` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `post` -- -- -------------------------------------------------------- -- -- 表的结构 `poststatus` -- CREATE TABLE IF NOT EXISTS `poststatus` ( `id` int(11) NOT NULL, `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `position` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `poststatus` -- INSERT INTO `poststatus` (`id`, `name`, `position`) VALUES (1, '草稿', 1), (2, '已发布', 2), (3, '已归档', 3); -- -------------------------------------------------------- -- -- 表的结构 `tag` -- CREATE TABLE IF NOT EXISTS `tag` ( `id` int(11) NOT NULL, `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `frequency` int(11) DEFAULT '1' ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `tag` -- INSERT INTO `tag` (`id`, `name`, `frequency`) VALUES (60, 'Yii', 113), (61, 'RESTful Web服务', 57), (62, 'Yii2', 293), (63, 'Gii', 59), (64, '查询构建器', 54), (65, 'DAO', 54), (66, 'GridView', 57), (67, 'ListView', 57), (68, 'DetailView', 57), (69, 'ActiveRecord', 113), (70, '安装', 4), (71, 'Composer', 4), (72, '小部件', 1), (73, 'widget', 1), (74, '视频教程', 1), (75, '教程', 1); -- -------------------------------------------------------- -- -- 表的结构 `user` -- CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `status` smallint(6) NOT NULL DEFAULT '10', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `user` -- INSERT INTO `user` (`id`, `username`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `status`, `created_at`, `updated_at`) VALUES (1, 'weixi', 'pG7TRyTIXlEbcenpi34TzmMYS2zDsMTF', '$2y$13$HtJqGRmc76KIRIwokii8AOQ1XZljXiuWCKUGFnH9vkTnfBpHtqgFu', NULL, '<EMAIL>', 10, 1462597929, 1462597929); -- -- Indexes for dumped tables -- -- -- Indexes for table `adminuser` -- ALTER TABLE `adminuser` ADD PRIMARY KEY (`id`); -- -- Indexes for table `comment` -- ALTER TABLE `comment` ADD PRIMARY KEY (`id`), ADD KEY `FK_comment_post` (`post_id`), ADD KEY `FK_comment_user` (`userid`), ADD KEY `FK_comment_status` (`status`); -- -- Indexes for table `commentstatus` -- ALTER TABLE `commentstatus` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migration` -- ALTER TABLE `migration` ADD PRIMARY KEY (`version`); -- -- Indexes for table `post` -- ALTER TABLE `post` ADD PRIMARY KEY (`id`), ADD KEY `FK_post_author` (`author_id`), ADD KEY `FK_post_status` (`status`); -- -- Indexes for table `poststatus` -- ALTER TABLE `poststatus` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tag` -- ALTER TABLE `tag` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `username` (`username`), ADD UNIQUE KEY `email` (`email`), ADD UNIQUE KEY `password_reset_token` (`password_reset_token`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `adminuser` -- ALTER TABLE `adminuser` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `comment` -- ALTER TABLE `comment` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1; -- -- AUTO_INCREMENT for table `commentstatus` -- ALTER TABLE `commentstatus` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `post` -- ALTER TABLE `post` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `poststatus` -- ALTER TABLE `poststatus` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tag` -- ALTER TABLE `tag` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=76; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- 限制导出的表 -- -- -- 限制表 `comment` -- ALTER TABLE `comment` ADD CONSTRAINT `FK_comment_post` FOREIGN KEY (`post_id`) REFERENCES `post` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `FK_comment_status` FOREIGN KEY (`status`) REFERENCES `commentstatus` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `FK_comment_user` FOREIGN KEY (`userid`) REFERENCES `user` (`id`) ON DELETE CASCADE; -- -- 限制表 `post` -- ALTER TABLE `post` ADD CONSTRAINT `FK_post_author` FOREIGN KEY (`author_id`) REFERENCES `adminuser` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `FK_post_status` FOREIGN KEY (`status`) REFERENCES `poststatus` (`id`) ON DELETE CASCADE; /*!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 */;
<reponame>nadiiiiia/INASSURE2 -- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 23, 2017 at 02:08 PM -- Server version: 5.6.17 -- PHP Version: 5.5.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `project` -- -- -------------------------------------------------------- -- -- Table structure for table `file` -- CREATE TABLE IF NOT EXISTS `file` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=13 ; -- -- Dumping data for table `file` -- INSERT INTO `file` (`id`, `name`, `path`) VALUES (1, 'file1', 'export.xlsx'), (2, 'test', 'export.xlsx'), (3, 'test', 'export.xlsx'), (4, 'file1', 'export.xlsx'), (5, 'file1', 'export.xlsx'), (6, 'file1', 'export.xlsx'), (7, 'file1', 'export.xlsx'), (8, 'file1', 'export.xlsx'), (9, 'file1', 'export.xlsx'), (10, 'file1', 'export.xlsx'), (11, '<NAME>', 'export.xlsx'), (12, 'file1', 'export.xlsx'); -- -------------------------------------------------------- -- -- Table structure for table `log` -- CREATE TABLE IF NOT EXISTS `log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `date` date NOT NULL, `type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `file_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `IDX_8F3F68C5A76ED395` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `meet` -- CREATE TABLE IF NOT EXISTS `meet` ( `id` int(11) NOT NULL AUTO_INCREMENT, `agent_id` int(11) DEFAULT NULL, `customer_id` int(11) DEFAULT NULL, `nom` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `tel1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `tel2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `tel3` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fax1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fax2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `surname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `adresse` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ville` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `npa` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nom_modif` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `prenom_modif` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `age` int(11) DEFAULT NULL, `age_enfant1` int(11) DEFAULT NULL, `age_enfant2` int(11) DEFAULT NULL, `age_enfant3` int(11) DEFAULT NULL, `age_enfant` int(11) DEFAULT NULL, `age_conjoint` int(11) DEFAULT NULL, `non_sante` int(11) DEFAULT NULL, `nom_medicament` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `subside_combien` int(11) DEFAULT NULL, `adrese_modif` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `localite_modif` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `NPA_modif` int(11) DEFAULT NULL, `etage_app` int(11) DEFAULT NULL, `code_acces` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `natel` int(11) DEFAULT NULL, `commentaire` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Mr_caisse_maladie_base` int(11) DEFAULT NULL, `mr_caisse_maladie_LCA` int(11) DEFAULT NULL, `enfant1_caisse_maladie_base` int(11) DEFAULT NULL, `enfant1_caisse_maladie_LCA` int(11) DEFAULT NULL, `enfant2_caisse_maladie_base` int(11) DEFAULT NULL, `enfant2_caisse_maladie__LCA` int(11) DEFAULT NULL, `enfant3_caisse_maladie_base` int(11) DEFAULT NULL, `enfant3_caisse_maladie_LCA` int(11) DEFAULT NULL, `enfant4_caisse_maladie_base` int(11) DEFAULT NULL, `enfant4_caisse_maladie_LCA` int(11) DEFAULT NULL, `navigateur` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `UserName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `base_com_modif` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `LCA_com_modif` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `situation_familiale_modif` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nombre_enfant_modif` int(11) DEFAULT NULL, `famille_caisse_maladie_oui` tinyint(1) DEFAULT NULL, `Mr_caisse_maladie_base_liste` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Mr_caisse_maladie_LCA_liste` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Enfant1_caisse_maladie_base_liste` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Enfant1_caisse_maladie_lca_list` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Enfant2_caisse_maladie_base_list` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Enfant2_caisse_maladie_lca_list` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Enfant3_caisse_maladie_base_list` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Enfant3_caisse_maladie_lca_list` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Enfant4_caisse_maladie_base_list` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `Enfant4_caisse_maladie_lca_list` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sante` tinyint(1) DEFAULT NULL, `consommation_medicam` tinyint(1) DEFAULT NULL, `decission` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `travaille_mr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `travaille_madame` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `subside_modif` tinyint(1) DEFAULT NULL, `franchise_Mme` int(11) DEFAULT NULL, `Mr_franchise` int(11) DEFAULT NULL, `Enfant1_franchise` int(11) DEFAULT NULL, `enfant2_franchise` int(11) DEFAULT NULL, `enfant3_franchise` int(11) DEFAULT NULL, `enfant4_franchise` int(11) DEFAULT NULL, `habitation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rdv_prie` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_INDICE_CONTACT` int(11) DEFAULT NULL, `CMK_S_FIELD_TELEPHONE_COMPOSE` int(11) DEFAULT NULL, `CMK_S_FIELD_DATE_DEBUT_TRAITEMENT` date DEFAULT NULL, `CMK_S_FIELD_DATEHEURETRAITEMENT` date DEFAULT NULL, `CMK_S_FIELD_DATETRAITEMENT` date DEFAULT NULL, `CMK_S_FIELD_HEURETRAITEMENT` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_DATEHEURE_RACCROCHE` date DEFAULT NULL, `CMK_S_FIELD_DATE_DEBUT_RACCROCHE` date DEFAULT NULL, `CMK_S_FIELD_HEURE_DEBUT_RACCROCHE` date DEFAULT NULL, `CMK_S_FIELD_DATEHEURE_DEBUT_RAPPEL_PREVU` date DEFAULT NULL, `CMK_S_FIELD_DATE_DEBUT_RAPPEL_PREVU` date DEFAULT NULL, `CMK_S_FIELD_HEURE_DEBUT_RAPPEL_PREVU` date DEFAULT NULL, `CMK_S_FIELD_DUREE_APPEL` int(11) DEFAULT NULL, `CMK_S_FIELD_DUREE_ATTENTE` int(11) DEFAULT NULL, `CMK_S_FIELD_DUREE_COMMUNICATION` int(11) DEFAULT NULL, `CMK_S_FIELD_DUREE_POST_APPEL` int(11) DEFAULT NULL, `CMK_S_FIELD_DUREE_TRAITEMENT` int(11) DEFAULT NULL, `CMK_S_FIELD_DUREE_PRODUCTION` int(11) DEFAULT NULL, `CMK_S_FIELD_NOMCAMPAGNE` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_NOMFICHIER` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_QUALIFICATION_MERE` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_QUALIFICATION` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_CODE_QUALIFICATION` int(11) DEFAULT NULL, `CMK_S_FIELD_COMMENTAIRES` int(11) DEFAULT NULL, `CMK_S_FIELD_NUM_IMPORT` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_NOM_IMPORT` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_DATE_IMPORT` date DEFAULT NULL, `CMK_S_FIELD_AGENT_NOM` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_AGENT_LOGIN` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_POSTE_AGENT` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_INDICE_AGENT` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_1` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_2` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_3` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_4` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_5` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_6` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_7` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_8` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_9` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_10` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_11` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_12` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_13` int(11) DEFAULT NULL, `cCMK_S_FIELD_TENTATIVES_14` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_15` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_16` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_17` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_18` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_19` int(11) DEFAULT NULL, `CMK_S_FIELD_TENTATIVES_20` int(11) DEFAULT NULL, `CMK_S_FIELD_COMMERCIAL_NOM` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_COMMERCIAL_DATE` date DEFAULT NULL, `CMK_S_FIELD_COMMERCIAL_RDV_HEUREMINUTE` int(11) DEFAULT NULL, `CMK_S_FIELD_COMMERCIAL_RDV_HEURE` int(11) DEFAULT NULL, `CMK_S_FIELD_COMMERCIAL_RDV_MINUTE` int(11) DEFAULT NULL, `CMK_S_FIELD_COMMERCIAL_RDV_OBSERVATION` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `CMK_S_FIELD_COMMERCIAL_RDV_ETAT` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cmk_nom_fichier` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cmk_nom_commercial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cmk_date_prise_comm` date DEFAULT NULL, `cmk_date_rdv_comm` date DEFAULT NULL, `cmk_observation_comm` date DEFAULT NULL, `ref_contact_crm` int(11) DEFAULT NULL, `tel_crm` int(11) DEFAULT NULL, `poste_crm` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `agent_crm` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `login_agent_crm` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `qualification_commercial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `observation_commercial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_start_commercial` date DEFAULT NULL, `date_end_commercial` date DEFAULT NULL, `duration_commercial` int(11) DEFAULT NULL, `duration_call_commercial` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `IDX_E9F6D3CE3414710B` (`agent_id`), KEY `IDX_E9F6D3CE9395C3F3` (`customer_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9 ; -- -- Dumping data for table `meet` -- INSERT INTO `meet` (`id`, `agent_id`, `customer_id`, `nom`, `tel1`, `tel2`, `tel3`, `fax1`, `fax2`, `surname`, `adresse`, `ville`, `npa`, `nom_modif`, `prenom_modif`, `age`, `age_enfant1`, `age_enfant2`, `age_enfant3`, `age_enfant`, `age_conjoint`, `non_sante`, `nom_medicament`, `subside_combien`, `adrese_modif`, `localite_modif`, `NPA_modif`, `etage_app`, `code_acces`, `natel`, `commentaire`, `Mr_caisse_maladie_base`, `mr_caisse_maladie_LCA`, `enfant1_caisse_maladie_base`, `enfant1_caisse_maladie_LCA`, `enfant2_caisse_maladie_base`, `enfant2_caisse_maladie__LCA`, `enfant3_caisse_maladie_base`, `enfant3_caisse_maladie_LCA`, `enfant4_caisse_maladie_base`, `enfant4_caisse_maladie_LCA`, `navigateur`, `UserName`, `base_com_modif`, `LCA_com_modif`, `situation_familiale_modif`, `nombre_enfant_modif`, `famille_caisse_maladie_oui`, `Mr_caisse_maladie_base_liste`, `Mr_caisse_maladie_LCA_liste`, `Enfant1_caisse_maladie_base_liste`, `Enfant1_caisse_maladie_lca_list`, `Enfant2_caisse_maladie_base_list`, `Enfant2_caisse_maladie_lca_list`, `Enfant3_caisse_maladie_base_list`, `Enfant3_caisse_maladie_lca_list`, `Enfant4_caisse_maladie_base_list`, `Enfant4_caisse_maladie_lca_list`, `sante`, `consommation_medicam`, `decission`, `travaille_mr`, `travaille_madame`, `subside_modif`, `franchise_Mme`, `Mr_franchise`, `Enfant1_franchise`, `enfant2_franchise`, `enfant3_franchise`, `enfant4_franchise`, `habitation`, `rdv_prie`, `CMK_S_FIELD_INDICE_CONTACT`, `CMK_S_FIELD_TELEPHONE_COMPOSE`, `CMK_S_FIELD_DATE_DEBUT_TRAITEMENT`, `CMK_S_FIELD_DATEHEURETRAITEMENT`, `CMK_S_FIELD_DATETRAITEMENT`, `CMK_S_FIELD_HEURETRAITEMENT`, `CMK_S_FIELD_DATEHEURE_RACCROCHE`, `CMK_S_FIELD_DATE_DEBUT_RACCROCHE`, `CMK_S_FIELD_HEURE_DEBUT_RACCROCHE`, `CMK_S_FIELD_DATEHEURE_DEBUT_RAPPEL_PREVU`, `CMK_S_FIELD_DATE_DEBUT_RAPPEL_PREVU`, `CMK_S_FIELD_HEURE_DEBUT_RAPPEL_PREVU`, `CMK_S_FIELD_DUREE_APPEL`, `CMK_S_FIELD_DUREE_ATTENTE`, `CMK_S_FIELD_DUREE_COMMUNICATION`, `CMK_S_FIELD_DUREE_POST_APPEL`, `CMK_S_FIELD_DUREE_TRAITEMENT`, `CMK_S_FIELD_DUREE_PRODUCTION`, `CMK_S_FIELD_NOMCAMPAGNE`, `CMK_S_FIELD_NOMFICHIER`, `CMK_S_FIELD_QUALIFICATION_MERE`, `CMK_S_FIELD_QUALIFICATION`, `CMK_S_FIELD_CODE_QUALIFICATION`, `CMK_S_FIELD_COMMENTAIRES`, `CMK_S_FIELD_NUM_IMPORT`, `CMK_S_FIELD_NOM_IMPORT`, `CMK_S_FIELD_DATE_IMPORT`, `CMK_S_FIELD_AGENT_NOM`, `CMK_S_FIELD_AGENT_LOGIN`, `CMK_S_FIELD_POSTE_AGENT`, `CMK_S_FIELD_INDICE_AGENT`, `CMK_S_FIELD_TENTATIVES_1`, `CMK_S_FIELD_TENTATIVES_2`, `CMK_S_FIELD_TENTATIVES_3`, `CMK_S_FIELD_TENTATIVES_4`, `CMK_S_FIELD_TENTATIVES_5`, `CMK_S_FIELD_TENTATIVES_6`, `CMK_S_FIELD_TENTATIVES_7`, `CMK_S_FIELD_TENTATIVES_8`, `CMK_S_FIELD_TENTATIVES_9`, `CMK_S_FIELD_TENTATIVES_10`, `CMK_S_FIELD_TENTATIVES_11`, `CMK_S_FIELD_TENTATIVES_12`, `CMK_S_FIELD_TENTATIVES_13`, `cCMK_S_FIELD_TENTATIVES_14`, `CMK_S_FIELD_TENTATIVES_15`, `CMK_S_FIELD_TENTATIVES_16`, `CMK_S_FIELD_TENTATIVES_17`, `CMK_S_FIELD_TENTATIVES_18`, `CMK_S_FIELD_TENTATIVES_19`, `CMK_S_FIELD_TENTATIVES_20`, `CMK_S_FIELD_COMMERCIAL_NOM`, `CMK_S_FIELD_COMMERCIAL_DATE`, `CMK_S_FIELD_COMMERCIAL_RDV_HEUREMINUTE`, `CMK_S_FIELD_COMMERCIAL_RDV_HEURE`, `CMK_S_FIELD_COMMERCIAL_RDV_MINUTE`, `CMK_S_FIELD_COMMERCIAL_RDV_OBSERVATION`, `CMK_S_FIELD_COMMERCIAL_RDV_ETAT`, `cmk_nom_fichier`, `cmk_nom_commercial`, `cmk_date_prise_comm`, `cmk_date_rdv_comm`, `cmk_observation_comm`, `ref_contact_crm`, `tel_crm`, `poste_crm`, `agent_crm`, `login_agent_crm`, `qualification_commercial`, `observation_commercial`, `date_start_commercial`, `date_end_commercial`, `duration_commercial`, `duration_call_commercial`) VALUES (1, 38, NULL, 'Edward', '478957895', '4789578789', '7', '7', '7', 'George', 'Paris', '7', '7', '7', '7', 7, 7, 7, 7, 7, 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ingenieur', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (7, NULL, NULL, 'alain', NULL, NULL, NULL, NULL, NULL, 'gor', 'Paris', 'Paris', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (8, NULL, NULL, 'alem', NULL, NULL, NULL, NULL, NULL, 'sa', 'tunis', 'tunis', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `username_canonical` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `email_canonical` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `enabled` tinyint(1) NOT NULL, `salt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `last_login` datetime DEFAULT NULL, `locked` tinyint(1) NOT NULL, `expired` tinyint(1) NOT NULL, `expires_at` datetime DEFAULT NULL, `confirmation_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `password_requested_at` datetime DEFAULT NULL, `roles` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:array)', `credentials_expired` tinyint(1) NOT NULL, `credentials_expire_at` datetime DEFAULT NULL, `phone_number` int(11) DEFAULT NULL, `address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `picture_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'icone.PNG', PRIMARY KEY (`id`), UNIQUE KEY `UNIQ_8D93D64992FC23A8` (`username_canonical`), UNIQUE KEY `UNIQ_8D93D649A0D96FBF` (`email_canonical`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=39 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `username`, `username_canonical`, `email`, `email_canonical`, `enabled`, `salt`, `password`, `last_login`, `locked`, `expired`, `expires_at`, `confirmation_token`, `password_requested_at`, `roles`, `credentials_expired`, `credentials_expire_at`, `phone_number`, `address`, `picture_name`) VALUES (38, 'direction', 'direction', '<EMAIL>', '<EMAIL>', 1, 'eivcmb1aa8oc0o480scs4wss88ok40c', '$2y$13$eivcmb1aa8oc0o480scs4u6ro.Dh4eiARwdVYpIg0MlFVASToOmjm', '2017-03-23 12:22:38', 0, 0, NULL, NULL, NULL, 'a:1:{i:0;s:13:"ROLE_AGENTTFR";}', 0, NULL, NULL, NULL, 'icone.PNG'); -- -- Constraints for dumped tables -- -- -- Constraints for table `log` -- ALTER TABLE `log` ADD CONSTRAINT `FK_8F3F68C5A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); -- -- Constraints for table `meet` -- ALTER TABLE `meet` ADD CONSTRAINT `FK_E9F6D3CE3414710B` FOREIGN KEY (`agent_id`) REFERENCES `user` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `FK_E9F6D3CE9395C3F3` FOREIGN KEY (`customer_id`) REFERENCES `user` (`id`) ON DELETE CASCADE; /*!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 */;
<reponame>digice/sqlayer CREATE USER 'test'@'%' IDENTIFIED WITH mysql_native_password AS '<PASSWORD>'; GRANT USAGE ON *.* TO 'test'@'%' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; CREATE DATABASE IF NOT EXISTS `test`; GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'%';
<reponame>vaibhav-bot-bhopal/nishant.in<gh_stars>0 -- MySQL dump 10.13 Distrib 8.0.26, for Win64 (x86_64) -- -- Host: 127.0.0.1 Database: blueolz8_nishant -- ------------------------------------------------------ -- Server version 8.0.26 /*!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 */; /*!50503 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 `failed_jobs` -- DROP TABLE IF EXISTS `failed_jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `failed_jobs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `failed_jobs` -- LOCK TABLES `failed_jobs` WRITE; /*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */; /*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `galleries` -- DROP TABLE IF EXISTS `galleries`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `galleries` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `original_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `filename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `file_size` bigint NOT NULL, `file_path` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `galleries` -- LOCK TABLES `galleries` WRITE; /*!40000 ALTER TABLE `galleries` DISABLE KEYS */; INSERT INTO `galleries` VALUES (34,'SDTRx1.jpg','7fe76a976749b2c9e13ddf3e5d327e32ba63e2c1.jpg',1178373,'C:\\xampp\\htdocs\\nishant.in\\storage\\app/public/gallery\\7fe76a976749b2c9e13ddf3e5d327e32ba63e2c1.jpg','2021-07-06 23:48:11','2021-07-06 23:48:11'),(35,'SDTRx11.jpg','182ed336f56ff3095533989962b38230209d2744.jpg',1283584,'C:\\xampp\\htdocs\\nishant.in\\storage\\app/public/gallery\\182ed336f56ff3095533989962b38230209d2744.jpg','2021-07-06 23:48:34','2021-07-06 23:48:34'),(36,'SDTRx12.jpg','99b6903b98d4a35d6390b2d765dfdc3949d388bc.jpg',610093,'C:\\xampp\\htdocs\\nishant.in\\storage\\app/public/gallery\\99b6903b98d4a35d6390b2d765dfdc3949d388bc.jpg','2021-07-06 23:48:34','2021-07-06 23:48:34'),(37,'SDTRx17.jpg','05937e63552024ef7ab14c001d6cfd009dbfa508.jpg',1403598,'C:\\xampp\\htdocs\\nishant.in\\storage\\app/public/gallery\\05937e63552024ef7ab14c001d6cfd009dbfa508.jpg','2021-07-06 23:48:35','2021-07-06 23:48:35'),(38,'SDTRx19.jpg','768c0035825535f86c8682fc9b2c28bd44f7f505.jpg',1252853,'C:\\xampp\\htdocs\\nishant.in\\storage\\app/public/gallery\\768c0035825535f86c8682fc9b2c28bd44f7f505.jpg','2021-07-06 23:48:35','2021-07-06 23:48:35'),(39,'SDTRx26.jpg','c57ab5ae820e5e437bf821f739630474a1abe975.jpg',1046261,'C:\\xampp\\htdocs\\nishant.in\\storage\\app/public/gallery\\c57ab5ae820e5e437bf821f739630474a1abe975.jpg','2021-07-06 23:48:35','2021-07-06 23:48:35'),(43,'angular.jpg','c8019a9a94c380b0fe162647eee2548e4572cfc9.jpg',13703,'C:\\xampp\\htdocs\\nishant.in\\storage\\app/public/gallery\\c8019a9a94c380b0fe162647eee2548e4572cfc9.jpg','2021-09-17 06:24:48','2021-09-17 06:24:48'); /*!40000 ALTER TABLE `galleries` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `migrations` -- DROP TABLE IF EXISTS `migrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `migrations` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `migrations` -- LOCK TABLES `migrations` WRITE; /*!40000 ALTER TABLE `migrations` DISABLE KEYS */; INSERT INTO `migrations` VALUES (1,'2014_10_12_000000_create_users_table',1),(2,'2014_10_12_100000_create_password_resets_table',1),(3,'2019_08_19_000000_create_failed_jobs_table',1),(4,'2021_02_27_070436_create_news_englishes_table',1),(5,'2021_03_01_073111_create_testimonials_table',2),(6,'2021_03_25_072441_create_galleries_table',3); /*!40000 ALTER TABLE `migrations` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `news_englishes` -- DROP TABLE IF EXISTS `news_englishes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `news_englishes` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `date` date NOT NULL, `discription` text COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `mimages` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `news_englishes` -- LOCK TABLES `news_englishes` WRITE; /*!40000 ALTER TABLE `news_englishes` DISABLE KEYS */; INSERT INTO `news_englishes` VALUES (49,'The Legend of Kukraj','the-legend-of-kukraj','2021-03-15','<p style=\"text-align:justify;\">So let me tell you a story. The story of Kukraj. It goes back over 600 years.<br>This forest which is now Ranthambhore tiger reserve, was just a forest back then and Allauddin Khilji was the ruler of Sawai Madhopur. The only people who would cross this dense jungle were the moghia tribesmen, or the occasional traders.<br>Once there was a group of tribal people who had a huge dog with them. Dogs can sense a predator and warn you so most people kept dogs with them. Although this one they say was the size of a St. Bernard.<br>One day a rich trader travelling to Ranthambhore stumbled upon them. He noticed this dog and offered to buy it. The tribesmen, reluctant at first, gave up the dog for a handsome amount of money.<br>After only a few days, the trader, enters his house to find blood and flesh in his room. He thought the dog must have killed some cat for himself. The trader, a religious man, got so furiated that he started beating the dog badly. The dog yelped and ran away from his house.<br>A few days went by and the trader happened to cross the forest again. On this visit he went to the tribesmen to tell them about the incident but he was shocked to find the dog sleeping there. Apparently when it was beaten, instinctively it ran back to his original owners. The trader, complaining about the money he had paid for the dog lifted a big rock and smashed the dog\'s skull with it. It died then and there.<br>When he returned home he shared the whole incident with his wife, taking pride in how he had killed the dog with brutality. The woman was in shock after hearing the account. She started to cry. The trader was confused!<br>And then she told him what had happened...<br>One day when the trader was out, a giant snake entered his chamber. His wife was alone at home with no one around to help. She started yelling for help. And this dog came running into the room. Upon seeing the snake he started fighting with it and eventually killed it and saved the lady.<br>The trader felt deep, deep guilt when he learned the truth. He rode back to the tribesmen, sad and apologetic, and sat by the place where he had killed the magnificent dog, and wept for a long time cursing himself for his sin.<br>Afterwards he constructed a small temple there, in memory of the \'great dog\'. It happens to be there still and is the only temple in the world made in the name of a dog. That valley later got named Kukraj ghati after the dog. Kuk comes from sanskrit word kukkur meaning Dog, and so Kukraj means Lord of Dogs.</p><p>Today Kukraj ghati lies in an area where the terrain is so tough that tourism had to be closed. A few years back when it was still open, <NAME>, the oldest safari driver in Ranthambhore was returning with his guests very late in the evening. Suddenly he whispered \"sahab tiger, tiger, tiger!\"<br>The European tourists were thrilled to find a tiger at twilight. But Raees noticed that the tiger (most probably T42, a dominant male) was acting strange. He was sitting with his head slightly bowed, ears down and shoulders shivering. He was wagging the end of his tail vigorously, which in cats, shows confusion or fear.<br>What Raees saw next would have made anyone numb... A large, shaggy dog, grey in color, the size of a young cow, was walking towards them. The huge tiger was cowering in its presence. The dog simply took a stroll on the dirt track in front of them, came right up to the gypsy, sniffed it, looked straight into the eyes of its occupants, and walked away in the direction of the tomb of Kukraj and vanished into the dense forest...</p><p style=\"text-align:justify;\">In August 2014, we spent 11 days straight without seeing a tiger. Our guide insisted that we prayed to Kukraj. We finished the agarbatti n stuff, sat in our gypsy and \"kaawwwwww!\" a sambhar deer gave a distressed alarm call from somewhere. Suddenly atleast 20-30 langurs started running and climbed the trees. Then she appeared. Tigress T19 Krishna. Then one, two, three all her cubs followed her. Sun setting in the backdrop, and four tigers walking towards us. Regal, almost magical it was.</p>','1615808724Kukraj.jpeg','','2021-03-15 06:15:24','2021-08-14 01:53:16'); /*!40000 ALTER TABLE `news_englishes` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `password_resets` -- DROP TABLE IF EXISTS `password_resets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `password_resets` -- LOCK TABLES `password_resets` WRITE; /*!40000 ALTER TABLE `password_resets` DISABLE KEYS */; /*!40000 ALTER TABLE `password_resets` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `testimonials` -- DROP TABLE IF EXISTS `testimonials`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `testimonials` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `discription` text COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `testimonials` -- LOCK TABLES `testimonials` WRITE; /*!40000 ALTER TABLE `testimonials` DISABLE KEYS */; INSERT INTO `testimonials` VALUES (14,'<NAME>','Nishant has been a great asset to our Disneynature Tiger team throughout three years of production and is a huge pleasure to work with. He’s an excellent communicator, and a consummate diplomat, with solid technical knowledge and field skills to back it up. Nishant’s understanding of animal behaviour is a great help when assisting our expert cameramen in the jungle. His silky drone skills and hands-on gimbal experience have been invaluable, and he is always great company on location.','1615895140avatar.jpg','2021-03-16 06:15:41','2021-03-16 06:15:41'); /*!40000 ALTER TABLE `testimonials` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `users` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `role_as` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '<PASSWORD>', `status` tinyint NOT NULL DEFAULT '1', `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `users` -- LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` VALUES (1,'Admin','<EMAIL>',NULL,'$2y$10$ODsjXA1Fzn/v6GWCDbBmieNDpZD3NQAPxFWOLIBjxI17rOec.VXSq','admin',0,'s1HecEQQKj0NrdMqCgzi0ULhjI4w4VbokdEblcutEYCSmuXhlbYQ8ASQXryB','2021-02-27 03:15:13','2021-09-17 06:22:58'),(2,'SuperUser','<EMAIL>',NULL,'$2y$10$9lDJrdk/EBVJbwCrE8mtQetrXBNU6im5197WyYSsME7noy1KXHZ6q','superadmin',0,'exGMzDBBUWeuiDO0bRu6CApk6QIUgd6hYPHCmg7wVFJESgbKAPJCqny2bsrP','2021-02-27 07:12:52','2021-07-19 01:19:00'),(4,'<NAME>','<EMAIL>',NULL,'$2y$10$u2/ULTUR.oD1AhuqOTzSeeqBGF4IHRL9oRc86Mgki3Km.vkt/PSVu','admin',0,NULL,'2021-09-17 06:22:26','2021-09-17 06:22:55'); /*!40000 ALTER TABLE `users` 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 2021-11-12 15:03:39
DROP TABLE public.full_packs; DROP TABLE public.full_unpacks; DROP TABLE public.linehauls; DROP TABLE public.service_areas; DROP TABLE public.shorthauls; DROP TABLE public.zip3s; DROP TABLE public.zip5_rate_areas;
CREATE TABLE "public"."patient_live_status"("id" serial NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "facility" integer NOT NULL, "hospital_patient_id" text NOT NULL, "patient" integer NOT NULL, "severity" text NOT NULL, "test_status" text NOT NULL, "ward" integer NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("facility") REFERENCES "public"."facility"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("patient") REFERENCES "public"."patient"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("severity") REFERENCES "public"."severity"("key") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("test_status") REFERENCES "public"."test_result_status"("key") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("ward") REFERENCES "public"."ward"("id") ON UPDATE cascade ON DELETE cascade); CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"() RETURNS TRIGGER AS $$ DECLARE _new record; BEGIN _new := NEW; _new."updated_at" = NOW(); RETURN _new; END; $$ LANGUAGE plpgsql; CREATE TRIGGER "set_public_patient_live_status_updated_at" BEFORE UPDATE ON "public"."patient_live_status" FOR EACH ROW EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); COMMENT ON TRIGGER "set_public_patient_live_status_updated_at" ON "public"."patient_live_status" IS 'trigger to set value of column "updated_at" to current timestamp on row update';