1 Pertemuan > Relational Model SQL DDL, SQL DML, Aljabar dan Kalkulus Matakuliah: >/ > Tahun: > Versi: >

Presentation on theme: "1 Pertemuan > Relational Model SQL DDL, SQL DML, Aljabar dan Kalkulus Matakuliah: >/ > Tahun: > Versi: >"— Presentation transcript:

1 Pertemuan > Relational Model SQL DDL, SQL DML, Aljabar dan Kalkulus Matakuliah: >/ > Tahun: > Versi: >

2 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Mahasiswa dapat menggunakan Relational model SQL DDL, SQL DML, Aljabar, dan Kalkulus

3 Outline Materi Pengenalan Relational Model Relational Aljabar Relational Kalkulus SQL

4 PENGENALAN RELATIONAL MODEL BEBERAPA ISTILAH PENTING – RELATION SCHEMA – RELATION INSTANCE – FIELD / COLUMN / ATTRIBUTE – DOMAIN – TUPLE / RECORD – DEGREE / ARITY

5 PENGENALAN RELATIONAL MODEL Contoh : Cardinality = 3, degree = 5, all rows distinct

6 QUERY RELATIONAL DATA RELATIONAL DATABASE QUERY Relational database: a set of relations Relation: made up of 2 parts:  Instance : a table, with rows and columns. #Rows = cardinality, #fields = degree / arity.  Schema : specifies name of relation, plus name and type of each column. Contoh : Students(sid: string, name: string, login:string, age: integer, gpa: real).

7 QUERY RELATIONAL DATA QUERY LANGUAGES Contoh : Tampilkan pelajar yang berusia 18 th SELECT * FROM Students S WHERE S.age=18

8 DESAIN LOGIKAL DATABASE ENTITY SETS TO TABLES Employees ssn name lot

9 DESAIN LOGIKAL DATABASE RELATIONSHIP SETS TO TABLES (WITHOUT CONSTRAINT) TRANSLATING RELATIONSHIP SETS WITH KEY CONSTRAINT dname did since lot name ssn Manages Employees Departments budget

10 DESAIN LOGIKAL DATABASE TRANSLATING RELATIONSHIPS WITH PARTICIPATION CONSTRAINTS lot name dname budgetdid since name dname budgetdid since Manages since Departments Employees ssn Works_In

11 DESAIN LOGIKAL DATABASE TRANSLATING WEAK ENTITY SETS lot name age pname Dependents Employees ssn Policy cost

12 DESAIN LOGIKAL DATABASE TRANSLATING CLASS HIERARCHIES Contract_Emps name ssn Employees lot hourly_wages ISA Hourly_Emps contractid hours_worked

13 DESAIN LOGIKAL DATABASE TRANSLATING ER DIAGRAMS WITH AGGREGATION ER TO RELATIONAL

14 PENGENALAN VIEWS UPDATE DESTROYING DROP TABLE Students ALTERING ALTER TABLE Students ADD COLUMN firstYear: integer

15 RELASI ALJABAR SELECTION DAN PROJECTION SET OPERATIONS –UNION –INTERSECTION –SET DIFFERENCE –CROSS-PRODUCT RENAMING JOINS DIVISION

16 RELASI ALJABAR R1 S1 S2

17 RELASI ALJABAR

18 RELASI ALJABAR

19 RELASI ALJABAR A B1 B2 B3 A/B1A/B2A/B3

20 RELASI KALKULUS TUPLE RELATIONAL CALCULUS DOMAIN RELATIONAL CALCULUS

21 SQL QUERY DASAR DML DDL SELECT UNION, INTERSECT, AND EXCEPT

22 SQL QUERY LANJUTAN NESTED QUERIES AGGREGATE OPERATORS – GROUP BY – HAVING NULL VALUES TRIGGERS AND ACTIVE DATABASES DESIGNING ACTIVE DATABASES

23 > Dilanjutkan ke pert. 03 Pengembangan Aplikasi Basis Data

Download ppt "1 Pertemuan > Relational Model SQL DDL, SQL DML, Aljabar dan Kalkulus Matakuliah: >/ > Tahun: > Versi: >"

Similar presentations