0% found this document useful (0 votes)
116 views

SQL Assignment2 Opt1

The document provides instructions for a SQL assignment involving a trainee database. Trainees have attributes like name, birthdate, test scores. Learners must create the database tables, add records, modify a table, create a view for passed trainees, query passed trainees by birth month, and find the longest name with age.

Uploaded by

ngvuhoangtuan82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views

SQL Assignment2 Opt1

The document provides instructions for a SQL assignment involving a trainee database. Trainees have attributes like name, birthdate, test scores. Learners must create the database tables, add records, modify a table, create a view for passed trainees, query passed trainees by birth month, and find the longest name with age.

Uploaded by

ngvuhoangtuan82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

SQL BASICS

Training Assignments

Program Code BSQL

Version 3.1

Effective Date 01/11/2016

Hanoi, 11/2016
Training Assignments SQL BASICS Issue/Revision: x/y

RECORD OF CHANGES

*A - Added M - Modified D - Deleted

Date Changes A* Contents Version


M, D

14-Oct-2016 Create A Add the new assignments. v1.0

14-Oct-2018 Update M Template. v1.1

01-Jun-2019 Update M Update Objective v1.2

17e-BM/DT/FSOFT v1/1 Internal use 2/5


Training Assignments SQL BASICS Issue/Revision: x/y

Contents
For the following assignments:...........................................................................................................4
Day 2. Lesson 2: SQL Basic..............................................................................................................4
Assignment 2_Opt1: Fresher Training Management......................................................................4

17e-BM/DT/FSOFT v1/1 Internal use 3/5


Training Assignments SQL BASICS Issue/Revision: x/y

CODE: BSQL_Assignment2_Opt1
TYPE: n/a
LOC: n/a
DURATION: 180 MINUTES

For the following assignments:


• Print out respectively the screenshots to show the query results.
• Pack screenshots and SQL scripts or your answers into the zip file named
BSQL_Assignment<i>_AccountName.zip (for instance: BSQL_Assignment1_NamNT.zip) then handle to
the evaluator via email ([email protected] ) or follow the guidance of the class admin.

Day 2. Lesson 2: SQL Basic


Assignment 2_Opt1: Fresher Training Management
Barem: a: 40% (4), b: 10%(1), c: 15%(1.5), d: 15%(1.5), e: 20%(2)
Objective: H5SD - SQL skills
Problem Description:
In the design for the Fresher Training Management, given the Trainee table with below initial
attributes fields:
 TraineeID: trainee identifier, auto increment field

 Full_Name: full name of the trainee

 Birth_Date: trainee birth date

 Gender: only have one of two value male, female

 ET_IQ: entry test point (IQ) of trainee, integer, value range from 0 to 20

 ET_Gmath: entry test point (GMath) of trainee, integer, value range from 0 to 20

 ET_English: entry test point (English) of trainee, integer, value range from 0 to 50

 Training_Class: the class code that the trainee is joining

 Evaluation_Notes: trainee evaluation notes, free text.


Questions to answer:
a) Create the tables (with the most appropriate/economic field/column constraints & types) and add at
least 10 records to each created table.
b) Change the table TRAINEE to add one more field named Fsoft_Account which is a not-null & unique
field.
c) Create a VIEW that includes all the ET-passed trainees. One trainee is considered as ET-passed
when he/she has the entry test points satisfied the below criteria:
• ET_IQ + ET_Gmath >=20
• ET_IQ>=8
• ET_Gmath>=8
• ET_English>=18
d) Query all the trainees who is passed the entry test, group them into different birth months.

17e-BM/DT/FSOFT v1/1 Internal use 4/5


Training Assignments SQL BASICS Issue/Revision: x/y

e) Query the trainee who has the longest name, showing his/her age along with his/her basic
information (as defined in the table).
Estimated Time to complete:180 mins.

-- THE END --

17e-BM/DT/FSOFT v1/1 Internal use 5/5

You might also like