MySQL server supports extensions which may not be found in other SQL databases. This means, if these extensions of MySQL are used, the code can’t be ported to other SQL servers. But sometimes, it can be ported.Let us understand the MySQL extensions to standard SQL −Enclosing StringsThe strings can be enclosed in “ (double quotes) or ‘ (single quote) by default. If the ‘ANSI_QUOTES’ SQL mode is on, the strings have to be enclosed using ‘, and if “ (double quotes) is used, the server interprets this as identifiers.Escape Character\ is the escape character for strings.Accessing TableMySQL doesn’t support tablespaces, ... Read More
The standards compliance tells how MySQL is related to the ANSI/ISO SQL standards. There are many versions of the SQL standard, and the phrase ‘SQL standard’ is used to refer to the current version of SQL standard at any point in time.Following are the MySQL Standards Compliance −MySQL server was originally designed to work with medium-sized databases (10 to 100 million rows or 100 MB per table) on small systems. But currently, it has been upgraded to work with terabyte-sized databases.MySQL supports ODBC levels ranging from 0 to 3.5.1.MySQL also supports high-availability database clustering, which can be achieved with the ... Read More
ProblemHow to display and calculate the sum of n numbers by using dynamic memory allocation function in C language?SolutionFollowing is the C program to display the elements and calculate the sum of n numbers by the user by using dynamic memory allocation functions. Here, we also try to reduce the wastage of memory.Example Live Demo#include #include void main(){ //Declaring variables and pointers, sum// int numofe, i, sum=0; int *p; //Reading number of elements from user// printf("Enter the number of elements : "); scanf("%d", &numofe); //Calling malloc() function// p=(int *)malloc(numofe*sizeof(int)); /*Printing O/p - ... Read More
Else − if the ladder is the most general way of writing a multi-way decision.The syntax for else if the ladder is as follows −if (condition1) stmt1; else if (condition2) stmt2; - - - - - - - - - - else if (condition n) stmtn; else stmt x;FlowchartRefer the flowchart given below −ExampleFollowing is the C program to execute Else If Ladder conditional statement − Live Demo#include void main (){ int a, b, c, d; printf("Enter the values of a, b, c, d: "); scanf("%d%d%d%d", ... Read More
ProblemWhat is the simple program to show the left, right shifts, and complement of a number by using C language?SolutionLeft ShiftIf the value of a variable is left-shifted one time, then its value gets doubled.For example, a = 10, then a1 = 5ExampleFollowing is the C program for the shift operations − Live Demo#include main (){ int a=9; printf("Rightshift of a = %d",a>>1);//4// printf("Leftshift of a = %d",a2);//2// printf("Leftshift by 2 of a = %d",a
The logic we use to implement to delete the vowels from the given string is as follows −for(i=0; i
ProblemHow to find the cube root of any given number by using the C programming language?SolutionAlgorithmStep 1: Enter any number at run time Step 2: Read from console Step 3: Compute result Result:pow(number, 1.0/3.0) Step 4: Increment result Step 5: Print resultExampleFollowing is the C program to find the cube root of any given number −//finding cube root of given number// #include #include #include void main(){ int number, result; printf("Enter any number: "); scanf("%d", &number); result=pow(number, 1.0/3.0); result++; printf("\Cube of %d is: %d", number, result); getch(); }OutputWhen the above ... Read More
An array of characters (or) collection of characters is called a string.Input and output for stringsExampleFollowing is the C program for input and output for strings −#include main ( ){ char a[30]; printf("enter your name"); scanf ( "%s", a); printf ("your name is %s", a); getch ( ); }OutputWhen the above program is executed, it produces the following result −1. Enter your name : Lucky 2. Enter your name : Lucky Lol Your name is Lucky Your name is LuckyNote −‘&’ is not used for accepting strings because name of the string itself specifies the ... Read More
An array of characters (or) collection of characters is called a string.DeclarationRefer to the declaration given below −char stringname [size];For example - char a[50]; a string of length 50 characters.InitializationThe initialization is as follows −Using single character constant −char string[20] = { ‘H’, ‘i’, ‘l’, ‘l’, ‘s’ ,‘\0’}Using string constants −char string[20] = "Hello":;‘\0’ is called a null character. It marks the end of the string.‘\0’ is automatically placed by the compiler, if a string is given as input. The user has to take care of placing ‘\0’ at the end if a single character is given.Accessing − There is ... Read More
Fibonacci Series is a sequence of numbers obtained by adding the two previous numbers.Fibonacci series starts from two numbers f0 & f1.The initial values of fo & f1 can be taken 0, 1 or 1, 1 Fibonacci series satisfies the following conditions −fn = fn-1 + fn-2AlgorithmRefer to the algorithm for the Fibonacci series.START Step 1: Read integer variable a, b, c at run time Step 2: Initialize a=0 and b=0 Step 3: Compute c=a+b Step 4: Print c Step 5: Set a=b, b=c Step 6: Repeat 3 to 5 for n times STOPExampleFollowing is the C program for the ... Read More