Databázy (2) Prednáška 08. Alexander Šimko
|
|
- Phyllis Randall
- 5 years ago
- Views:
Transcription
1 Databázy (2) Prednáška 08 Alexander Šimko
2 Contents I Funkcie Zložené typy PL/pgSQL Agregačné funkcie
3 Funkcie Section 1 Funkcie
4 Funkcie PostgreSQL umožňuje vytvoriť si vlastné databázové funkcie Nejedná sa o funkciu v matematickom zmysle funkcia môže vracať hodnotu funkcia môže meniť stav databázy
5 Funkcie Na čo sú dobré vlastné databázové funkcie? Sprehľadnenie kódu Optimalizáciu operáciu, ktorá potrebuje pracovať nad veľa riadkami vykoná databázový server ušetríme teda prenášanie veľkého množstva dát po sieti Rozšírenie databázového systému napr. vlastné agregačné funkcie
6 Funkcie Príkaz CREATE FUNCTION CREATE [OR REPLACE] FUNCTION nazov_funkcie (argument_1 typ_1,..., argument_n typ_n) RETURNS navratovy_typ LANGUAGE nazov_jazyka AS $$definicia$$ vytvorí zadanú funkciu ak už existuje, tak končí chybou ak je zadané OR REPLACE, tak prepíše existujúcu funkciu
7 Funkcie LANGUAGE nazov_jazyka implementačný jazyk funkcie sql plpgsql k tomu sa dostaneme neskôr...
8 Funkcie Príklad funkcie implementovanej v SQL CREATE FUNCTION random_date(fromdate DATE, todate DATE) RETURNS DATE LANGUAGE sql AS $$ SELECT floor(random()*(todate-fromdate))::integer + fromdate $$ SELECT random_date(date , DATE )
9 Funkcie Pozor, aby sa argumenty nevolali ako stĺpce CREATE FUNCTION number_of_employees_with_salary(salary numeric) RETURNS bigint LANGUAGE sql AS $$ SELECT count(*) FROM employees AS e WHERE e.salary = salary $$ e.salary = salary vyhodnotí ako e.salary = e.salary
10 Funkcie Príklad volania databázovej funkcie z JDBC Connection connection =... CallableStatement callable = connection.preparecall("{? = call number_of_employees_with_salary(? ) }"); callable.registeroutparameter(1, Types.BIGINT); callable.setbigdecimal(2, BigDecimal.valueOf(1000)); callable.execute(); long count = callable.getlong(1); System.out.println(count); callable.close();
11 Funkcie Tabuľka ako návratový typ RETURNS TABLE (nazov_stlpca_1 typ_stlpca_1,..., nazov_stlpca_n typ_stlpca_n)
12 Funkcie Tabuľka ako návratový typ CREATE FUNCTION get_rich_employees() RETURNS TABLE (employee_id integer, last_name varchar) LANGUAGE sql AS $$ SELECT employee_id, last_name FROM hr.employees AS e WHERE e.salary > 5000 $$ SELECT * FROM get_rich_employees()
13 Funkcie Reagovanie na NULLové vstupy CALLABLE ON NULL INPUT funkcia je štandardne spustená toto je default RETURNS NULL ON NULL INPUT STRICT funkcia vráti NULL bez toho, aby jej telo bolo spustené
14 Funkcie Reagovanie na NULLový vstupy CREATE FUNCTION test(input integer) RETURNS boolean LANGUAGE SQL AS $$ SELECT input IS NULL $$ SELECT test(null) TRUE CREATE FUNCTION test(input integer) RETURNS boolean LANGUAGE SQL RETURNS NULL ON NULL INPUT AS $$ SELECT input IS NULL $$ SELECT test(null) NULL
15 Funkcie Funkcia ktorá nič nevracia Treba použiť návratový typ void
16 Funkcie Funkcia ktorá nič nevracia CREATE FUNCTION test() RETURNS void LANGUAGE SQL AS $$ CREATE TABLE aa(id serial) $$ Dá sa spustiť pomocou SELECT test() Select vráti nezmyselnú tabuľku 1x1 so stĺpcom typu void:)
17 Funkcie Definícia funkcie môže obsahovať aj postupnosť príkazov CREATE FUNCTION test() RETURNS void LANGUAGE SQL AS $$ DROP TABLE aa; CREATE TABLE aa(id serial); $$
18 Funkcie Atribúty pre optimalizáciu dopytov IMMUTABLE funkcia nemení databázu vždy pre rovnaký vstup vráti rovnaký výstup čiže je to funkcia v matematickom zmysle každé volanie funkcie sa teda dá nahradiť funkčnou hodnotou STABLE funkcia nemení databázu pre rovnaký vstup vráti rovnaký výstup iba v rámci jedného čítania tabuľky čiže funkcia pri opätovnom spustení SQL príkazu môže vrátiť niečo iné VOLATILE funkcia môže zakaždým vrátiť inú hodnotu toto je default
19 Funkcie Atribúty pre optimalizáciu dopytov CREATE FUNCTION ran() RETURNS DOUBLE PRECISION LANGUAGE sql AS $$ SELECT random() $$; SELECT ran() FROM generate_series(1,3); ran
20 Funkcie Atribúty pre optimalizáciu dopytov CREATE FUNCTION ran2() RETURNS DOUBLE PRECISION IMMUTABLE LANGUAGE sql AS $$ SELECT random() $$; SELECT ran2() FROM generate_series(1,3); ran
21 Funkcie VOLATILE aby sa neoptimalizovalo, čo nechceme CREATE TABLE test (id serial, value integer); INSERT INTO test (value) SELECT random()*2000 FROM generate_series(1, ); SELECT i, (SELECT value FROM test TABLESAMPLE SYSTEM_ROWS (1)) FROM generate_series(1,3) AS seq(i); i value
22 Funkcie VOLATILE aby sa neoptimalizovalo, čo nechceme CREATE FUNCTION ran() RETURNS integer LANGUAGE sql AS $$ SELECT value FROM test TABLESAMPLE SYSTEM_ROWS (1) $$; SELECT i, ran() FROM generate_series(1,3) AS seq(i); i value
23 Funkcie Čo ak potrebujeme cykly, podmienky, lokálne premenné? Musíme použíť iný jazyk: C PL/pgSQL...
24 Zložené typy Section 2 Zložené typy
25 Zložené typy Motivácia Complexné číslo je dvojica reálnych čísel: reálna časť, imaginárna časť Má význam aby obe zložky boli uložené ako hodnota jedného stĺpca
26 Zložené typy Príkaz CREATE TYPE CREATE TYPE nazov_typu AS ( nazov_atributu_1 nazov_typu_1,... nazov_atributu_n nazov_typu_n ) v databázovom systéme vytvorí daný zložený typ
27 Zložené typy Príkaz CREATE TYPE Príklad CREATE TYPE complex AS ( r numeric, i numeric ); CREATE TABLE test ( id integer, x complex )
28 Zložené typy Literál zloženého typu ( val1, val2,..., valn) hodnoty uzavreté v zátvorkách a apostrofoch
29 Zložené typy Literál zloženého typu Príklad (10, 20)
30 Zložené typy Literál zloženého typu Komplikácie Ak chceme NULL hodnotu, musíme hodnotu vynechať (10, ) Textové reťazce treba vložiť pomocou úvodzoviek (10, "tralala")
31 Zložené typy Operátor ROW ROW vytvára hodnoty zložených typov ROW(10, NULL) ROW(10, tralala ) V prípade aspoň dvoch argumentov je ROW nepovinný: (10, NULL) (10, tralala )
32 Zložené typy Práca so zloženými typmi INSERT INTO test(id, x) VALUES (1, ROW(10,20)); SELECT * FROM test WHERE x.i = 20; UPDATE test SET x.i = (x).i * 2 WHERE x.i = 20; -- zatvorky su potrebne CREATE FUNCTION double(x complex) RETURNS complex LANGUAGE sql AS $$ SELECT 2*x.r, 2*x.i -- toto vytvori hodnotu zlozeneho typu $$
33 Zložené typy Pre každú tabuľku existuje rovnomenný zložený typ CREATE TABLE mytable ( id integer, x integer, y integer ); Vznikol zložený typ mytable CREATE FUNCTION myfunction(r mytable) RETURNS integer LANGUAGE sql AS $$ SELECT r.x + r.y $$ Vznikla funkcia, ktorá na vstupe berie jeden riadok tabuľky mytable a produkuje hodnotu typu integer
34 Zložené typy Názov tabuľky a alias zastupujú riadok môžeme ich použiť ako parameter funkcie mytable id x y SELECT id, myfunction(mytable) FROM mytable id myfunction
35 PL/pgSQL Section 3 PL/pgSQL
36 PL/pgSQL PL/pgSQL procedurálne rozšírenie SQL lokálne premenné, cykly, podmienky spúšťanie SQL špecifické pre PostgreSQL inšpirované PL/SQL od Oracle
37 PL/pgSQL Ukážka Anonymný blok v PL/pgSQL DECLARE random_string varchar := ; length integer := 10; BEGIN FOR i IN 1..length LOOP random_string := random_string chr(cast(floor(random()*(ascii( z ) - ascii( a ) + 1)) + ascii( a ) as integer)); END LOOP; END;
38 PL/pgSQL Ukážka Funkcia implementovaná pomocou PL/pgSQL CREATE FUNCTION random_char() RETURNS char LANGUAGE plpgsql AS $$ DECLARE max_ascii integer := ascii( z ); min_ascii integer := ascii( a ); random_ascii integer; BEGIN random_ascii := CAST(floor(random()*(max_ascii - min_ascii + 1)) + min_ascii as integer); return chr(random_ascii); END; $$
39 PL/pgSQL Ukážka Funkcia implementovaná pomocou PL/pgSQL CREATE FUNCTION random_string(length integer) RETURNS varchar LANGUAGE plpgsql AS $$ DECLARE random_string varchar := ; BEGIN FOR i IN 1..length LOOP random_string := random_string random_char(); END LOOP; return random_string; END; $$
40 PL/pgSQL V PL/pgSQL môžeme volať SQL BEGIN -- ak nic nevracia PERFORM INSERT INTO mytable(id,x,y) VALUES(99,10,20); END;
41 PL/pgSQL Získanie výsledku SQL príkazu jeden riadok DECLARE my_id integer; row mytable; -- zlozeny typ automaticky vytvoreny pre tabulku BEGIN -- SELECT ktory vracia jeden riadok SELECT * INTO row FROM mytable WHERE id = 3; IF NOT FOUND THEN -- test ci SELECT nieco vratil RAISE EXCEPTION row with id % not found, 3; END IF -- INSERT/UPDATE/DELETE, ktory vracia INSERT INTO mytable (x,y) VALUES (10,20) RETURNING id INTO my_id; END;
42 PL/pgSQL Získanie výsledku SQL príkazu viac riadkov DECLARE row mytable; sum integer := 0; BEGIN FOR row IN SELECT * FROM mytable LOOP sum := sum + row.x; END LOOP; END;
43 PL/pgSQL Kto chce vedieť viac
44 Agregačné funkcie Section 4 Agregačné funkcie
45 Agregačné funkcie Ako implementovať agregačnú funkciu? Uvažujme aritmetický priemer a n = x 1 + x x n n
46 Agregačné funkcie Prvý nápad (presudokód) avg(xs[]) { n = 0; sum = 0; for each x do { ++n; sum += x; } return sum/n; }
47 Agregačné funkcie Prvý nápad dosť zlé avg(xs[]) { n = 0; sum = 0; for each x do { ++n; sum += x; } } return sum/n; čo ak robíme avg nad riadkami? musíme vytvoriť veľké vstupné pole a naplniť ho hodnotami
48 Agregačné funkcie Druhý nápad Iterujme priamo tabuľku n = 0; sum = 0; for each row do { ++n; sum += row.x; } return sum/n;
49 Agregačné funkcie Druhý nápad Stav výpočtu dajme dokopy state = (0,0); -- stav je dvojica (n,sum) for each row do { state = (state.n+1, state.sum+row.x); } return state.sum/state.n;
50 Agregačné funkcie Druhý nápad Jedna iterácia ako funkcia avg_step(state, x) { return (state.n+1, state.sum+x); } state = (0,0); -- stav je dvojica (n,sum) for each row do { state = avg_step(state, row.x); } return state.sum/state.n;
51 Agregačné funkcie Druhý nápad Výpočet výsledku ako funkcia avg_step(state, x) { return (state.n+1, state.sum+x); } avg_result(state) { return state.sum/state.n; } state = (0,0); -- stav je dvojica (n,sum) for each row do { state = avg_step(state, row.x); } return avg_result(state);
52 Agregačné funkcie Druhý nápad Počiatočná hodnota vyňatá POCIATOCNA_HODNOTA = (0,0); avg_step(state, x) { return (state.n+1, state.sum+x); } avg_result(state) { return state.sum/state.n; } state = POCIATOCNA_HODNOTA; for each row do { state = avg_step(state, row.x); } return avg_result(state);
53 Agregačné funkcie Všeobecná štruktúra vyhodnotenia agregačnej funkcie AGG_STATE_TYPE state = AGG_INITIAL_VALUE; for each row do { state = agg_step(state, row.x1,..., row.xn); } return agg_result(state);
54 Agregačné funkcie Agregačná funkcia je teda daná dátovým typom stavu počiatočným stavom funkciou jedného kroku funkciou na získanie výsledku
55 Agregačné funkcie Príkaz CREATE AGGREGATE CREATE AGGREGATE nazov (typ_argumentu_1,..., typ_argumentu_n) ( STYPE = nazov_datoveho_typu_stavu, INITCOND = pociatocny_stav, -- zadany ako retazcovy literal SFUNC = funkcia_jedneho_kroku, FINALFUNC = funkcia_na_ziskanie_vysledku )
56 Agregačné funkcie Vlastná implementácia aritmetického primeru CREATE TYPE myavg_type AS (n integer, sum integer); CREATE FUNCTION myavg_step(state myavg_type, x integer) RETURNS myavg_type LANGUAGE sql AS $$ SELECT state.n+1, state.sum+x; -- toto vytvori hodnotu $$; -- zlozeneho typu CREATE FUNCTION myavg_result(state myavg_type) RETURNS double precision LANGUAGE sql AS $$ SELECT state.sum::double precision / state.n::double precision $$;
57 Agregačné funkcie Vlastná implementácia aritmetického priemeru CREATE AGGREGATE myavg(integer) ( STYPE = myavg_type, INITCOND = (0,0), SFUNC = myavg_step, FINALFUNC = myavg_result );
58 Agregačné funkcie Vlastná implementácia aritmetického priemeru test val SELECT myavg(val) from test myavg 2.5
59 Agregačné funkcie Poznámka a n = x 1 + x x n n V prípade veľmi veľkých čísel môže byť suma x 1 + x x n natoľko veľká, že sa nezmestí do žiadneho podporovaného dátového typu
60 Agregačné funkcie Iný prístup a n+1 = x 1 + x x n + x n+1 n + 1
61 Agregačné funkcie Iný prístup a n+1 = x 1 + x x n + x n+1 n + 1 = x 1 + x x n n x n+1 n + 1
62 Agregačné funkcie Iný prístup a n+1 = x 1 + x x n + x n+1 n = x 1 + x x n n + 1 = x 1 + x x n n x n+1 n + 1 n n + x n+1 n + 1
63 Agregačné funkcie Iný prístup a n+1 = x 1 + x x n + x n+1 n = x 1 + x x n + x n+1 n + 1 n + 1 = x 1 + x x n n + 1 = x 1 + x x n n n n + x n+1 n + 1 n n x n+1 n + 1
64 Agregačné funkcie Iný prístup a n+1 = x 1 + x x n + x n+1 n = x 1 + x x n + x n+1 n + 1 n + 1 = x 1 + x x n n + 1 = x 1 + x x n n = a n n n x n+1 n + 1 n n + x n+1 n + 1 n n x n+1 n + 1
65 Agregačné funkcie Iný prístup dátový typ stavu (a, n) n a n+1 = a n n x n+1 n + 1 počiatočný stav (0, 0) funkcia jedného kroku (a, n), x ( a n n+1 + x n+1, n + 1) funkcia na získanie výsledku (a, n) a
66 Agregačné funkcie Iný prístup (a, n), x ( n a n x n + 1, n + 1) a je aktuálny priemer začína 0 n n+1 je postupne 0, 1 2, 2 3,..., 1 (limitne) v každom kroku je a n n+1 a x n+1 je postupne x, x 2, x 3,...0 (limitne) a sa v každom kroku mení čoraz menej konverguje k výsledku robí sa veľa násobení a delení pri nepresných dátových operáciach sa nepresnosti kopia
67 Agregačné funkcie Čo takto geometrický priemer? g n = n x 1 x 2... x n
68 Agregačné funkcie Prvý nápad stav: (p, n) počiatočný stav: (1, 0) jeden krok: (p, n), x (p x, n + 1) výsledok: (p, n) n p
69 Agregačné funkcie Prvý nápad dosť zlé stav: (p, n) počiatočný stav: (1, 0) jeden krok: (p, n), x (p x, n + 1) výsledok: (p, n) n p Uvažujme, že máme riadkov a 10 x 20 pre každé x čize konečné g je medzi 10 a 20 ale konečné p je minimálne p má aspoň cifier numeric má maximálne cifier pred desatinnou bodkou premenná p nám pretečie pri každom PostgreSQL dátovom type
70 Agregačné funkcie Druhý nápad Násobenie zmeňme na sčítanie g n = n x 1 x 2... x n log b g n = log n b x 1 x 2... x n = log b (x 1 x 2... x n ) 1 n = 1 n log b(x 1 x 2... x n ) = 1 n (log b x 1 + log b x log b x n ) g n = b log b gn = b 1 n (log b x 1+log b x 2 + +log b x n)
71 Agregačné funkcie Druhý nápad Násobenie zmeňme na sčítanie g n = b 1 n (log b x 1+log b x 2 + +log b x n) = b 1 n sum sum = log b x 1 + log b x log b x n stav: (sum, n) počiatočný stav: (0, 0) jeden krok: (sum, n), x (sum + log b x, n + 1) výsledok: (sum, n) b 1 n sum
72 Agregačné funkcie Koniec Koniec
Databázy (1) Prednáška 11. Alexander Šimko
Databázy (1) Prednáška 11 Alexander Šimko simko@fmph.uniba.sk Contents I Aktualizovanie štruktúry databázy Section 1 Aktualizovanie štruktúry databázy Aktualizácia štruktúry databázy Štruktúra databázy
More informationDatabázové systémy. SQL Window functions
Databázové systémy SQL Window functions Scores Tabuľka s bodmi pre jednotlivých študentov id, name, score Chceme ku každému doplniť rozdiel voči priemeru 2 Demo data SELECT * FROM scores ORDER BY score
More informationPoradové a agregačné window funkcie. ROLLUP a CUBE
Poradové a agregačné window funkcie. ROLLUP a CUBE 1) Poradové a agregačné window funkcie 2) Extrémy pomocou DENSE_RANK(), TOP() - Príklady 3) Spriemernené poradia 4) Kumulatívne súčty 5) Group By a Datepart,
More informationDatabázy (1) Prednáška 08. Alexander Šimko
Databázy (1) Prednáška 08 Alexander Šimko simko@fmph.uniba.sk Contents I Subqueries (poddopyty) konštrukcia WITH Section 1 Subqueries (poddopyty) Subquery (poddopyt) Použitie SELECTu na mieste, kde sme
More informationSpájanie tabuliek. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)
Spájanie tabuliek Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) 2011-2016 Úvod pri normalizácii rozdeľujeme databázu na viacero tabuliek prepojených cudzími kľúčmi SQL umožňuje tabuľky opäť spojiť
More informationVYLEPŠOVANIE KONCEPTU TRIEDY
VYLEPŠOVANIE KONCEPTU TRIEDY Typy tried class - definuje premenné a metódy (funkcie). Ak nie je špecifikovaná inak, viditeľnosť členov je private. struct - definuje premenné a metódy (funkcie). Ak nie
More informationJazyk SQL. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)
Jazyk SQL Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) 2011-2016 Jazyk SQL - Structured Query Language SQL je počítačový jazyk určený na komunikáciu s relačným SRBD neprocedurálny (deklaratívny) jazyk
More informationProgramovanie v jazyku Python. Michal Kvasnica
Programovanie v jazyku Python Michal Kvasnica Organizačné detaily Prednášky aj cvičenia v 638 Povinná účasť na cvičeniach Hodnotenie: priebežné odovzdávanie zadaní (40% známky) záverečný projekt na skúške
More informationConstraint satisfaction problems (problémy s obmedzujúcimi podmienkami)
I2AI: Lecture 04 Constraint satisfaction problems (problémy s obmedzujúcimi podmienkami) Lubica Benuskova Reading: AIMA 3 rd ed. chap. 6 ending with 6.3.2 1 Constraint satisfaction problems (CSP) We w
More information1 Komplexný príklad využitia OOP
1 Komplexný príklad využitia OOP Najčastejším využitím webových aplikácií je komunikácia s databázovým systémom. Komplexný príklad je preto orientovaný práve do tejto oblasti. Od verzie PHP 5 je jeho domovskou
More informationRegistrácia účtu Hik-Connect
Registrácia účtu Hik-Connect Tento návod popisuje postup registrácie účtu služby Hik-Connect prostredníctvom mobilnej aplikácie a webového rozhrania na stránke www.hik-connect.comg contents in this document
More informationCopyright 2016 by Martin Krug. All rights reserved.
MS Managed Service Copyright 2016 by Martin Krug. All rights reserved. Reproduction, or translation of materials without the author's written permission is prohibited. No content may be reproduced without
More informationkucharka exportu pro 9FFFIMU
požiadavky na export kodek : Xvid 1.2.1 stable (MPEG-4 ASP) // výnimočne MPEG-2 bitrate : max. 10 Mbps pixely : štvorcové (Square pixels) rozlíšenie : 1920x1080, 768x432 pre 16:9 // výnimočne 1440x1080,
More informationINDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables
INDEX Exercise No Title 1 Basic SQL Statements 2 Restricting and Sorting Data 3 Single Row Functions 4 Displaying data from multiple tables 5 Creating and Managing Tables 6 Including Constraints 7 Manipulating
More informationNormalizácia a normálne formy
Normalizácia a normálne formy normalizácia je proces, pomocou ktorého sa dá databáza zbaviť štrukturálnych vád normalizácie je súhrnom niekoľkých tzv. normálnych foriem - množín pravidiel, ktoré hovoria
More informationVnorené SQL. Autor prezentácie: Peter Šípoš
Vnorené SQL Autor prezentácie: Peter Šípoš Literatúra Programmatic SQL od Pearson Ed Embedded SQL: http://download.oracle. com/docs/cd/b10501_01/appdev.920/a97269/pc_06sql.htm Oracle Dynamic SQL: http://download.oracle.
More informationRecipient Configuration. Štefan Pataky MCP, MCTS, MCITP
Recipient Configuration Štefan Pataky MCP, MCTS, MCITP Agenda Mailbox Mail Contact Distribution Groups Disconnected Mailbox Mailbox (vytvorenie nového účtu) Exchange Management Console New User Exchange
More informationDATABÁZOVÉ SYSTÉMY. Databázová technológia je pojem, ktorý sa zaoberá riadením veľkého množstva perzistentných (stály), spoľahlivých a zdieľaných dát.
LITERATÚRA: Jaroslav Pokorný Databázová abeceda Všetky manuály: POSTGRE SQL 7.2 C.J.Date an introduction to database systems Someber A. databázové systémy, 1988 DATABÁZOVÉ SYSTÉMY Databáza súbor informácií,
More informationTestovanie bieleho šumu
Beáta Stehlíková FMFI UK Bratislava Opakovanie z prednášky Vygenerujeme dáta Vygenerujeme dáta: N
More informationJeden z variantov príkazu priradenia nám umožňuje zadať za sebou aj viacej vstupných hodnôt, ako napríklad
Príkaz priradenia Príkaz priradenia slúži na priradenie hodnoty premennej. Má tvar premenná = výraz, kde premenná je identifikátor, znak = sa číta priraď a vyhodnotením výrazu sa získa hodnota určitého
More information1) 2) 3) 4) 5) 6) 7) XML. 8) 9) 10) 11) CRUD
OBSAH 1) Úvod do SQL Server, množinové operácie 2) Uložené procedúry, funkcie 3) Pohľady a CTE 4) Rekurzia a transitívny uzáver 5) Triggery. Transakcie. 6) Kurzory.Pivot tabuľky 7) XML. B-stromy a indexy
More informationEntity Framework: Úvod
Entity Framework: Úvod Martin Macák Fakulta informatiky, Masarykova univerzita, Brno 29. 9. 2016 Osnova prednášky 1. Základy Entity Frameworku 2. Návrh databázy (detailnejšie Code First prístup) 3. Migrácie
More informationTvorba informačných systémov. 4. prednáška: Návrh IS
Tvorba informačných systémov 4. prednáška: Návrh IS Návrh informačného systému: témy Ciele návrhu ERD DFD Princípy OOP Objektová normalizácia SDD Architektonické pohľady UML diagramy Architektonické štýly
More informationAn Introduction to Structured Query Language
An Introduction to Structured Query Language Alexandra Roatiş David R. Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Winter 2016 CS 348 SQL Winter
More informationAssertions, Views, and Programming. CS157A Chris Pollett Oct. 31, 2005.
Assertions, Views, and Programming CS157A Chris Pollett Oct. 31, 2005. Outline Assertions Views Database Programming Assertions It is useful to be able to specify general constraints in SQL -- i.e., other
More information1) Introduction to SQL
1) Introduction to SQL a) Database language enables users to: i) Create the database and relation structure; ii) Perform insertion, modification and deletion of data from the relationship; and iii) Perform
More informationTable of Contents. PDF created with FinePrint pdffactory Pro trial version
Table of Contents Course Description The SQL Course covers relational database principles and Oracle concepts, writing basic SQL statements, restricting and sorting data, and using single-row functions.
More informationTextový formát na zasielanie údajov podľa 27 ods. 2 písm. f) zákona
Popis textového formátu a xsd schémy na zasielanie údajov podľa 27 ods. 2 písm. f) zákona (formu na zaslanie údajov si zvolí odosielateľ údajov) Textový formát na zasielanie údajov podľa 27 ods. 2 písm.
More informationAnycast. Ľubor Jurena CEO Michal Kolárik System Administrator
Anycast Ľubor Jurena CEO jurena@skhosting.eu Michal Kolárik System Administrator kolarik@skhosting.eu O nás Registrátor Webhosting Serverové riešenia Správa infraštruktúry Všetko sa dá :-) Index Čo je
More informationSpatial Databases by Open Standards and Software 3.
Spatial Databases by Open Standards and Software 3. Gábor Nagy Spatial Databases by Open Standards and Software 3.: Advanced features in PostgreSQL Gábor Nagy Lector: Zoltán Siki This module was created
More informationAplikačný dizajn manuál
Aplikačný dizajn manuál Úvod Aplikačný dizajn manuál je súbor pravidiel vizuálnej komunikácie. Dodržiavaním jednotných štandardov, aplikácií loga, písma a farieb pri prezentácii sa vytvára jednotný dizajn,
More informationData Reference Searcher. Documentation
Documentation Martin Dráb 8/19/2010 TABLE OF CONTENT Table of content... 1 Basic information... 2 Supported versions of Microsoft Dynamics AX... 2 Supported languages... 2 Installation... 3 User guide...
More informationTable of Contents POSTGRESQL DATABASE OBJECT MANAGEMENT 4. POSTGRESQL SCHEMAS 5 PostgreSQL Schema Designer 7. Editing PostgreSQL Schema General 8
PostgreSQL Database Object Management 1 Table of Contents POSTGRESQL DATABASE OBJECT MANAGEMENT 4 POSTGRESQL SCHEMAS 5 PostgreSQL Schema Designer 7 Editing PostgreSQL Schema General 8 PostgreSQL Tables
More informationOracle 1Z MySQL 5.6 Developer.
Oracle 1Z0-882 MySQL 5.6 Developer http://killexams.com/exam-detail/1z0-882 SELECT... WHERE DATEDIFF (dateline, 2013-01-01 ) = 0 C. Use numeric equivalents for comparing the two dates: SELECT...WHERE MOD(UNIX_TIMESTAMP
More informationManaging Your Database Using Oracle SQL Developer
Page 1 of 54 Managing Your Database Using Oracle SQL Developer Purpose This tutorial introduces Oracle SQL Developer and shows you how to manage your database objects. Time to Complete Approximately 50
More informationsqoop Automatic database import Aaron Kimball Cloudera Inc. June 18, 2009
sqoop Automatic database import Aaron Kimball Cloudera Inc. June 18, 2009 The problem Structured data already captured in databases should be used with unstructured data in Hadoop Tedious glue code necessary
More informationRiešenia a technológie pre jednotnú správu používateľov
Riešenia a technológie pre jednotnú správu používateľov Radovan Semančík Agenda Úvod: Identity Crisis Technológie správy používateľov Postup nasadenia Záver Súčasný stav IT Security Nekonzistentné bezpečnostné
More informationMonitoring and Resolving Lock Conflicts. Copyright 2004, Oracle. All rights reserved.
Monitoring and Resolving Lock Conflicts Objectives After completing this lesson you should be able to do the following: Detect and resolve lock conflicts Manage deadlocks Locks Prevent multiple sessions
More informationRESTRICTING AND SORTING DATA
RESTRICTING AND SORTING DATA http://www.tutorialspoint.com/sql_certificate/restricting_and_sorting_data.htm Copyright tutorialspoint.com The essential capabilities of SELECT statement are Selection, Projection
More informationINTERMEDIATE SQL GOING BEYOND THE SELECT. Created by Brian Duffey
INTERMEDIATE SQL GOING BEYOND THE SELECT Created by Brian Duffey WHO I AM Brian Duffey 3 years consultant at michaels, ross, and cole 9+ years SQL user What have I used SQL for? ROADMAP Introduction 1.
More informationPortál pre odborné publikovanie ISSN
1 Portál pre odborné publikovanie ISSN 1338-0087 16. Matlab 2D grafy Foltin Martin MATLAB/Comsol 25.09.2009 Silnou stránkou prostredia Matlab je grafika. Grafika je nástroj na prehľadné zobrazovanie výsledkov,
More informationCSE 530A SQL. Washington University Fall 2013
CSE 530A SQL Washington University Fall 2013 SELECT SELECT * FROM employee; employee_id last_name first_name department salary -------------+-----------+------------+-----------------+-------- 12345 Bunny
More information/* toto je viacriadková poznámka */ ako v Delphi, len sa rozlišujú malé a veľké písmená!!!
Organizácia programu #include using namespace std; int main() return 0; // jednoriadková poznámka Identifikátor Dátové typy int (long), unsigned, float (double), bool 0,1, char, trieda
More informationRetrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL
More informationCS2300: File Structures and Introduction to Database Systems
CS2300: File Structures and Introduction to Database Systems Lecture 14: SQL Doug McGeehan From Theory to Practice The Entity-Relationship Model: a convenient way of representing the world. The Relational
More informationIssues related to PL/pgSQL usage
Issues related to PL/pgSQL usage Pavel Stěhule 2018-04-30 1 Next SQL execution Query optim. (reduced by plan cache) Query initialization (every time) Query execution (every time) Previous 2 Next Compilation
More informationIntroduction to Programming Using Java (98-388)
Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;
More informationTP-LINK 150Mbps Wireless AP/Client Router Model TL-WR743ND Rýchly inštalačný sprievodca
TP-LINK 150Mbps Wireless AP/Client Router Model TL-WR743ND Rýchly inštalačný sprievodca Obsah balenia TL-WR743ND Rýchly inštalačný sprievodca PoE injektor Napájací adaptér CD Ethernet kábel Systémové požiadavky
More informationIntroduction to PL/pgSQL
PostgreSQL Conference East 2009 Introduction to PL/pgSQL Josh Williams All you can do in a database... CREATE READ UPDATE DELETE... Complete and utter CRUD. Intro to PL/pgSQL All About PL/pgSQL Anatomy
More informationSystém pre podporu výuky teórie programovacích jazykov
Mendelova univerzita v Brně Provozně ekonomická fakulta Systém pre podporu výuky teórie programovacích jazykov Diplomová práca Vedúci práce: doc. Ing. Dr. Jiří Rybička Bc. Petra Pavlačičová Brno 2012 Ďakujem
More informationUsing the Set Operators. Copyright 2006, Oracle. All rights reserved.
Using the Set Operators Objectives After completing this lesson, you should be able to do the following: Describe set operators Use a set operator to combine multiple queries into a single query Control
More informationSQL Data Definition and Data Manipulation Languages (DDL and DML)
.. Cal Poly CPE/CSC 365: Introduction to Database Systems Alexander Dekhtyar.. SQL Data Definition and Data Manipulation Languages (DDL and DML) Note: This handout instroduces both the ANSI SQL synatax
More informationDatabase Programming with PL/SQL
Database Programming with PL/SQL 2-2 Objectives This lesson covers the following objectives: List and define the different types of lexical units available in PL/SQL Describe identifiers and identify valid
More information2. Týždeň MySQL - dátové typy a funkcie num. a reťazcové
2. Týždeň MySQL - dátové typy a funkcie num. a reťazcové 1. Prvky jazyka MySQL http://dev.mysql.com/doc/refman/5.7/en/language-structure.html 2. Typy a pretypovanie http://dev.mysql.com/doc/refman/5.7/en/data-types.html
More informationPROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)
Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 4 Database Programming PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL) AGENDA 6. Stored Functions Procedural Database Programming
More informationIMPLEMENTACE MODULÁRNÍ ARITMETIKY DO OBVODŮ FPGA A ASIC
VYSOKÉ UČENÍ TECHNICKÉ V BRNĚ BRNO UNIVERSITY OF TECHNOLOGY FAKULTA ELEKTROTECHNIKY A KOMUNIKAČNÍCH TECHNOLOGIÍ ÚSTAV MIKROELEKTRONIKY FACULTY OF ELECTRICAL ENGINEERING AND COMMUNICATION DEPARTMENT OF
More informationDATABASE DESIGN - 1DL400
DATABASE DESIGN - 1DL400 Fall 2015 A course on modern database systems http://www.it.uu.se/research/group/udbl/kurser/dbii_ht15 Kjell Orsborn Uppsala Database Laboratory Department of Information Technology,
More informationDatabase Programming with PL/SQL
Database Programming with PL/SQL 3-2 Objectives This lesson covers the following objectives: Recognize the SQL statements that can be directly included in a PL/SQL executable block Construct and execute
More informationDatabase Programming with PL/SQL
Database Programming with PL/SQL 3-3 Objectives This lesson covers the following objectives: Construct and execute PL/SQL statements that manipulate data with DML statements Describe when to use implicit
More information6. Riadenie chodu programu
6. Riadenie chodu programu 6.1. Výrazový príkaz 6.2. Prázdny príkaz 6.3. Bloky. 6.4. Oblasť platnosti identifikátora 6.5. Podmienený príkaz if-else. 6.6. Prepínač 6.7. Cykly Cyklus while Cyklus for Cyklus
More informationPLpgSQL. Procedural Language Extensions for the pgsql 3/16/2018 1
PLpgSQL Procedural Language Extensions for the pgsql 3/16/2018 1 Limitations of Basic SQL What we have seen of SQL so far: data definition language (create table(...)) constraints (domain, key, referential
More informationLecture (07) Arrays. By: Dr. Ahmed ElShafee. Dr. Ahmed ElShafee, ACU : Fall 2015, Programming I
Lecture (07) Arrays By: Dr Ahmed ElShafee ١ introduction An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type Instead
More informationDiscuss setting up JDBC connectivity. Demonstrate a JDBC program Discuss and demonstrate methods associated with JDBC connectivity
Objectives Discuss setting up JDBC connectivity. Demonstrate a JDBC program Discuss and demonstrate methods associated with JDBC connectivity Setting Up JDBC Before you can begin to utilize JDBC, you must
More informationAdvanced SQL GROUP BY Clause and Aggregate Functions Pg 1
Advanced SQL Clause and Functions Pg 1 Clause and Functions Ray Lockwood Points: s (such as COUNT( ) work on groups of Instead of returning every row read from a table, we can aggregate rows together using
More informationDatabázy (2) Prednáška 03. Alexander Šimko
Databázy (2) Prednáška 03 Alexander Šimko simko@fmph.uniba.sk Contents I Databázové transakcie Section 1 Databázové transakcie Transakcie Transakcia je postupnosť príkazov, ktoré vystupujú ako celok Databázové
More informationInformatika 2. Generiká
Informatika 2 Generiká Pojmy zavedené v 10. prednáške (1) štandardný vstup a výstup textové súbory binárne súbory objektové prúdy Informatika 2 1 Pojmy zavedené v 10. prednáške (2) objektové prúdy nečitateľné
More informationActual4Test. Actual4test - actual test exam dumps-pass for IT exams
Actual4Test http://www.actual4test.com Actual4test - actual test exam dumps-pass for IT exams Exam : 1z0-144 Title : Oracle Database 11g: Program with PL/SQL Vendor : Oracle Version : DEMO Get Latest &
More informationDatabase Programming with PL/SQL
Database Programming with PL/SQL Trapping Oracle Server Exceptions 1 Copyright 2013, Oracle and/or its affiliates. All rights Objectives This lesson covers the following objectives: Describe and provide
More information2. In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years?
ORACLE Placement Papers 1. A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there
More informationArrays. Lecture 11 CGS 3416 Fall October 26, 2015
Arrays Lecture 11 CGS 3416 Fall 2015 October 26, 2015 Arrays Definition: An array is an indexed collection of data elements of the same type. Indexed means that the array elements are numbered (starting
More informationBasic SQL. Dr Fawaz Alarfaj. ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation
Basic SQL Dr Fawaz Alarfaj Al Imam Mohammed Ibn Saud Islamic University ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation MIDTERM EXAM 2 Basic
More informationCS 464/564 Introduction to Database Management System Instructor: Abdullah Mueen
CS 464/564 Introduction to Database Management System Instructor: Abdullah Mueen LECTURE 10: INTRODUCTION TO SQL FULL RELATIONAL OPERATIONS MODIFICATION LANGUAGE Union, Intersection, Differences (select
More informationSample Examination. Family Name:... Other Names:... Signature:... Student Number:...
Family Name:... Other Names:... Signature:... Student Number:... THE UNIVERSITY OF NEW SOUTH WALES SCHOOL OF COMPUTER SCIENCE AND ENGINEERING Sample Examination COMP1917 Computing 1 EXAM DURATION: 2 HOURS
More informationKORA. RDBMS Concepts II
RDBMS Concepts II Outline Querying Data Source With SQL Star & Snowflake Schemas Reporting Aggregated Data Using the Group Functions What Are Group Functions? Group functions operate on sets of rows to
More informationWorking with Columns, Characters and Rows. Copyright 2008, Oracle. All rights reserved.
Working with Columns, Characters and Rows What Will I Learn? In this lesson, you will learn to: Apply the concatenation operator to link columns to other columns, arithmetic expressions or constant values
More information2 PL/SQL - fundamentals Variables and Constants Operators SQL in PL/SQL Control structures... 7
Table of Contents Spis treści 1 Introduction 1 2 PLSQL - fundamentals 1 2.1 Variables and Constants............................ 2 2.2 Operators.................................... 5 2.3 SQL in PLSQL.................................
More informationWriting PostgreSQL Functions and how to debug them By Lloyd Albin
Writing PostgreSQL Functions and how to debug them By Lloyd Albin What we are going to cover Function Basics Procedural Languages Function Behavior NULL INPUT Security Syntax Inline (Function) Syntax Basic
More informationTriedy v C++ 1. Úvod do tried
1. Úvod do tried Používanie nového dátového typu ktorý budeme oht class trieda nás dovedie k využívaniu objektových vlastností jazyka C++. Tento nový typ programov OOP objektovo orientované programovanie
More informationORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems
ORACLE TRAINING CURRICULUM Relational Database Fundamentals Overview of Relational Database Concepts Relational Databases and Relational Database Management Systems Normalization Oracle Introduction to
More informationpackage balik; public class TopLevel1 {... }
Seminář Java Speciální třídy, výčtový typ Radek Kočí Fakulta informačních technologií VUT Březen 2010 Radek Kočí Seminář Java Speciální třídy, výčtový typ 1/ 20 Téma přednášky Vnořené třídy Anonymní třídy
More informationSun Certified MySQL Associate
310-814 Sun Certified MySQL Associate Version 3.1 QUESTION NO: 1 Adam works as a Database Administrator for a company. He creates a table named Students. He wants to create a new table named Class with
More informationWriting PL/SQL Executable Statements. Copyright 2007, Oracle. All rights reserved.
What Will I Learn? In this lesson, you will learn to: Construct accurate variable assignment statements in PL/SQL Construct accurate statements using built-in SQL functions in PL/SQL Differentiate between
More informationSQL: Data De ni on. B0B36DBS, BD6B36DBS: Database Systems. h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 3
B0B36DBS, BD6B36DBS: Database Systems h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 3 SQL: Data De ni on Mar n Svoboda mar n.svoboda@fel.cvut.cz 13. 3. 2018 Czech Technical University
More informationOracle 1Z Oracle Database 11g SQL Fundamentals I. Download Full Version :
Oracle 1Z1-051 Oracle Database 11g SQL Fundamentals I Download Full Version : https://killexams.com/pass4sure/exam-detail/1z1-051 QUESTION: 238 You need to perform these tasks: - Create and assign a MANAGER
More informationCourse Details Duration: 3 days Starting time: 9.00 am Finishing time: 4.30 pm Lunch and refreshments are provided.
Database Administration with PostgreSQL Introduction This is a 3 day intensive course in skills and methods for PostgreSQL. Course Details Duration: 3 days Starting time: 9.00 am Finishing time: 4.30 pm
More informationCOMP 430 Intro. to Database Systems. Encapsulating SQL code
COMP 430 Intro. to Database Systems Encapsulating SQL code Want to bundle SQL into code blocks Like in every other language Encapsulation Abstraction Code reuse Maintenance DB- or application-level? DB:
More informationArrays. Lecture 11 CGS 3416 Spring March 6, Lecture 11CGS 3416 Spring 2017 Arrays March 6, / 19
Arrays Lecture 11 CGS 3416 Spring 2017 March 6, 2017 Lecture 11CGS 3416 Spring 2017 Arrays March 6, 2017 1 / 19 Arrays Definition: An array is an indexed collection of data elements of the same type. Indexed
More informationDATABASE MANAGEMENT SYSTEMS PREPARED BY: ENGR. MOBEEN NAZAR
DATABASE MANAGEMENT SYSTEMS PREPARED BY: ENGR. MOBEEN NAZAR SCHEME OF PRESENTATION LAB MARKS DISTRIBUTION LAB FILE DBMS PROJECT INSTALLATION STEPS FOR SQL SERVER 2008 SETTING UP SQL SERVER 2008 INTRODUCTION
More informationDatabázové systémy. 10. prednáška. NoSQL databázy Viktor Škultéty, ESTEN s.r.o.
Databázové systémy 10. prednáška NoSQL databázy 26.4.2016 Viktor Škultéty, ESTEN s.r.o. 1 Prečo doteraz SQL a zrazu NoSQL? NoSQL - Not Only SQL znamená, že relačné systémy sú síce osvedčená technológia
More informationData Types in MySQL CSCU9Q5. MySQL. Data Types. Consequences of Data Types. Common Data Types. Storage size Character String Date and Time.
- Database P&A Data Types in MySQL MySQL Data Types Data types define the way data in a field can be manipulated For example, you can multiply two numbers but not two strings We have seen data types mentioned
More informationSQL STORED ROUTINES. CS121: Relational Databases Fall 2017 Lecture 9
SQL STORED ROUTINES CS121: Relational Databases Fall 2017 Lecture 9 SQL Functions 2 SQL queries can use sophisticated math operations and functions Can compute simple functions, aggregates Can compute
More informationPL/PGSQL AN INTRODUCTION ON USING IMPERATIVE PROGRAMMING IN POSTGRESQL
PL/PGSQL AN INTRODUCTION ON USING IMPERATIVE PROGRAMMING IN POSTGRESQL Robert Sosinski Founder & Engineering Fellow AGENDA PL/pgSQL: what it is and why it matters Volatility: living in an uncertain data
More information7. PL/SQL. 7.1 Introduction. PL/SQL = Procedural Language extensions to SQL
7. PL/SQL 7.1 Introduction PL/SQL = Procedural Language extensions to SQL Overcome declarative SQL s inability to specify control aspects of DB interaction. Add procedural capabilities to Oracle programming.
More informationObsah. SOA REST REST princípy REST výhody prest. Otázky
REST Peter Rybár Obsah SOA REST REST princípy REST výhody prest Otázky SOA implementácie WEB (1990) CORBA (1991) XML-RPC (1998) WS-* (1998) SOAP RPC/literal SOAP Document/literal (2001) REST (2000) SOA
More informationOracle Database 11g: SQL and PL/SQL Fundamentals
Oracle University Contact Us: +33 (0) 1 57 60 20 81 Oracle Database 11g: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn In this course, students learn the fundamentals of SQL and PL/SQL
More informationDatabase Programming with SQL
Database Programming with SQL 2-1 Objectives This lesson covers the following objectives: Apply the concatenation operator to link columns to other columns, arithmetic expressions, or constant values to
More informationCOP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA
COP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA OUTLINE Postgresql installation Introduction of JDBC Stored Procedure POSTGRES INSTALLATION (1) Extract the source file Start the configuration
More informationTYPY, KONŠTANTY, PROCEDÚRY A FUNKCIE PRE PRÁCU S POĽOM
TYPY, KONŠTANTY, PROCEDÚRY A FUNKCIE PRE PRÁCU S POĽOM Doposiaľ sme si ukázali základné štruktúry a jednotky jazyka. Pracovali sme s premennými rôznych typov ako aj s konštantnými hodnotami. Používali
More informationGridDB Advanced Edition SQL reference
GMA022C1 GridDB Advanced Edition SQL reference Toshiba Solutions Corporation 2016 All Rights Reserved. Introduction This manual describes how to write a SQL command in the GridDB Advanced Edition. Please
More informationDatabase Programming with PL/SQL
Database Programming with PL/SQL 5-4 Objectives This lesson covers the following objectives: List the benefits of using parameters with cursors Create PL/SQL code to declare and use a cursor with a parameter
More information