Dokumen tersebut membahas tentang join beberapa tabel, fungsi agregat, dan contoh-contoh kueri SQL untuk mengambil dan memanipulasi data dari beberapa tabel film, reviewer, dan rating.
OpenSplice DDS: The Open Source Middleware Accelerating Wall StreetAngelo Corsaro
In the past few years Open Source has enjoyed an increasingly swift adoption within Capital Markets. This growth has been motivated by the control provided over the technology, as opposed to the lock-in and inflexibility characteristic of proprietary technology, and the performance that Open Source Software has been able to deliver.
Pair Programming inseamna 1 PC, 2 oameni, 4 maini. O metoda din XtremeProgramming care dezvolta skill-urile programatorilor facandu-i sa invete unii de la ceilalti si creste calitatea produselor software.
OpenSplice DDS: The Open Source Middleware Accelerating Wall StreetAngelo Corsaro
In the past few years Open Source has enjoyed an increasingly swift adoption within Capital Markets. This growth has been motivated by the control provided over the technology, as opposed to the lock-in and inflexibility characteristic of proprietary technology, and the performance that Open Source Software has been able to deliver.
Pair Programming inseamna 1 PC, 2 oameni, 4 maini. O metoda din XtremeProgramming care dezvolta skill-urile programatorilor facandu-i sa invete unii de la ceilalti si creste calitatea produselor software.
Vortex: The Intelligent Data Sharing Platform for the Internet of ThingsAngelo Corsaro
The real value of the Internet of Things (IoT) and the Industrial Internet (I2) are ubiquitous information availability and consequently the decisions that can be made from it. If we look at the technology landscape, there isn’t a single platform that provides efficient, timely and ubiquitous data sharing across network-connected devices. Well… I should better say there wasn’t until now!
Vortex is the first platform to enable ubiquitous, efficient and timely data sharing across mobile, embedded, desktop, cloud and web applications. This presentation will (1) introduce the elements that make the Vortex platform and (2) describe its applicability
What is inclusion? How do class reviews and focusing on in-class support help us build more inclusive schools where all students belong socially, emotionally and intellectually? How do we work as district staff within this focus to keep the dream alive?
This presentation introduces dscript, a framework that brings DDS-like publish/subscribe to the Web Browser. Beyond providing an inter-browser Pub/Sub abstraction, dscript provides with a semaless integratio with native DDS applications. Meaning that data can flow effortlessly from native DDS applications to the browser and viceversa.
OpenSplice DDS enables seamless, timely, scalable and dependable data sharing between distributed applications and network-connected devices. Its technical and operational benefits have propelled adoption across multiple industries, such as Defence and Aerospace, SCADA, Gaming, Cloud Computing, Automotive, etc.
If you want to learn about OpenSplice DDS or discover some of its advanced features, this webcast is for you!
In this two-parts webcast we will cover all the aspects tied to architecting and developing OpenSplice DDS systems. We will look into Quality of Services, data selectors concurrency and scalability concerns.
We will present the brand-new, and recently finalized, C++ and Java APIs for DDS, including examples of how this can be used with C++11 features. We will show how, increasingly popular, functional languages such as Scala can be used to efficiently and elegantly exploit the massive HW parallelism provided by modern multi-core processors.
Finally we will present some OpenSplice specific extensions for dealing very high-volumes of data – meaning several millions of messages per seconds.
Vortex: The Intelligent Data Sharing Platform for the Internet of ThingsAngelo Corsaro
The real value of the Internet of Things (IoT) and the Industrial Internet (I2) are ubiquitous information availability and consequently the decisions that can be made from it. If we look at the technology landscape, there isn’t a single platform that provides efficient, timely and ubiquitous data sharing across network-connected devices. Well… I should better say there wasn’t until now!
Vortex is the first platform to enable ubiquitous, efficient and timely data sharing across mobile, embedded, desktop, cloud and web applications. This presentation will (1) introduce the elements that make the Vortex platform and (2) describe its applicability
What is inclusion? How do class reviews and focusing on in-class support help us build more inclusive schools where all students belong socially, emotionally and intellectually? How do we work as district staff within this focus to keep the dream alive?
This presentation introduces dscript, a framework that brings DDS-like publish/subscribe to the Web Browser. Beyond providing an inter-browser Pub/Sub abstraction, dscript provides with a semaless integratio with native DDS applications. Meaning that data can flow effortlessly from native DDS applications to the browser and viceversa.
OpenSplice DDS enables seamless, timely, scalable and dependable data sharing between distributed applications and network-connected devices. Its technical and operational benefits have propelled adoption across multiple industries, such as Defence and Aerospace, SCADA, Gaming, Cloud Computing, Automotive, etc.
If you want to learn about OpenSplice DDS or discover some of its advanced features, this webcast is for you!
In this two-parts webcast we will cover all the aspects tied to architecting and developing OpenSplice DDS systems. We will look into Quality of Services, data selectors concurrency and scalability concerns.
We will present the brand-new, and recently finalized, C++ and Java APIs for DDS, including examples of how this can be used with C++11 features. We will show how, increasingly popular, functional languages such as Scala can be used to efficiently and elegantly exploit the massive HW parallelism provided by modern multi-core processors.
Finally we will present some OpenSplice specific extensions for dealing very high-volumes of data – meaning several millions of messages per seconds.
2. Tabel Movie
mID Title Year Director
101 Gone with the Wind 1939 Victor Fleming
102 Star Wars 1977 George Lucas
103 The Sound of Music 1965 Robert Wise
104 E.T. 1982 Steven Spielberg
105 Titanic 1997 James Cameron
106 Show White 1937
107 Avatar 2009 James Cameron
108 Raiders of the Lost Ark 1982 Steven Spielberg
Kalkulus Relasional 2
3. Tabel Reviewer
rID Name
201 Sarah Martinez
202 Daniel Lewis
203 Brittany Harris
204 Mike Anderson
205 Chris Jackson
206 Elizabeth Thomas
207 James Cameron
208 Ashley White
Kalkulus Relasional 3
5. Kueri 1
Semua judul film yang disutradarai oleh James
Cameron
judul film: Movie
sutradara: Movie
SELECT title
FROM Movie
WHERE director = 'James Cameron'
Kalkulus Relasional 5
6. Kueri 2
Tampilkan tahun publikasi film untuk semua film
yang mendapat rating 4 atau 5. Urutkan hasilnya dari
besar ke kecil.
Tahun publikasi: Movie
Nilai rating: Rating
SELECT m.year
FROM Movie m, Rating r
WHERE m.mID = r.mID
AND r.stars IN (4, 5)
ORDER BY m.year DESC
Kalkulus Relasional 6
7. Kueri 3
Ada reviewer yang tidak mencantumkan tanggal
ketika mereka memberikan rating kepada sebuah film.
Tampilkan nama semua reviewer yang tidak
mencantumkan tanggal dalam rating mereka
tanggal rating: Rating
nama reviewer: Reviewer
SELECT rv.name
FROM Reviewer rv, Rating rt
WHERE rv.rID = rt.rID
AND rt.ratingDate IS NULL
Kalkulus Relasional 7
8. Fungsi Agregat
Fungsi agregatku ada lima,
macam-macam ragamnya
MAX
MIN
SUM
AVG
COUNT
Aggregate: Mengumpulkan beberapa data
Kalkulus Relasional 8
9. Fungsi Agregat
Dicantumkan dalam klausa SELECT
Dikombinasikan dengan klausa GROUP BY
SELECT MAX(stars) FROM Rating;
SELECT MIN(stars) FROM Rating;
SELECT COUNT(*) FROM Rating;
SELECT AVG(stars) FROM Rating;
Kalkulus Relasional 9
10. Klausa GROUP BY
Menjelaskan atribut mana yang tidak diagregatkan
SELECT rID, MAX(stars)
FROM Rating
GROUP BY rID;
Tampilkan nama reviewer dan nilai rating terkecil yang pernah
mereka berikan. Urutkan berdasarkan nama reviewer.
nama reviewer: Reviewer
nilai rating: Rating
nilai rating terkecil: MIN(stars)
(lanjutkan)
Kalkulus Relasional 10
11. Bonus Time!
Tampilkan nama reviewer dan nilai rating terkecil yang pernah
mereka berikan. Urutkan berdasarkan nama reviewer.
SELECT rv.name, MIN(rt.stars)
FROM Reviewer rv, Rating rt
WHERE rv.rID = rt.rID
GROUP BY rv.name
ORDER BY rv.name;
Kalkulus Relasional 11
12. Latihan (Tugas Mandiri)
Tampilkan gaji minimum, gaji maksimum, jumlah
gaji, dan rata-rata gaji untuk setiap jenis
pekerjaan.
Tampilkan jumlah orang yang memiliki jenis
pekerjaan yang sama.
Buat kueri yang menampilkan selisih antara gaji
maksimum dengan gaji minimum. Beri label
“Perbedaan Gaji”.
13. Kombinasi dengan klausa
WHERE
Apa beda antara
SELECT rID, AVG(stars)
FROM Rating
GROUP BY rID ORDER BY rID;
dengan
SELECT rID, AVG(stars)
FROM Rating
WHERE stars > 3
GROUP BY rID ORDER BY rID;
Kalkulus Relasional 13
14. Klausa HAVING
Tampilkan ID reviewer dan rata-rata rating yang
pernah mereka berikan, yang nilai rata-ratanya lebih
besar dari 3
SELECT rID, AVG(stars)
FROM Rating
GROUP BY rID ORDER BY rID
HAVING AVG(stars) > 3;
Kalkulus Relasional 14
16. Menambahkan Baris Baru
Sisipkan sebuah baris baru yang berisi nilai untuk setiap field.
Tuliskan nilai-nilai tiap field sesuai urutan field dalam
spesifikasi tabel
Secara opsional, tuliskan hanya field-field yang diperlukan.
INSERT INTO departments(department_id, department_name,
manager_id, location_id)
VALUES (70, 'Public Relations', 100, 1700);
1 row created.
Apit data karakter dan waktu dalam sepasang single quote.
17. Menyisipkan Baris Baru
dengan Nilai Null kolom dari daftar kolom
Secara implisit: Hilangkan nama
pada pernyataan INSERT.
INSERT INTO departments (department_id,
department_name )
VALUES (30, 'Purchasing');
1 row created.
Secara eksplisit: Tuliskan keyword NULL pada klausa
VALUES.
INSERT INTO departments
VALUES (100, 'Finance', NULL, NULL);
1 row created.
18. Menyisipkan Nilai Khusus
Fungsi SYSDATE mencatat tanggal dan waktu saat ini.
INSERT INTO employees (employee_id,
first_name, last_name,
email, phone_number,
hire_date, job_id, salary,
commission_pct, manager_id,
department_id)
VALUES (113,
'Louis', 'Popp',
'LPOPP', '515.124.4567',
SYSDATE, 'AC_ACCOUNT', 6900,
NULL, 205, 100);
1 row created.
19. Menyisipkan Nilai Tanggal
Tertentu
INSERT INTO employees
VALUES (114,
'Den', 'Raphealy',
'DRAPHEAL', '515.127.4561',
TO_DATE('FEB 3, 1999', 'MON DD, YYYY'),
'AC_ACCOUNT', 11000, NULL, 100, 30);
1 row created.
20. Menyalin Baris dari Tabel lain
Tuliskan pernyataan INSERT dengan sebuah subkueri.
INSERT INTO sales_reps(id, name, salary, commission_pct)
SELECT employee_id, last_name, salary, commission_pct
FROM employees
WHERE job_id LIKE '%REP%';
4 rows created.
Cocokkan jumlah kolom pada klausa INSERT dengan yang ada
pada subkueri.
Jangan lupa mencocokkan tipe data.
21. Mengubah Baris dalam Tabel
Baris tertentu diubah jika secara eksplisit klausa WHERE
dituliskan.
UPDATE employees
SET department_id = 70
WHERE employee_id = 113;
1 row updated.
Semua baris dalam tabel akan diubah jika klausa WHERE
dihilangkan.
UPDATE copy_emp
SET department_id = 110;
22 rows updated.
22. Menghapus Baris dari Tabel
Baris tertentu dihapus menggunakan klausa WHERE.
DELETE FROM departments
WHERE department_name = 'Finance';
1 row deleted.
Semua baris akan terhapus apabila klausa WHERE tidak
dinyatakan secara eksplisit.
DELETE FROM copy_emp;
22 rows deleted.
Klausa WHERE dapat menggunakan klausa IN.