Tabel: Inti dari setiap database

Pengantar Basis Data Relasional dalam SQL

Timo Grossenbacher

Data Journalist

Redundansi dalam tabel university_professors

SELECT *
FROM university_professors
LIMIT 3;
Pengantar Basis Data Relasional dalam SQL
-[ RECORD 1 ]--------+-------------------------------------------------
firstname            | Karl
lastname             | Aberer
university           | ETH Lausanne
university_shortname | EPF
university_city      | Lausanne
function             | Chairman of L3S Advisory Board
organization         | L3S Advisory Board
organization_sector  | Education & research
-[ RECORD 2 ]--------+-------------------------------------------------
firstname            | Karl
lastname             | Aberer
university           | ETH Lausanne
university_shortname | EPF
university_city      | Lausanne
function             | Member Conseil of Zeno-Karl Schindler Foundation
organization         | Zeno-Karl Schindler Foundation
organization_sector  | Education & research
-[ RECORD 3 ]--------+-------------------------------------------------
firstname            | Karl
lastname             | Aberer
(truncated)
function             | Member of Conseil Fondation IDIAP
organization         | Fondation IDIAP
(truncated)
Pengantar Basis Data Relasional dalam SQL

Pengantar Basis Data Relasional dalam SQL

Saat ini: Satu "jenis entitas" di database

Pengantar Basis Data Relasional dalam SQL

Model database lebih baik dengan tiga jenis entitas

Lama:

Baru:

Pengantar Basis Data Relasional dalam SQL

Model database lebih baik dengan empat jenis entitas

Pengantar Basis Data Relasional dalam SQL

Buat tabel baru dengan CREATE TABLE

CREATE TABLE table_name (
 column_a data_type,
 column_b data_type,
 column_c data_type
);
Pengantar Basis Data Relasional dalam SQL

Buat tabel baru dengan CREATE TABLE

CREATE TABLE weather (
 clouds text,
 temperature numeric,
 weather_station char(5)
);

Pengantar Basis Data Relasional dalam SQL

Ayo berlatih!

Pengantar Basis Data Relasional dalam SQL

Preparing Video For Download...