About Me

My photo
I'm simple and very cheerful person, i like to play guitar under the mango tree

Saturday, October 4, 2008

SQL STATEMENT USING JOINS

TABLES
>ITEMS

>VENDORS

>PARTOF

>INGREDIENTS

>STORES

>MEALS

>MADEWITH

>ORDERS


SQL USING JOIN(OUTPUT AND SQL VIEWS)

1. SELECT Vendors.vendorid, name, companyname
FROM Ingridients
, Vendors
WHERE Ingridie
nts.vendorid=Vendors.vendorid;



2. SELECT name
FROM Ingridients, Vendors
WHERE Ingridients.v
endorid=Vendors.vendorid AND companyname='Veggies_R_Us';



3. SELECT stores.storeid, price
FROM orders, stores

WHERE orders.storeid = stores.storeid AND state = 'CA';



4. SELECT state, SUM(price) AS [Sum]
FROM st
ores, orders
WHERE stores.storeid = orders.storeid
GROUP BY state;




5. SELECT v.vendorid AS ["VENDOR ID"], name
FROM Ingridients AS i, Vendors AS v
WHERE i.vendorid=v.vendorid And v.companyname In ('Veggies_R_Us','Spring Water Supply')
ORDER BY v.vendorid;




6. SELECT DISTINCT mi.name, price
FROM Ingridients AS i, Vendors AS v, Items AS mi, Madewith AS mw
WHERE i.vendorid=v.vendorid And i.ingridientid=mw.ingridientid And mw.itemid=mi.itemid And companyname=('Veggies_R_Us');



7. SELECT companyname, MAX(price) AS Presyo
FROM Ingridients AS i, Vendors AS v, Items AS mi, Madewith AS mw
WHERE i.vendorid=v.vendorid And i.ingridientid=mw.ingridientid And mw.itemid=mi.itemid
GROUP BY v.vendorid, companyname;



8. SELECT DISTINCT (companyname)
FROM Ingridients AS i, Vendors AS v, Items AS mi, Madewith AS mw
WHERE i.vendorid=v.vendorid And i.ingridientid=mw.ingridientid And mw.itemid=mi.itemid And mi.name='Fruit Plate';




9. SELECT v2.companyname
FROM Vendors AS v1, Vendors AS v2
WHERE v1.vendorid=v2.referredby And v1.companyname='Veggies_R_Us';




10. SELECT i.name, m.name
FROM items AS i, meals AS m, partof AS p
WHERE i.itemid = p.itemid AND p.mealid = m.mealid;




11. SELECT i.name
FROM Ingridients AS i, Madewith AS mw
WHERE i.ingridientid=mw.ingridientid And inventory=quantity;




12. SELECT ingridientid
FROM Ingridients, Vendors
WHERE name = companyname;




13. SELECT *
FROM meals, partof;




14. SELECT m.name AS meal, i.name AS item
FROM meals AS m, partof AS p, items AS i
WHERE m.mealid = p.mealid AND i.itemid = p.itemid;




15. SELECT *
FROM meals AS m1, meals AS m2;




16. SELECT m.name AS meal, i.name AS item
FROM meals AS m, partof AS p, Items AS i
WHERE i.itemid = p.itemid;




17. SELECT items.name, ing.name
FROM items, madewith AS mw, ingridients AS ing
WHERE items.itemid=mw.itemid And mw.ingridientid=ing.ingridientid And 3*mw.quantity>ing.inventory;



18. SELECT a.name
FROM Items AS a, Items AS q
WHERE a.price > q.price AND q.name = 'Garden Salad';



19. SELECT DISTINCT (i.name)
FROM items AS a, items AS q, madewith AS m, ingridients AS i
WHERE a.price>q.price And q.name='Garden Salad' And i.ingridientid=m.ingridientid And m.itemid=a.itemid;



20. SELECT i1.name, COUNT(*) AS rank
FROM Ingridients AS i1, Ingridients AS i2
WHERE i1.name >= i2.name
GROUP BY i1.ingridientid, i1.name;




21. SELECT name
FROM ingridients AS i INNER JOIN vendors AS v ON i.vendorid = v.vendorid
WHERE v.companyname = 'Veggies_R_Us';



22. SELECT i1.name
FROM Items AS i1 INNER JOIN Items AS i2 ON i1.price > i2.price
WHERE i2.name = 'Garden Salad';



26. SELECT companyname, i.vendorid, i.name
FROM Vendors AS v INNER JOIN Ingridients AS i ON v.vendorid = i.vendorid;



34. SELECT *
FROM meals INNER JOIN partof ON meals.mealid = partof.mealid;

Monday, September 15, 2008

what is emo?

emo is a type of music, which is derived from early 80's hardcore.  I 
don t know the whole story, but emo combines hardcore with more melodic
and experimental music. Fugazi is the easiest example of a band i can
name that is considered to be "emo" also bands like promise ring and
texas is the reason play this vein of music.

Emo is generally said to have started with DC bands like Embrace (Ian
MacKaye's band after Minor Threat and before Fugazi) and Rites of
Spring (Guy Picciotto's band also before Fugazi), but is in no way
limited to them, around '85. The sound was basically a slower more
emotional (hence the name "emo") post- version of hardcore. The vocals
are usually sung in "whiny" (for lack of a better word) sort of way.

Emotional in this context generally connotes "vulnerability" and/or
"troubledness", which is different from the emotionality of the
screaming and thrashing generally associated with hardcore. This open
emphasis on "vulnerability" and/or "troubledness" represented a major
break in the hardcore/punk scene at that time, for it prided itself on
tough- and hardness, as it generally does today.