Question: Using the Apache Cassandra schema below, create an SQL CHECK statement as described in Chapter 3 to express an integrity constraint that states that the
Using the Apache Cassandra schema below, create an SQL CHECK statement as described in Chapter 3 to express an integrity constraint that states that the duration spent in a project cannot exceed 48 months.


CREATE KEYSPACE firm WITH replication = \{'class': 'SimpleStrategy', 'replication_factor' : 3\}; CREATE TABLE firm.employees ( eno text PRIMARY KEY, name text, title text ) WITH comment = 'Information about the employees'; CREATE TABLE firm.assignments ( eno text, pno text, responsibility text, duration smallint, PRIMARY KEY ((pno), eno) ) WITH comment = 'Which employees have been assigned to which projects, for what duration (in months), and with what responsibility.'; CREATE TABLE firm.projects ( pno text PRIMARY KEY, name text, budget int, location text ) WITH comment = 'Information about projects.'; CREATE KEYSPACE firm WITH replication = \{'class': 'SimpleStrategy', 'replication_factor' : 3\}; CREATE TABLE firm.employees ( eno text PRIMARY KEY, name text, title text ) WITH comment = 'Information about the employees'; CREATE TABLE firm.assignments ( eno text, pno text, responsibility text, duration smallint, PRIMARY KEY ((pno), eno) ) WITH comment = 'Which employees have been assigned to which projects, for what duration (in months), and with what responsibility.'; CREATE TABLE firm.projects ( pno text PRIMARY KEY, name text, budget int, location text ) WITH comment = 'Information about projects
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
