Docsity

SQL Assistant Quick Warm-Up Exercise, Study Guides, Projects, Research of Database Management Systems (DBMS)

Toggle sidebar
bg1
SQL Assistant Quick Warm-Up Exercise
This exercise will teach instructors and students how to use SQL Assistant to issue SQL queries. This exercise will also teach
instructors how to create and modify their own SQL Assistant course space, and how to assign SQL exercises using SQL Assistant to
their students. If you do not have a Teradata University Network account, before attempting this exercise create your (free) account
at www.teradatauniversitynetwork.com by following instructions under Register quick link.
STEP 1 (INSTRUCTORS) – instructor logs into SQL Assistant and executes two sample SQL queries
I) Log into your www.teradatauniversitynetwork.com account. Once you are logged in, click on Apply & Do and then click on Teradata
Database link:
II) Click on Register and then follow the instructions and create your own Teradata SQL Assistant / Web Edition account (login and
password)
III) Once you get the message that your account has been created, use the Login to SQL Assistant link at the top of the screen to log into
SQL Assistant, using the following parameters:
Username: <use the SQL Assistant login name you created >
Password: <use the SQL Assistant password you created >
Default Database: db_jukic_zagi
IV) You are now logged into TUN’s Teradata SQL Assistant / Web Edition and you are ready to query the database db_jukic_zagi (whose
diagrams and data are shown in the document available at http://dbtextbook.com/ downloads/ZAGI.pdf). In this warm-up exercise, you will
create two sample SQL queries.
Query 1 - Write the following SQL query in the query space:
select * from product;
and execute the query by clicking on the (Execute) icon.
This query retrieves all the information from the Product table, as follows:
productid productname productprice vendorid categoryid
3X3 Cosy Sock 15.00 MK FW
5X5 Tiny Tent 150.00 MK CP
1X1 Zzz Bag 100.00 PG CP
4X4 Dura Boot 90.00 PG FW
2X2 Easy Boot 70.00 MK FW
6X6 Biggy Tent 250.00 MK CP
Query 2 - Write the following SQL query in the query space:
select storeid, storezip, regionname
from store s, region r
where s.regionid = r.regionid
order by s.storeid;
and execute the query by clicking on the (Execute) icon.
This query retrieves for each store the store ID, store zip code and store region, as follows:
storeid storezip regionname
S1 60600 Chicagoland
S2 60605 Chicagoland
S3 35400 Tristate
pf3
pf4

Partial preview of the text

Download SQL Assistant Quick Warm-Up Exercise and more Study Guides, Projects, Research Database Management Systems (DBMS) in PDF only on Docsity!

SQL Assistant Quick Warm-Up Exercise

This exercise will teach instructors and students how to use SQL Assistant to issue SQL queries. This exercise will also teach instructors how to create and modify their own SQL Assistant course space, and how to assign SQL exercises using SQL Assistant to their students. If you do not have a Teradata University Network account, before attempting this exercise create your (free) account at www.teradatauniversitynetwork.com by following instructions under Register quick link.

STEP 1 (INSTRUCTORS) – instructor logs into SQL Assistant and executes two sample SQL queries

I) Log into your www.teradatauniversitynetwork.com account. Once you are logged in, click on Apply & Do and then click on Teradata Database link:

II) Click on Register and then follow the instructions and create your own Teradata SQL Assistant / Web Edition account (login and password)

III) Once you get the message that your account has been created, use the Login to SQL Assistant link at the top of the screen to log into SQL Assistant, using the following parameters:

Username: Password: Default Database: db_jukic_zagi

IV) You are now logged into TUN’s Teradata SQL Assistant / Web Edition and you are ready to query the database db_jukic_zagi (whose diagrams and data are shown in the document available at http://dbtextbook.com/ downloads/ZAGI.pdf). In this warm-up exercise, you will create two sample SQL queries.

Query 1 - Write the following SQL query in the query space:

select * from product;

and execute the query by clicking on the (Execute) icon.

This query retrieves all the information from the Product table, as follows:

productid productname productprice vendorid categoryid 3X3 Cosy Sock 15.00 MK FW 5X5 Tiny Tent 150.00 MK CP 1X1 Zzz Bag 100.00 PG CP 4X4 Dura Boot 90.00 PG FW 2X2 Easy Boot 70.00 MK FW 6X6 Biggy Tent 250.00 MK CP

Query 2 - Write the following SQL query in the query space:

select storeid, storezip, regionname from store s, region r where s.regionid = r.regionid order by s.storeid;

and execute the query by clicking on the (Execute) icon. This query retrieves for each store the store ID, store zip code and store region, as follows:

storeid storezip regionname S1 60600 Chicagoland S2 60605 Chicagoland S3 35400 Tristate

STEP 2 (INSTRUCTORS) – instructor creates a course space for his/her students

I) Log into your www.teradatauniversitynetwork.com account. Once you are logged in, click on Apply & Do and then click on Teradata Database link:

II) Click on the link Manage Courses for Teradata SQL Assistant/Web Edition

III) Follow the instructions for logging in (you will use your TUN user name and password)

IV) Click on Create a Course

V) Create a course using the following parameters:

Course Title: Course Type: database Default Database: db_jukic_zagi Course Password: Course End Date:

Once the parameters are entered click on Create Course

In order to proceed with the STEP 3 you will have to give your students the following information:

Course Title Course Password

STEP 4 (INSTRUCTORS) – instructor modifies the course and assigns actual exercises to his/her students

Now you are ready to modify your course and change the default data set and/or assign other data sets to the course you created for your students.

I) Log into your www.teradatauniversitynetwork.com account. Once you are logged in, click on Apply & Do and then click on Teradata Database link:

II) Click on View data sets for use with SQL Assistant to view all of the available data sets for use with the SQL Assistant. Once you viewed the data sets click the back button on your browser.

III) If you want to change the default database (from db_jukic_zagi ) for your course or add more data sets to your course click on Manage Courses for Teradata SQL Assistant/Web Edition

III) Follow the instructions for logging in (you will use your TUN user name and password).

IV) To change the default database of your course click on Manage a Course , select your course, choose a data set as your new default database, and click on Modify. To proceeded with the next step, click on Course Maintenance link

IV) To add more data sets to your course, click on Manage Course Databases , select your course, and add the additional data sets to your course.

Your course is now prepared and you can assign actual SQL exercises of your choosing to the students in your course, using the available data sets.

NOTE:

  • In addition to writing and executing SQL queries, the Teradata SQL Assistant Web functionality for TUN has been enhanced to include write capabilities. Therefore, in addition to select statements, your SQL can include statements such as create, grant, insert, update, delete, etc. The Teradata SQL user account for each professor has 100MB of writeable space (perm space) to use for creating tables. When a student registers for a course, their Teradata SQL user account gets 10MB of perm space. Each Teradata user can create tables in their user account. The Teradata SQL Assistant / Web Edition Tutorial (available under Teradata Database link in Apply & Do section) contains detailed instructions for using the perm space. A professor can create a sample database in their user account and then grant access to their new sample database to the students. In order for professors to allow other professors to use the new sample database for any course, follow the instructions in the Process to submit a new database for Teradata SQL Assistant/Web Edition document (available under Teradata Database link in Apply & Do section).