SQL - Additional Hands On
SQL - Additional Hands On
Important Instructions:
Coverage:
1. DDL_DML_DQL_DCL_TCL
2. Constraints
3. Clauses
NOTE: All the pre-requisites are already available as part of Mandatory hands on exercises or Guided
Practice. Please refer to the same.
DDL_DML_DQL_DCL_TCL
Data:
Trainer_Info
Page 1
C2: Protected
Additional Hands On – SQL
Batch_Info
Module_Info
Field Description Type Size
Associate_Info
Siz
Field Description Type
e
Associate_Id Unique ID to every associate Character 20
Questions
Page 2
C2: Protected
Additional Hands On – SQL
Associate_Status
Field Description Type Size
AFeedbackGiven Flag to test whether Associate has given feedback or not Character 20
TFeedbackGiven Flag to test whether Trainer has given feedback or not Character 20
Trainer_Feedback
Field Description Type Size
Associate_Feedback
Siz
Field Description Type
e
Associate_Id Associate Id from associate_Info Character 20
Page 3
C2: Protected
Additional Hands On – SQL
Login_Details
Size: 20
Size: 20
Start_Date
End_Date
Deliverables Expected:
New Columns in batch_Info & trainer_Info & changed column data types
Page 4
C2: Protected
Additional Hands On – SQL
Constraints
Exercise1: Create an Oracle table called customers that stores customer ID, name, and address
information. The customer ID should be the primary key for the table.
address varchar2(50)
city varchar2(50),
state varchar2(25)
zip_code varchar2(10))
Exercise2:
Based on the departments table below, create an Oracle table called employees that stores
employee number, employee name, department, and salary information.
The primary key for the employees table should be the employee number. Create a foreign key
on the employees table that references the departments table based on the department_id field.
);
Clauses
– This case study is to develop a Course Management System (CMS) for ABC University.
The following are the two use cases for which the database needs to be designed.
Page 5
C2: Protected
Additional Hands On – SQL
• Add Course:
• Retrieve Course:
• The courses to be added will have the following attributes: Course Code, Course Name, Number
of participants, Course Description, Course Duration, Course start date, and Course Type.
Exercise1: Develop a query which would retrieve and display the students name, their course enrolled
(course name and course code), base fees. Display the records ordering the base fees in descending
order.
Page 6
C2: Protected