Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.

### Tables ###
TABLE: CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) )
TABLE: CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) )
TABLE: CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) )
TABLE: CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) )
TABLE: CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) )
TABLE: CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) )
TABLE: CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) )
TABLE: CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) )
TABLE: CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) )
TABLE: CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) )
TABLE: CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) )

### Question ###
How many courses are in the Psychology department for each year? Return a line chart.

### Accurate SQL ###

SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY year