COC Sample Practical Question for Database
Administration Level 3
Author: addisvie October 8, 2015 0 Comments
QUESTION PAPERS
coc for DBA
Email
Database Administration
Level 3
COC Sample Questions
Model question 1
1. Let ABC_college want a database to record its students detail and the
course the student take with the grade the student get. Design the ER
diagram by Visio 2003/2007 to model the objects.
2. Design the program logic of the above question using pescd and flow
chart.(use Visio 2003/2007) to draw the flow chart.
3. Develop ER diagram for university course enrollment system depending
up on below information
Entity: Department, student, course and instructor
Attribute:
Department will have (id (pk),name,addres)
Student will have (id (pk),fname,lname,dept,sex)
Course will have (c-id (pk),c_title,cr_hr)
Instructor will have (id (pk), fname, lname, address (multivalued
attribute))
Use cardinality of relationships b/n entities.
4. Create the database name ABC_College
Create the following tables in the database
Student
Filed Datatype Size Constraint
Studentid Varchar 10 Primary key
Name Char 30 Not null
Sex Char 6 Default
Birthday Datetime Not null
Section Char 6
Deptname Char 40 Not null
Course
Filed Data type Size Constraint
Course_code Varchar 8 Primary key
Course_title Char 40 Not null
Credit Int Not null
Grade report
Filed Datatype Size Constraint
Sid Varchr 10 Primary key,forignkey
C_code Varchar 8 Primary key,forignkey
Grade Char 1 Grade(A,B,C,D,F)
Add a new column into student table named ”email address” with data
type char and size 25
Insert the following data into tables
Student tables
Studentid Name Sex Birthday Section Deptname Email address
Computer
R101 Kiros Male 20/02/80 Room1 science [email protected]
Computer
R102 Mulu Female 12/06/78 Room1 science [email protected]
R103 Getachew Male 17/01/70 Room2 Electrical [email protected]
Computer
R104 Melkamu Male 10/09/73 Room1 science [email protected]
R105 Sable Female 19/01/82 Room2 Electrical [email protected]
Course table
Course_code Course_title Credit
ICT001 Calculus 80
ICT002 Software 104
Elec003 Electrical 200
Grade Report
Sid C_code Grade
R101 ICT001 B
R101 ICT002 C
R102 ICT001 A
R103 Elec003 C
R104 ICT001 B
R104 ICT002 A
R105 Elec003 B
Query analyzer
1. Write a query to display the student name for all students those who
score grade ”B”.
2.write a query to display the student id and name for all female students
those who score grade ”A” and who learn in software course.
3. Write a query to display the student for all students those who score
grade “A” and who learn in computer science department the sort by
department name descending and name ascending order.
4. Write a query code in query analyzer to back up the project
ABC_COLLEGE database
5. create a query to update the student section for all students with
“room4” those who score grade”A” or ”B” and who learn software
course.
6. Write a query code in query analyzer to restore to restore the project
ABC_COLLEGE.
7. Write the query to display the student for all students for all students
those who score grades Between “A” and “D” and who learn in calculus
course.
8. write a query to display the student id and name for all student who
work in a computer science department with any student whose name
contain a ”T”.
Model question 2
Suppose you are database administrator in a company and assigned to
create a database that management the information about the company
employees.
The main tasks of the project are the following
1. Create a data base named HRM using SQL server 2005 enterprise
manager
2. Create the following tables in HRM data base by using the following
information
Table 1: Department
Filed name Data type size
Dep ID Char 10
Dep name Char 50
Table 2: Employee
Filed name Data type SIZE
EMP ID Char 50
F name Char 50
Sex Char 10
DOB Data and time
Salary numeric
Dep ID Char 10
Table 3:- Training
Filed name Data type SIZE
EMP- ID Char 10
Training ID Char 10
Title Char 10
Instructor name Char 50
1. Set DEP id for department EMP ID Employee training ID for training
table as key
2. Create a relationship the 3 tables
3. Insert the following records in to respective tables
Department
DEP ID DEP name
0111 Finance
0112 Human resource
0113 Information technology
Employee
Emp id F name L name Sex Date of birth Hired date salary DEP ID
E001 Abebe Mekasha M 12/4/1950 6/15/1987 4000 0111
E002 Tewodrose Sileshi M 5/27/1975 3/27/1996 3000 0113
E003 Selam Nigussie F 4/9/1986 12/5/2006 1500 0114
E004 Bekele Abera M 12/3/1967 5/13/2000 10000 0115
E005 Taye Daniel M 5/13/1980 4/6/2000 2500 0114
Training
Emp id Training id title Last name duration
E001 000 ICT Belay 1month
E002 001 Accounting Neuro 2 month
E003 002 Oracle Ava 4 month
E004 003 Mgmt Emi 3 month
E005 004 Strategic planning Emi Month
1. Insert the following record in to department table by using query
analyze Dept id 0116 Dep name =marketing
2. Write SQL statement that displays records that containing Emp ID ,first
name ,last name and department name and save it by name Employs for
each dept and save it by the name salary in my document folder
3. Write SQL statement that displays the total salary of employees by for
each dept and save it by the name salary in my document folder
4. Write SQL statement that increases the salary of employs by 20% and
save it by name increment in my document
5. Write SQL that delete the record that contain zelalme from employee
table and save it by the name zelalme in my documents folder
6. Update the value abebe in the Fname column of the Employee table to
TOLA where empid= E001 using update statement.
7. Select all of the records from the Employee table using select statement.
8. Select Studid, Fname and sex fields from the employee table where
salary is greater than 1500 using select where clause statement.
9. Select all the records from Employee table where their Fname is like M
using Like operator.
10. Select all the records from Employee table where their Fname is like
‘b-k-le’ using Like operator.
11. Select all the records from Employee table where Fname Not like
‘%A%’ using Like operator with the NOT keyword.