SQL homework help

profileaco249
154155981_projectseinfeld.doc

Using  the  Seinfeld  Database  

 

Your  answers  must  be  placed  in  a  single,  continuous  text  file.      Each  answer  must  include  both  the  query  used  and  the  response  set.    In  cases  where  the  response  set  is  larger  than  5  lines,  only  paste  in  the  first  5  lines.  

 

1. Show  EPISODES  schema  

2. Select  everything  from  EPISODES  

3. Select  name  column  from  EPISODES  

4. Select  name  and  season  from  EPISODES,  aliasing  name  to  “Show  Title”  and  

season  to  “Season  No”  

5. Select  *  from  EPISODES  where  name  is  equal  to  “The  Deal”    

6. Select  name  from  EPISODES  where  name  is  equal  to  “The  Deal”  capitalizing  the  

deal  

7. Select  name,  season  from  EPISODES  where  “GUY”  is  contained  in  name  

8. Count  the  instances  where  “The”  appears  in  a  name  

9. Select  name,  season  from  EPISODES  where  “the”  does  not  appear  

10. Select  name,  season  from  EPISODES  where  episode  was  in  the  second  season  

11. Select  name,  season  from  EPISODES  where  episode  was  in  the  second  or  fifth  

season  

12. Count  EPISODES  where  episode  was  in  the  second  or  fifth  season  

13. Count  seasons,  aliasing  count  as  “Number  of  Season”  

14. Count  number  of  episodes  per  season  

15. Show  episodes  with  no  season  

16. Join  FOODS  with  FOOD_TYPES,  displaying  the  name  column  of  each  

17. Display  the  frequency  of  food_types  in  FOODS  

18. Display  foods  and  their  prices  (join  FOOD  and  FOOD_PRICES)  

19. Display  each  food  and  its  price  

20. Display  each  food,  its  price,  and  its  food  type,  showing  the  most  expensive  

first  

21. List  total  amount  for  each  food  type  

22. List  foods  referenced  in  each  episode  

 

 

23. Create  a  new  table  for  actors,  with  columns  for  the  actor’s  real  name  and  the  

name  of  the  character  played  

24. Insert  the  appropriate  values  for  Jerry  Seinfeld  and  minimally  four  other  

regulars  

25. Using  Dia  or  a  comparable  tool,  creates  an  ER  model  for  the  Seinfeld  

database.    Use  crow’s  foot  (IE)  notation.    Attach  the  resulting  file  separately.