Explain the integrity constraints, Database Management System

Assignment Help:

Explain the integrity constraints: Not Null,  Unique, Primary Key with an example each. Is the combination 'Not Null, Primary Key' a valid combination. Justify.

Not Null - Should hold valid values and cannot be NULL.

Unique - An attribute or a combination of two or more attributes must have a unique value in each row. The unique key can have NULL values.

Primary Key - It is similar as unique key but cannot have NULL values. A table can have at most one primary key in it.

For example:

STUDENT

Roll No

Name

City

Mobile

 

17

Ankit Vats

Delhi

9891663808

16

Vivek rajput

Meerut

9891468487

6

Vanita

Punjab

NULL

75

Bhavya

delhi

9810618396

Roll No is a primary key.

Name is defined with NOT NULL, means each student must have a name.

'Not Null, Primary Key' is a valid combination. Primary key constraint already includes

'Not Null' constraint in it but we can also add 'Not Null' constraint with it. The use of

'Not Null' with 'Primary Key' will not have any effect. It is same as if we are using just 'Primary Key'.


Related Discussions:- Explain the integrity constraints

Describe embedded query language, Describe Embedded Query Language? Emb...

Describe Embedded Query Language? Embedded Query Language - A query language (e.g., SQL) can be implemented in two ways. It can be used interactively or embedded within a host

Explain different types of keys and relational model., Relational Model: T...

Relational Model: The relational model uses a collection of tables to represent both data and the relationships among those data. Each table has multiple columns and each column h

Explain the shadow paging recovery technique, Explain the shadow paging rec...

Explain the shadow paging recovery technique.  Ans: Shadow paging is a method used to acquire atomic and durable transactions, and provides the capability to manipulate pages i

Database for online assignment system, i want to database for online assign...

i want to database for online assignment submission system

Selective replication-data replication, Selective replication: This is a c...

Selective replication: This is a combination of generating small fragments of relation and replicating them rather than a entire relation. The data should be fragmented on require

What is a sub-query, (a) What is a Sub-Query? (b) What is the differen...

(a) What is a Sub-Query? (b) What is the difference between a scalar sub-query and a tabular sub-query? (c) Write an equivalent SQL statement to get the Name of Product wh

Create a database of a motor bike racing club, You have a friend that runs ...

You have a friend that runs a motor bike club that holds racing events at various venues on weekends, on a monthly basis. Some venues are private race tracks and some are dirt trac

Database, i would like to ask if you will do assignment of database number ...

i would like to ask if you will do assignment of database number of words 1500 and how much

Explain view in rdbms, Explain view in RDBMS? View - A view is a relati...

Explain view in RDBMS? View - A view is a relation (virtual rather than base) and could be used in query expressions, which is, queries can be written by using the view as a re

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd