How many papers were published in 2005. Calculate the difference between the number of paper published in 2005 and the number of paper published in the previous year.
published in 2005 refer to Year = 2005; Difference refer to SUBTRACT(SUM(Year = 2005). SUM(Year = 2004))
SELECT SUM(CASE WHEN Year = 2005 THEN 1 ELSE 0 END) , SUM(CASE WHEN year = 2005 THEN 1 ELSE 0 END) - SUM(CASE WHEN year = 2004 THEN 1 ELSE 0 END) AS diff FROM Paper
CREATE TABLE IF NOT EXISTS "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
);
CREATE TABLE IF NOT EXISTS "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
);
CREATE TABLE IF NOT EXISTS "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
);
CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
);
CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
);
