1> /*  Sample output file for tables created following directions  */
2> /*  in lab guide, Sept. 23rd.				*/
3> /*								*/
4> /*  Will be creating database objects - go to my database.	*/
5> /*								*/
6> use evelyn
1> /*								*/
2> /*  Create table to store event data.			*/
3> /*								*/
4> create table eventinfo
5> 	(eventID smallint not null
6> 		constraint eventid_pk primary key,
7> 	eventname varchar(40) not null,
8> 	type varchar(20) null,
9> 	eventdate smalldatetime not null,
10> 	eventtime smalldatetime null,
11> 	location varchar(40) null,
12> 	ticket smallmoney null,
13> 	attendance smallint null)
1> /*								*/
2> /*  Create table to store contact data.			*/
3> /*								*/
4> create table contactinfo
5> 	(contactID tinyint not null
6> 		constraint contactid_pk primary key,
7> 	fname varchar(20) not null,
8> 	lname varchar(20) not null,
9> 	num_street varchar(20) null,
10> 	city varchar(20) null,
11> 	state char(2) null,
12> 	zip char(10) null,
13> 	phone char(12) not null)
1> /*								*/
2> /*  Insert some rows into each table.			*/
3> /*								*/
4> insert into eventinfo
5> values (1, 'Community Days', 'Outdoor fair', '9/8/2000', '10:00 am',
6> 	'University Mall', 0, 5000)
7> insert into eventinfo
8> values (2, 'Halloween Parade', 'Parade', 'Oct 31 2000', '6 pm',
9> 	'Main St., Newark', 0, 200)
10> /*  Notice use of two single quotes to inser apostrophe.	*/
11> insert into eventinfo
12> values (3, 'Fireman's Barbecue', 'Fundraiser', '11/10/2000', '5 pm',
13> 	'Newark Senior Center', 15, 500)
(1 row affected)
(1 row affected)
(1 row affected)
1> /*								*/
2> insert into contactinfo
3> values (1, 'Eliza', 'Doolittle', '123 Albert Square', 'Newark', 
4> 	'DE', '19700', '302-368-0000')
5> insert into contactinfo
6> values (2, 'Henry', 'Higgins', '321 Victoria Circle', 'Newark',
7> 	'DE', '19700-1234', '731-0000')
(1 row affected)
(1 row affected)
1> /*								*/
2> /*  Show that tables now contain data.			*/
3> /*								*/
4> select * from eventinfo
 eventID eventname                                type                
         eventdate                  eventtime                 
         location                                 ticket

         attendance 
 ------- ---------------------------------------- -------------------- 
        -------------------------- -------------------------- 
        ----------------------------------------
------------------------ 
        ---------- 
       1 Community Days                           Outdoor fair        
                Sep  8 2000 12:00AM        Jan  1 1900 10:00AM
         University Mall
0.00
               5000 
       2 Halloween Parade                         Parade              
                Oct 31 2000 12:00AM        Jan  1 1900  6:00PM
         Main St., Newark
0.00
                200 
       3 Fireman's Barbecue                       Fundraiser          
                Nov 10 2000 12:00AM        Jan  1 1900  5:00PM
         Newark Senior Center
15.00
                500 

(3 rows affected)
1> /*								*/
2> select * from contactinfo
 contactID fname                lname                num_street          
	 city                 state zip        phone        
 --------- -------------------- -------------------- -------------------- 
	-------------------- ----- ---------- ------------ 
         1 Eliza                Doolittle            123 Albert Square   
	 Newark               DE    19700      302-368-0000 
         2 Henry                Higgins              321 Victoria Circle 
	 Newark               DE    19700-1234 731-0000     

(2 rows affected)
1> /*								*/
2> /*  Show information about tables using Sybase stored procedure.*/
3> /*								*/
4> sp_help eventinfo
 Name                           Owner                         
	 Type                   
 ------------------------------ ------------------------------ 
	---------------------- 
 eventinfo                      dbo                           
	 user table             

(1 row affected)
 Data_located_on_segment        When_created               
 ------------------------------ -------------------------- 
 default                               Sep 29 2000 12:32AM 
 Column_name     Type            Length Prec Scale Nulls Default_name   
	 Rule_name       Identity 
 --------------- --------------- ------ ---- ----- ----- --------------- 
	--------------- -------- 
 eventID         smallint             2 NULL  NULL     0 NULL           
	 NULL                   0 
 eventname       varchar             40 NULL  NULL     0 NULL           
	 NULL                   0 
 type            varchar             20 NULL  NULL     1 NULL           
	 NULL                   0 
 eventdate       smalldatetime        4 NULL  NULL     0 NULL           
	 NULL                   0 
 eventtime       smalldatetime        4 NULL  NULL     1 NULL           
	 NULL                   0 
 location        varchar             40 NULL  NULL     1 NULL           
	 NULL                   0 
 ticket          smallmoney           4 NULL  NULL     1 NULL           
	 NULL                   0 
 attendance      smallint             2 NULL  NULL     1 NULL           
	 NULL                   0 
 index_name           index_description                                       
	 index_keys                                                                                                                                                                                                                                                     
	 index_max_rows_per_page 
 -------------------- -------------------------------------------------------- 
	--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
	----------------------- 
 eventid_pk           clustered, unique located on default                    
	  eventID                                                                                                                                                                                                                                                       
	                       0 

(1 row affected)
No defined keys for this object.
Msg 18085, Level 16, State 1:
Procedure 'sp_helpartition', Line 83:
Object is not partitioned.
(return status = 0) 
1> /*								*/
2> sp_help contactinfo
 Name                           Owner                         
	 Type                   
 ------------------------------ ------------------------------ 
	---------------------- 
 contactinfo                    dbo                           
	 user table             

(1 row affected)
 Data_located_on_segment        When_created               
 ------------------------------ -------------------------- 
 default                               Sep 29 2000 12:32AM 
 Column_name     Type            Length Prec Scale Nulls Default_name   
	 Rule_name       Identity 
 --------------- --------------- ------ ---- ----- ----- --------------- 
	--------------- -------- 
 contactID       tinyint              1 NULL  NULL     0 NULL           
	 NULL                   0 
 fname           varchar             20 NULL  NULL     0 NULL           
	 NULL                   0 
 lname           varchar             20 NULL  NULL     0 NULL           
	 NULL                   0 
 num_street      varchar             20 NULL  NULL     1 NULL           
	 NULL                   0 
 city            varchar             20 NULL  NULL     1 NULL           
	 NULL                   0 
 state           char                 2 NULL  NULL     1 NULL           
	 NULL                   0 
 zip             char                10 NULL  NULL     1 NULL           
	 NULL                   0 
 phone           char                12 NULL  NULL     0 NULL           
	 NULL                   0 
 index_name           index_description                                       
	 index_keys                                                                                                                                                                                                                                                     
	 index_max_rows_per_page 
 -------------------- -------------------------------------------------------- 
	--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
	----------------------- 
 contactid_pk         clustered, unique located on default                    
	  contactID                                                                                                                                                                                                                                                     
	                       0 

(1 row affected)
No defined keys for this object.
Msg 18085, Level 16, State 1:
Procedure 'sp_helpartition', Line 83:
Object is not partitioned.
(return status = 0) 
1> /*								*/
2> /*  Illustrate use of dump transaction command:		*/
3> /*  use this command whenever dropping (deleting) objects or	*/
4> /*  making changes to existing objects, or when changing or	*/
5> /*  deleting rows, in order to free up log space.            */
6> /*								*/
7> dump tran evelyn with truncate_only