MySQL Pagination Without Double Querying

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

295 Views

To work with MySQL pagination, firstly let us see how to use CREATE command and use it to create a table. mysql>CREATE table RowCountDemo -> ( -> ID int, -> Name varchar(100) -> ); Query OK, 0 rows affected (0.95 sec) Records are inserted with the help of INSERT command. mysql>INSERT into RowCountDemo values(1, 'Larry'); Query OK, 1 row affected (0.15 sec) mysql>INSERT into RowCountDemo values(2, 'John'); Query OK, 1 row affected (0.13 sec) mysql>INSERT into RowCountDemo values(3, 'Bela'); Query OK, 1 row ... Read More

Add Super Privileges to MySQL Database

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

8K+ Views

Firstly, check the MySQL database with DESC command. mysql>DESC mysql.db; The following is the output. +-----------------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------------+---------------+------+-----+---------+-------+ | Host | char(60) | NO | PRI | | ... Read More

Difference Between Float, Double, and Decimal in C#

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

2K+ Views

Float , double and a decimal are all Value Types in C#. Value type variables can be assigned a value directly. They are derived from the class System.ValueType. The value types directly contain data. Float Value Type Float is a 32-bit single-precision floating point type with range 3.4 x 1038 to + 3.4 x 1038 Memory Size is 4 bytes. float a = 3.5f; Double Value Type Double is a 64-bit double-precision floating point type with range (+/-)5.0 x 10-324 to (+/-)1.7 x 10308 Memory Size is 8 bytes. double d = 5.78788 Decimal Value ... Read More

Difference Between Overriding and Hiding in C#

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

2K+ Views

Method hiding is also called shadowing in C#. The method of the parent class is available to the child class without using the override keyword in shadowing. The child class has its own version of the same function. Define a behavior that is specific to the subclass type in overriding, you, which means a subclass can implement a parent class method based on its requirement. Hiding redefines the complete method, whereas overriding redefines only the implementation of the method. In Overriding, you can access the base class using the child class’ object overridden method.. Shadowing has cannot access the ... Read More

Recommended IDEs for C# on Windows, Linux, Mac OS

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

383 Views

The best IDE for C# on Windows is Microsoft Visual Studio. It is an IDE to develop websites, web apps, mobile apps, etc. The following are the features of Visual Studio IDE − Code Editor − Visual Studio has a code editor supporting syntax highlighting and code completion using IntelliSense. Breakpoints − Set breakpoints and allow monitoring the variable values as the execution progress. Extend Capability − With Visual Studio, you can extend the functionality of the IDE. The extension includes macros, packages, etc. Built-in-languages − Visual Studio supports more than 30 programming ... Read More

Difference Between Pass-by-Value and Pass-by-Reference in C#

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

894 Views

Reference Parameters A reference parameter is a reference to a memory location of a variable. The reference parameters represent the same memory location as the actual parameters that are supplied to the method. When you pass parameters by reference, unlike value parameters, a new storage location is not created for these parameters. Pass by Value This is the default mechanism for passing parameters to a method. In this mechanism, when a method is called, a new storage location is created for each value parameter. The values of the actual parameters are copied into them. Hence, the changes made to the ... Read More

Dynamic Programming in JavaScript

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

3K+ Views

Dynamic programming breaks down the problem into smaller and yet smaller possible sub-problems. These sub-problems are not solved independently. Rather, results of these smaller sub-problems are remembered and used for similar or overlapping sub-problems. Dynamic programming is used where we have problems, which can be divided into similar sub-problems so that their results can be re-used. Mostly, these algorithms are used for optimization. Before solving the in-hand sub-problem, the dynamic algorithm will try to examine the results of the previously solved sub-problems. The solutions of sub-problems are combined in order to achieve the best solution. For a problem to be ... Read More

Change MySQL Timezone

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

366 Views

To change the timezone in MySQL, we can use the SET command. The following is the syntax. SET time_zone=’someValue’; Let us now use the above syntax and apply it in the below query. mysql > SET time_zone = '+8:00'; Query OK, 0 rows affected (0.00 sec) Above, the time_zone is changed by a value equivalent to 8. To change the timezone globally, use the GLOBAL command. Here is the syntax. SET GLOBAL time_zone = 'someValue'; Here is an example. mysql> SET GLOBAL time_zone = '+8:00'; Query OK, 0 rows affected (0.00 sec) The above query will change the timezone globally.

Underscore in Python

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

661 Views

In Python in some cases we use Single Underscore(_) and some cases we use Double Underscores (__). In Python has following cases, where we use underscore. If we want to store the value of last expression in interpreter. If we want to ignore some values. For declaration of variable or function. To separate digits of number lateral value. It is also used as ‘Internationalization (i18n)’ or ‘Localization (l10n)’ functions. Now some examples on every cases. Used in interpreter The Python Interpreter stores the last expression value in the '_'. >>> 20 20 >>> _ ... Read More

Get New Record Key ID from MySQL Insert Query

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

624 Views

We can get new record key with the help of LAST_INSERT_ID() function from MySQL. First, we will create a table and for inserting record, we will use LAST_INSERT_ID(). Let us create a table with the help of create command. The query is as follows − mysql> create table LastInsertRecordIdDemo -> ( -> id int auto_increment, -> value varchar(100), -> primary key(id) -> ); Query OK, 0 rows affected (0.52 sec) After creating a table, we will insert records and set it using LAST_INSERT_ID() ... Read More

Advertisements