Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following is a database design about students, who may major and minor in zero or more areas, where each area belongs to one school.

image text in transcribed
image text in transcribed
The following is a database design about students, who may major and minor in zero or more areas, where each area belongs to one school. The following ER diagram shows the idea: Nane Nane Age id Name Id Id Gender Student Majors) Area - Belongs)-- School Minors Clearly, all together 5 tables will be needed. The following are the SQL statements to create some of these 5 tables: CREATE TABLE School ( INTEGER PRIMARY KEY, Id Name VARCHAR (45) UNIQUE NOT NULL CREATE TABLE Area ( INTEGER PRIMARY KEY, Id Name VARCHAR (25) UNIQUE NOT NULL, School INTEGER NOT NULL REFERENCES School (id) ON DELETE CASCADE CREATE TABLE Majors ( Student INTEGER REFERENCES Student (Id) ON DELETE CASCADE, Area INTEGER REFERENCES Area (Id), PRIMARY KEY (Student, Area) CREATE TABLE Student ( INTEGER PRIMARY KEY Id Name VARCHAR (30) NOT NULL Age INTEGER NOT NULL, Gender CHAR (1) NOT NULL CHECK (Gender IN ('M,F CREATE TABLE Minors ( Student INTEGER

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago