Hello. I am learning SQLite and I am just a beginner. I have two tables in my database and I am coding some simple queries. If I run the
.schema
command then it is shown for datatypes and columns in my database:
CREATE TABLE songs (
id INTEGER,
name TEXT,
artist_id INTEGER,
danceability REAL,
energy REAL,
key INTEGER,
loudness REAL,
speechiness REAL,
valence REAL,
tempo REAL,
duration_ms INTEGER
);
CREATE TABLE artists (
id INTEGER,
name TEXT
);
I have one table for songs and one table for artists. Every song is for one artist. Now I want to get the name of a song in which the artist's name is
ZZZZZ
, but I do not know how to do it.
What I have tried:
I have tried this query:
SELECT name FROM songs , SELECT name FROM artists WHERE name = "Post Malone";
But it raises an error that :
Error: near "SELECT": syntax error
And actually, I could not solve it. I will be really grateful for your help and advice even if you share a useful link would be great.