Day 8

Quiz

1:In the following code, what will the database size be increased to the first time it runs out of allocated space?
CREATE DATABASE Customer
  ON
  (NAME = cust_dat,
  FILENAME = 'c:\ SQL_Data\ custdat.mdf',
  SIZE = 100MB,  MAXSIZE = 500MB,
  FILEGROWTH = 20MB)
A1: The initial size starts at 100MB. When that 100MB is used up, the database will automatically increase 20MB to 120MB.
2:What would happen if you tried to insert the value 123abc into a column defined with a data type of INTEGER?
A2: The record would not be inserted. The SQL server would return an invalid data type error.
3:How many primary keys can you have per table?
A3: One.

Exercises

1:Write the code to create a table with the following columns and specifications:
A1: Call the new ...

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.