Working with Tables

A database is nothing but an empty file that will contain the tables our programs will actually use to store data. The data will be stored in the tables as columns and rows that you have been using up to this point in our queries. To put the information in the database, you need objects such as tables and columns to house the data. Table 8.3 lists the information that would be needed for a pet store database.

Table 8.3. Sample Table of Pet Store Data in Columns and Rows
Pet NameTagsAnimalBreedFavorite Food
Calvin1325DogDalmatianEats Anything
Sarah9526Dog Steak
SpikeA256CatFussyTuna
Rex1DinosaurT-RexTriceratops (tastes like chicken)

Just as you have to create our databases, you have to create your tables within that database. After ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.