NOT NULL column : NULL « Select Query « SQL Server / T-SQL






NOT NULL column


13>
14> CREATE TABLE project   (project_no   CHAR(4) NOT NULL,
15>                         project_name CHAR(15) NOT NULL,
16>                         budget FLOAT NULL)
17>
18> insert into project values ('p1', 'Search Engine',        120000.00)
19> insert into project values ('p2', 'Programming',          95000.00)
20> insert into project values ('p3', 'SQL',                  186500.00)
21>
22> 
23>
24> -- VAR computes the variance of all the values listed in a column or expression
25>
26> SELECT VAR(budget) variance_of_budgets FROM project
27>
28> drop table project
29> GO

(1 rows affected)

(1 rows affected)

(1 rows affected)
variance_of_budgets
------------------------
      2236583333.3333321

(1 rows affected)
1>
           
       








Related examples in the same category

1.Count function deals with NULL values
2.Replacing a NULL Value with an Alternative Value