COC Level 5 Web Dev DB Admin EOS Questions Plus Practical
COC Level 5 Web Dev DB Admin EOS Questions Plus Practical
Database Administration
Based on Ethiopian Occupational Standards (EOS)
A. <div>
B. <header>
C. <span>
D. <section>
Answer: B and D
Answer: C
Answer: C
A. 200
B. 301
C. 404
D. 500
Answer: C
Answer: A
✅ Client-side scripting runs in the browser (e.g., JavaScript), while server-side scripting
runs on the server (e.g., PHP, Node.js).
✅ It ensures the website looks and functions well on all devices, including desktops,
tablets, and mobile phones.
✅ To manage changes to source code, collaborate with teams, and track history of
code changes.
2. Write a simple HTML form that submits user data to a PHP page.
3. Using SQL, write a query to display names of students from a table where age > 18.
.container {
display: flex;
flex-wrap: wrap;
}
.box {
flex: 1 1 300px;
margin: 10px;
padding: 20px;
background-color: #f2f2f2;
}
A. <ul>
B. <ol>
C. <li>
D. <list>
Answer: B
A. text-color
B. font-color
C. color
D. textStyle
Answer: C
A. getElementByName()
B. getElementById()
C. getById()
D. querySelectorAll()
Answer: B
Answer: A
A. String
B. Boolean
C. Character
D. Array
Answer: C
11. Which SQL statement is used to insert new data into a database?
A. UPDATE
B. INSERT INTO
C. ADD NEW
D. CREATE
Answer: B
A. font-size
B. text-size
C. size
D. text-font
Answer: A
A. for
B. repeat
C. while
D. do-while
Answer: A, C, D
14. Which database command is used to remove all records from a table?
A. DELETE
B. REMOVE
C. TRUNCATE
D. DROP
Answer: C
A. GET
B. POST
C. PUT
D. DELETE
Answer: C
18. The SQL `GROUP BY` clause is used for aggregation. ✅ True
28. The HTML `<iframe>` tag is used to embed another web page. ✅ True
✅ To provide metadata about the HTML document such as character set, viewport,
and SEO information.
7. Define a foreign key in database design.
✅ A foreign key is a field in one table that uniquely identifies a row in another table.
✅ Model-View-Controller.
✅ Postman or Curl.
✅ They are used to apply styles depending on the device's screen size or resolution.
✅ `==` compares values with type coercion, `===` compares both value and type.
✅ An API that follows the constraints of REST architecture and allows stateless
communication.
✅ Using the `required` attribute, `pattern`, `min`, `max`, and client-side scripts.
✅ Content Delivery Network: distributes static files across multiple servers worldwide.
✅ Solution: Use <form> with method='POST' and input fields for name, email, and a
<textarea> for message.
17. 2. Write a SQL query to retrieve all users who registered in the year 2023 from a
table named 'users'.
18. 3. Design a CSS class that makes text red, bold, and center-aligned.
19. 4. Write a JavaScript function that alerts 'Hello, World!' when a button is clicked.
20. 5. Create a PHP script that connects to a MySQL database called 'school' with
username 'root' and no password.
21. 6. Write a SQL query to delete all records from the 'orders' table where order_date is
before 2022.
22. 7. Implement a JavaScript function to validate that a form input is not empty.
✅ Solution: CREATE TABLE products (id INT PRIMARY KEY, name VARCHAR(100),
price DECIMAL(10,2));
24. 9. Use PHP to check if a session variable 'username' is set and print it.
25. 10. Create an HTML5 page with a responsive layout using Flexbox.
26. 11. Write a PHP function that calculates the factorial of a number.
27. 12. Develop a login form using HTML and validate it using JavaScript.
✅ Solution: Use <form>, <input type='text'> and <input type='password'>, then validate
inputs with JS before submit.
28. 13. Write a SQL statement to add a new column 'email' to the 'customers' table.
29. 14. Create a MySQL query to count the number of products in each category.
30. 15. Write a JavaScript function to change the background color of an element by ID.
31. 16. Build a simple PHP registration form with error handling for empty inputs.
✅ Solution: Check each $_POST value and display messages if empty before inserting
to DB.
32. 17. Write a CSS rule that hides an element with class 'hidden'.
33. 18. Write a SQL query that joins 'orders' and 'customers' tables using customer_id.
34. 19. Create a PHP script that uploads a file to a folder named 'uploads'.
✅ Solution: Use move_uploaded_file($_FILES['file']['tmp_name'], 'uploads/' .
$_FILES['file']['name']);
35. 20. Write JavaScript code to display current date and time in a div.