Question: SQL Answer the following question: 1.List the students (first name, Last Name and GPA) who were admitted in the year 2015. 2.List the Juniors (first

 SQL Answer the following question: 1.List the students (first name, Last

SQL Answer the following question:

1.List the students (first name, Last Name and GPA) who were admitted in the year 2015.

2.List the Juniors (first name, Last Name and GPA) who were admitted before the year 2015

3.List the Average GPA by Major (Major code is sufficient).

4.List the Average GPA by College.

5.List the College with the least average GPA.

6.List the students with GPAs higher than the total average GPA.

7.List the Name of the student with the highest GPA.

8.List the college of the student with the highest GPA.

9.List Number of days elapsed since admission for each student.

10.How many majors does each college have.

11.List the maximum GPA by student status.

12.Create a trigger before insert and update on the Students table that checks if the Majorcode is missing (null or empty string) and enters the default valueComputer Science. To activate the trigger, you need to: INSERT INTO Students VALUES ('SomeID','SomeFN','SomeLN','SomeStatus',',GPA,'SomeDate');

Or

INSERT INTO Students VALUES ('SomeID','SomeFN','SomeLN','SomeStatus',,GPA,'SomeDate');

CREATE TABLE Departments ( DeptCode CHAR(3) PRIMARY KEY, DepartName VARCHAR2(25), College VARCHAR2(25)); CREATE TABLE Students ( ID CHAR(3) PRIMARY KEY, FName VARCHAR2(25), LName VARCHAR2(25), Status VARCHAR2(25), Majorcode CHAR(3) REFERENCES Departments(DeptCode), GPA NUMBER (4,2), AdmittedDate DATE); INSERT INTO Departments VALUES('100','Computer Science','INF'); INSERT INTO Departments VALUES('101','Business Informatics','INF'); INSERT INTO Departments VALUES('102','Mathematics','AS'); INSERT INTO Departments VALUES('103','Accounting','COB'); INSERT INTO Students VALUES ('101','Tom','Smith','Freshman','103',3.51,'3-May-2015'); INSERT INTO Students VALUES ('104', 'Dori', 'Negrino','Sophomore','101',2.98,'2-Jul-2015'); INSERT INTO Students VALUES ('923','Horst','Keller','Junior','101',3.49,'21-Jul-2013'); INSERT INTO Students VALUES ('489','Sascha', 'Kruger','Junior', '100',4.00,'21-Apr-2014'); INSERT INTO Students VALUES ('519','Lisa', 'Miller','Freshman','101',2.79,'21-Oct-2015'); INSERT INTO Students VALUES ('911','Toni','Gaddis','Senior','103',3.68,'1-Nov-2011'); INSERT INTO Students VALUES ('636','Shawn','Lauriat','Freshman','102',3.93,'3-May-2015'); INSERT INTO Students VALUES ('671','Richard','Klein','Senior','103',3.72,'1-Jun-2015'); INSERT INTO Students VALUES ('727','Cathy','Manning','Freshman','100',3.92,'3-May-2015'); INSERT INTO Students VALUES ('453','Peter','Burrows','Sophomore','102',3.34,'2-Sep-2014'); INSERT INTO Students VALUES ('441','Eric','Grover','Freshman','103',3.91,'1-Jan-2017')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!