Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 projectsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started