E-Education Infrastructure
 
STUDENT
 
FACULTY
 
SCHOOL
 
SUPPORT
 
PUBLIC
 
SIGNUP
DAILY QUIZ
 
     
  B U L L E T I N    B O A R D

641 Week 7 Outline

(Subject: Database/Authored by: Liping Liu on 10/4/2026 4:00:00 AM)/Views: 6357
Blog    News    Post   

Lecture 1: Basic SQL DML Statements

Preparation: Creating sample Oracle tables using scripts from script loader on ecourse.org and Lookup tables using dictionaries (user_tables, user_constraints, user_cons_columns)

Running an Oracle Script. Running a few scripts and then use dictionary tables to find out the database tables and constraints created by the scripts

select, delete, update, insert: understand what each does and memorize the basic syntax for each command

 

SELECT columns (separated by commas)

FROM tables (separated by commas)

WHERE conditions (apply to individual records)

 

UPDATE table_name

SET col1=exp1, col2=exp2,….coln=expn

WHERE conditions (apply to individual rows)

 

INSERT into table_name (col-1, col-2 ….., col-n)

VALUES (val-1, val-2, …..,val-n)

 

DELETE FROM table_name

WHERE conditions (apply to individual rows)

 

Examples: Basic Select Statements

Example 1: Find all employees whose salary is more than 800

Example 2: Find all employees who were hired after 1980

Example 3: Find all employees who never received commissions.

Example 4: Find those salesmen who were hired before 1983

Example 5: Find all distinct job titles

Example 6: Find those employees whose name starts with K

Example 7: Finds all managers whose salary is more than 200

Example 8: find all analysts whose name ends with T

 

Additional Exercises:

  • The company just started a new marketing department in Chicago. The department ID is 50. Insert a new record into the database.
  • Create a new employee for SARA with job title CLERK and salary 2500 in Department 20
  • Delete salesmen who made less than 100 commissions
  • Change Adams’ name to ADAM
  • Find all analysts whose name ends with T

Homework:

Reading: Chapter 15

Design:

Correctness Questions (due on 10/21): Online at ecourse.org

Closeness Questions (due on 10/28): Write SQL statements for the following problems:

  1. Give all salesmen 100 dollars of commission if they never received one before
  2. Find those employees who was hired between January 1, 1980 and July 1, 1983
  3. Delete those managers who were hired before 1979
  4. Insert a record for a new saleswoman SUSAN who was hired on February 27, 1986. Her initial salary is 1400 dollars. She has been assigned with an employee number 8045
  5. The company is to create "Management" department in Akron. Use a sequence that starts from 40 and auto increment by 10 to generate the department. 
  6. Find the total number of employees who have never received commissions
  7. Find the department that has less than 5 employees
  8. Find the years that company hired more than 5 employees
  9. Find the location that has more than 3 employees
  10. Find all the employees located in Dallas

           Register

Blog    News    Post
 
     
 
Blog Posts    News Digest    Contact Us    About Developer    Privacy Policy

©1997-2026 ecourse.org. All rights reserved.