alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Glassfish example source code file (RosterApp_derby.sql)

This example Glassfish source code file (RosterApp_derby.sql) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Glassfish tags/keywords

create, drop, foreign, key, key, not, not, null, primary, references, table, table, varchar, varchar

The Glassfish RosterApp_derby.sql source code

DROP TABLE TeamPlayer ;
DROP TABLE Player ;
DROP TABLE Team ;
DROP TABLE League ;

CREATE TABLE Player 
(
	player_Id VARCHAR(255) PRIMARY KEY NOT NULL, 
	name VARCHAR(255), 
	position VARCHAR(255), 
	salary DOUBLE PRECISION NOT NULL
);

CREATE TABLE League 
(
	league_Id VARCHAR(255) PRIMARY KEY NOT NULL, 
	name VARCHAR(255), 
	sport VARCHAR(255)
);

CREATE TABLE Team 
(
	team_Id VARCHAR(255) PRIMARY KEY NOT NULL, 
	city VARCHAR(255), 
	name VARCHAR(255),
	league_Id VARCHAR(255),
	FOREIGN KEY (league_Id)   REFERENCES League (league_Id)
);

CREATE TABLE TeamPlayer 
(
	player_Id VARCHAR(255) NOT NULL, 
        team_Id VARCHAR(255) NOT NULL, 
        CONSTRAINT pk_TeamPlayer PRIMARY KEY (player_Id, team_Id),
	FOREIGN KEY (team_Id)   REFERENCES Team (team_Id),
	FOREIGN KEY (player_Id)   REFERENCES Player (player_Id)
);

Other Glassfish examples (source code examples)

Here is a short list of links related to this Glassfish RosterApp_derby.sql source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.