Tips for writing readable code:
USE pubs
SELECT au_fname, au_lname
FROM authors
WHERE state = 'CA'
USE pubs
CREATE TABLE myauthors
(
first VARCHAR(30) NOT NULL,
last VARCHAR(40) NOT NULL,
address VARCHAR(40) NOT NULL,
city VARCHAR(30) NOT NULL,
state VARCHAR(2) NOT NULL,
zip CHAR(9) NOT NULL,
phone VARCHAR(20) NULL
)
Even if the current SQL Server installation is not case sensitive, readability is improved if a consistent style is used. It is also good practice to always code object names in Transact-SQL statements using the exact same case as was used to define the object.
Batches | Functions |