Professional Documents
Culture Documents
DEFINITION OF DATA
A Data is collection of a logically related data.Data involves specifying the types of data ( For Example:-Numeric,Alphanumeric,etc), structures & rules for data to be stored in the database
numbers and they can be positive or negative or zero;with decimal point or without decimal point.If data is without decimal point then it is integer & if data is with decimal point then it is (float).
Storage Required
3 Bytes 8 Bytes 4 Bytes
YEAR
TIME
YYYY
HHH:MI:SS
1 Bytes
3 Bytes
If century is not given then century is assumed from 1970 to 2069 i.e.if you give year as 69 then it is taken as 2069 whereas if you give year as 70 then it is taken as 1970.
Boolean data means true or false.Boolean data value of false is zero or true is nonzero-(generally 1).Storage required is 1 byte.
ENUM
Enum is a list or enumeration of string values.A column of type ENUM can be set to a value from the list.A list can contain maximum 65,535 different values.This column can contain NULL (Stored as 1,2,3).You can prevent NULL values from being accepted by declaring the column as NOT NULL when creating a table.Values stored in database are integers.
In some cases it is not possible or applicable to provide a value for a particular column in your table.In this case thr column is said to be NULL,which means absence of value.NULL is used for various cases where a value cannot be supplied such as Not Applicable or Unknown or Empty Set
T.Y.BCOM (A)
PRIMARY KEY
A table typically has a column or combination of columns that contain values that uniquely identify each row in the table. This column, or columns, is called the primary key (PK) of the table and enforces the entity integrity of the table. Because primary key constraints guarantee unique data, they are frequently defined on an identity column.
When you specify a primary key constraint for a table, the Database Engine enforces data uniqueness by automatically creating a unique index for the primary key columns. This index also permits fast access to data when the primary key is used in queries. If a primary key constraint is defined on more than one column, values may be duplicated within one column, but each combination of values from all the columns in the primary key constraint definition must be unique.
AS SHOWN IN THE FOLLOWING ILLUSTRATION, THE PRODUCT AND VENDORID COLUMNS IN THE PURCHASING.PRODUCTVENDOR TABLE FORM A COMPOSITE PRIMARY KEY CONSTRAINT FOR THIS TABLE. THIS MAKES SURE THAT THAT EVERY ROW IN THE PRODUCTVENDOR TABLE HAS A UNIQUE COMBINATION OF PRODUCTID AND VENDORID. THIS
FOREIGN KEY
THANK YOU