Monday, February 9, 2026

Prototype Monitoring

 In this task, you will learn how to measure the speed and cost of a certain function (in Python). The most basic way to determine how fast your function runs is:

Below is the code of a Simple Text Scoring  AI-inspired Sentiment prototype. Open you VSCode and run it at least 3 times with different inputs (your input must contain at least one of the positive and negative words specified in the sentiment_score function e.g. "My love life is good but a bit sad.")


Write the result in your Google Form with the format:

Test 1: 

Prompt: My love life is good but a bit sad. 

Score: (number) 

Result: .0876 ms 


Test 2: 

Prompt: (prompt 2)

Score: (number) 

Result: .0876 ms 


Test 3: 

Prompt: (prompt 3)

Score: (number) 

Result: .0876 ms 

Wednesday, March 25, 2020

Final Exam

Kulas, the administrator of Pitok University, wants to know who/how many students are experiencing the symptoms of COVID-19. The symptoms known so far are Fever, cough, sore throat, colds and many more.

He decided to form a group of programmers who are going to develop a survey app that is going to fulfill the above requirement. You are tasked to create the design for the backend database for the said app.

Sample data:
Kyra Nituda
- cough, sore throat
Jodessa Edades
- colds
Susan Lorenzo
- fever, cough, sore throat
Grace Basi-Basi
- colds
Jessie Bualat
- sore throat, fever
Lorlyn Camansi
- fever, sore throat, shortness of breath
Camille Dono
- no symptoms
Sylvia Aranas
- cough, colds, sore throat

Write/Draw your answer to a paper, take a picture of it then (pass) PM it to @pitokbatolata. I am going to accept your answers up to 3:00PM only. Good luck!

Your answers should resemble our last activities in which you are going to input the sample data in your database design.

Tuesday, January 28, 2020

Entity Relationship Diagram

ERD
 - Entity Relationship Diagram
 -  is a type of structural diagram for use in database design. An ERD contains different symbols and connectors that visualize two important information: The major entities within the system scope, and the inter-relationships among these entities.

Entity / Entities
 - tables
 - is a definable thing or concept within a system, such as a person/role (e.g. Student), object (e.g. Invoice), concept (e.g. Profile) or event (e.g. Transaction) (note: In ERD, the term "entity" is often used instead of "table", but they are the same). When determining entities, think of them as nouns.
 - symbol is a rectangle

Weak Entities
 - tables that are dependent to other tables
 - symbol is double lined rectangle

Attributes
 - columns
 - is a property or characteristic of the entity that holds it
 - symbol is oval/elliipse

Types of Attributes
 - Derived ex. Age from Birthday
- symbol is dashed ellipse
 - Multi-valued ex. tags in a tweet - double line
- symbol is double ellipse
 - Composite ex. Name from lastName + firstName

Relationship
 - A relationship between two entities signifies that the two entities are associated with each other somehow

Cardinality
 - defines the possible number of occurrences in one entity which is associated with the number of occurrences in another

One-to-One Cardinality
 - is mostly used to split an entity in two to provide information concisely and make it more understandable ex. user and userProfile

One-to-Many Cardinality
 - A one-to-many relationship refers to the relationship between two entities X and Y in which an instance of X may be linked to many instances of Y, but an instance of Y is linked to only one instance of X

Many-to-Many Cardinality
 - A many-to-many relationship refers to the relationship between two entities X and Y in which X may be linked to many instances of Y and vice versa

Cardinality Symbols:



More Readings:
https://www.tutorialspoint.com/dbms/er_diagram_representation.htm





Sunday, January 26, 2020

Database Normalization

First Normal Form (1NF)
- A relation is in first normal form if and only if the domain of each attribute contains only atomic (indivisible) values, and the value of each attribute contains only a single value from that domain.

1NF Criteria:
- Eliminate repeating groups[clarification needed] in individual tables
- Create a separate table for each set of related data
- Identify each set of related data with a primary key

Second Normal Form (2NF)
A relation is in the second normal form if it fulfills the following two requirements:

- It is in first normal form.
- It does not have any non-prime attribute that is functionally dependent on any proper subset of any candidate key of the relation. A non-prime attribute of a relation is an attribute that is not a part of any candidate key of the relation.

* "There should be no partial dependency"

Third Normal Form (3NF)
- The entity is in second normal form.
- No non-prime (non-key) attribute is transitively dependent on any key i.e. no non-prime attribute depends on other non-prime attributes. All the non-prime attributes must depend only on the candidate keys.

* it should not have Transitive Dependency.


Additional readings:

https://www.studytonight.com/dbms/database-normalization.php
https://www.studytonight.com/dbms/first-normal-form.php
https://www.studytonight.com/dbms/second-normal-form.php
https://www.studytonight.com/dbms/third-normal-form.php

Sunday, January 19, 2020

Activity 1-21-2020 Section B

* Create this user account:

Full Name : iJet Dono
username : ijet
password : 54321
user level : 10

1. Login using the user account ijet

2. Encode this user:

Full Name : John Paul Balaan
username  : jpaul
password  : 69
user level: 10

2. Encode this Product:

Name : Hentai Soy Sauce
Barcode : 666666
Brand : JP Hentai
Unit : Pouch
Category : Condiments
Supplier : Hentai Enterprises
Cost Price : 10.00
Selling Price : 15.00

3. Logout

4. Login using the account jpaul

Tuesday, January 14, 2020

Activity Section A

1. Alter the structure of tblProducts, add this column:
prod_encodedBy int

2. Modify the Products data entry and add a label "Encoded By" which will contain the full name of the user who encoded/updated that certain product.

Assignment For Section B

Create this table:

tblUsers
user_id AI
user_fullName Text(50)
user_username Text(20)
user_password Text(20)
user_level int

1. Create a data entry for the users table
2.  a. Create a login form. Make this as the startup form.
     b. If login is successful, display the full name of the user to the title bar of the dashboard.

Note: Create a default user in the database: 
     username: admin
     password: 12345