Skip to content

Instantly share code, notes, and snippets.

View mximenes88's full-sized avatar
💻
Cybersecurity

Morgana Ximenes mximenes88

💻
Cybersecurity
View GitHub Profile
@mximenes88
mximenes88 / join_statements_sql.txt
Last active October 19, 2018 23:01
Join Statements in SQL- Web Developer Track at Bloc
#### Exercises
1. How do you find related data held in two separate data tables?
Related data held in two separate data tables are found with an INNER JOIN.
2. Explain, in your own words, the difference between an INNER JOIN, LEFT OUTER JOIN, and RIGHT OUTER JOIN. Give a real-world example for each.
Inner Join: It is when two tables are combined and the resulting table contain rows that are matching from both tables.
ex. You have a table containing all the available arts classes with a classid ,class names and enrollment number at an university and in another table you have the students table, with the name of every student in the university regardless of whether they are taking arts classes or not and the corresponding classid enrolment. You can combine both tables using an inner join to only display the names of students taking arts classes.
@mximenes88
mximenes88 / sql_operators
Created October 12, 2018 22:52
SQL Operators Checkpoint - Web Dev Track @ Bloc
#### EXERCISES
1. Write out a generic SELECT statement.
SELECT numbers
FROM table1
WHERE numbers > 4
2. Create a fun way to remember the order of operations in a SELECT statement, such as a mnemonic.
@mximenes88
mximenes88 / sql_command.txt
Last active October 12, 2018 22:54
SQL Commands Checkpoint- Web Dev Track @ Bloc
#### Exercises
Use the commands above to complete the following tasks, and submit the SQL statements. Real-world examples must be distinct from those used in the text.
1. List the commands for adding, updating, and deleting data.
Adding: INSERT INTO
Updating: UPDATE
Deleting: DELETE
Altering a table: ALTER TABLE
@mximenes88
mximenes88 / installing_&_using _postgres
Last active October 12, 2018 22:55
Postgres Checkpoint- Web Dev Track @ Bloc
#### EXERCISE
Create a database called library using the appropriate Postgres command line tools.
Download and execute this file in the database: Library Data
Run the following query using psql to confirm that the data was imported correctly.
Create a gist with the results and submit the answers.
#### RESULTS
id | title | author
@mximenes88
mximenes88 / intro_to_database.txt
Last active October 12, 2018 22:54
Intro to Databases Checkpoint- Web Dev track @ Bloc
#### Exercises
1. What data types do each of these values represent?
"A Clockwork Orange" : String
42 : Integer
09/02/1945 : Integer/Date
98.7: Float
$15.99: Float/Currency
@mximenes88
mximenes88 / algos_sorting_answers.txt
Last active October 4, 2018 00:17
Algorithms: Sorting Checkpoint- Web Developer Track @ Bloc
#### EXERCISES
1. Write pseudocode for bubble sort.
FUNCTION bubbleSort (array)
DO
SET SWAPPED to false
FOR first index of array to last index of collection - 1
IF array[i] > array[i+1]
SET tmp to array[i]
SET array[i] to array[i+1]
SET array[i+1]to tmp
@mximenes88
mximenes88 / algos_searching_answers.txt
Last active September 28, 2018 19:03
Algorithms: Searching Checkpoint- Web Development track @ Bloc
#### Exercises
Short Answer :
1. What is a real-life scenario that uses linear search?
You need to find a certain article on a magazine without knowing the page number. In this scenario, each page starting from the first page would be checked until the article was found.
2. What is a real-life scenario that uses binary search?
@mximenes88
mximenes88 / recursive_answers.txt
Last active September 28, 2018 19:02
Recursion Assignment for Web Development Track @ Bloc
#### Exercises
1. Define and compare recursion and iteration.
Recursion is a procedure that calls itself until a certain condition (base case) is reached. Recursive solutions can be slower and are subjected to system limitations
Iteration is a procedure that uses loop to repeat a process. Iterative solutions may be harder to implement.
2. Name five algorithms that are commonly implemented by recursion.
@mximenes88
mximenes88 / time_complexity_basics_answers.txt
Created September 21, 2018 01:11
Time Complexity Basics Checkpoint- Web Developer Track @ Bloc
#### Exercises
1. What is time complexity and what is its relation to algorithms?
Time complexity is the measuring of the time that takes to execute a program and it is usually expressed as a function. Time Complexity Analysis is used to describe how efficient an algorithm is based on the input size.
2. What is runtime?
Runtime is the physical time duration that an algorithm takes to complete.
@mximenes88
mximenes88 / algorithms_introduction_answers.txt
Created September 19, 2018 15:38
Algorithms Introduction Checkpoint- Web Development @ Bloc
#### EXERCISES
1. Using proper pseudo-code, describe the following primitive algorithms:
MAKING COFFEE
FUNCTION makingCoffeeKeurig()
GET Coffee Pod and water
PUT Coffee Pod and water in Keurig
IF Keurig Machine light is not green
WAIT
ELSE