lianghsun/bird-text2sql-bench huggingface dataset:
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
What is the tag and the artist of the most downloaded single?

### Hint
the most downloaded single refers to MAX(totalSnatched where releaseType = 'single');

### SQL
SELECT T2.tag, T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'single' ORDER BY T1.totalSnatched DESC LIMIT 1
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
How many releases are tagged "1980s"?

### Hint
tag = '1980s';

### SQL
SELECT COUNT(id) FROM tags WHERE tag LIKE '1980s'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
How many times has the release "city funk" been downloaded?

### Hint
groupName = 'city funk'; downloaded refers to totalSnatched;

### SQL
SELECT totalSnatched FROM torrents WHERE groupName LIKE 'city funk'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Please list the releases that have been downloaded for more than 20000 times.

### Hint
releases refer to groupName; downloaded for more than 20000 times refers to totalSnatched > 20000;

### SQL
SELECT groupName FROM torrents WHERE totalSnatched > 20000
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
What are the tags of the release "sugarhill gang"?

### Hint
release "sugarhill gang" refers to groupName = 'sugarhill gang';

### SQL
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupName = 'sugarhill gang'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
How many tags does the release "city funk" have？

### Hint
release "city funk" refers to groupName = 'city funk';

### SQL
SELECT COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupName = 'city funk'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Please list the titles of all the releases with the tag "1980s".

### Hint
titles refer to groupName;

### SQL
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Among the releases with the tag "1980s", which one of them is the most downloaded? Please give its title.

### Hint
title refers to groupName; the most downloaded refers to MAX(totalSnatched);

### SQL
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s' ORDER BY T1.totalSnatched DESC LIMIT 1
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
How many releases by the artist michael jackson are tagged "pop"?

### Hint
tag = 'pop';

### SQL
SELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.artist = 'michael jackson'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Among the releases that were released in 2000, how many of them were released as an album and tagged "pop"?

### Hint
groupYear = 2000; album refers to releaseType;

### SQL
SELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.releaseType = 'album' AND T1.groupYear = 2000
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
What are the average download times for the a release tagged "1980s"?

### Hint
AVG(totalSnatched where tag = '1980s');

### SQL
SELECT CAST(SUM(T1.totalSnatched) AS REAL) / COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Name the title of the top three releases with the highest number of downloads.

### Hint
title refers to groupName; the highest number of downloads refers to MAX(totalSnatched);

### SQL
SELECT groupName FROM torrents ORDER BY totalSnatched DESC LIMIT 3
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Provide the name of the artist who released his or her Single-Table in 2012 with the highest number of downloads. Name the Single-Table title as well.

### Hint
title refers to groupName; the highest number of downloads refers to MAX(totalSnatched where groupYear = 2012 and releaseType = 'single');

### SQL
SELECT artist, groupName FROM torrents WHERE groupYear = 2012 AND releaseType LIKE 'Single' ORDER BY totalSnatched DESC LIMIT 1
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
How many albums and Single-Tables were released by the artist named '50 cent' between 2010 and 2015?

### Hint
albums refer to releaseType = 'album'; releaseType = 'single'; between 2010 and 2015 refers to groupYear between 2010 and 2015;

### SQL
SELECT COUNT(id), ( SELECT COUNT(id) FROM torrents WHERE groupYear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releaseType LIKE 'album' ) FROM torrents WHERE groupYear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releaseType LIKE 'Single'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
An American rapper '2Pac' released his first solo album in 1991, how many years have passed until his next album was released?

### Hint
2Pac is an artist; album refers to releaseType; groupYear = 1991; SUBTRACT(groupYear = 1991, groupYear where releaseType = 'album' LIMIT 1 OFFSET 1);

### SQL
SELECT ( SELECT groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' ORDER BY groupYear LIMIT 1, 1 ) - groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' AND groupYear = 1991
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Find the average number of downloads for Single-Tables released by '2Pac' between 2001 and 2013.

### Hint
2Pac is an artist; releaseType = 'single'; between 2001 and 2013 refers to groupYear between 2001 and 2013; average number of downloads = AVG(totalSnatched);

### SQL
SELECT AVG(totalSnatched) FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'Single' AND groupYear BETWEEN 2001 AND 2013
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Provide the title, release year and the tag associated with the live album that has the highest number of downloads?

### Hint
release year refers to groupYear; title of live album refers to groupName where releaseType = 'live album'; the highest number of downloads refers to MAX(totalSnatched);

### SQL
SELECT T1.groupName, T1.groupYear, T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'live album' ORDER BY T1.totalSnatched DESC LIMIT 1
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Provide the name of artists who released at least two bootlegs in 2016.

### Hint
at least two bootlegs refer to COUNT(releaseType = 'bootleg')≥ 2; groupYear = 2016;

### SQL
SELECT artist FROM torrents WHERE groupYear = 2016 AND releaseType LIKE 'bootleg' GROUP BY artist HAVING COUNT(releaseType) > 2
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Which artist released singles between 1980 to 1982?

### Hint
releaseType = 'single'; between 1980 to 1982 refers to groupYear between 1980 and 1982;

### SQL
SELECT artist FROM torrents WHERE groupYear BETWEEN 1980 AND 1982 AND releaseType LIKE 'single'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Indicates groups with id from 10 to 20 with singles downloaded at least 20.

### Hint
releaseType = 'single'; downloaded at least 20 refers to totalSnatched ≥ 20; id from 10 to 20 refer to id between 10 and 20; groups refer to groupName;

### SQL
SELECT groupName FROM torrents WHERE totalSnatched >= 20 AND releaseType LIKE 'single' AND id BETWEEN 10 AND 20
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Among the artists from 1980 to 1982. Which artist was tagged as "disco"?

### Hint
from 1980 to 1982 refers to groupYear between 1980 and 1982; tag = 'disco';

### SQL
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'disco' AND T1.groupYear BETWEEN 1980 AND 1982
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Provide the name of artists who had no more than 100 downloads and are tagged "funk" in 1980.

### Hint
no more than 100 downloads refer to totalSnatched ≤ 100; groupYear = 1980; tag = 'funk';

### SQL
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'funk' AND T1.groupYear = 1980 AND T1.totalSnatched <= 100
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Which artist has released the most singles with the tag "soul"?

### Hint
the most singles refer to MAX(COUNT(releaseType = 'single'));

### SQL
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'soul' AND T1.releaseType = 'single' GROUP BY T1.artist ORDER BY COUNT(T1.releaseType) DESC LIMIT 1
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Among the artists with the id from 10 to 30. Which artist released the product with the tag "funk" in 1980?

### Hint
id from 10 to 30 refers to id between 10 and 30; groupYear = 1980;

### SQL
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'funk' AND T1.groupYear = 1980 AND T1.id BETWEEN 10 AND 30
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
List the group name has the most downloaded that have released jazz genres from 1982 or later.

### Hint
the most downloaded refers to MAX(totalSnatched); tag = 'jazz'; from 1982 or later refers to groupYear ≥ 1982;

### SQL
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'jazz' AND T1.groupYear >= 1982 ORDER BY T1.totalSnatched DESC LIMIT 1
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Which artist has id "16"? Provide her or his tag genre.

### Hint
FALSE;

### SQL
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.id = 16
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
Among id from 10 to 50. Which artist tagged as "new.york" has the most downloads?

### Hint
Among id from 10 to 50 refers to id between 10 and 50; tag = 'new.york'; the most downloads refer to MAX(totalSnatched);

### SQL
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.id BETWEEN 10 AND 50 AND T2.tag LIKE 'new.york' ORDER BY T1.totalSnatched DESC LIMIT 1
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
List the name of artists who have released albums and mixtape from 1980 to 1985 in "dance" genre.

### Hint
albums and mixtape refer to releaseType; from 1980 to 1985 refers to groupYear between 1980 and 1985; tag = 'dance';

### SQL
SELECT COUNT(T1.artist) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'dance' AND T1.groupYear BETWEEN 1980 AND 1985 AND T1.releaseType LIKE 'album' OR T1.releaseType LIKE 'mixtape'
### Database Schema
CREATE TABLE "torrents"
(
    groupName     TEXT,
    totalSnatched INTEGER,
    artist        TEXT,
    groupYear     INTEGER,
    releaseType   TEXT,
    groupId       INTEGER,
    id            INTEGER
        constraint torrents_pk
            primary key
)

CREATE TABLE "tags"
(
    "index" INTEGER
        constraint tags_pk
            primary key,
    id      INTEGER
        constraint tags_torrents_id_fk
            references torrents,
    tag     TEXT
)

### Question
How many singles were released between 1979 and 1981 labeled as "soul"?

### Hint
releaseType = 'single'; between 1979 and 1981 refers to groupYear between 1979 and 1981; tag = 'soul';

### SQL
SELECT COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'soul' AND T1.groupYear BETWEEN 1979 AND 1981 AND T1.releaseType LIKE 'single'