Thursday , 22 October 2020
Stackode
Home > Tag Archives: MySql

Tag Archives: MySql

Laravel Syntax error or access violation: 1071

laravel-key-too-long

Trying to migrate in Laravel. When run “$ php artisan migrate” get this error : [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes or Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes or PDOException::("SQLSTATE[42000]: Syntax error or access violation: ...

Read More »

How to delete index in MySql

How to delete index in MySql, first you need to know the exact name of the INDEX (Unique key in this case) to delete or update it. INDEX names are usually same as column names. In case of more than one INDEX applied on a column, MySQL automatically suffixes numbering to the column names to create unique INDEX names. For ...

Read More »

RDBMS Concepts – SQL

What is RDBMS? RDBMS stands for Relational Database Management System. RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd. What is ...

Read More »

Delete Query – SQL

Delete Query – SQL is used to delete the existing records from a table. You can use WHERE clause with DELETE query to delete selected rows, otherwise all the records would be deleted. Syntax: The basic syntax of DELETE query with WHERE clause is as follows: DELETE FROM table_name WHERE [condition]; You can combine N number of conditions using AND ...

Read More »

Having Clause – SQL

Having Clause – SQL enables you to specify conditions that filter which group results appear in the final results. The WHERE clause places conditions on the selected columns, whereas the HAVING clause places conditions on groups created by the GROUP BY clause. Syntax: The following is the position of the HAVING clause in a query: SELECT FROM WHERE GROUP BY ...

Read More »

SQRT Function SQL

SQRT Function SQL is used to find out the square root of any number. You can Use SELECT statement to find out square root of any number as follows: SQL> select SQRT(16); +----------+ | SQRT(16) | +----------+ | 4.000000 | +----------+ 1 row in set (0.00 sec) You are seeing float value here because internally SQL will manipulate square root ...

Read More »

Databases – SQL

Databases – SQL There are many popular RDBMS available to work with. This tutorial gives a brief overview of few most popular RDBMS. This would help you to compare their basic features. MySQL MySQL is an open source SQL database, which is developed by Swedish company MySQL AB. MySQL is pronounced “my ess-que-ell,” in contrast with SQL, pronounced “sequel.” MySQL ...

Read More »

LIKE Clause – SQL

LIKE Clause – SQL is used to compare a value to similar values using wildcard operators. There are two wildcards used in conjunction with the LIKE operator: The percent sign (%) The underscore (_) The percent sign represents zero, one, or multiple characters. The underscore represents a single number or character. The symbols can be used in combinations. Syntax: The ...

Read More »

Transactions – SQL

Transactions – SQL is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order, whether in a manual fashion by a user or automatically by some sort of a database program. A transaction is the propagation of one or more changes to the database. For example, if you ...

Read More »

RAND Function SQL

RAND Function SQL that can be invoked to produce random numbers between 0 and 1: SQL> SELECT RAND( ), RAND( ), RAND( ); +------------------+-----------------+------------------+ | RAND( ) | RAND( ) | RAND( ) | +------------------+-----------------+------------------+ | 0.45464584925645 | 0.1824410643265 | 0.54826780459682 | +------------------+-----------------+------------------+ 1 row in set (0.00 sec) When invoked with an integer argument, RAND( ) uses that value ...

Read More »