![]() ![]() Deleting a View DROP VIEW View_name Triggers 1. How to call view SELECT * FROM View_name 3. DROP INDEX DROP INDEX index_name ON table_name Views 1. CREATE INDEX CREATE INDEX index_name on table_name(column_name) ĬREATE UNIQUE INDEX index_name on table_name(column_name) 2. DELETE DELETE FROM table_name where condition Example DELETE from EMPLOYEE where empId='0001' Indexes 1. WHERE condition Example UPDATE EMPLOYEE SET dept = 'Sales' WHERE empId='0001' 4. Example SELECT * FROM EMPLOYEE where dept ='sales' 3. Example INSERT INTO EMPLOYEE VALUES (0001, 'Ava', 'Sales') 2. ![]() INSERT INSERT INTO table_name (column1, column2, column3. COMMENT Single-Line Comments: -Line1 Multi-Line comments: /* Line1, RENAME RENAME TABLE table_name1 to new_table_name1 6. ALTER ALTER TABLE Table_name ADD column_name datatype Example INSERT INTO EMPLOYEE VALUES (0001, 'Dave', 'Sales') 3. Supports many operating systems like Linux*,CentOS*, Solaris*,Ubuntu*,Windows*, MacOS*,FreeBSD* and others.High productivity as it uses stored procedures, triggers, views to write a highly productive code.Reliable, very fast and easy to use database server.Open-source relational database management systems.MySQL is a open-source, free and very popular relational database management system which is developed, distributed and supported by Oracle corporation. The editor shows sample boilerplate code when you choose language as 'MySQL' and start writing queries to learn and test online without worrying about tedious process of installation. Getting started with the OneCompiler's MySQL editor is really simple and pretty fast. It's one of the robust, feature-rich online editor and compiler for MySQL. ![]() "Table Size (MB)" FROM information_schema.Write, Run & Share MySQL queries online using OneCompiler's MySQL online editor and compiler for free. It will also list number of rows in each table. Please change ‘ mydb‘ with your actual database name. This query will calculate size of all tables in a database in mysql server. | Table Name | Rows Count | Table Size (MB) | "Table Size (MB)" FROM information_schema.TABLES WHERE table_schema = " mydb" AND table_name =" table_one" SELECT table_name "Table Name", table_rows "Rows Count", round(((data_length + index_length)/1024/1024),2) Please change ‘ mydb‘ with your actual database name and ‘ table_one‘ with your actual table name. This query will calculate size of single table in a database in mysql server. +-+-+Ĭheck Single Table Size in MySQL Database "Database Size (MB)" FROM information_schema.TABLES GROUP BY table_schema SELECT table_schema "Database Name", SUM(data_length+index_length)/1024/1024 ![]() This query will calculate size of all databases in mysql server. "Database Size (MB)" FROM information_schema.TABLES where table_schema = ' mydb' SELECT table_schema "Database Name", SUM( data_length + index_length)/1024/1024 This query will calculate the size of the single database in MySQL server. We will use the information_schema table to find tables and databases size. MySQL stored all the information related to tables in a database in the information_schema database. This article will help you to calculate the size of tables and database in MySQL or MariaDB servers though SQL queries. MySQL is a Relational Database Management System, widely used as a database system for Linux systems. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |