- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 4378 Articles for MySQL
3K+ Views
Let us understand what table, view and synonym in the structured query language (SQL) are.Table, view and synonymA table is a repository of data, where in the table it is a physical entity. A table resides physically in the database.A view is not a part of the database’s physical representation. It is precompiled, so that data retrieval behaves faster and also provides a secure accessibility mechanism.A synonym is an alternate name assigned to a table, view, sequence or program unit.ExampleCreate table employee (empID integer primary key, name varchar2(30), skill varchar2(30), salary number(20), DOB datetime).Let’s say there is a scenario where ... Read More
4K+ Views
Update command is a data manipulation command which is used to edit the records of a table. It may be used to update a single row based on a condition, all rows or set of rows based on the condition given by the user.It is used along with the SET clause, operationally, a WHERE clause may be used to match conditions −Example 1An example is given below for the use of update command −update table student set name=’sneha’ where branch=’CSE’;Example 2Given below is another example of the usage of update command −create table employee(ename varchar(30), department varchar(20)); insert into employee ... Read More
594 Views
It is common to select certain data or rows from a table. The rows are returned in the order in which they appear in the table. We may sometimes require that the rows we select from the table must be returned to us in ascending or descending order with respect to some column.The “ORDER BY” statement is used to order the results with respect to some column. The following example will provide more clarity.Suppose, we have a table which consists of various fields including the “name” field. We want to select all the rows from the table but we want ... Read More
502 Views
You can delete an existing table from MySql Database using the "DROP TABLE" statement in Node. Sometimes, we need to delete the whole table, though in corporates it is always advised to archive the tables which are not in used instead of deleting them.While deleting a table, we have two scenarios −Deleting a table if it exists, else throw an errorDeleting the table whether it exists or not.We will discuss both the scenarios here.Before proceeding, please check the following steps are already executed −mkdir mysql-testcd mysql-testnpm init -ynpm install mysqlThe above steps are for installing the Node - mysql dependecy ... Read More
2K+ Views
Introduction to SequelizeSequealize follows the promise-based Node.js ORM for different servers like – Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server.Following are some of the main features of NodeJS sequelize −Transaction SupportRelationsEager and Lazy LoadingRead Replication and more...Connecting to MySQL using SequelizeWe need to establish a connection between MySQL and Node.js using Sequelize.After creating a successful connection with sequelize, we would require the following three files for configuration. Please carefully create the following files in their respective folders only.SequelizeDemo > application.jsThis will be our root file which will hold the actual logic.SequelizeDemo>utils>database.jsThis will hold all the connection details to MySQL.SequelizeDemo>models>user.jsThis ... Read More
2K+ Views
In this post, we will understand the difference between the ALTER command and the UPDATE command in SQL.ALTER CommandThis command is a Data Definition Language (DDL).It performs operation at the structural level, not the data level.This command is used to add, delete, and modify the attributes of the tables in a database.This command, by default, initializes the values of all values in the tuple to NULL.It changes the structure of the table.Syntax: Add a column −ALTER TABLE table_name ADD column_name datatype;Drop a ColumnALTER TABLE table_name DROP COLUMN column_name;UPDATE CommandThis command is a Data Manipulation Language (DML).It performs operations on the ... Read More
137 Views
In this post, we will understand the difference between MySQL and PostgreSQL.MySQLIt is a relational database management system.It is the product developed by Oracle Corporation.It is supported by Windows, Mac OS X, Linux, BSD, UNIX, z/OS, Symbian, AmigaOS.It can’t be extended.In this system, the phpMyAdmin tool gives the GUI.Mysqldump and XtraBackup provide backup in MySQL.It provides temporary table.It doesn’t provide a materialized view.It doesn’t provide Data Domain Object to the system.PostgreSQLIt is an object-relational database management system.It was developed by the Global Development Group.It is supported by Windows, Mac OS X, Linux and BSD but not by UNIX, z/OS, Symbian, ... Read More
3K+ Views
In this post, we will understand the difference between WHERE clause and HAVING clause in SQL.WHERE ClauseIt is used to filter the records from the table based on a specific condition.It can be used without the ‘GROUP BY’ clause.It can be used with row operations.It can’t contain the aggregate functions.It can be used with the ‘SELECT’, ‘UPDATE’, and ‘DELETE’ statements.It is used before the ‘GROUP BY’ clause if required.It is used with a single row function such as ‘UPPER’, ‘LOWER’.HAVING ClauseIt is used to filter out records from the groups based on a specific condition.It can’t be used without the ... Read More
1K+ Views
In this post, we will understand the difference between COMMIT and ROLLBACK in SQL.COMMITIt validates the modifications that are made by the current transaction.Once the COMMIT statement has been executed, the transaction can’t be rolled back using ROLLBACK.It occurs when the transaction is successfully executed.SyntaxCOMMIT;ROLLBACKIt removes the modifications that were made by the current transaction.Once ROLLBACK is executed, the database would reach its previous state.This is the state where the first statement of the transaction would be in execution.ROLLBACK happens when the transaction is aborted in between its execution.SyntaxROLLBACK;
1K+ Views
In this post, we will understand the difference between SQL and T-SQL.SQLIt is a non-procedural language.Relational databases use SQL.It stands for structured query language.It uses query to view and manipulate data.DML and DDL operations are used- Data manipulation language, and data definition language.It is considered as an open-source language.It helps in the manipulation of data and data controlling.Transfer of data happens one by one when SQL is used.T-SQLIt is a Microsoft product.It is known as Transact Structure Query language.It gives a high degree of control to the developers/programmers.It works its best, and provides good performance with Microsoft SQL server.It is ... Read More