intro
15445这门课的第一份hwhttps://15445.courses.cs.cmu.edu/fall2020/homework1/,
主要是对这个数据库https://musicbrainz.org/doc/MusicBrainz_Database
进行一些sql语句的编写;
The homework contains 10 questions in total and is graded out of 100 points. For each question, you will need to construct a SQL query that fetches the desired data from the SQLite DBMS. It will likely take you approximately 6-8 hours to complete the questions. 6-8小时, 好吓人.. 两小时做不完就溜 : )
intall sqlite3
按照这儿安装就行了 https://www.tutorialspoint.com/sqlite/sqlite_installation.htm
要注意拼写, 刚刚把usr
拼成了user
…
各个表直接的关系:
通过.schema xxx
, xxx为表名, 这些表之间的关系如下:
sql 题
q1List all types of work ordered by type ascendingly.
送分, 主要是确保你安装正确了并且数据集一样;
q2 List works with longest name of each type.
For each work type, find works that have the longest names. There might be cases where there is a tie for the longest names - in that case, return all of them. Display work names and corresponding type names, and order it according to work type (ascending) and use work name (ascending) as tie-breaker.
算了, 我放弃.. 也太难了…