Jennifer Nicholas has Published 291 Articles

How do I alter a MySQL table column defaults?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

224 Views

To alter a MySQL table column defaults, you can use the CHANGE command. The syntax is as follows −alter table yourTableName change yourCoumnName youColumnName datatype not null default Value;To understand the above syntax, let us create a table. The following is the query −mysql> create table DefaultDemo ... Read More

How to get the current version of my iOS project in code?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

209 Views

When we build an iOS application, by default it get a version 1.0 and build 0. Whenever we upload a new build to the app store, we need to change the version number. We can update the build number for testing builds. The version and build number are stored in ... Read More

How to increase varchar size of an existing column in a database without breaking existing data in MySQL?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

597 Views

Increase the varchar size of an existing column in a database with the help of CHANGE command. The syntax is as follows −alter table yourTableName change yourColumnName yourColumnName dataType;Here, we are creating a table with a single column and varchar size 200 −mysql> create table IncreaseVarcharDemo    −> (   ... Read More

Returning a value even if there is no result in a MySQL query?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

9K+ Views

You can use IFNULL() function from MySQL to return a value even if there is not result. Let us create a table. Te query to create a table.mysql> create table IfNullDemo    −> (    −> Id int,    −> Name varchar(100)    −> ); Query OK, 0 rows affected ... Read More

Resolve the MySQL error 'TYPE=MyISAM'?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

1K+ Views

To fix the error, you just need to replace TYPE with ENGINE. The syntax to set the engine is as follows −ENGINE = MyISAM;The MySQL error occurs when TYPE is used. Let us see the same scenario while creating a table −mysql> create table Customers −> ( ... Read More

How to return the nth record from MySQL query?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

1K+ Views

To get the nth record from MySQL query, you can use LIMIT. The syntax is as follows −select *from yourTableName order by yourColumnName limit n, 1;To understand the above syntax, let us create a table. The following is the query to create a table −mysql> create table NthRecordDemo ... Read More

How to make MySQL's NOW() and CURDATE() functions use UTC?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

215 Views

To make MySQL’s NOW() and CURDATE() functions use UTC, you need to write my.cnf file. Write the below instruction in my.cnf −[mysqld_safe] timezone = UTCFirstly, reach the directory with the help of the following query −mysql> select @@datadir;The following is the output −+---------------------------------------------+ | @@datadir ... Read More

How to insert multiple rows with single MySQL query?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

414 Views

You can insert multiple rows with the help of values() separated by comma(, ). The syntax is as follows −insert into yourTableName values(value1, value2, ...N), (value1, value2, ...N), (value1, value2, ...N), (value1, value2, ...N), (value1, value2, ...N), (value1, value2, ...N)................N;To insert multiple rows, let us create a table. The following ... Read More

How to alter multiple columns in a single statement in MySQL?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

2K+ Views

Alter multiple columns in a single statement with the help of CHANGE command. The syntax is as follows −alter table yourTableName change yourOldColumnName1 yourNewColumnName1 dataType, yourOldColumnName2 yourNewColumnName2 dataType, . . . NTo understand the above syntax, let us create a table. The query to create a table is as follows ... Read More

8085 program to add 2-BCD numbers

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:24

5K+ Views

In this program we will see how to add two 8-bit BCD numbers.Problem StatementWrite 8085 Assembly language program to add two 8-bit BCD number stored in memory location 8000H – 8001H.DiscussionThis task is too simple. Here we are taking the numbers from memory and after adding we need to put ... Read More

Advertisements