CJCoding With Joseph
15free / daySign inCreate account

Rename the Departments Table

The college now calls its departments faculties. Rename the whole departments table to faculties with one ALTER TABLE statement. Afterwards faculties must exist with every column departments had, and departments itself must no longer exist. The columns, rows and constraints all come along; only the table's name changes.

Expected result:

Table faculties
✓ id INTEGER PRIMARY KEY
✓ code TEXT NOT NULL
✓ name TEXT NOT NULL
✓ building TEXT
✓ budget REAL
✓ founded_year INTEGER
✓ phone TEXT
✓ email TEXT
✓ is_active INTEGER NOT NULL DEFAULT 1
✓ head_instructor_id INTEGER
✓ UNIQUE (code)

Table departments
✓ departments is dropped
Hints3 available
Topics:
ALTER & DROP
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sel, ins, desc)

Results

Run your SQL to see every statement's output here, then how it compares with the expected answer.

Not sure what is in a table? SHOW TABLES lists them and DESCRIBE students shows the columns — or open the database browser on the left.