Knowee
Questions
Features
Study Tools

Problem Statement: There are three tables: Student Table, Program Table, and Scholarship Table as shown belowWrite an SQL query to list STUDENT_ID who does not get Scholarship. Student Table STUDENT_ID FIRST_NAME LAST_NAME GPA ENROLLMENT_DATE MAJOR 201 Shivansh Mahajan 8.79 2021-09-01 09:30:00 Computer Science Program Table STUDENT_REF_ID PROGRAM_NAME PROGRAM_START_DATE 201 Computer Science 2021-09-01 00:00:00 Scholarship Table STUDENT_REF_ID SCHOLARSHIP_AMOUNT SCHOLARSHIP_DATE 201 5000 2021-10-15 00:00:00 AnswerLanguagejava1select s.student_id from student s left join PREVNEXT

Question

Problem Statement: There are three tables: Student Table, Program Table, and Scholarship Table as shown belowWrite an SQL query to list STUDENT_ID who does not get Scholarship. Student Table STUDENT_ID FIRST_NAME LAST_NAME GPA ENROLLMENT_DATE MAJOR 201 Shivansh Mahajan 8.79 2021-09-01 09:30:00 Computer Science Program Table STUDENT_REF_ID PROGRAM_NAME PROGRAM_START_DATE 201 Computer Science 2021-09-01 00:00:00 Scholarship Table STUDENT_REF_ID SCHOLARSHIP_AMOUNT SCHOLARSHIP_DATE 201 5000 2021-10-15 00:00:00 AnswerLanguagejava1select s.student_id from student s left join PREVNEXT

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Sure, here is the SQL query to list the STUDENT_ID who does not get a Scholarship:

SELECT s.STUDENT_ID 
FROM Student s 
LEFT JOIN Scholarship sch 
ON s.STUDENT_ID = sch.STUDENT_REF_ID 
WHERE sch.STUDENT_REF_ID IS NULL;

This query works by performing a LEFT JOIN on the Student and Scholarship tables using the STUDENT_ID and STUDENT_REF_ID fields. The WHERE clause then filters out the students who have a scholarship (where STUDENT_REF_ID is not NULL), leaving only the students who do not have a scholarship.

This problem has been solved

Similar Questions

Consider these following tables and only solve the query. Tables: 1) student: s_no (primary key), student_name, course_no (foreign key), age 2) courser-course-no (primary key), course-name

Provide the SQL statements to the following two queries in this order (you may enter one query after the other separated by a semi-colon and a new line). Create a table named "scholarship" with the fields school_id(primary key), student_id( referencing ID in students table) and amount (numeric value with precision of 8 and scale of 2). Use appropriate data types. Insert the scholarship amount of 40000 given to student "00128" with school_id "00001"

Give a table:Student (studentId, name, major) Primary key is [studentId, major].Which code snippet will list out students that the major not equals 'IT'?SELECT * FROM Student HAVING major <> 'IT'All of the aboveSELECT * FROM Student s WHERE s.major != 'IT'SELECT * FROM Student GROUP BY major HAVING major <> 'IT'

Problem StatementIn a university's academic department, a database table named "students" that stores information about students, including their student ID, name, enrolled course, and scores obtained in different subjects.The university administration wants to analyze the performance of students and identify those who scored above a certain threshold. To facilitate this analysis, you are tasked with creating a stored procedure named "GetHighScorers".The following table is already created, and the records are inserted into the table.TABLE: students student_id INT PRIMARY KEY, student_name VARCHAR(50), course VARCHAR(50), score INT

Given 3 tables, students(id, name) , courses(id, name) , grades(id, course_id, student_id, grade), for each student, get all the courses that he/she is enrolled in along with the grade he/she scored for each course. Order the result by the student name in ascending order and if there is a tie, break it with the course name in ascending order and if there is a tie break it with the grade in ascending order. Your query should output a table with the following columns (name, course, grade).

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.