0% found this document useful (0 votes)
55 views5 pages

Training Assignments: SQL Basics

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

Training Assignments: SQL Basics

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

SQL BASICS

T rai ni ng Assi gnments

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_Opt2: 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_Opt2
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 (XYZ@fsoft.com.vn ) or follow the guidance of the class admin.

Day 2. Lesson 2: SQL Basic


Assignment 2_Opt2: Fresher Training Management
Barem: Each sub-question is 10%.
Objective: H5SD - SQL skills
Problem Description:
In the database design for the Employee Management System of FSOFT Company, given tables of
the application with below:
EMPLOYEE:
• EmpNo: employee code, primary key.
• EmpName: employee name.
• BirthDay: birth day of the employee.
• DeptNo: department code of the employee.
• MgrNo: manager code, not null.
• StartDate: starting date of work.
• Salary: salary of the employee, data type is money (VND).
• Level: level of the employee (accepts value range from 1 to 7 only).
• Status: status of the employee (0: working, 1: unpaid leave, 2: out)
• Note: some note about employee, free text.
EMP_SKILL:
• SkillNo: skill code, foreign key.
• EmpNo: employee code, foreign key.
• SkillLevel: skill level of the employee (accepts value range from 1 to 3 only).
• RegDate: registration date.
• Description: skill description, free text.
Primary key (SkillNo, EmpNo)
SKILL:
• SkillNo: skill code, primary key, auto increment.

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


Training Assignments SQL BASICS Issue/Revision: x/y

• SkillName: name of skill.


• Note: some note about skill, free text.
DEPARTMENT:
• DeptNo: department code, primary key, auto increment.
• DeptName: department name.
• Note: some note about department, free text.
Questions to answer:
Q1:
a. Create EMPLOYEE table with the most appropriate/economic field/column constraints & types. All
fields are mandatory except Note field.
b. Create SKILL table with the most appropriate/economic field/column constraints & types, all fields
are mandatory except Note field.
c. Create DEPARTMENT table with the most appropriate/economic field/column constraints & types, all
fields are mandatory except Note field.
d. Create EMP_SKILL table with the most appropriate/economic field/column constraints & types, all
fields are mandatory except Description field.
Q2:
a. Add an Email field to EMPLOYEE table and make sure that the database will not allow the value for
Email to be inserted into a new row if that value has already been used in another row.
b. Modify EMPLOYEE table to set default values to 0 of MgrNo and Status fields.
Q3:
a. Add the FOREIGN KEY constrain of DeptNo field to the EMPLOYEE table that will relate the
DEPARTMENT table.
b. Remove the Description field from the EMP_SKILL table.
Q4:
a. Add at least 5 records into each the created tables.
b. Create a VIEW called EMPLOYEE_TRACKING that will appear to the user as EmpNo, Emp_Name
and Level. It has Level satisfied the criteria: Level >=3 and Level <= 5.
Estimated Time to complete:180 mins.

-- THE END --

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy