There is a students
table below with a few columns and a few records rows.
Write a set of SQL statements to:
- create a new table
courses
with the following columns, data types and constraints.
column | data type | constraint |
---|
id | INTEGER | NOT NULL, PRIMARY KEY, AUTOINCREMENT |
name | TEXT | NOT NULL |
- Extract
distinct
names of all not-null unique
course
s students are enrolled in, from students
table, and insert them in the newly created courses
table.