Ankith Reddy has Published 1070 Articles

Query in MySQL for string fields with a specific length?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 11:14:27

4K+ Views

To query for string fields with a specific length, use the char_length() or length() from MySQL.SyntaxThe syntax is as follows −Case 1 − Use of char_length()This can be used when we are taking length in a number of characters.The syntax −select *from yourTableName where char_length(yourColumnName)=anySpecificLengthValue;Case 2 − Use of length()This ... Read More

How to make a primary key start from 1000?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 11:00:44

2K+ Views

To make a primary key start from 1000, you need to alter your table and set to auto_increment with value 1000. The syntax is as follows −alter table yourTableName auto_increment=1000;To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> ... Read More

Set the width of a tab character with CSS

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 10:21:12

102 Views

Use the tab-size property in CSS to set the width of a tab character. You can try to run the following code to implement the tab-size propertyExampleLive Demo                    #demo {             tab-size: 12;          }                     The tab-size Property                This is demo text.          

frexp() in C++

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 10:12:32

77 Views

The function frexp() is used to break the floating point number into its binary significand and integral exponent for 2. It returns the binary significand and its range is (0.5, 1). If we pass value zero, its significand and exponent value will be zero.Here is the mathematical expression of frexp(), ... Read More

remquo() in C++

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 10:09:57

46 Views

The function remquo() is used to calculate the floating point remainder of numerator or denominator and stores the quotient to the passed pointer. It returns Nan(Not a number) when denominator is zero.Here is the syntax of remquo() in C++ language, float remquo(float var1, float var2, int* var3);Here, var1  − The ... Read More

What is the type of string literals in C/ C++?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 10:08:32

215 Views

The string literals are the set of characters which is enclosed in double quotes(“ “). Wide-string literals are prefixed with L always.Types of string literals −Sr.No.String Literals & Description1“ “Unprefixed string literal2L” “Wide-string literal3u8” “UTF-8 encoded string literal4u” “UTF-16 encoded string literal5U” “UTF-32 encoded string literal6R” “Raw string literalHere is ... Read More

Purpose of Unions in C/ C++

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 10:04:03

4K+ Views

Union is a user-defined datatype. All the members of union share same memory location. Size of union is decided by the size of largest member of union. If you want to use same memory location for two or more members, union is the best for that.Unions are similar to structures. ... Read More

#pragma Directive in C/C++

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 09:50:00

3K+ Views

The preprocessor directive #pragma is used to provide the additional information to the compiler in C/C++ language. This is used by the compiler to provide some special features.Here is the syntax of #pragma directive in C/C++ language, #pragma token_nameThe table of some of #pragma directives in C/C++ language is given ... Read More

Header files “stdio.h” and “stdlib.h” in C

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 09:39:07

14K+ Views

stdio.hThe header file stdio.h stands for Standard Input Output. It has the information related to input/output functions.Here is the table that displays some of the functions in stdio.h in C language, Sr.No.Functions & Description1printf()It is used to print the strings, integer, character etc on the output screen.2scanf()It reads the character, ... Read More

Static Data Members in C++

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 09:29:34

20K+ Views

Static data members are class members that are declared using the static keyword. There is only one copy of the static data member in the class, even if there are many class objects. This is because all the objects share the static data member. The static data member is always ... Read More

Advertisements