Today I met a word called Zappos and wondering its relationship with Amazon. Originally I thought it is a vendor, and it turns out it is not
[from Wiki] Zappos.com is an online shoe and apparel shop currently based in Henderson, Nevada.
In July 2009, the company announced it would be acquired by Amazon.com in an all-stock deal worth about $1.2 billion. Since its founding in 1999, Zappos has grown to be the largest online shoe store.
1) inner join has only join, usually inner is omitted
2) left join, right join and full join are outer join, outer is usually omitted.
3) joint table, both ids from two tables will be primary
mysql examples: (typing it down makes me remember it longer)
alter table invoice_items add foreign key (invoice_id) references invoices(invoice_id); //add foreign key
insert food(name, asin) values(‘apple’, ‘1234’)
each INDEX table is identified by the primary id, it stores in a 8k page, either in disk or ram.
then inside make Shift+F
now is list by %CPU, then press one of the field you want to sort by
for example: press ‘n’ for order by memory
- If it has the same name in both tables, we can use
syntax. If the name differs, say we had CustomerId and CId, we would use the
ON Customers.CustomerId = Reservations.CId syntax
- The inner join selects only those records from database tables that have matching values;
The INNER keyword can be omitted.
LEFT OUTER JOIN returns all values from the left table, even if there is no match with the right table. In such rows, there will be NULL values. In other words, left outer join returns all the values from the left table, plus matched values from the right table. Note, that the OUTER keyword can be omitted.
- for the names in select, usually using table.column, but if there is only one table has such name, you can omit the table, just use select column, rather than specifying table.column.
Limit – MySQL Command
is used to limit your MySQL query results to those that fall within a specified range. You can use it to show the first X number of results, or to show a range from X – Y results. It is phrased as Limit X, Y
and included at the end of your query
. X is the starting point (remember the first record is 0) and Y is the duration (how many records to display).
SELECT * FROM `your_table` LIMIT 0, 10
This will display the first 10 results from the database.
SELECT * FROM `your_table` LIMIT 5, 5
This will show records 6, 7, 8, 9, and 10