1a select indeks from dosije where mesto_rodjenja='beograd' union select indeks from ispit where ocena=10 order by indeks desc;

Similar documents
Rešenja zadataka za vežbu na relacionoj algebri i relacionom računu

Uvod u relacione baze podataka

ukupan broj I kolokvijum poeni na testu II kolokvijum poeni na testu max max III kolokvijum

STUDY GUIDE. Learn Serbian. Have fun. GRAMMAR VOCABULARY PRACTICE ANSWER KEY. LESSON 14

Homework Assignment 2. Due Date: October 17th, CS425 - Database Organization Results

Dictionary: an abstract data type

Dictionary: an abstract data type

Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition

Geometry Chapter 3 3-6: PROVE THEOREMS ABOUT PERPENDICULAR LINES

Databases Exam HT2016 Solution

series. Utilize the methods of calculus to solve applied problems that require computational or algebraic techniques..

Lebesgue measure on R is just one of many important measures in mathematics. In these notes we introduce the general framework for measures.

Database Systems SQL. A.R. Hurson 323 CS Building

8.EE The Intersection of Two

Name: Block: Unit 2 Inequalities

4 CONNECTED PROJECTIVE-PLANAR GRAPHS ARE HAMILTONIAN. Robin Thomas* Xingxing Yu**

Recitation 7. Treaps and Combining BSTs. 7.1 Announcements. FingerLab is due Friday afternoon. It s worth 125 points.

Chapter 4. Measure Theory. 1. Measure Spaces

Gibbs Sampling Methods for Multiple Sequence Alignment

Skip Lists. What is a Skip List. Skip Lists 3/19/14

Sub-Queries in SQL SQL. 3 Types of Sub-Queries. 3 Types of Sub-Queries. Scalar Sub-Query Example. Scalar Sub-Query Example

Languages. Theory I: Database Foundations. Relational Algebra. Paradigms. Projection. Basic Operators. Jan-Georg Smaus (Georg Lausen)

Chapter 7. Inclusion-Exclusion a.k.a. The Sieve Formula

STAT 302 Introduction to Probability Learning Outcomes. Textbook: A First Course in Probability by Sheldon Ross, 8 th ed.

Homework 3 posted, due Tuesday, November 29.

Correlated subqueries. Query Optimization. Magic decorrelation. COUNT bug. Magic example (slide 2) Magic example (slide 1)

( ).666 Information Extraction from Speech and Text

Skylines. Yufei Tao. ITEE University of Queensland. INFS4205/7205, Uni of Queensland

Relational Design Theory I. Functional Dependencies: why? Redundancy and Anomalies I. Functional Dependencies

Circles & Interval & Set Notation.notebook. November 16, 2009 CIRCLES. OBJECTIVE Graph a Circle given the equation in standard form.

(b) y intercept. (m) slope. Slope Intercept Form. One way to write a linear equation is in Slope Intercept Form. Slope Intercept Form.

P Q1 Q2 Q3 Q4 Q5 Tot (60) (20) (20) (20) (60) (20) (200) You are allotted a maximum of 4 hours to complete this exam.

Lecture 24: Bloom Filters. Wednesday, June 2, 2010

12/3/2010 REVIEW ALGEBRA. Exam Su 3:30PM - 6:30PM 2010/12/12 Room C9000

Relational Database Design

Constraints: Functional Dependencies

Constraints: Functional Dependencies

Relational-Database Design

Introduction to Proofs

Review: Keys. What is a Functional Dependency? Why use Functional Dependencies? Functional Dependency Properties

Query Processing. 3 steps: Parsing & Translation Optimization Evaluation

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Chapter 2 - Basics Structures

SideNail. Martín Schonaker, Santiago Martínez

Chapter 4 Systems of Linear Equations; Matrices

PSU MATH RELAYS LOGIC & SET THEORY 2017

Quiz 2. Due November 26th, CS525 - Advanced Database Organization Solutions

1.4 Outer measures 10 CHAPTER 1. MEASURE

MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X.

Fibonacci (Min-)Heap. (I draw dashed lines in place of of circular lists.) 1 / 17

Weight-balanced Binary Search Trees

4. Probability of an event A for equally likely outcomes:

Introduction. Normalization. Example. Redundancy. What problems are caused by redundancy? What are functional dependencies?

) ( ) Thus, (, 4.5] [ 7, 6) Thus, (, 3) ( 5, ) = (, 6). = ( 5, 3).

Weight-balanced Binary Search Trees

Using the File Geodatabase API. Lance Shipman David Sousa

Intermediate Algebra Section 9.1 Composite Functions and Inverse Functions

DO FIVE OUT OF SIX ON EACH SET PROBLEM SET

DATABASE DESIGN I - 1DL300

Skip List. CS 561, Lecture 11. Skip List. Skip List

Complexity. CS 320, Fall Dr. Geri Georg, Instructor Some materials adapted from Prof. Wim Bohm.

2.5 Compound Inequalities

Binary Search Trees. Lecture 29 Section Robb T. Koether. Hampden-Sydney College. Fri, Apr 8, 2016

Name Date Partners. Lab 2 GAUSS LAW

MTH 202 : Probability and Statistics

Natural Numbers: Also called the counting numbers The set of natural numbers is represented by the symbol,.

Axioms of Probability

Gauss Law 1. Name Date Partners GAUSS' LAW. Work together as a group on all questions.

11 Block Designs. Linear Spaces. Designs. By convention, we shall

CMSC 132, Object-Oriented Programming II Summer Lecture 6:

Name Date Partners. Lab 4 - GAUSS' LAW. On all questions, work together as a group.

Extra Practice 1. Name Date. Lesson 4.1: Writing Equations to Describe Patterns

BASICS OF PROBABILITY CHAPTER-1 CS6015-LINEAR ALGEBRA AND RANDOM PROCESSES

Scheduling with AND/OR Precedence Constraints

UNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours.

The File Geodatabase API. Dave Sousa, Lance Shipman

SUCCEEDING IN THE VCE 2017 UNIT 3 SPECIALIST MATHEMATICS STUDENT SOLUTIONS

But RECAP. Why is losslessness important? An Instance of Relation NEWS. Suppose we decompose NEWS into: R1(S#, Sname) R2(City, Status)

The Jordan Canonical Form

Chapter 7: Relational Database Design

Dataflow Analysis. A sample program int fib10(void) { int n = 10; int older = 0; int old = 1; Simple Constant Propagation

1 Основни појмови егзактно посредног претраживања Релаксација и рестрикција

Functional Dependencies and Normalization. Instructor: Mohamed Eltabakh

2-INF-237 Vybrané partie z dátových štruktúr 2-INF-237 Selected Topics in Data Structures

Chapter 7: Relational Database Design. Chapter 7: Relational Database Design

Relational Algebra and Calculus

Chapter 1 (Basic Probability)

EECS 495: Randomized Algorithms Lecture 14 Random Walks. j p ij = 1. Pr[X t+1 = j X 0 = i 0,..., X t 1 = i t 1, X t = i] = Pr[X t+

Measures. Chapter Some prerequisites. 1.2 Introduction

Lecture 4: Hidden Markov Models: An Introduction to Dynamic Decision Making. November 11, 2010

INF1383 -Bancos de Dados

Regular Languages. Problem Characterize those Languages recognized by Finite Automata.

Fundamentals of Probability CE 311S

Section 2: Classes of Sets

Schema Refinement. Feb 4, 2010

G-C, G-CO Tangent Lines and the Radius of a Circle

2.3. Solving Absolute Value Inequalities. Inequalities ENGAGE. 2.3 Solving Absolute Value

CS 240 Data Structures and Data Management. Module 4: Dictionaries

Things to Know and Be Able to Do Understand the meaning of equations given in parametric and polar forms, and develop a sketch of the appropriate

Lecture 5: Hashing. David Woodruff Carnegie Mellon University

Transcription:

1a union b intersect c except 2 select d.indeks, count(*) br_ispita d join ispit i on d.indeks=i.indeks group by d.indeks union, 0 d where not exists ( select * i where d.indeks=i.indeks); 3, id_predmeta, ocena, case when ocena=10 then 'deset' when ocena=9 then 'devet' when ocena=8 then 'osam' when ocena=7 then 'sedam' when ocena=6 then 'sest' else 'nepolozen'

; end as rezultat_ispita, id_predmeta, ocena, case ocena when 10 then 'deset' when 9 then 'devet' when 8 then 'osam' when 7 then 'sedam' when 6 then 'sest' else 'nepolozen' end as rezultat_ispita ; 4 select naziv, case from predmet; 5 select kategorija, count(*) from (select naziv, case from predmet) as a group by kategorija; with predmet_kategorija (predmet, kategorija) as ( select naziv, case from predmet) select kategorija, count(*) from predmet_kategorija group by kategorija; 6 with student_bodovi as (, sum(bodovi) pol_bodovi i join predmet p on i.id_predmeta=p.id_predmeta

where ocena>5 ) select count(*) br_studenata from student_bodovi where pol_bodovi>10; 7 with student_ocene as (, ocena br8, cast(null as smallint) br9 where ocena=8 union all, cast(null as smallint) br8, ocena br9 where ocena=9), count(br8) broj_8, count(br9) broj_9 from student_ocene ; with student_8 as (, count(*) br8 where ocena=8 ), student_9 as (, count(*) br9 where ocena=9 ) select coalesce(s1.indeks, s2.indeks), coalesce(br8,0) broj_8, coalesce(br9, 0) broj_9 from student_8 s1 full outer join student_9 s2 on s1.indeks=s2.indeks;, sum(case when ocena=8 then 1 else 0 end) broj_8, sum(case when ocena=9 then 1 else 0 end) broj_9 having sum(case when ocena=8 then 1 else 0 end)>0 or sum(case when ocena=9 then 1 else 0 end)>0;, sum(case when ocena=8 then 1 else 0 end) broj_8, sum(case when ocena=9 then 1 else 0 end) broj_9 where ocena=8 or ocena=9

; 8 insert into dosije (indeks, ime, prezime, god_rodjenja, mesto_rodjenja) values (20100028, 'Marko', 'Markovic', 1990, 'Kragujevac'); 9 insert into predmet values (2005, 'P112', 'Uvod u arhitekturu racunara', 6), (2006, 'P116', 'Razvoj softvera', 6); 10 insert into ispit (indeks, id_predmeta, godina_roka, oznaka_roka, ocena), id_predmeta, 2011, 'jun', 9, predmet where god_rodjenja=1991 and naziv='programiranje 2'; 11 delete where god_rodjenja=1990; 12 delete where id_predmeta in ( select id_predmeta from predmet where naziv='programiranje 2' or bodovi=15); 13 update predmet set bodovi=bodovi*1.2 where sifra like 'P%'; 14 update ispit set (godina_roka, oznaka_roka, datum_ispita)=(2011, 'jun', null) where id_predmeta in (select id_predmeta from predmet where naziv='analiza 1') and godina_roka=2011 and oznaka_roka='jan'; 15 update predmet set bodovi=(select max(bodovi) from predmet) where exists ( select * i join dosije d on i.indeks=d.indeks and i.id_predmeta=predmet.id_predmeta); 16 select distinct coalesce(ir.naziv, nema odgovarajuceg ), coalesce(p.naziv, nema odgovarajuceg )

ni_rok ir left outer join ispit i on ir.godina_roka=i.godina_roka and ir.oznaka_roka=i.oznaka_roka full outer join predmet p on p.id_predmeta=i.id_predmeta; 17 with pom as (, count(distinct id_predmeta) br_polozenih, avg(ocena+0.0) prosek i join predmet p on p.id_predmeta=i.id_predmeta where ocena>5 having sum(bodovi) between 15 and 25) select d.indeks, ime, prezime, count(distinct id_predmeta) br_polaganih, br_polozenih, prosek d join pom on d.indeks = pom.indeks join ispit i on i.indeks = d.indeks group by d.indeks, ime, prezime, br_polozenih,prosek order by d.indeks