This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Security audit | |
on: | |
push: | |
paths: | |
- '**/Cargo.toml' | |
- '**/Cargo.lock' | |
jobs: | |
security_audit: | |
runs-on: ubuntu-latest | |
steps: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. You can use join clauses to bring together two seperate tables and based off of what kind of join clause you use | |
and any conditionals you could get just data that overlaps or all data for both connected by a primary and foreign key. | |
2. A cross join is going to take two seperate tables and return every possible combination of the two tables rows combined | |
so lets say you had a table of 10 items that needed to be ordered for an inventory order and another table of 5 rows of | |
different vendors and their location and names if you did a cross table you would get all 50 possible cobinations of orders. | |
An inner join happens when you want to join two tables together returning only what they both have in common based off of | |
the given condition. One example could be if lets say you had a table of cities and an id for each city and then you had a | |
table of residents which also contained city id's you could do an inner join to determine what city the resident lived in | |
if any of the city_id's from the residents |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QUESTION 1: | |
COUNT returns value of number of Values in a given column. EX: SELECT COUNT( DISTINCT, age) FROM background; | |
Would count the total number of distinct ages in the background table. | |
SUM returns a sum of numeric values in a given column. EX: SELECT SUM(debits) FROM accountspayable; Would sum the | |
total of the numeric values in the debits column in the accounts payable table. | |
AVG returns the average value of a given column. EX: SELECT AVG(age) FROM background; Would return the average of the ages in | |
the background table. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QUESTION 1: | |
SELECT age | |
FROM backgroundcheck | |
WHERE age = 18 | |
QUESTION 2: | |
Sly cats SELECT columns | |
FROM fancy tables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Question 1 & 2: | |
To add data you use the INSERT INTO commands followed by the table name followed by the VALUES command and whatever data | |
values necessary in accordance with the data types for those particular columns. To update data you use the UPDATE command | |
followed by the table name and then the SET command and the data types you would like to update by their column name with | |
an = and then the value. You can additionally have a WHERE clause to set a conditional statement for the the particular data | |
you are targeting to update. To delete you can use the DELETE FROM commands followed by the table name and WHERE command with | |
conditionals and also a AND command to add additional conditionals after the where command. You can use the ALTER TABLE | |
command followed by the table name and ADD COLUMN or DROP COLUMN followed by a text description of why. You can set a default | |
value for that by using the SET DEFAULT command followed by what you want the default to be. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library=# SELECT * FROM books; | |
id | title | author | |
------+------------------------------------------+--------------------- | |
1259 | Eloquent Ruby | Russell A. Olson | |
1593 | JavaScript: The Good Parts | Douglas Crockford | |
8982 | Designing Object-Oriented Software | Rebecca Wirfs-Brock | |
7265 | Practical Object-Oriented Design in Ruby | Sandi Metz | |
(4 rows) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[5] pry(main)> post = Post.first | |
Post Load (1.0ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 1]] | |
=> #<Post:0x6615ea0 | |
id: 1, | |
title: "First Post", | |
string: nil, | |
body: "This is the first post in our system", | |
created_at: Sat, 30 Dec 2017 19:07:44 UTC +00:00, | |
updated_at: Sat, 30 Dec 2017 19:07:44 UTC +00:00> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="reduce"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
NewerOlder