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

ADD a COLUMN with ALTER TABLE

Oops! We forgot to add the university_shortname column to the professors table. You've probably already noticed:

In chapter 4 of this course, you'll need this column for connecting the professors table with the universities table.

However, adding columns to existing tables is easy, especially if they're still empty.

To add columns you can use the following SQL query:

ALTER TABLE table_name
ADD COLUMN column_name data_type;

Bu egzersiz

Introduction to Relational Databases in SQL

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

Egzersiz talimatları

Alter professors to add the text column university_shortname.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Add the university_shortname column
___
___ university_shortname ___;

-- Print the contents of this table
SELECT * 
FROM professors
Kodu Düzenle ve Çalıştır