1.UPDATE celebsSET age = 22
WHERE id = 1;
SELECT * FROM celebs
2.ALTER TABLE celebs ADD COLUMN twitter_handle TEXT;
SELECT*FROM celebs;
3.UPDATE celebs
SET twitter_handle='@taylorswift13'
WHERE id=4;
SELECT *FROM celebs;
4.SELECT price, ROUND(AVG(downloads), 2) FROM fake_apps
GROUP BY price;
5.CREATE TABLE artists(id INTEGER PRIMARY KEY, name TEXT)
6.SELECT* FROM albums
JOIN artists ON albums.artist_id=artists.id;
7.SELECT * FROM albums
LEFT JOIN artists ON
albums.artist_id=artists.id;
8.SELECT
albums.name AS 'Album',
albums.year,
artists.name AS 'Artist'
FROM
albums
JOIN artists ON
albums.artist_id=artists.id
WHERE
albums.year>1980.
网友评论