1 / 5

SQL HW1

SQL HW1. Turn in as a hardcopy at the start of next class period. You may work this assignment in groups. Using MySQL. The MySQL server is on candler.cs.unca.edu ssh to candler before connecting to the MySQL server Logon to the server using the student account as follows:

pgeraci
Download Presentation

SQL HW1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQL HW1 Turn in as a hardcopy at the start of next class period. You may work this assignment in groups.

  2. Using MySQL • The MySQL server is on candler.cs.unca.edu • ssh to candler before connecting to the MySQL server • Logon to the server using the student account as follows: candler> mysql –u student This account does not have a password • Use the orderEntry database for this HW: mysql> use orderEntry; • To run a query that has been stored in a file with the name query1.sql (in the current working directory): mysql> source query1.sql;

  3. OPTIONAL: Connecting to the MySQL Server from OpenOffice Base on Windows • Download the ‘Driver Installer (zipped EXE)’ for Windows from: http://dev.mysql.com/downloads/connector/odbc/3.51.html • Follow the ‘Configuring a MyODBC DSN on Windows’ instructions on: http://dev.mysql.com/doc/refman/5.0/en/myodbc-configuration-dsn-windows.html • In Base select connect to an ‘existing database’ and follow instructions.

  4. Some basic SQL statements: • Show the databases that are available for you to query: mysql> show databases; • Select a database with the use command: mysql> use <dataBaseName>; • Show the tables in a database: mysql> show tables; • After executing the use <dataBaseName> command • View the attributes of a table: mysql> describe <tableName>; • After executing the use <dataBaseName> command

  5. Formulate the following queries in SQL and turn in a hardcopy of each query: • Develop queries to answer the following questions from page 125 of your textbook: 2, 5, 6, 13

More Related