Column constraints, Database Management System


On  delete  Cascade:  Using  this  key  whenever  a  parent  row  is  removed  in  a referenced table then all the corresponding child rows are removed from the referencing table. This constraint is a form of referential integrity constraint.

Example 1:



pno number (4) PRIMARY KEY, pname char (20) NOT NULL,

qoh number (5) DEFAULT (100),

 class char (1) NOT NULL,

rate number (8,2) NOT NULL,

CHECK ((class='A' AND rate<1000) OR (class='B' AND rate>1000 AND rate<4500) OR (class='C' AND rate>4500))


The command above makes a table. Primary key constraint makes sure that product number (pno) is not null and unique (both are the properties of primary key). Please note down the use of data type char (20). In many executions of SQL on commercial DBMS such as Oracle and SQL server, a data type known as varchar and varchar2 is used respectively. Varchar mainly is variable length character type subject to a maximum specified in the declarations. We will use them at most of the places soon.

Please note the use of check constraints in the table formed above. It correlates two dissimilar attribute values.

Posted Date: 3/11/2013 12:55:29 AM | Location : United States

Related Discussions:- Column constraints, Assignment Help, Ask Question on Column constraints, Get Answer, Expert's Help, Column constraints Discussions

Write discussion on Column constraints
Your posts are moderated
Related Questions
Question: Consider the following database relations for a textbook ordering system used by a college bookshop: Book (b-copy#, bname, ISBN#, author, price, subject) Order (s#

What is Primary key? Primary Key - Primary key is one of the candidate keys which uniquely identifies each row in the relation.

Explain the Cascadeless Schedule A cascadeless schedule is one in which for every pair of transactions Ti and Tj like that Tj reads a data item before written by Ti, the commit

What is an object ID? Each class-derived table has an ID for primary key, one or more object IDs form primary key for association derived tables. An object ID is equivalent dat

We are looking to find someone to prepare a database which improves upon the one we are using at present. The present database will be found here: Click on filter options and yo

Views in relational algebra:   1. Basic expression contains either  a) A relation in the database. b) A constant relation. 2.  General expressions are madde out of sma

What is called mirroring? The simplest approach to introducing redundancy is to duplicate each disk. This method is called mirroring or shadowing.

Which operations need the participating relations to be union compatible? A UNION, INTERSECTION and DIFFERENCE operations need the participating relations to be union compatibl

What are the objectives of query processing?       Ans: The objectives of query processing is to transform a query written in a high level language into a accurate and efficien