Monday, March 24, 2014

Homework Chapters 6-10

I'm going to attempt to create a homework set that covers things I've learned in chapters 6 through 10... keep in mind these are just exercises, it's important to know how to read and write this stuff, but it's also import to understand them deeper *cough* *cough* so that you're not lost in the multiple choice portion of the test.

Chapter 6
1. What are stopwords?
2. What is the difference between LIKE and CONTAINS in the WHERE clause?
3. What is a Stemmer, and what does it do?

Chapter 7 (The Big Dog)
4. What's the difference between FOR XML AUTO, FOR XML PATH, and FOR XML RAW?
5. Use humanresources.jobcandidate in AdventureWords2012 and display email address's of candidates (EMail)
6. Use humanresources.jobcandidate in AdventureWords2012 and display first name and last name of people who's education was in the state of Iowa (IA)... (ns:Resume/ns:Education/ns:Edu.Location/ns:Location/ns:Loc.State)
7. Use this code:
 DECLARE @X XML
 SET @X = '<root>
<production.Categories categoryid="1" categoryname="Beverages" description="Soft drinks, coffees, teas, beers, and ales" />
<production.Categories categoryid="2" categoryname="Condiments" description="Sweet and savory sauces, relishes, spreads, and seasonings" />
<production.Categories categoryid="3" categoryname="Confections" description="Desserts, candies, and sweet breads" />
<production.Categories categoryid="4" categoryname="Dairy Products" description="Cheeses" />
<production.Categories categoryid="5" categoryname="Grains/Cereals" description="Breads, crackers, pasta, and cereal" />
<production.Categories categoryid="6" categoryname="Meat/Poultry" description="Prepared meats" />
<production.Categories categoryid="7" categoryname="Produce" description="Dried fruit and bean curd" />
<production.Categories categoryid="8" categoryname="Seafood" description="Seaweed and fish" />
<production.Categories categoryid="9" categoryname="Beer" description="Budweiser" />
<production.Categories categoryid="10" categoryname="liquor" description="Captain Morgan" />
</root>'

Query @X to:
         A. Return the categoryid of categoryname "Beer"
         B. Return everything from @x
         C. Shread categoryname and description from categoryid 9 and 10
8. What kind of XML indexes can be created?  page 260
9. What's the difference between element centric XML, and attribute centric?

Chapter 8
10. Create a table called QuestionTen in TESTDB.  Column one called "PlayerID" should be an integer that is 5 digits, this column can't be NULL.  Column two called "FirstName" as a variable character up to 25 characters long, this can be NULL.
11. Alter table "QuestionTen" and add "LastName" as variable character 25, not null
12. Add primary key constraint to table "QuestionTen" on the PlayerID column.
13. Discuss what the difference is between a primary key constraint, and a unique key constraint
14. What is a default constraint, what's the syntax?
15. What is a check constraint, what's the syntax?

That should keep me busy, along with not forgetting stuff from chapters 3-5.... Cheers!

Chapter 9
COMING SOON

Chapter 10
COMING SOON

No comments:

Post a Comment