- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 11365 Articles
AmitDiwan
333 Views
To use the @ sign, use MySQL SET command. The @sign is used to set user-defined variables. Following is the syntax −SET @anyVariableName:=yourValue;Let us first create a table −mysql> create table DemoTable1331 -> ( -> Id int, -> Name varchar(20) -> ); Query OK, 0 rows ... Read More
AmitDiwan
143 Views
You do not need to format a number in MySQL, for this use DECIMAL data type. Let us first create a table −mysql> create table DemoTable1330 -> ( -> Amount DECIMAL(10, 2) -> ); Query OK, 0 rows affected (0.85 sec)Insert some records in the table using ... Read More
AmitDiwan
22 Views
The CharEnumerator.GetType() method in C# is used to get the type of the current instance.Syntaxpublic Type GetType();Let us now see an example to implement the CharEnumerator.GetType() method −Exampleusing System; public class Demo { public static void Main(){ string strNum = "john"; CharEnumerator ch ... Read More
AmitDiwan
200 Views
For this, you can use substring() along with length(). Let us first create a table −mysql> create table DemoTable1329 -> ( -> StudentName varchar(40) -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1329 values('David Miller'); ... Read More
AmitDiwan
785 Views
Fir this, use INSERT INTO SELECT statement. Let us first create a table −mysql> create table DemoTable1 -> ( -> Id int, -> Name varchar(20), -> Age int -> ); Query OK, 0 rows affected (1.72 sec)Insert some records in the table using insert command ... Read More
AmitDiwan
298 Views
For this, you can use time_format(). Let us first create a table −mysql> create table DemoTable1326 -> ( -> Arrivaltime time -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1326 values('12:10:45'); Query OK, 1 row ... Read More
AmitDiwan
93 Views
To order MySQL results without identifier, the syntax is as follows −select * from yourTableName order by 1 DESC LIMIT yourLimitValue;Let us first create a table −mysql> create table DemoTable1325 -> ( -> Id int, -> Name varchar(20) -> ); Query OK, 0 rows affected (0.69 ... Read More
AmitDiwan
1K+ Views
You can use aggregate function count(*). If it returns a value greater than 1, that would mean the table has composite primary key.Let us first create a table −mysql> create table DemoTable1324 -> ( -> StudentId int, -> StudentName varchar(20), -> StudentAge int, -> StudentCountryName ... Read More
AmitDiwan
188 Views
You can use the concept INFORMATION_SCHEMA.TABLES for this. Let us first create a table. This would be our most recent table −mysql> create table DemoTable1323 -> ( -> FirstName varchar(10) -> ); Query OK, 0 rows affected (0.43 sec)Insert some records in the table using insert command ... Read More
AmitDiwan
97 Views
To create a table from an already created table, use CREATE TABLE AS SELECT statement. Let us first create a table −mysql> create table DemoTable1318 -> ( -> Id int, -> FirstName varchar(10), -> LastName varchar(10), -> Age int -> ); Query OK, 0 rows affected (0.50 sec)Insert some records ... Read More