Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, Please assist with this. Provide answer and steps to answer. We are using SQ

ID: 3665580 • Letter: H

Question

Hi,

Please assist with this. Provide answer and steps to answer.

We are using SQL.

Now storing data in a table is one thing (and you typically use SQL for this as well), the reason you store data is that you can retrieve it and analyze it. For example, we may be interested in all students who reside in Cobb and who were born after 1970. If we were using a non-declarative programming language such as Java or C++, we would have to write a routine that would process the 2-dimensional array in which we had stored the table. In other words, we would have to write a routine that would look something like, where MAX is the size of the first dimension of the array, and STUDENT is the array in question:

for (i = 0; i < MAX; i++) {
     if (STUDENT[i,2] == "Cobb" && STUDENT[i,3] > 1970) {
             /** ADD i to the RESULT
                   ....
     }
}

As you start retrieving data stored in multiple tables, you will understand that this will get complicated.

Exercise:

As an exercise, try to write a routine that retrieves all students who reside in Cobb, were born after 1970, and received a grade of C or better in a course taught by Evan Duggan. Use the the dropbox associated with this module to show your result.

Fortunately, SQL releases you from the need to write complicated routines to retrieve information from tables. Rather than writing routines to tell the computer not only what to retrieve but also how to do it, SQL simply allows you to tell the program what to retrieve through logical statements. Thus, the following is a SQL query to retrieve all students residing in Cobb and born after 1970:

SELECT * FROM STUDENTS
     WHERE County = 'Cobb' AND DoB > 1970

You will agree that this is easier than writing routines to process 2-dimensional arrays, and you can imagine how much easier it gets when you have to retrieve data from multiple tables.

Explanation / Answer

Yes,retrieving data stored in multiple tables gets comlicated. For tha avoce scenario lets consider 2 tables as below:

Students:

Course:

Sql Query:

SELECT * FROM STUDENTS
WHERE Country = 'Cobb' AND DoB > 1970 AND Course.CourseTutor = 'Evan Duggan' AND course.Grade ='c'

Result:

Student DoB Country xyz 1972 COBB abc 1963 INd zsx 1980 COBB
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote