CUSTOMER CustomerNumber CustomerLastName CustomerFirstName
CUSTOMER ( CustomerNumber, CustomerLastName, CustomerFirstName, Phone) COURSE ( CourseNumber, Course, CourseDate, Fee) ENROLLMENT ( CustomerNumber, CourseNumber, AmountPaid) where: CustomerNumber in ENROLLMENT must exist in CustomerNumber in CUSTOMER CourseNumber in ENROLLMENT must exist in CourseNumber in COURSE CustomerNumber and CourseNumber are surrogate keys. Therefore, these numbers will never be modified, and there is no need for cascading updates. No customer data are ever deleted, so there is no need to cascade deletions. Courses can be deleted. If there are enrollment entries for a deleted class, they should also be deleted. These tables, referential integrity constraints, and data are used as the basis for the SQL statements you will create in the exercises that follow. For each SQL statement you write, show the results based on these data. Use data types consistent with what we have shown in class. 3.52. Write the SQL statements necessary to create the tables and their referential integrity constraints. 3.53. Populate the tables with data. 3.54. Write an SQL query to list all occurrences of Adv. Pastels. Include all associated data for each occurrence of the class. 3.55. Write an SQL query to list all students and courses they are registered for. Include, in this order, CustomerNumber, CustomerLastName, CustomerFirstName, Phone, CourseNumber, and AmountPaid. 3.56. Write an SQL query to list all students registered in Adv. Pastels start-ing on October 1, 2013. Include, in this order, Course, CourseDate, Fee, CustomerLastName, CustomerFirstName, and Phone. 3.57. Write an SQL query to list all students registered in Adv. Pastels starting on October 1, 2013. Include in this order, Course, CourseDate, CustomerLastName, CustomerFirstName, Phone, Fee, and AmountPaid. Use a join. 3.58. Modify your query to include all students, regardless of whether they registered in Adv. Pastels, starting October 1, 2013. Include, in this order, CustomerLastName, CustomerFirstName, Phone, Course, CourseDate, Fee, and AmountPaid.
Solution
import java.awt.*;
import java.applet.*;
public category Tank extends applications programme
purpose target;
public int x, y, w, h;
public int maxX=400,maxY=360,minX=0,minY=0;
public int maxFire; // the utmost quantity of shots allowed for the tank to fireside promptly
public int gamma hydroxybutyrateShells; // The max range of shells allowed to be pink-slipped
public Boolean isMoving, isAlive, exploded;
Graphics g;
Tank()
public Tank(int xpos, int ypos, Color c, int speed, int newDirection, int maxFire)
public void move() else break;
case EAST: if( (x+tankWidth()+moveBy)>maxX) else break;
case SOUTH: if( (y+tankHeight()+moveBy)>maxY ) else break;
case WEST: if( (x-moveBy<minX) ) else break;
}
}
public void turn(int newDirection)
public void turnAround()
void explode()
public void paint(Graphics gr)
//polygon canon wheels
int x11[] = ;
int y11[] = ;
int x12[] = ;
int y12[] = ;
int x13[] = x11;
int y13[] = ;
int x14[] = ;
int y14[] = y12;
int x1[][] = ;
int y1[][] = ;
//roundrect canon compartment
int x2[] = ;
int y2[] = ;
//rect canon case
int x3[] = ;
int y3[] = ;
int x3w[] = ;
int y3h[] = ;
//oval canon cap
int x4[] = ;
int y4[] = ;
//canon
int x5[] = ;
int y5[] = ;
int x5w[] = ;
int y5h[] = ;
int d = direction - 1;
//draw wheels
g.setColor(Color.black);
g.fillPolygon(x1[d], y1[d] ,8);
//draw compartment
g.setColor(color);
g.fillRoundRect(x2[d],y2[d],25,25,5,5);
//draw canon
g.setColor(Color.black);
g.fillRect(x5[d],y5[d],x5w[d],y5h[d]);
//draw canon case
g.setColor(new Color(47,79,79));
g.fillRect(x3[d],y3[d],x3w[d],y3h[d]);
//draw canon cap
g.setColor(Color.black);
g.fillOval(x4[d],y4[d],15,15);
}
int tankWidth()direction==3)return 35;
else {return 40;
}
int tankHeight()come 35;
}
}

