Friday, March 16, 2012

Oracle Exercise - Start the default Oracle database (orcl)

1. Start the default Oracle database (orcl) or the one you created in lab 3. For this assignment you will use either the SQL*Plus Worksheet interface or the console interface for SQL.
2. Once in the SQL interface, write the SQL statements (and record them here) to perform the following:
a. Create a table named movies, with columns of movie_ID, name, genre, and release date (choose the appropriate datatype).

b. Get a description of the movies table.

3. Take a snapshot of the results of the statement in 2b and paste it here.
4. Write the SQL statements (and record them here) to perform the following:
a. Change the movies table to include runtime in minutes (hint: just use an integer).
b. Get a description of the table movies.

5. Take a snapshot of the results of the statement in 4b and paste it here.
a. Create a table named actors, with columns of actor_ID, last name, first name, and birth date (choose the appropriate datatype). Choose the appropriate field to act as the primary key for this table.

b. Alter the movie table so that movie_ID is the primary key and add actor_ID as a foreign key.

c. Get a description of the table actors, take a snapshot of the results and paste it here.

3. Execute the following SQL statement to show the constraints you created in 2b.
4. Write the SQL statements (and record them here) to perform the following:
a. Create a view named current_film that includes the name of the movie, the genre and the first and last name of an actor.

b. Get a description of the view you created titled current_film

5. Take a snapshot of the results of the previous statements and paste them here.

6. Save, then upload this completed lab to the link as instructed in the assignment

No comments: