Chandu yadav has Published 1090 Articles

Byte-compile Python libraries

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

913 Views

Python is an interpreter based language. However it internally compiles the source code to byte code when a script (.py extension) is run and afterwards the bytecode version is automatically removed. When a module (apart from the precompiled built-in modules) is first imported, its compiled version is also automatically built ... Read More

How to take MySQL database backup using MySQL Workbench?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

559 Views

To make MySQL database backup using MySQL, first we need to install MySQL Workbench. Follow the below link to install MySQL workbench.https://dev.mysql.com/downloads/windows/installer/8.0.htmlAfter installing successfully, we need to open MySQL Workbench. Choose the option “Data Export”. Here is the snapshot.Select the database you want to export. You can also set the ... Read More

Python import modules from Zip archives (zipimport)

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

2K+ Views

Use of 'zipimport' module makes it possible to import Python modules and packages from ZIP-format archives. This module also allows an item of sys.path to be a string naming a ZIP file archive. Any files may be present in the ZIP archive, but only files .py and .pyc are available ... Read More

How to keep the connection alive in MySQL Workbench?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

924 Views

To keep connection alive in MySQL Workbench, you need to reach at the following location −Edit -> Preferences -> SQL EditorHere is the snapshot of all the options.After clicking the “Edit” menu, we will select “Workbench Preferences” as shown below −Now, select SQL Editor and set an interval. You can ... Read More

Warning control in Python Programs

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

2K+ Views

Warning is different from error in a program. If error is encountered, Python program terminates instantly. Warning on the other hand is not fatal. It displays certain message but program continues. Warnings are issued to alert the user of certain conditions which aren't exactly exceptions. Typically warning appears if some ... Read More

Inserting multiple rows in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

7K+ Views

Insert multiple rows in MySQL with the help of “values”. You can enclose the values with parentheses set with comma separation. The syntax is as follows to insert multiple rows in MySQL.insert into yourTableName(yourColumnName1, yourColumnName2, ..............yourColumnNameN) values(value1, value2, ...valueN), (value1, value2, ...valueN), (value1, value2, ...valueN), ...........((value1, value2, ...valueN);Let us now ... Read More

Selecting a single row in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

2K+ Views

If you want to select a single row on the basis of primary key, use the WHERE clause. The syntax is as follows −SELECT * FROM yourTableName WHERE yourPrimaryKeyColumnName = someValue;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> ... Read More

Sort by date & time in descending order in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

3K+ Views

Let us create a table to sort date and time in ascending order. The query to create a table is as follows −mysql> create table SortByDateAndTime    -> (    -> UserId int,    -> UserName varchar(100),    -> IssueDate date,    -> IssueTime time    -> ); Query OK, ... Read More

Easy way to re-order columns in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

10K+ Views

To re-order columns in MySQL, use the ALTER TABLE MODIFY COLUMN. The syntax is as follows -ALTER TABLE yourTableName MODIFY COLUMN yourColumnName data type after yourColumnName.To understand the above syntax, let us first create a table. The query to create a table is as follows.mysql> create table reOrderColumn -> ( ... Read More

Order a MySQL table by two columns?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

677 Views

Order a MySQL table by two columns with the help of below syntax −order by yourColumnName1 DESC, yourColumnName2 DESC;Let us first create a table for our example −mysql> create table OrderByDemo -> ( -> StudentId int, -> StudentName varchar(100), ... Read More

Advertisements