Python Forum
Chinook Database in Python (Albun Top 10)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Chinook Database in Python (Albun Top 10)
#1
How do I make a python program that prints an album top 10 of the albums that have been listened to most often from the Chinook database. The output of the application takes the following form:

Attached Files

Thumbnail(s)
   
Reply
#2
What have you tried?
Is the database local or are you connecting to a remote server?
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply
#3
I have a local database file chinook.db but don’t now how I get the top 10 loost listen albums with python
Reply
#4
How much Python coding have you done? Do you know how to construct loop and branches?

I'd use the sqlite3 package for for the kind of a project and this tutorial should get you started, least ways.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply
#5
Have you read this?

https://docs.yugabyte.com/preview/sample...%20library.
Reply
#6
Thanks for your answer but how get I get with a query the top listen 10 albums
Reply
#7
Is this link talking about the database you are using for your assignment?

https://docs.yugabyte.com/preview/sample...%20library
Reply
#8
Sorry I can open your link
Reply
#9
Sorry, try now.

Your database will have a schema that defines how all the tables are linked. The entity relationship in the link I provided documents the schem for a chinook database that contains music information. I don't know if this is the database you are using or not.

Once you find the schema, you'll need to find out what table contains the information you are looking for When you know that, you write a query to get the info. It is likely that the query can be written to sort the responses in decreasing order and limit the number of responses to 10. But it all starts with finding where the information is in your database.
Reply
#10
Yes this is the database
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020