In this post, we will understand the difference between COMMIT and ROLLBACK in SQL.COMMITIt validates the modifications that are made by the current transaction.Once the COMMIT statement has been executed, the transaction can’t be rolled back using ROLLBACK.It occurs when the transaction is successfully executed.SyntaxCOMMIT;ROLLBACKIt removes the modifications that were made by the current transaction.Once ROLLBACK is executed, the database would reach its previous state.This is the state where the first statement of the transaction would be in execution.ROLLBACK happens when the transaction is aborted in between its execution.SyntaxROLLBACK;
In this post, we will understand the difference between linear regression and logistic regression.Linear RegressionIt helps predict the variable that is continuous, and is a dependent variable.This is done using a given set of independent variables.It extrapolates a line to find the value of dependent variable.Least square methods are used to estimate the accuracy.The best fit line is found, that helps predict the output.It is generally a continuous value.The relation between the dependent variable and independent variable has to be linear.The independent variables may have collinearity between them.It is considered a machine learning problem, i.e an applied statistics problem.Logistic RegressionIt ... Read More
In this post, we will understand the difference between clustered index and non-clustered index.Clustered indexIt is quick.It requires less memory to perform operations.The index is the main data.A table can have one clustered index only.It has inherent ability to store data on the disk.It can store pointers to block not to data.The leaf nodes contain actual data.The clustered key defines the order of data within table.It is a type of index where the table records are physically reordered to match with the index.Non-clustered indexIt is slower.It requires more memory to perform operations.The index is a copy of data.A table can ... Read More
In this post, we will understand the difference between grant and revoke.GrantIt is a DCL command.It grants permissions to users on database objects.It can also be used to assign access rights to users.For every user, the permissions need to be specified.When the access is decentralized, permission granting is easier.Syntax:grant privilege_name on object_name to {user_name | public | role_name}RevokeIt is a DCL command.It removes permissions if they are granted to users on database objects.It takes away/revokes the rights of the users.If access for a user is removed, all specific permissions provided by that user to others will be removed.If decentralized access ... Read More
In this post, we will understand the difference between SQL and T-SQL.SQLIt is a non-procedural language.Relational databases use SQL.It stands for structured query language.It uses query to view and manipulate data.DML and DDL operations are used- Data manipulation language, and data definition language.It is considered as an open-source language.It helps in the manipulation of data and data controlling.Transfer of data happens one by one when SQL is used.T-SQLIt is a Microsoft product.It is known as Transact Structure Query language.It gives a high degree of control to the developers/programmers.It works its best, and provides good performance with Microsoft SQL server.It is ... Read More
In this post, we will understand the difference between backup and recovery.BackupIt refers to storing a copy of the original data in a separate memory location.It is basically a copy of data that is used to restore the original data in case of a data loss/damage.It is the replication of data.It just keeps one extra copy to ensure data is not lost forever.It helps in giving data protection.It makes the process of data recovery hassle free and easy.It is an affordable process.It is used in production environments.Example - SnapManager helps create a backup of data and everything else in the ... Read More
A CSV file is a comma-separated file, that is used to store data in an organized way. It usually stores data in tabular form. Most of the business organizations store their data in CSV files.In C#, StreamReader class is used to deal with the files. It opens, reads and helps in performing other functions to different types of files. We can also perform different operations on a CSV file while using this class.OpenRead() method is used to open a CSV file and ReadLine() method is used to read its contents.OpenRead() method is used to open a CSV file and ReadLine() ... Read More
An array of characters is called a string.DeclarationFollowing is the declaration for an array −char stringname [size];For example − char a[50]; string of length 50 charactersInitializationUsing single character constant −char a[10] = { ‘H’, ‘e’, ‘l’, ‘l’, ‘o’ ,‘\0’}Using string constants −char a[10] = "Hello":;AccessingThere is a control string "%s" used for accessing the string till it encounters ‘\0’.The logic used to convert vowels from upper to lower or lower to upper is −for(i=0;string[i]!='\0';i++){ if(string[i]=='a'||string[i]=='e'||string[i]=='i'||string[i]=='o'||string[i]=='u'){ string[i]=toupper(string[i]); } } printf("The result string with converted vowels is : "); puts(string);ProgramFollowing is the C program using conversion functions ... Read More
Given a matrix, we need to print the boundary elements of the matrix and display their sum.ExampleRefer the matrix given below −Given matrix1 2 3 4 5 6 7 8 9Boundary Matrix1 2 3 4 6 7 8 9Sum of boundary elements: 1 + 2 + 3 + 4 + 6 + 7 + 8 + 9 = 40The logic to find the sum of boundary matrix is as follows −for(i = 0; i
The two’s complement for a given binary number can be calculated in two methods, which are as follows −Method 1 − Convert the given binary number into one’s complement and then, add 1.Method 2 − The trailing zero’s after the first bit set from the Least Significant Bit (LSB) including one that remains unchanged and remaining all should be complementing.The logic to find two’s complement for a given binary number is as follows −for(i = SIZE - 1; i >= 0; i--){ if(one[i] == '1' && carry == 1){ two[i] = '0'; } else ... Read More