Skip to content

Instantly share code, notes, and snippets.

View adrimolano's full-sized avatar

Adriana Molano adrimolano

  • Delmar International Inc.
  • Montreal
View GitHub Profile
@charset "UTF-8";
/* CSS Document */
body {
font-family: 'Open Sans', sans-serif;
font-size: 16px;
font-weight: 100;
background-image: url(../images/body.jpg);
background-attachment: fixed;
background-size: cover;
<!doctype html>
<html>
<head>
<title>Ajax Example</title>
</head>
<body>
<section>
<h1>Recent Posts</h1>
<article>
<h2>Post 1</h2>
arrayOfLight = function(num){
arr = [];
for(var i = 1; i <= num; i++){
arr.push(i);
}
console.log(arr);
};
arrayOfLight(25);
## Question Set 1
a. What are the four main data manipulation (CRUD) SQL commands?
**INSERT**
**SELECT**
**UPDATE**
**DELETE**
b. Can you delete records from two tables at once? Or will that need to be two separate delete statements?
Yes, you can.
@adrimolano
adrimolano / exercise 11_sql
Created May 9, 2016 22:25
exercise 11_sql
SELECT count(editions.isbn) AS "number of books", authors.id, concat_ws (' ',authors.first_name , authors.last_name) AS "full name"
FROM editions
join books on editions.book_id = books.id
join authors on books.author_id = authors.id
GROUP by authors.id
ORDER BY "number of books" DESC;
@adrimolano
adrimolano / exercise 10_sql
Created May 9, 2016 22:18
exercise 10_sql
SELECT count(editions.isbn) AS "number of books", authors.id, concat_ws (',',authors.first_name , authors.last_name) AS "full name"
FROM editions
join books on editions.book_id = books.id
join authors on books.author_id = authors.id
group by authors.id;
@adrimolano
adrimolano / exercise 9_sql
Last active May 9, 2016 21:10
exercise 9_sql
SELECT book_id, stock.stock
from editions
join stock on stock.isbn = editions.isbn
order by stock.stock DESC
LIMIT 10;
@adrimolano
adrimolano / exercise 8_sql
Created May 9, 2016 20:52
exercise 8_sql
SELECT avg(cost) AS average_cost,
avg(retail) AS average_price,
avg(retail - cost) AS average_profit
FROM stock;
@adrimolano
adrimolano / exercise 7_sql
Created May 9, 2016 20:46
exercise 7_sql
SELECT sum(stock.stock)
from stock;
@adrimolano
adrimolano / exercise 6_sql
Created May 9, 2016 20:23
exercise 6_sql
SELECT books.title, editions.publication
from editions
full outer join books on books.id = editions.book_id;