Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a new database in your instance of Postgres. The database should contain information about a festival that has several zones. Each zone is dedicated

Create a new database in your instance of Postgres.
The database should contain information about a festival that has several zones. Each zone is dedicated to a specific topic (e.g. music, food court, ecological zone, etc.). Every zone also has employees (one employee can work at different zones).
Write SQL-DDL statements to create a database, that should contain the following four tables:
zone: id, name, designation (food, concert/music, info), opening date, closing date. Primary key - id, auto generated;
employee: id, name, surname, date of birth, gender, status (working, vacation, quit), salary, experience description (can be empty). Primary key - id, auto generated;
participant: id, name, surname, date of birth, gender, preferred zone (should be chosen from the zone table). Primary key - id, auto generated;
employeezones: emp_id, zone_id, two dates - when employee started and ended (can be empty) working in this zone. This table stores workplaces of employees. One employee can work in multiple zones at the same time. Primary key - a group of two attributes {emp_id, zone_id}.
You can write create or replace commands for convenience.
Use foreign key constraints to maintain referential integrity. Add 2 useful check constraints as well.

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

Step: 3

blur-text-image

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

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions