Create the following queries on the ITCO630_A database used in unit 3 and save them all in a file called ITCO630_P5.SQL. Please note that you can execute individual queries in a query file by highlighting the lines that you want to execute before running the script. Remember to define what database to use with a USE statement. 1. Using a join, get the full details of all the students who work on the mid-term exam assignment. 2. Get the assignment names (duplicates eliminated) being worked on by students at Central University. 3. Get the last names of all the students who are working on assignment A1. 4. Get the student numbers and start dates of all the students with start dates equal to the earliest date. 5. Insert yourself into the student table using the last five digits of your phone number as the student number and show yourself as attending Central University. Then show all the records in the student table. 6. Delete yourself from the student table by matching your student number, and then show all the records in the student table. You should create a zip file called ITCO630_P5.ZIP with your query file (ITCO630_P5.SQL) included.

ITCO630_P5.SQL

1. Full details of students working on the mid-term exam assignment:

“`sql
SELECT s.StudentNumber, s.FirstName, s.LastName, s.Gender, a.AssignmentName
FROM Student AS s
JOIN Assignment AS a
ON s.StudentID = a.StudentID
WHERE a.AssignmentName = ‘Mid-Term Exam’;
“`

2. Assignment names being worked on by students at Central University (without duplicates):

“`sql
SELECT DISTINCT a.AssignmentName
FROM Student AS s
JOIN Assignment AS a
ON s.StudentID = a.StudentID
WHERE s.University = ‘Central University’;
“`

3. Last names of students working on assignment A1:

“`sql
SELECT s.LastName
FROM Student AS s
JOIN Assignment AS a
ON s.StudentID = a.StudentID
WHERE a.AssignmentName = ‘A1’;
“`

4. Student numbers and start dates of students with start dates equal to the earliest date:

“`sql
SELECT s.StudentNumber, s.StartDate
FROM Student AS s
WHERE s.StartDate = (SELECT MIN(StartDate) FROM Student);
“`

5. Insert yourself into the student table using the last five digits of your phone number as the student number and show yourself as attending Central University. Then show all the records in the student table:

“`sql
INSERT INTO Student (StudentNumber, FirstName, LastName, Gender, University)
VALUES (‘[Your last five digits of phone number]’, ‘[Your First Name]’, ‘[Your Last Name]’, ‘[Your Gender]’, ‘Central University’);

SELECT *
FROM Student;
“`

6. Delete yourself from the student table by matching your student number, and then show all the records in the student table:

“`sql
DELETE FROM Student
WHERE StudentNumber = ‘[Your last five digits of phone number]’;

SELECT *
FROM Student;
“`

Please make sure to save the above queries in a file named ITCO630_P5.SQL.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer