Question
Create a table called client with the following columns: id - an auto-incrementing integer which is the primary key, size 11 first_name - a varchar
Create a table called client with the following columns:
id- an auto-incrementing integer which is the primary key, size 11
first_name- a varchar with a maximum length of 255 characters, cannot be null
last_name- a varchar with a maximum length of 255 characters, cannot be null
email- a varchar with a maximum length of 255 characters, cannot be null
The combination of the first_nameand last_name must be unique in this table. Name this constraint as full_name
Create a table called employee with the following columns:
id- an auto-incrementing integer which is the primary key, size 11
first_name- a varchar of maximum length 255, cannot be null
last_name- a varchar of maximum length 255, cannot be null
start_date- a date, cannot be null
email- a varchar with a maximum length of 255 characters, cannot be null
The combination of the first_nameand last_name must be unique in this table. Name this constraint as full_name
Create a table called project with the following columns:
id- an auto-incrementing integer which is the primary key, size 11
title- a varchar of maximum length 255, cannot be null
comments- a text column
cid- an integer which is a foreign key reference to the client table
The project titlemust be unique in this table
Create a table called works_on representing a many-to-many relationship between employees and projects, with the following properties:
pid- an integer which is a foreign key reference to the project table
eid- an integer which is a foreign key reference to the employee table
due_date- a date, not null
The primary key is a combination of eid and pid
Do not name any constraints other than the full_name for client and employee.
Step 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