Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.79 KB | None | 0 0
  1. CREATE TABLE club (club_id INTEGER NOT NULL,
  2.                    club_name CHAR(25) NOT NULL,
  3.                    club_city CHAR(25) NOT NULL,
  4.                    club_addr CHAR(100) NOT NULL,
  5.                    club_guest_count INTEGER NOT NULL,
  6.                    PRIMARY KEY(club_id));
  7.  
  8. CREATE TABLE coach (coach_id INTEGER NOT NULL,
  9.                     coach_name CHAR(25) NOT NULL,
  10.                     coach_rating double precision NOT NULL,
  11.                     coach_marked_workouts_count INTEGER NOT NULL,
  12.                     PRIMARY KEY(coach_id));
  13.  
  14. CREATE TABLE sport (sport_id INTEGER NOT NULL,
  15.                     sport_name CHAR(25) NOT NULL,
  16.                     PRIMARY KEY(sport_id));
  17.  
  18. CREATE TABLE workout (w_id INTEGER NOT NULL,
  19.                       w_clubid INTEGER NOT NULL,
  20.                       w_sportid INTEGER NOT NULL,
  21.                       w_coachid INTEGER NOT NULL,
  22.                       w_date DATETIME NOT NULL,
  23.                       w_type CHAR(1) NOT NULL,
  24.                       w_places INTEGER NOT NULL,
  25.                       w_duribility CHAR(10) NOT NUll,
  26.                       PRIMARY KEY(w_id));
  27.  
  28. CREATE TABLE client (client_id INTEGER NOT NULL,
  29.                      client_name CHAR(50) NOT NULL,
  30.                      client_birth_date DATE NOT NULL,
  31.                      client_clubid INTEGER NOT NULL,
  32.                      client_login CHAR(30) NOT NULL,
  33.                      client_password CHAR(30) NOT NULL,
  34.                      client_email CHAR(30) NOT NULL,
  35.                      PRIMARY KEY(client_id));
  36.  
  37. CREATE TABLE client_workout (cw_clientid INTEGER NOT NULL,
  38.                              cw_workoutid INTEGER NOT NULL,
  39.                              cw_rating CHAR(10) NOT NULL,
  40.                              PRIMARY KEY(cw_clientid, cw_workoutid));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement