Consider the following tables with partial saved information
Solution
a. This insert statement insert a new row in the Student table with following values
FirstName ----- Mike
LastName ----- Johnson
Major ------- CIS
YearEnrolled -----2015
If there is primary key is defined its value should be included in the insert columns eg ID here.
b.
This select query will display all records from the table Takes where StudentId = 123 and Grade =A
Now in the table for the first condition ,there are two rows with the StudentId =123 but for second condition Grade = A , and both conditions should satisfy so there is only one row which will be the output as follows
StudentId =123
UniqueCourseIdentified = CIS101_2014Q11
Grade =A
c.
This delete query will delete all rows from the table where StudentID =222
There is no rows matching this condition. So no row will be deleted.
d.
This update query will update the table Course . It will set the value of CourseTitle =\"Business Terminology\" where CourseId =\"BUS101\".
now there is one row with this CourseID =\"BUS101\" where CourseTitle =\"Introduction to Business\" . With this update query, The CourseTitle will be Changed to \"Business Terminology\".
e.
This select query will select all majors and count the corresponding rows matching those majors from Student table as it is grouping the rows based on major.
The output will will as under:
CIS 2
Business 1
Drama 1
