
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 4381 Articles for MySQL

11K+ Views
Relationships in DBMS can be stated as a relation between two entities like Employee-Department, Student-Course, etc.One-to-One relationship in DBMS is a relationship between an instance of an entity with another.The relation can be stated as −An Employee is issued an Employee ID Card. An individual employee is offered a unique ID card in the company. Here, Employee and ID Card (ID_Card) are entities.

8K+ Views
Managing data was the key and was essential. Therefore, data model originated to solve the file system issues. Here are the Data Models in DBMS −Hierarchical ModelIn Hierarchical Model, a hierarchical relation is formed by collection of relations and forms a tree-like structure.The relationship can be defined in the form of parent child type.One of the first and most popular Hierarchical Model is Information Management System (IMS), developed by IBM.ExampleThe hierarchy shows an Employee can be an Intern, on Contract or Full- Time. Sub-levels show that Full-Time Employee can be hired as a Writer, Senior Writer or Editor:AdvantagesThe design of ... Read More

4K+ Views
Good Database Design is what everyone wants to achieve to avoid the consequences of dealing with a bad design.The following are the objectives of a good database design −Avoid Redundant DataThe table in the database should be constructed following standards and with utmost dedication. It should have different fields and minimize redundant data. The table should always have a Primary Key that would be a unique id.Faultless InformationThe database should follow the standards and conventions and provide meaningful information useful to the organization.Data IntegrityIntegrity assists in guaranteeing that the values are valid and faultless. Data Integrity is set to tables, ... Read More

57K+ Views
Dependencies in DBMS is a relation between two or more attributes. It has the following types in DBMS −Functional DependencyFully-Functional DependencyTransitive DependencyMultivalued DependencyPartial DependencyLet us start with Functional Dependency −Functional DependencyIf the information stored in a table can uniquely determine another information in the same table, then it is called Functional Dependency. Consider it as an association between two attributes of the same relation.If P functionally determines Q, thenP -> QLet us see an example −EmpIDEmpNameEmpAgeE01Amit28E02Rohit31In the above table, EmpName is functionally dependent on EmpID because EmpName can take only one value for the given value of EmpID:EmpID -> EmpNameThe same is displayed ... Read More

4K+ Views
Identifying entity relationships in DBMS is used to identify a relationship between strong and weak entity.Before beginning, let us take an example of Professor entity, which is our Strong Entity, with Professor_ID as a Primary Key −Professor_IDProfessor_NameProfessor_CityProfessor_SalaryThe weak entity is Professor_Dependents entity:NameDOBRelationNow, let us continue, Weak EntityWeak Entity is dependent on Strong Entity and does not have a primary key. Weak Entity has a partial key. It is represented as double rectangle −Strong EntityOther entities are dependent on Strong Entity and it has a key attribute i.e. a primary key and represented as a single rectangle.Identifying RelationshipsIt links the strong and weak entity ... Read More

6K+ Views
Entity in DBMS can be a real-world object with an existence, For example, in a Company database, the entities can be Employees, Department, Project, etc. In a College database, the entities are Profession, Students, Result, Activities, etc.An entity is represented as a single rectangle, shown belowThe following are the entity relationships −One-to-One RelationshipUnder One-to-One (1:1) relationship, an instance of entity P is related to instance of entity Q and an instance of entity Q is related to instance of entity P.Let us see an example −A person can have only one passport, and a passport is assigned to a single person.One-to-Many RelationshipUnder ... Read More

295 Views
It is quite possible to add multiple virtual generated columns in a MySQL table. It can be illustrated with the following example as follows −Examplemysql> Create table profit(cost int, price int, profit int AS (price-cost), price_revised int AS (price-2)); Query OK, 0 rows affected (0.73 sec) mysql> Describe profit; +---------------+---------+------+-----+---------+-------------------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------+------+-----+---------+-------------------+ | cost | int(11) | YES | | NULL | ... Read More

158 Views
It is quite possible to add multiple stored generated columns in a MySQL table. It can be illustrated with the following example as follows −Examplemysql> Create table profit1(cost int, price int, profit int AS (price-cost) STORED, price_revised int AS (price-2) STORED); Query OK, 0 rows affected (0.36 sec) mysql> Describe profit1; +---------------+---------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------+------+-----+---------+------------------+ | cost | int(11) | YES | | NULL | ... Read More

219 Views
For adding MySQL stored GENERATED COLUMNS in a table, we can use the same syntax as adding a column just adding “AS(expression)” after the data type. Its syntax would be as follows −SyntaxALTER TABLE table_name ADD COLUMN column_name AS(expression)STORED;Examplemysql> ALTER TABLE employee_data_stored ADD COLUMN FULLName Varchar(200) AS (CONCAT_WS(" ", 'First_name', 'Last_name')) STORED; Query OK, 2 rows affected (1.23 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> Describe employee_data_stored; +------------+--------------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+------------------+ | ID ... Read More

833 Views
Followings are some basic differences between MySQL stored GENERATED COLUMNS and MySQL virtual GENERATED COLUMNS −In terms of Disk SpaceIf we see the difference in terms of disk space then virtual generated columns would not take any disk space. On the other hand, the stored generated column would take disk space.In terms of operationIf we see the difference in terms of operation then virtual generated columns are INPLACE operations which means that the table definition is changed without having to recopy all the data again. On the other hand, stored generated columns are a copy operation and it has the ... Read More