Q 3

I) 1. List out the data types in Sybase

2. State true or false:

a) char for storing fixed-length string

b) varchar for variable –length string

c) nchar for variable –length ,multi-byte character string

d) text for large binary strings

3. State the following:

a) Single table can have only two timestamp columns

b) Image data types can store upto 2KB of image data per row

c) By default ,Sybase treats the date in the format as ‘mdy’

d) Logical data type of bit permit null values and may not be indexed

4. Answer the following:

a) Minimum value of tinyint

b) Storage size of int is _ _bytes

c) A float column with a precision of 1 to 7 is stored as _____in ____bytes

d) Storage size of money data types is

5. What is the difference between decimal data types and Float data types




1. Find the names of headships sunked in battles

2 .Find the names of the ships having the gun caliber of 16 (taking into account Outcomes table)

49ans: select name from ships where class in(select class from classes where bore=16) union select ship

from outcomes where ship in(select class from classes where bore=16)

3. Find the battles in which Kongo-class ships took part.

50ans: select o.battle from outcomes o where o.ship in (select s.name from ships s where o.ship=s.name

and s.class='kongo')

4. Find the countries having classes of both ordinary ships and cruisers

38 ans: select country from classes where type='bc' and country in (select country from classes where

type='bb') union select country from classes where type='bc' and country in (select country from classes

where type='bb') and class in(select ship from outcomes)

No comments: