Get the Size of MySQL Database Tables

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

399 Views

To get the size of the tables of a MySQL database, you can use the “information_schema.tables”. Here is the syntax to know the size of all tables. SELECT TABLE_NAME AS `ALLTABLESNAME`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `TABLESIZEIN(MB)` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "yourDatabaseName" ORDER BY (DATA_LENGTH + INDEX_LENGTH) ASC; Let us apply the above syntax to get the size of the tables. mysql> SELECT TABLE_NAME AS `ALLTABLESNAME`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `TABLESIZEIN(MB)` -> FROM information_schema.TABLES WHERE TABLE_SCHEMA = "business" ... Read More

Why Doesn’t MySQL Support Millisecond and Microsecond Precision?

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

623 Views

The millisecond/ microsecond precision wasn’t supported in previous versions like 5.6.4. But now MySQL supports millisecond/ microsecond precision with timestamp, datetime, and time. The official statement. “MySQL now supports fractional seconds for TIME, DATETIME, and TIMESTAMP values, with up to microsecond precision”. You can check the MySQL version on your system using the version() method. mysql> SELECT version(); The following is the output. +-----------+ | version() | +-----------+ | 8.0.12 | +-----------+ 1 row in set (0.01 sec) Let us now see the syntax to check the date difference. mysql> SELECT DATEDIFF(now(), ... Read More

Instruction Type MVI and D8 in 8085 Microprocessor

Samual Sam
Updated on 30-Jul-2019 22:30:23

9K+ Views

In 8085 Instruction set, this instruction MVI M, d8 is used to load a memory location pointed by HL pair with an 8-bit value directly. This instruction uses immediate addressing for specifying the data. It occupies 2-Bytes in memory. Mnemonics, Operand Opcode(in HEX) Bytes MVI M, Data 36 2 As an example, we can consider MVI M, ABH as an example instruction of this type. It is a 2-Byte instruction, with opcode for MVI M using up one Byte, and ABH using up another more Byte. We are considering that HL register pair is ... Read More

Copy Table from One MySQL Database to Another

George John
Updated on 30-Jul-2019 22:30:23

6K+ Views

The following is the syntax to copy a table from one database to another. INSERT INTO yourDestinationDatabaseName.yourTableName SELECT * from yourSourceDatabaseName.yourtableName; Let us see an example. The CREATE command is used to create a table in the database ‘business’. We are creating a new table here. mysql> use business; Database changed mysql> create table OriginalTable -> ( -> id int -> ); Query OK, 0 rows affected (0.46 sec) Creating a new table in the database ‘test’. mysql> use test; Database changed mysql> create ... Read More

Instruction Type LDA A16 in 8085 Microprocessor

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

22K+ Views

In 8085 Instruction set, LDA is a mnemonic that stands for LoaD Accumulator with the contents from memory. In this instructionAccumulatorwill get initialized with 8-bit content from the 16-bit memory address as indicated in the instruction as a16. This instruction uses absolute addressing for specifying the data. It occupies 3-Bytes in the memory. First Byte specifies the opcode, and the successive 2-Bytes provide the 16-bit address, i.e. 1-Byte each for each memory location. Mnemonics, Operand Opcode(in HEX) Bytes LDA Address 3A 3 Let us consider LDA 4050H as an example instruction of this type. ... Read More

Layered Operating System

David Meador
Updated on 30-Jul-2019 22:30:23

18K+ Views

The operating system is split into various layers In the layered operating system and each of the layers have different functionalities. This type of operating system was created as an improvement over the early monolithic systems. Why Layering in Operating System? Layering provides a distinct advantage in an operating system. All the layers can be defined separately and interact with each other as required. Also, it is easier to create, maintain and update the system if it is done in the form of layers. Change in one layer specification does not affect the rest of the layers. Each of ... Read More

Kill All Processes in MySQL Show Processlist

Chandu yadav
Updated on 30-Jul-2019 22:30:23

4K+ Views

We can kill the processes with the help of the ‘kill’ command. However, you need to kill those processes one by one, since MySQL does not have any massive kill command. To check how many processes exist, use ‘show processlist’ mysql> show processlist; The following is the output. +----+-----------------+-----------------+------+---------+------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State ... Read More

Instruction Type STA A16 in 8085 Microprocessor

Samual Sam
Updated on 30-Jul-2019 22:30:23

17K+ Views

In 8085 Instruction set, STA is a mnemonic that stands for STore Accumulator contents in memory. In this instruction, Accumulator8-bit content will be stored to a memory location whose 16-bit address is indicated in the instruction as a16. This instruction uses absolute addressing for specifying the destination. This instruction occupies 3-Bytes of memory. First Byte is required for the opcode, and next successive 2-Bytes provide the 16-bit address divided into 8-bits each consecutively. Mnemonics, Operand Opcode(in HEX) Bytes STA Address 32 3 Let us consider STA 4050H as an example instruction of this type. ... Read More

Save MySQL Query Output to Excel or TXT File

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

3K+ Views

To save MySQL query output into a text file, we can use the OUTFILE command. Let us first create a table. mysql> create table SaveintoTextFile -> ( -> id int, -> name varchar(100) -> ); Query OK, 0 rows affected (0.55 sec) Inserting records into the table. mysql> insert into SaveintoTextFile values(1, 'John'); Query OK, 1 row affected (0.44 sec) mysql> insert into SaveintoTextFile values(101, 'Carol'); Query OK, 1 row affected (0.17 sec) mysql> insert into SaveintoTextFile values(3, 'David'); Query OK, 1 row ... Read More

Instruction Type: XCHG in 8085 Microprocessor

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

13K+ Views

In 8085 Instruction set, there is one mnemonic XCHG, which stands for eXCHanGe. This is an instruction to exchange contents of HL register pair with DE register pair. This instruction uses implied addressing mode. As it is1-Byte instruction, so It occupies only 1-Byte in the memory. After execution of this instruction, the content between H and D registers and L and E registers will get swapped respectively. Mnemonics, Operand Opcode(in HEX) Bytes XCHG EB 1 Let us suppose, HL and DE register pairs are having ABCDH and 6789H contents respectively. After execution of ... Read More

Advertisements