1. Assuming there is a table called Grades that contains student_id for student
ID: 3718245 • Letter: 1
Question
1. Assuming there is a table called Grades that contains student_id for student id, school_term for school term associated with the grade, course such as (SE352 or SE452) grade containing letter grade (A, A-,B+….). Write a SQL that inserts your projected grade for this class into this table.
2. Provide the SQL to update the grade in prior problem to change the grade to B+. Assume primary key is your student_id and course.
3. Assuming you need to write a java program to insert and update the Grades table, what other information do you need in order to connect to the database from your application?
Explanation / Answer
1. To insert the data into the table we need use insert query.
insert into Grades values(120,2,'SE352','B-');
2. To update the data in the table we have to use update query. Below is the update query which updates the grade to B+.
update Grades set grade='B+' where course='SE52';
3. Inorder to connect the database to the application using java program we need to know the complete the structure of database table and we need to know the username and the password of the user who have access to the database table. These two things are enough to insert or update data from application.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.