BaşlayınÜcretsiz Başlayın

User-defined data types

ENUM or enumerated data types are great options to use in your database when you have a column where you want to store a fixed list of values that rarely change. Examples of when it would be appropriate to use an ENUM include days of the week and states or provinces in a country.

Another example can be the directions on a compass (i.e., north, south, east and west.) In this exercise, you are going to create a new ENUM data type called compass_position.

Bu egzersiz

Functions for Manipulating Data in PostgreSQL

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Create an enumerated data type, compass_position
___ ___ ___ AS ___ (
  	-- Use the four cardinal directions
  	'___', 
  	'___',
  	'___', 
  	'___'
);
Kodu Düzenle ve Çalıştır