0% found this document useful (0 votes)
39 views11 pages

Prctice Questions For Coc

Uploaded by

Esubalew
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)
39 views11 pages

Prctice Questions For Coc

Uploaded by

Esubalew
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/ 11

COC Internal Assessment MGMBPTC ICT Department

Section One:

Database Administration Project: Cyber Technology College (CTC) Database

Project Overview:

You are appointed as the Database Administrator for Cyber Technology College (CTC). Your
primary task is to design, implement, and manage a relational database system that will store and
handle information related to students, courses, and instructors at CTC.

Objectives:

 Design an efficient database structure using Entity-Relationship Diagrams (ERD).


 Implement the database and create necessary tables.
 Populate the database with sample data.
 Execute various SQL queries to retrieve, update, and manipulate data.
 Implement database maintenance tasks like backups and schema modifications.

Project Requirements:

Part 1: Database Design

1. Entity-Relationship Diagram (ERD)

 Task: Design an ERD based on the following entities:

 Student: Identified by SID, with attributes fname, lname, sname, sex, age,
and course.
 Instructor: Identified by i_ID, with attributes fname, lname, sex, and
salary.
 Course: Identified by course_code, with attributes course_name, cr_hr.
 Department: Contains attributes like Dname, Dnumber, Mgr (manager),
and Locations.
 Relationships:

1
COC Internal Assessment MGMBPTC ICT Department

 Students enroll in multiple courses.


 Instructors teach multiple courses.
 Each course belongs to a department.

 Deliverable: Submit a complete ERD diagram that shows all entities, attributes,
primary keys, and relationships with cardinalities.

 Use vision software application for desining ERD diagram.


 Use SQL Server software application for part2 - part4.
 Use visual studio code software application for part 5.

Part 2: Database Implementation

1. Database Creation

 Task: Create a new database named CTC.


 Deliverable: A SQL script that creates the database CTC.

2. Table Creation

 Task: Based on your ERD, write SQL scripts to create the required tables in the
CTC database. Ensure that:

 Primary keys and foreign keys are correctly set.


 Relationships are enforced via constraints.

 Deliverable: SQL scripts to create all necessary tables with appropriate data types
and constraints.

3. Data Insertion

 Task: Insert at least 5 sample records into each table you've created.
 Deliverable: SQL script with INSERT INTO commands to populate the tables
with sample data.

2
COC Internal Assessment MGMBPTC ICT Department

Part 3: Data Manipulation and Queries

Query 1: Retrieve Female Students

 Task: Write a query to display all female students.


 Deliverable: SQL query and the resulting dataset.

Query 2: Filter Students by Last Name

 Task: Display all students whose last names start with 'D' and end with 'N'.
 Deliverable: SQL query and the resulting dataset.

Query 3: Filter Students by Age

 Task: Display all students who are younger than 30 years old.
 Deliverable: SQL query and the resulting dataset.

Query 4: Update Student Information

 Task: Change the sname of the student with SID = 'S001' to 'Awoke'.
 Deliverable: SQL query to perform the update and show the affected record.

Query 5: Modify Student Table Schema

 Task: Remove the age column from the Student table.


 Deliverable: SQL script to modify the table schema.

Query 6: Add New Column to Instructor Table

 Task: Add a phone number column to the Instructor table.


 Deliverable: SQL script to add the new column.

Query 7: Delete Instructor Record

 Task: Delete one record from the Instructor table. Specify which record and why.
 Deliverable: SQL query to delete the record and an explanation.

3
COC Internal Assessment MGMBPTC ICT Department

Query 8: Select Specific Instructor Information

 Task: Retrieve only i_ID, fname, and lname from the Instructor table.
 Deliverable: SQL query and the resulting dataset.

Query 9: Update Instructor Salary

 Task: Increase all instructors' salaries by 20%.


 Deliverable: SQL query to perform the update and show the affected records.

Query 10: Sort Students by Last Name

 Task: Display all students sorted by sname in ascending order.


 Deliverable: SQL query and the resulting dataset.

Query 11: Count Gender Distribution

 Task: Count the total number of male and female students.


 Deliverable: SQL query and the resulting counts.

Query 12: Find Salary Extremes

 Task: Determine the maximum and minimum salary from the Instructor table.
 Deliverable: SQL query and the resulting values.

Part 4: Database Maintenance

1. Database Backup

 Task: Perform a backup of the CTC database and save the backup in your "My
Documents" folder.
 Deliverable: A script or command-line output showing that the backup was
successfully created, along with the file path.

Submission Guidelines:

4
COC Internal Assessment MGMBPTC ICT Department

 Submit your ERD as a PDF file.


 All SQL scripts should be organized and commented, then submitted in a single SQL file
or multiple files compressed in a .zip archive.
 Provide screenshots or output logs where necessary, especially for tasks involving data
retrieval or schema modification.
 Ensure that the backup file is accessible and properly labeled in your submission.

Part 5: User Authentication Input Validation

Objectives:

In this project, you will design a simple user authentication system that checks whether a user
has entered both a username and a password. The project aims to help you understand the
importance of input validation and how to implement basic conditional logic in Python.

 Develop a basic Python script that prompts the user for input.
 Implement conditional logic to validate the user's input.
 Provide appropriate feedback to the user based on the input received.

Project Requirements:

1. Script Functionality:

 Your script should prompt the user to enter a username and a password.
 The script must check if both fields are provided.
 If both the username and password are provided, the script should display a
success message.
 If either the username or password (or both) is missing, the script should prompt
the user to provide both.

2. Detailed Instructions:

 Input Handling:

5
COC Internal Assessment MGMBPTC ICT Department

 Use the input() function to collect the username and password from the
user.
 Store these inputs in variables named username and password.

 Conditional Logic:

 Implement an if-else statement to check if both the username and


password variables contain values.
 Display a message "Both username and password are provided." if both
fields are filled.
 Display a message "Please provide both username and password." if one
or both fields are empty.

3. Code Structure:

 Your code should be organized and well-commented.


 Follow Python's best practices for naming variables and structuring your script.

4. Testing:

 Case 1: Both username and password are provided.


 Case 2: Only username is provided.
 Case 3: Only password is provided.
 Case 4: Neither username nor password is provided.

 Case 5: Spaces or empty strings are entered as username and/or password.


5. Submission Requirements:
o Submit the final Python script (user_authentication.py) containing your solution.
o Include a short report (maximum one page) explaining how your script works, the
logic you implemented, and how you tested the code.

6
COC Internal Assessment MGMBPTC ICT Department

Section Two:

Project Overview: In this section databases can be created and connected to the Web. After
establishing a connection and interact with the database, the candidates perform database user
input manipulation of update existing data stored in the database, insertion of data in the
database and deletion of data in the database

In this section the candidate also design and execute code on the server Server-side scripting for
dynamic web pages involves the use of variables, data types, operators, conditional statements
and loop statements in PHP.

In the section two of this exam there are 4 (four) project works available each project has their
own task.

Project One: Connecting the web application to the database

Task 1: Download and Install XAMPP on Windows 10


Deliverable: Check your XAMPP has been installed and configured correctly. And ready your
code editor (Notepad++, or Sublime text editor, or Visual Studio code)

Task 2: Creating a database and a table.

 Create a database named “cocdb” with the following credentials:


o Host: localhost
o Username: root
o Password: 12345
o Database: cocdb
 Create a table named “contacts” with the following attributes:
o Name
o Email
o Phone
o Message

7
COC Internal Assessment MGMBPTC ICT Department

o submission_date

Deliverable: Create the stated database and table with indicated credentials and attributes.

Task 3: connecting the web application to the database

 Write a PHP script to connect your “cocdb” database into your web application. And save
this file named as “db.php” in your working folder.
 Your db.php file must display a message that your database is successfully connected.

Deliverable: Establishing and checking a connection to database using a PHP code.

Task 4: creating the HTML, PHP, and CSS files for the form

 Create as“index.html” file that handles a web pages to database.

 Create “styles.css” file for styling the web pages.

 Create a “process_form.php” files. This file helps to handle form submission and
database insertion.

 Run the “index.html” file and display the output.

Deliverable: The HTML form can handles a web pages for connecting to database, a PHP page
helps to save data from HTML form to your database and the “css” file also necessary for styling
the web pages

Project Two: Retrieve Data from Database and Display on Web Pages in an HTML table

Task 1: Retrieve Data from Database and Display on Web Pages.

 Create a PHP script named as “display_data.php”. This file can retrieves data based on
the search term and displays it in an HTML table.

 Run the “display_data.php” files and Display the data in an HTML table format

8
COC Internal Assessment MGMBPTC ICT Department

Deliverable: Implementing the updating ”Search” button data based on the search term and
displays it in an HTML table format.

Project Three: Update Database Data from User Input

Task 1: Creating an update form and an update_process PHP file

 Create an update form and a PHP script to handle the update process, named as
“update_form.php”.
 Create an updated process PHP Script named as “update_process.php”.
 Run the “update_form.php” files and Display the output

Deliverable: To implement the updating functionality, you can add an "Update" button to your
“update_form.php” file and create a PHP script to handle the updating process.

Task 2: Deletion of data in the database using PHP scripts

 Create an update form with delete button and named as: “update_delete_form.php”
 Create the delete process PHP script and named as: “delete_process.php”.
 Run the “update_delete_form.php” files and Display the output

Deliverable: To implement the deletion functionality, you can add a "Delete" button to your
“update_delete_form.php” file and create a PHP script to handle the deletion process.

Project Four: Designing and executing server-side script for dynamic web pages
Task 1: creating a table
 Creating a table named as: “users” with the following attributes:-
o Username
o Email
Deliverable: The users table can accept and store data inserted in user input form
Task 1: Using the “cocdb” database perform the following questions carefully.
 Create and display ‘Hello, PHP!’ by creating message variable.
 Using arithmetic operators to display the sum of two numbers which is 10+5.

9
COC Internal Assessment MGMBPTC ICT Department

 Create If statement to show welcome message when the user is logged in.
 Create a simple for loop that used to generate unordered list with five list items.
 Create a link to Go to Form and create the following user input form to accept Username
and Email.
 Create “index.php” file.
o (NB: This an “index2.php” file must include all tasks of PHP variable,
arithmetic operators, if_statement and for_loop statements)
 Create a “form.php”, this file will display the form for user input.
 Create a “submit_form.php”, this file will handle the form submission and display the
submitted data.
 Access index.php to see the output of all tasks and navigate to the form as shown in the
screenshot below.

 Access the “Go to Form” link then insert and store data into “users” table

User input form

10
COC Internal Assessment MGMBPTC ICT Department

Deliverable: Executing the designed PHP Variables, data types, operators, conditional
statements and loop statements in PHP

11

You might also like