ICT COC Level 3 DBA Practice Question
ICT COC Level 3 DBA Practice Question
Project Information
Given the necessary materials, supplies and information the candidate is expected to perform the
following project.
B) Design the ERD for ABC Company Database based on the above given requirement on Microsoft Office Visio 2003/7 software.
Task 2: Designing flowchart:
The following pseudocode describes an algorithm which will accept a student’s mark from the keyboard and returns ‘satisfactory’ if
the mark is greater than or equal to 50, otherwise ‘not satisfactory’ will be returned.
Pseudocode:
Start
If (mark<=50)
Display “Satisfactory”
Else
End if
Stop
• Configure with mixed mode (SQL server authentication and Windows authentication).
• Install all features of the SQL server
Suppose you are a database administrator in sales company and assigned to create a database that manages the sales information
about the company’s customers and their orders.
Table 1: CUSTOMER
Attributes Type Size
Page 2 of 5
Cust_ID varchar 12
FirstName char 20
LastName char 20
City varchar 30
IndustryType Char
Table 2: SALESPERSON
Attribute Type Size
SP_ID Varchar 10
Name Char 20
Age Int
Salary Money
Table 3: Order
Attribute Type Size
Number Varchar 10
Order_Date Date/Time
SP_ID Varchar 10
Cust_ID Varchar 12
Amount Money
3. Set Cust_ID for Customer, SP_ID for Salesperson and Number for Order table as a primary key.
SALESPERSON CUSTOMER
ORDER
SALESPERSON
SP_ID Name Age Salary
Page 3 of 5
103 Azeb 35 2000
CUSTOMER
Cust_ID FirstName LastName City IndustryType
ORDER
Number Order_Date SP_ID Cust_ID Amount
6. Write SQL statement that displays the names of all salespeople that have an order with ‘muluken’ and save the result set
by the name mulukenOrder in My Document folder.
7. Design SQL statement that displays the names of all salespeople that do not have any order with ‘muluken’
and save the result set by the name NonmulukendOrders in local disk D: .
8. Design SQL statement that displays the names of salespeople that have 2 or more orders and save the
result set in your flesh disk by the name MoreOrders.
9. Develop SQL statement that removes the column name “IndustryType” from the customer table.
10. Design SQL statement to take backup for your Sales database and save the backup by the name
salesBackup in your flesh disk.
11. Assume that the sales database was failed accidentally. Design SQL statement that Recover the failed database into an
earlier state from the backup.
Answer 6:
Page 4 of 5
select Salesperson.Name from Salesperson, Orders where Salesperson.SP_ID = Orders.SP_id and cust_id = '4';
or
select Salesperson.Name from Salesperson where Salesperson.SP_ID = '{select Orders.SP_id from Orders, Customer
where Orders.cust_id = Customer.Cust_id and Customer.name = 'Samsonic'}';
Answer 7:
Answer 8:
SELECT name FROM Orders, Salesperson WHERE Orders.SP_id = Salesperson.SP_id GROUP BY name, SP_id HAVING COUNT(
SP_id ) >1
Page 5 of 5