Day 5

Quiz

1:For each of the following items, identify the database name, owner, table name, and column name (if available). Where the value will default, indicate that.
  1. CompanyName

  2. Customers.CompanyName

  3. Northwind.dbo.Products.QuantityPerUnit

  4. Northwind..Products.UnitPrice

  5. dbo.Suppliers.City

  6. Mary.Suppliers.City

  7. Suppliers

  8. dbo.Suppliers

A1: Answer:
  1. CompanyName—Column name in a table in query. Unqualified, so cannot determine other information.

  2. Customers.CompanyName—Column name in Customers table. Current database is assumed. Table is owned by current user or dbo.

  3. Northwind.dbo.Products.QuantityPerUnit—Fully qualified column name of QuantityPerUnit column in Products table owned by dbo in the Northwind database.

  4. Northwind..Products.UnitPrice—Same as (c), except ...

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.