All are based on the following airline database schema Fligh
All are based on the following airline database schema:
Flights(flno, from, to, distance, departs)
Aircraft(aid, aname, range)
Certified(eid, aid)
Employees(eid, ename, salary)
By definition, pilots are those employees who are certified on at least one aircraft. An aircraft can be used for any flight provided it has sufficient range. Pilots can pilot any flight provided they are certified on an aircraft with sufficient range.
PROBLEMS:
1. Find flno of flights that can be piloted by every pilot whose salary is over $100,000.
2. Solve problem 1 without using the division operator.
3. Find names of pilots who can operate planes with a range greater than 3,000 miles, but are not certified on any Boeing.
4. Find eid of employee(s) with the highest salary.
5. Find eid of employee(s) with the second highest salary.
Consider the following conditions in your instantiation:
A. Design a table with 10 tuples (rows) For each of four tables provided in airline data base schema.
B. Fill in tables with random values. (Values should be meaningful)
C. Tables that have common columns (e.g. ‘aid’), should have at least 4 common values for that column.
D. Based on your original tables, create result table for each operation.
THANK YOU
Solution
import java.util.Scanner;
/* category Node */
class Node
creator */
public Node()
/* builder */
public Node(int d,Node n)
/* perform to line link to next Node */
public void setLink(Node n)
/* perform to line knowledge to current Node */
public void setData(int d)
/* perform to urge link to next node */
public Node getLink()
come back link;
}
/* perform to urge knowledge from current Node */
public int getData()
come back data;
}
}
/* category linkedList */
class linkedList
begin ;
protected Node finish ;
public int size ;
/* builder */
public linkedList()
begin = null;
finish = null;
size = 0;
}
/* perform to envision if list is empty */
public mathematician isEmpty()
come back begin == null;
}
/* perform to urge size of the list */
public int getSize()
come back size;
}
/* perform to insert part at the begining */
public void insertAtStart(int val)
{
Node nptr = new Node(val,null);
nptr.setLink(start);
if(start == null)
{
begin = nptr;
nptr.setLink(start);
finish = start;
}
else
{
end.setLink(nptr);
begin = nptr;
}
size++ ;
}
/* perform to insert part at finish */
public void insertAtEnd(int val)
{
Node nptr = new Node(val,null);
nptr.setLink(start);
if(start == null)
{
begin = nptr;
nptr.setLink(start);
finish = start;
}
else
{
end.setLink(nptr);
finish = nptr;
}
size++ ;
}
/* perform to insert part at position */
public void insertAtPos(int val , int pos)
one ;
for (int i = 1; i < size - 1; i++)
ptr = ptr.getLink();
}
size++ ;
}
/* perform to delete part at position */
public void deleteAtPos(int pos)
one && pos == 1)
begin = null;
finish = null;
size = 0;
return ;
}
if (pos == 1)
begin = begin.getLink();
end.setLink(start);
size--;
return ;
}
if (pos == size)
whereas (s != end)
end = t;
end.setLink(start);
size --;
return;
}
Node ptr = start;
pos = pos - one ;
for (int i = 1; i < size - 1; i++)
ptr = ptr.getLink();
}
size-- ;
}
/* perform to show contents */
public void display()
making object of linkedList */
linkedList list = new linkedList();
System.out.println(\"Circular individually coupled List Test\ \");
char ch;
/* Perform list operations */
do
{
System.out.println(\"\ Circular individually coupled List Operations\ \");
System.out.println(\"1. insert at begining\");
System.out.println(\"2. insert at end\");
System.out.println(\"3. insert at position\");
System.out.println(\"4. delete at position\");
System.out.println(\"5. check empty\");
System.out.println(\"6. get size\");
int selection = scan.nextInt();
switch (choice)


