Learning Mysql



Download 4.24 Mb.
View original pdf
Page120/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   116   117   118   119   120   121   122   123   ...   366
Learning MySQL
Using the Music Database
In Chapter 4, we showed you how we understood the requirements for storing a music collection and how we designed the music
ER model. We also introduced the steps you take to convert an ER model to a format that makes sense for constructing a relational database. For convenience, we’ve reproduced the music database ER diagram in Figure. In this section, we show you the structure of the MySQL database that we created after converting the ER model into SQL statements. We don’t explain the SQL
statements we used to create the database that’s the subject of Chapter 6.
135

To begin exploring the music database, connect to the MySQL monitor using the root
MySQL account. For Mac OS Xor Linux, run a terminal program, and in the terminal window type mysql --user=root --password=the_mysql_root_password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version Type 'help' or 'h' for help. Type 'c' to clear the buffer.
mysql>
For Windows, click on the Start menu, then on the Run option, and then type
cmd
and press Enter. In the DOS or command window, type:
C:\> mysql --user=root --password=the_mysql_root_password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version Type 'help' or 'h' for help. Type 'c' to clear the buffer.
mysql>
If you find that the monitor doesn’t start, check the instructions in Error Message
About MySQL Executable Programs Not Being Found or Recognized in Chapter 2 to see how to run it.
artist_name artist_id
Artist
Compiles
Album
1
N
album_name album_id
Contains
1
Track
N
time track_name track_id
WasPlayedAt
1
Played
N
played
Figure 5-1. The ER diagram of the music database
136 | Chapter 5:

Download 4.24 Mb.

Share with your friends:
1   ...   116   117   118   119   120   121   122   123   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page