Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

Why isnt choosing a legal entity a onetime event?

Answered: 1 week ago