Tabellen: de kern van elke database

Introductie tot relationele databases in SQL

Timo Grossenbacher

Data Journalist

Redundantie in de tabel university_professors

SELECT *
FROM university_professors
LIMIT 3;
Introductie tot relationele databases in 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)
Introductie tot relationele databases in SQL

Introductie tot relationele databases in SQL

Nu: één "entiteitstype" in de database

Introductie tot relationele databases in SQL

Een beter databasemodel met drie entiteitstypes

Oud:

Nieuw:

Introductie tot relationele databases in SQL

Een beter databasemodel met vier entiteitstypes

Introductie tot relationele databases in SQL

Nieuwe tabellen maken met CREATE TABLE

CREATE TABLE table_name (
 column_a data_type,
 column_b data_type,
 column_c data_type
);
Introductie tot relationele databases in SQL

Nieuwe tabellen maken met CREATE TABLE

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

Introductie tot relationele databases in SQL

Laten we oefenen!

Introductie tot relationele databases in SQL

Preparing Video For Download...