CJCoding With Joseph
15free / daySign inCreate account
TitleOpen
86
Your First TableCreate a table called buildings with two columns: id, an INTEGER PRIMARY KEY, and name, a TEXT column that is NOT NULL.
easyNot startedSolve
87
Fill the Blanks With DefaultsCreate events with four columns: id INTEGER PRIMARY KEY; title TEXT NOT NULL; attendees INTEGER NOT NULL DEFAULT 0; and is_public INTEGER NOT NULL DEFAULT 1.
easyNot startedSolve
88
No Two Rooms Share a CodeCreate rooms with id INTEGER PRIMARY KEY, code TEXT NOT NULL UNIQUE and capacity INTEGER (NULL allowed).
easyNot startedSolve
89
Prices Are Not Whole NumbersCreate textbooks with id INTEGER PRIMARY KEY, title TEXT NOT NULL, price REAL NOT NULL and pages INTEGER (optional).
easyNot startedSolve
90
Link Labs to DepartmentsCreate labs with id INTEGER PRIMARY KEY, name TEXT NOT NULL and department_id INTEGER NOT NULL that REFERENCES departments(id).
easyNot startedSolve
91
Rules the Database EnforcesCreate clubs with id INTEGER PRIMARY KEY; name TEXT NOT NULL UNIQUE; founded_year INTEGER with a CHECK that it is at least 1900 (NULL is allowed, so a club with an unknown founding year passes); and member_cap INTEGER NOT NULL DEFAULT 30 with a CHECK that it is greater than 0.
mediumNot startedSolve
92
One Membership per Student per ClubCreate memberships to record which students belong to which clubs: id INTEGER PRIMARY KEY; student_id INTEGER NOT NULL that REFERENCES students(id); club_id INTEGER NOT NULL (no clubs table exists yet, so no foreign key here); joined_on TEXT NOT NULL DEFAULT CURRENT_DATE; and a table-level UNIQUE (student_id, club_id).
mediumNot startedSolve
93
Permits That Vanish With the StudentCreate parking_permits: id INTEGER PRIMARY KEY; student_id INTEGER NOT NULL that REFERENCES students(id) with ON DELETE CASCADE; plate TEXT NOT NULL UNIQUE; and expires_on TEXT (optional).
mediumNot startedSolve
94
Every Rule at OnceCreate exams with every kind of rule at once: id INTEGER PRIMARY KEY; course_id INTEGER NOT NULL that REFERENCES courses(id) ON DELETE CASCADE; title TEXT NOT NULL; exam_date TEXT NOT NULL; weight REAL NOT NULL DEFAULT 0.25 with a CHECK that it is greater than 0 and at most 1; max_marks INTEGER NOT NULL DEFAULT 100 with a CHECK that it is greater than 0; room TEXT (optional); and a table-level UNIQUE (course_id, exam_date).
hardNot startedSolve
95
Clubs and MembershipsBuild two related tables in one script.
hardNot startedSolve