SQL - Select all 4th Year Students from IT department
The students table has the following four columns
The table DDL is as below.
CREATE TABLE students(id int,name VARCHAR(100), department VARCHAR(3),year int);
Write the SQL statement to fetch the records (all the columns) of the students belonging
as 4 and department as IT. The names must be sorted in alphabetically ascending order.
select * from students where department='IT' and year=4 order by name;