Sometimes there is a requirement to convert a string to a number (int/float) in data analysis. For each string, we can assign a unique integer value to differentiate string values.For this, we use the data in Comma Separated Values(CSV) files. Say we have an excel file containing CSV data as follow −CompanyIndustryRecommendationHDFC BankFinanceHoldApolloHealthcareBuyHeroAutomobileUnderperformYes BankFinanceHoldM&MAutomobileUnderperformFortisHealthcareBuyMarutiAutomobileUnderperformAbove is just a few lines from a large dataset, we need to give different recommendation .i.e. Buy, Hold, Underperform etc. integer values, which will link to our metadata. So for the above input, our expected output will be something like −CompanyIndustryRecommendationHDFC BankFinance2ApolloHealthcare1HeroAutomobile3Yes BankFinance2M&MAutomobile3FortisHealthcare1MarutiAutomobile3Here is a way ... Read More
You can achieve it with the help of GROUP_CONCAT() function. The syntax is as follows −SELECT yourColumnName1, yourColumnName2, yourColumnName3, ..N, GROUP_CONCAT(yourColumnName4) as anyAliasName FROM yourTableName group by yourColumnName3, yourColumnName1, yourColumnName2;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table CommaDelimitedList -> ( -> Id int NOT NULL AUTO_INCREMENT, -> Name varchar(10), -> GroupId int, -> CompanyName varchar(15), -> RefId int, -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using INSERT command. ... Read More
Format the date DD/MM/YYYY using select and order by in descending order. The syntax is as follows −SELECT *FROM yourTableName where yourDatetimeColumnName order by STR_TO_DATE(yourDatetimeColumnName, ’%d/%m%Y’) desc;The above syntax will give the date in descending order. To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table DateFormatWithSelect -> ( -> UserId int, -> UserName varchar(100), -> UserLoginDatetime varchar(100) -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert ... Read More
You can append data to a MySQL database field with the help of in-built CONCAT() function.The syntax is as follows −update yourTableName set yourColumnName = CONCAT(yourColumnName, ’AppendValue’);To understand the above concept, let us create a table. The query to create a table −mysql> create table AppendingDataDemo −> ( −> FirstNameAndLastName varchar(200) −> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table with the help of insert command. The query is as follows −mysql> insert into AppendingDataDemo values('John'); Query OK, 1 row affected (0.27 sec) mysql> insert ... Read More
The method java.util.ArrayList.removeAll() removes all the the elements from the ArrayList that are available in another collection. This method has a single parameter i.e. the Collection whose elements are to be removed from the ArrayList.A program that demonstrates this is given as followsExample Live Demoimport java.util.ArrayList; import java.util.List; public class Demo { public static void main(String args[]) throws Exception { List aList1 = new ArrayList(); aList1.add("Anna"); aList1.add("John"); aList1.add("Mary"); ... Read More
To give a dynamic height to an UIlabel in swift we can use the frame property of UILabel. We can create a frame using the CGRect which allows us to give different variables like x position, y position, width, and height.Let’s create a label and add it as a subview to our view.let label = UILabel() label.frame = CGRect(x: 10, y: 40, width: 200, height: 50) label.backgroundColor = colorLiteral(red: 0.7450980544, green: 0.1568627506, blue: 0.07450980693, alpha: 1) label.textColor = colorLiteral(red: 0.05882352963, green: 0.180392161, blue: 0.2470588237, alpha: 1) label.text = "Custom label" self.view.addSubview(label)We can embed this in a function as well, and ... Read More
This is absolutely true that marketers are crossing all borders to not only sell their products but also to have an upper hand over their competitors. You look around and observe that their eyes are everywhere and they won’t even hesitate to have a sneak peek into your bedroom if they get a chance. Recently, I was scrolling down my social media account and came across this exceptional way of marketing and thought of sharing with you. Just have a look at these side-splitting advertising efforts.
Public relations officers also known as public relations or communications specialists, facilitate relations between organizations and the public. They may work for corporations, non-profit groups, or government agencies.Requirements To Become A Public Relations OfficerDegree: One does not usually need a very high-level degree. A foundation level degree is acceptable. MBA is a huge add-on, although.Start Low: One may start as a public assistant, and then become Public relations officer.Confidence: A qualification in such professions would be Confidence and self-motivational skills. These do come under the banner of soft skills, which are a necessity in this field.Excellent Communication Skills: If one ... Read More
You need to use CONVERT() function along with binary keyword. The syntax is as follows −SELECT CONVERT(binary CONVERT(yourColumnName using latin1) USING UTF8) as anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table UtfDemo -> ( -> Id int NOT NULL AUTO_INCREMENT, -> Name varchar(15), -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using INSERT command. The query is as follows −mysql> insert into UtfDemo(Name) values('Obama’s'); Query OK, 1 row affected (0.28 ... Read More
The following is the syntax to work with FOR LOOP in MySQL stored procedure −delimiter // CREATE procedure yourProcedureName() wholeblock:BEGIN DECLARE anyVariableName1 INT ; Declare anyVariableName3 int; DECLARE anyVariableName2 VARCHAR(255); SET anyVariableName1 =1 ; SET anyVariableName3 =10; SET anyVariableName2 = ''; loop_label: FORLOOP IF anyVariableName1 > anyVariableName3 THEN LEAVE loop_label; END IF; SET anyVariableName2 = CONCAT(anyVariableName2 ,anyVariableName1 ,', '); SET anyVariableName1 = anyVariableName1 + ... Read More