Question #57490

Atlanta Club is a new football club in the United States based in Mesa, Arizona. The football team
comprises young and upcoming players from various parts of the country and participates in professional

Based on your initial meeting with the management of Atlanta Club, you have analyzed that the players
are selected to play for the following positions:
 Goal keeper
 Defender
 Midfielder
 Forward
The Team Manager monitors the player’s performances in a game and grades them at a scale of 1 to 5.

Expert's answer

create database football
use football
create table player
(
Player_id int NOT NULL,
position_id int NOT NULL,
Name varchar(255) NOT NULL,
PRIMARY KEY (Player_id)
)
create table position
(
Position_id int NOT NULL,
Name varchar(255) NOT NULL,
description varchar(255) NOT NULL,
PRIMARY KEY (position_id)
)
create table matches
(
match_id int NOT NULL,
tournamentName varchar(80) NOT NULL,
dateandtime datetime ,
venue varchar(255) NOT NULL,
opponent_team varchar(255) NOT NULL,
PRIMARY KEY (match_id)
)
create
table
team
(
team_id int NOT NULL,
match_id int NOT NULL,
player_id int not null,
PRIMARY KEY (team_id)
)
package football;
import java.sql.*;
import java.util.*;
public class Football {
public static void main(String[] args) {
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/football","root","niit");
Statement st = con.createStatement();
Scanner sc = new Scanner(System.in);
System.out.println("Enter player id ");
int playerid = sc.nextInt();
System.out.println("Enter position id ");
int positionid = sc.nextInt();
System.out.println("Enter player name ");
String name = sc.next();
int i = st.executeUpdate("insert into player values ('"+playerid+"','"+positionid+"','"+name+"')");
if (i > 0)
{
System.out.println("data successfully inserted ..");
}
Statement st3 = con.createStatement();
Scanner sc3 = new Scanner(System.in);
System.out.println("Enter position id ");
int pid = sc3.nextInt();
System.out.println("Enter name ");
String pname = sc3.next();
System.out.println("Enter description ");
String description = sc3.next();
int k = st3.executeUpdate("insert into team values ('"+pid+"','"+pname+"','"+description+"')");
if (k > 0)
{
System.out.println("data successfully inserted ...");
}
}
Statement st2 = con.createStatement();
Scanner sc2 = new Scanner(System.in);
System.out.println("Enter match id ");
int mid = sc2.nextInt();
System.out.println("Enter tournament name ");
String tournamentname = sc2.next();
System.out.println("Enter venue ");
String venue = sc2.next();
System.out.println("Enter opponent team ");
String opponentteam = sc2.next();
int z = st2.executeUpdate("insert into matches values ('"+mid+"','"+tournamentname+"','2015-12-10','"+venue+"','"+opponentteam+"')");
if(z>0)
{
System.out.println("data successfully inserted ...");
}
Statement st1 = con.createStatement();
Scanner sc1 = new Scanner(System.in);
System.out.println("Enter team id ");
int id = sc1.nextInt();
System.out.println("Enter match id ");
int maid = sc1.nextInt();
System.out.println("Enter player id ");
int plid = sc1.nextInt();
int y = st1.executeUpdate("insert into team values ('"+id+"','"+maid+"','"+plid+"')");
if(y>0)
{
System.out.println("data successfully inserted ..");
}
}
catch(Exception e)
{
System.out.println(e);
}
}
import java.text.DateFormat;
import java.util.Date;
public class dateformatExample {
public static void main(String[] args) {
Date now = new Date();
DateFormat defaultDf = DateFormat.getDateInstance();
DateFormat shortDf = DateFormat.getDateInstance(DateFormat.SHORT);
System.out.println("1." + defaultDf.format(now));
System.out.println("2." + shortDf.format(now));
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS