17.10.2015 Views

Getting Started with IBM Data Studio for DB2

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

100 <strong>Getting</strong> <strong>Started</strong> <strong>with</strong> <strong>IBM</strong> <strong>Data</strong> <strong>Studio</strong> <strong>for</strong> <strong>DB2</strong><br />

2.8 Exercises<br />

In this chapter you learned how to start and stop instances, create and connect to<br />

databases, create tables, views, and indexes, and how to grant access to users. Here are<br />

some exercises to practice what you learned. You can use any of the connection you<br />

created in this chapter whenever the name of the database is not mentioned explicitly in<br />

the exercise.<br />

Exercise 1: You created a GSDB database in the previous chapter and learned to connect<br />

to it using <strong>Data</strong> <strong>Studio</strong> in this chapter. Browse the database tree to find out the various<br />

schemas in the database and the various objects associated <strong>with</strong> those schemas.<br />

Exercise 2: Try creating a table <strong>with</strong> various data types and insert some values into it. Try<br />

creating an index of single or multiple columns on this table.<br />

Exercise 3: Try creating a table <strong>with</strong> a primary key including single or multiple columns.<br />

Does an index automatically get created? What columns does it contain?<br />

Exercise 4: Try adding a user and see how many privileges you can give. Browse through<br />

all the possible privileges.<br />

Exercise 5: Create a table where the value <strong>for</strong> a specific column will always be generated<br />

by the <strong>DB2</strong> based on an expression defined by you.<br />

2.9 Summary<br />

In this chapter you have learned how to create and connect to a database and how to<br />

navigate the databases. You also learned how to use change plans to create objects in the<br />

database. You also learned how to manage different database objects, and view the<br />

relationships between objects. You learned how to add users and grant privileges using<br />

<strong>Data</strong> <strong>Studio</strong> as well as how to create an overview diagram that shows the relationships<br />

among the objects.<br />

2.10 Review questions<br />

1. How do you generate an entity-relationship diagram in <strong>Data</strong> <strong>Studio</strong>?<br />

2. Related database objects are grouped together in a _________.<br />

3. Why are connection profiles useful?<br />

4. When creating a new user in <strong>Data</strong> <strong>Studio</strong>, which tab in the object editor enables you to<br />

specify which objects that person has access to?<br />

5. When connecting to a database, which of these is a mandatory parameter?<br />

A. Port number<br />

B. Host name/IP address<br />

C. User ID/password

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!