Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Summary Create tables using create table statements in SQL Each table must have a primary key, which might span more than one column. When appropriate,

Summary

  1. Create tables using create table statements in SQL
  2. Each table must have a primary key, which might span more than one column.
  3. When appropriate, you should create a check constraint for a column to enforce the value restriction described.

image text in transcribed

There are 4 relations in the schema. Each are described below along with their integrity constraints . Player ( playerlD: number(9), name : varchar2(50) position varchar2(10), height: number(3) weight: number(3) team: varchar2(30) o Each Player is assigned a unique playerlD o The position of a player can either be Guard, Center or Forward o The team field is a foreign key to Team o height and weight can be NULL, but no other column may be . Team name: varchar2(30), city varchar2(20) o o o Each Team has a unique name associated with it. There can be multiple teams from the same city No column may be NULL . Game ( gamelD: number(9) homeTeam: varchar2(30), awayTeam : varchar2(30) homeScore number(3) awayScore : number(3), o Each Game has a unique gamelD o The fields homeTeam and awayTeam are foreign keys to Team. o Two teams may play each other multiple times each season o There is an integrity check to ensure home Team and awayTeam are different o Both homeScore and awayScore must be non-negative values o No column may be NULL . GameStats ( playerlD: number(9), gamelD: number(9) points: number(3), assists: number(3), rebounds: number(3), o GameStats records the performance statistics of a player within a game o A player may not play in every game, in which case he/she will not have his/her statistics recorded for that game o gamelD is a foreign key to Game o playerlD is a foreign key to Player o No column may be NULL

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

More Books

Students also viewed these Databases questions

Question

When should you avoid using exhaust brake select all that apply

Answered: 1 week ago