Database Articles

Page 293 of 547

How to insert NULL keyword as a value in a character type column of MySQL table having NOT NULL constraint?

Kumar Varma
Kumar Varma
Updated on 19-Jun-2020 304 Views

It is quite possible to insert the NULL keyword as a value in a character type column having NOT NULL constraint because NULL is a value in itself. Following example will exhibit it −ExampleSuppose we have a table test2 having character type column ‘Name’ along with NOT NULL constraint on it. It can be checked from the DESCRIBE statement as follows −mysql> Describe test2\G *************************** 1. row ***************************   Field: id    Type: int(11)    Null: NO     Key: Default: NULL   Extra: *************************** 2. row ***************************   Field: NAME    Type: varchar(20)    Null: NO     Key: ...

Read More

How can we remove NOT NULL constraint from a column of an existing MySQL table?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 19-Jun-2020 8K+ Views

We can remove a NOT NULL constraint from a column of an existing table by using the ALTER TABLE statement.ExampleSuppose we have a table ‘test123’ having a NOT NULL constraint on column ‘ID’ as follows −mysql> DESCRIBE test123; +-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra    | +-------+---------+------+-----+---------+-------+ | ID    | int(11) | NO   |     |   NULL  |       | | Date  | date    | YES  |     |   NULL  |       | +-------+---------+------+-----+---------+-------+ 2 rows in set (0.04 sec)Now if we ...

Read More

How can we apply a NOT NULL constraint to a column of an existing MySQL table?

Jai Janardhan
Jai Janardhan
Updated on 19-Jun-2020 505 Views

We can apply the NOT NULL constraint to a column of an existing MySQL table with the help of ALTER TABLE statement. SyntaxALTER TABLE table_name MODIFY colum_name datatype NOT NULL; Examplemysql> Create table test123(ID INT, Date DATE); Query OK, 0 rows affected (0.19 sec) mysql> Describe test123; +-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+-------+ | ID | int(11) | YES | | NULL | | | Date | date ...

Read More

What happens when we apply NOT NULL constraint, with ALTER TABLE statement, to a column contains NULL values?

karthikeya Boyini
karthikeya Boyini
Updated on 19-Jun-2020 324 Views

In this case, MySQL will return an error message regarding data truncated for the column. Following is an example of demonstrating it −ExampleSuppose we have a table ‘test2’ which contains a NULL value in column ‘ID’ at 2nd row. Now, if we will try to declare the column ID to NOT NULL then MySQL will return the error as follows −mysql> Select * from test2; +------+--------+ | ID   | Name   | +------+--------+ | 1    | Gaurav | | NULL | Rahul  | +------+--------+ 2 rows in set (0.00 sec) mysql> ALTER TABLE TEST2 MODIFY ID INT NOT NULL; ERROR 1265 (01000): Data truncated for column 'ID' at row 2

Read More

Object based Data Models

Alex Onsman
Alex Onsman
Updated on 19-Jun-2020 16K+ Views

In object based data models, the focus is on how data is represented. The data is divided into multiple entities each of which have some defining characteristics. Moreover, these data entities are connected with each other through some relationships.So, in object based data models the entities are based on real world models, and how the data is in real life. There is not as much concern over what the data is as compared to how it is visualised and connected.Some examples of object based data models areEntity Relationship Data ModelObject Oriented Data ModelSemantic Data ModelFunctional Data ModelOut of these models, ...

Read More

Comparison between E-R Model and Object Oriented Model

Alex Onsman
Alex Onsman
Updated on 19-Jun-2020 8K+ Views

The detailed comparison on the E- R model and Object Oriented Model is given as follows −E-R ModelER model is used to represent real life scenarios as entities. The properties of these entities are their attributes in the ER diagram and their connections are shown in the form of relationships. An ER model is generally considered as a top down approach in data designing.An example of ER model is −Advantages of E - R modelThe data requirements are easily understandable using an E - R model as it utilises clear diagrams.The E-R model can be easily converted into a relational database.The ...

Read More

Representation of class hierarchy in DBMS

Alex Onsman
Alex Onsman
Updated on 19-Jun-2020 7K+ Views

Class hierarchy can be viewed one of two waysSpecialization (Top Down Approach)Generalization (Bottom Up Approach)SpecializationSpecialization is a process of identifying subsets of an entity that shares different characteristics. It breaks an entity into multiple entities from higher level (super class) to lower level (subclass). The class vehicle can be specialized into Car, Truck and Motorcycle ( Top Down Approach)Hence, vehicle is the superclass and Car, Truck, Motorcycle are subclasses. All three of these inherit attributes from vehicle. Moreover, these three share those attributes among themselves while containing some other attributes which make them different.GeneralizationGeneralization is a process of generalizing an entity which ...

Read More

Moving Object Databases

Alex Onsman
Alex Onsman
Updated on 19-Jun-2020 1K+ Views

Moving objects are those whose position changes frequently over a period of time. Conventional databases don't know how to handle this scenario, as they assume the data objects are stationaryIn this case, we use moving object databases. These databases can store information about moving objects and allow querying on them.For example- The location of nearest taxis for a particular customer can be found using querying on moving object databases.The approaches used in handling moving object databases are:Location ManagementThe current locations of the objects are saved in the database and estimations are made on their near future positions. This information is ...

Read More

Mandatory and optional Participation

Alex Onsman
Alex Onsman
Updated on 19-Jun-2020 5K+ Views

Mandatory and optional participation are observed in E-R models between 2 different entities.Mandatory ParticipationIn the mandatory participation, for every instance of entity A, there must exist an instance of entity B and vice versa.An example of Mandatory participation would be relationship between mother and child. The child entity would exist only if there were a mother and similarly a mother would exist only if there were a childOptional participationIn optional participation, it is not necessary for all the instances of the entity to participate in a relationship. It may be that the number of instances participating for a particular entity ...

Read More

Remote system allowed in SAP HANA Smart Data Access

John SAP
John SAP
Updated on 17-Jun-2020 542 Views

In SAP HANA SPS07, it has been extended to MSSQL server and Oracle database and write operation was permitted to perform on remote data sources.Following remote systems are allowed under Smart Data Access with Write operation in SAP HANA SPS07 −SAP HANASybase ASESAP Sybase IQTeradata 13.0 or higherApache Hadoop 2.3MSSQL 11Oracle 12c

Read More
Showing 2921–2930 of 5,468 articles
« Prev 1 291 292 293 294 295 547 Next »
Advertisements