Download cse4701hw0Instructions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

DBase wikipedia , lookup

Oracle Database wikipedia , lookup

Concurrency control wikipedia , lookup

Microsoft Access wikipedia , lookup

Ingres (database) wikipedia , lookup

Btrieve wikipedia , lookup

Database wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Versant Object Database wikipedia , lookup

Clusterpoint wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Database model wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Relational model wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Transcript
CSE4701 Principles of Databases
Homework 0 MySQL Instructions to Load Databases – no credit given
Homework 0 provides you with experience in using MySQL Workbench and loading databases,
creating EERs, and making queries. There are four sample databases, the first two of which will
we will be using for making database queries using the SQL Query Language.
Chinook Database Sample: Digital media store, tables for artists, albums, media tracks, etc.
https://chinookdatabase.codeplex.com/
EER: https://chinookdatabase.codeplex.com/wikipage?title=Chinook_Schema&referringTitle=Home
Go to:
https://chinookdatabase.codeplex.com/releases/view/55681
and Download:
https://chinookdatabase.codeplex.com/downloads/get/557747
Then Extract the file: ChinookDatabase1.4_CompleteVersion.zip to get the file: Chinook_MySql.sql
NorthwindExtended Database Sample – Database of Employees, Customers, Suppliers, etc.
https://code.google.com/p/northwindextended/
EER: https://northwindextended.googlecode.com/files/Northwind.png
Download:
https://code.google.com/p/northwindextended/downloads/detail?name=Northwind.MySQL5.sql
Extract to get file: Northwind.MySQL5.sql
Sabermetricians Database Sample – very good instructions and how to ..
http://www.hardballtimes.com/databases-for-sabermetricians-part-one/
Download:
http://baseball-databank.org/files/BDB-sql-2008-11-13.sql.zip
Extract to get file: BDB-sql-2008-11-13.sql
See also Baseball data bank: http://www.baseball-databank.org/
Sports Database Sample
http://sportsdb.org/sd/samples
EER: http://sportsdb.org/modules/sd/assets/downloads/sportsdb-16.jpg
Download:
http://sportsdb.org/modules/sd/assets/downloads/sportsdb_sample_mysql.zip
Extract to get file: sportsdb_sample_mysql_20080303.sql
CSE4701 Principles of Databases
Homework 0 MySQL Instructions to Load Databases – no credit given
Instructions for Loading Each of the above Sample Database including the ability to do queries and the
creation of the EER diagram for each .sql file utilizing MySQL Workbench
LOADING THE .SQL FILE
1. Open MySQL Workbench
2. Click the LocalHost icon to open a new SQL Editor tab for LocalHost
3. Go to File -> Run SQL Script
a. Select the SAMPLE.sql file from wherever it is stored in your computer where
SAMPLE.sql is one of the .sql files listed on the first page of this document. See following
screen and enter a Default Schema Name of your choice – SAMPLE was used below.
b. Default character set can be left blank.
c. Click Run.
The resulting excerpt screen below shows the SAMPLE schema created:
4. Your SAMPLE database is now fully imported into the schema you selected/wrote.
CSE4701 Principles of Databases
Homework 0 MySQL Instructions to Load Databases – no credit given
RUNNING AN SQL QUERY
The screen below is the result of the Chinook.sql file being loaded (naming the database Chinook) and
the execution of the SQL query:
SELECT * FROM Chinook.employee;
Using the export icon below the arrow, you can generate a comma separated file, csv, in Excel:
Practice by generating queries for every table in the Chinook and Northwind Databases utilizing the
database diagrams that are in http://www.engr.uconn.edu/~steve/Cse4701/cse4701introov.pptx.
CSE4701 Principles of Databases
Homework 0 MySQL Instructions to Load Databases – no credit given
CREATING THE Extended Entity relationship (EER) DIAGRAM
1. Under the LocalHost tab that was created in the prior step, select: File->New Model and a new
MySQL Model Tab will be created
2. Select File -> Import -> Reverse Engineering to get the following screen:
3. Browse for the .sql file and then Execute – I have used Chinook_MySQL.sql and when complete
(there will be some errors for Chinook), you get the following with Chinook selected
4. Now you can create the EER diagram using: Model -> Create Diagram from Catalog Objects to
get the following screen which is of course unreadable:
CSE4701 Principles of Databases
Homework 0 MySQL Instructions to Load Databases – no credit given
5. Now select, Arrange -> Autolayout to yield the screen below:
6. Don’t forget to do a File -> Save Model as and name the file SAMPLE.mwb