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
| @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; |
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> | |
| <title>Ajax Example</title> | |
| </head> | |
| <body> | |
| <section> | |
| <h1>Recent Posts</h1> | |
| <article> | |
| <h2>Post 1</h2> |
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
| arrayOfLight = function(num){ | |
| arr = []; | |
| for(var i = 1; i <= num; i++){ | |
| arr.push(i); | |
| } | |
| console.log(arr); | |
| }; | |
| arrayOfLight(25); |
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 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. |
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
| 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; |
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
| 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; |
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
| SELECT book_id, stock.stock | |
| from editions | |
| join stock on stock.isbn = editions.isbn | |
| order by stock.stock DESC | |
| LIMIT 10; |
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
| SELECT avg(cost) AS average_cost, | |
| avg(retail) AS average_price, | |
| avg(retail - cost) AS average_profit | |
| FROM stock; |
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
| SELECT sum(stock.stock) | |
| from stock; |
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
| SELECT books.title, editions.publication | |
| from editions | |
| full outer join books on books.id = editions.book_id; |
NewerOlder