Oracle Academy Virtual Training

Total Page:16

File Type:pdf, Size:1020Kb

Oracle Academy Virtual Training

CIS 211C Oracle - Database Design and SQL HOMEWORK: # 6

The questions 1 & 2 cover topics in Section 12 in iLearning Database Design.

1. Do the following: Printout or download the Basic SQL commands handout available in sections 0 of iLearning under chapter 12. You will be doing the 7 steps shown in that handout.

2. You will be either printing out the requested information or screen coping the information into this work document below the instruction. i. Create the my_music table using the command below. ii. To create the table use the following command:

CREATE TABLE MY_MUSIC ( MUSICID NUMBER(2) NOT NULL, ARTIST_NAME VARCHAR2(20), TYPE VARCHAR2(13), CONSTRAINT MUSIC_PRIMARY_KEY PRIMARY KEY (MUSICID)); iii. Copy and paste the table structure into this lab assignment. iv. After completing step 2 (inserting the data shown below into the my_music table. Printout or screen copy the contents of the populated table into the lab.

enter the data shown in the table below:

Homework_6_Fa10.doc v. INSERT INTO tablename (column1, column2, ….) VALUES (value1, value2, …….) vi. Copy and paste the contents of the table into this lab assignment. b. After completing step 3 on the sheet print out or copy and paste the contents of the Music table showing the deletions (Bob Marley, and id 2). c. After completing step 4 printout/screen copy the structure of the altered Music table. d. Complete step 5 then printout/screen copy the revised structure of the Music table into the lab sheet. e. Complete the 4 Select commands in step 6, copy your command and the results into the lab sheet or print them out. f. Complete step 7 to DROP the my_music table

3. Run the following queries in Oracle Application Express. Paste a copy of each query on a word document or notepad .txt file, save and return via TalonNet:

4. Complete the following “Try It / Solve It” Exercises: a. Section 15, Practice Guide Database Design Lesson 1, Exercises 2, 3, and 7 (shown below)

Homework_6_Fa10.doc b. Write a query that displays the last_name and email addresses for all the people in the DJ on Demand d_client table. The column headings should appear as "Client" and "Email Address." c. The manager of Global Fast Foods decided to give all employees at 5%/hour raise + a $.50 bonus/hour. However, when he looked at the results, he couldn't figure out why the new raises were not as he predicted. Ms. Doe should have a new salary of $7.59, Mr. Miller's salary should be $11.00, and Monique Tuttle should be $63.50. He used the following query. What should he have done? SELECT last_name, salary *.05 +.50 FROM f_staffs; d. Label each example as SELECTION, PROJECTION or JOIN. Please give me Mary Adam's email address. I will need each customer's name and the order_total for their order. I would like only the manager_id column, not any of the other columns.

Homework_6_Fa10.doc

Recommended publications