Delimiters in MySQL?

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

7K+ Views

Delimiters can be used when you need to define the stored procedures, function as well as to create triggers. The default delimiter is semicolon.You can change the delimiters to create procedures and so on. However, but if you are considering multiple statements, then you need to use different delimiters like $$ or //.Here we have a table “GetRecordFromNow” wherein the following are the records −+---------------------+ | YourDateTime | +---------------------+ | 2018-12-07 22:30:18 | | 2018-12-03 22:30:31 | | 2018-12-02 22:30:41 | | 2018-12-01 22:30:56 | | 2018-12-03 22:31:04 | +---------------------+ 5 rows in ... Read More

What is the difference between hastily and quickly?

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

805 Views

Ideally speaking, there is no major difference between the words "hastily " and "quickly". Both come from the verbs' Haste' and 'Quick' and are used here as adverbs to qualify the verbs.Hastily: It refers to a work done hurriedly.Quickly: It can refer to both, work is done hurriedly or something indicative of speed.Thus, when one needs to denote the meaning of being in a hurry, with no time even to sit, relax and breathe, one uses 'Hastily'. But when one uses the word in a sense to indicate speedily, say 'Wait, I will quickly prepare Maggi for you.' Here, 'hastily' ... Read More

Is there a way to know your current username in MySQL?

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

9K+ Views

Yes, you can use the method CURRENT_USER() to know the current username in MySQL.The above method returns the username that can be used to authenticate the client connection.The query is as follows −mysql> select CURRENT_USER();The following is the output −+----------------+ | CURRENT_USER() | +----------------+ | root@% | +----------------+ 1 row in set (0.00 sec)Or you can use USER() method from MySQL. The query is as follows −mysql> select user();Here is the output −+----------------+ | user() | +----------------+ | root@localhost | +----------------+ 1 row in set (0.00 sec)

How to get primary key of a table in MySQL?

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

4K+ Views

To get the primary key of a table, you can use the show command. The syntax is as follows −SHOW INDEX FROM yourDatebaseName.yourTableName WHERE Key_name = 'PRIMARY';Suppose, we have a table with two primary keys; one of them is “Id” and second is “RollNum". The query for a table is as follows −mysql> create table TwoOrMorePrimary    −> (    −> Id int,    −> Name varchar(200),    −> RollNum int    −> ,    −> Primary key(Id, Age)    −> ); Query OK, 0 rows affected (0.85 sec)Apply the above syntax to get primary key of a table. ... Read More

How to frame the report of the event which was conducted last week in our college?

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

460 Views

Report writing is a part of academic writing. It is an informational work, such as writing, speech, made with the intention of providing information or recounting events in a presentable form, such that it can be published in a magazine or newspaper.Steps to Write A Report for A College Event Held PreviouslyGather Facts - This is the most extensive and the laborious part. You must know the inside-out phenomena, e.g. who was the chief guest, what was the exact time when the valediction ceremony was conducted. Never keep the facts in your mind, as you might forget in stress and ... Read More

Is simplicity an inspiration for writing?

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

244 Views

“Life is not complex. We are complex. Life is simple, and the simple thing is the right thing.” — Oscar Wilde.When I read such amazing quotations about simplicity, I feel like step out and explore the meaning and vastness of simplicity. In fact, William Hazlitt in his prose piece, On familiar style is scornful of the writers whose writing style is pedantic, with affectation and pretense, showy and gaudy, and thus it lacks a familiar style and even common sense too.How Can It Be Achieved?Simplicity can only be harvested from within, through hard work, engagement, and insight. This is even ... Read More

How to implement ternary conditional operator in MySQL?

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

3K+ Views

A ternary conditional operator looks like ?: in programming language like C, C++, Java etc. The syntax is as follows −(yourCondition) ? statement1:statement2;In the above syntax, if yourCondition becomes true then statement1 will evaluate and if yourCondition becomes false then statement2 will evaluate.But the above syntax does not work in MySQL. We can use IF() function from MySQL for the same purpose.Let us see an example −Case 1mysql> select if(3 > 5, 'Condition is true', 'Condition is not true') as ConditionalResult;The following is the output in which second statement evaluates since is 3 isn’t more than 5 −+-----------------------+ | ConditionalResult ... Read More

What are the new English words you have learned today?

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

352 Views

Ragtag: A group of people perceived as disreputable or undesirable.Lynch: (of a mob) kill (someone), especially by hanging, for an alleged offence with or without a legal trial.Gimcrack: A cheap and showy ornament; a knickknack or flimsy or poorly made but deceptively attractive.Vogie: Conceited, proud, cheerfulCarte Blanche: Unconditional authority; full discretionary power.Tummler: Any lively, prankish, or mischievous man.Hoity-Toity: Assuming airs; pretentious; haughty.Magisterial: Authoritative, weighty; of importance or consequence; of, relating to, or befitting a master: a magisterial pronouncement by the director of the board.Coeval: Of the same age, date, or duration; equally old: Analysis has proved that this manuscript is ... Read More

How does an FM radio set work?

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

1K+ Views

The FM receiver is the whole unit which takes the modulated signal as input and outputs the original audio signal. Radio amateurs are the initial radio receivers. They had got drawbacks such as poor sensitivity and selectivity.Selectivity is the selection of a particular signal while rejecting the others. Sensitivity is the capacity of detecting RF signal and demodulating it, while at the lowest power level. Both Selectivity and Sensitivity should be high for an FM receiver. To overcome these drawbacks of the ordinary receiver, the superheterodyne receiver was invented. This FM receiver consists of 5 main stages.RF Tuner SectionThe modulated ... Read More

Calculate age based on date of birth in MySQL?

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

13K+ Views

Calculate Age based on date of birth with the help of DATE_FORMAT() method in MySQL. Firstly, get the current date time with the help of now() method and you can place your date of birth in DATE_FORMAT().The syntax is as follows −SELECT DATE_FORMAT(FROM_DAYS(DATEDIFF(now(), 'yourDateofbirth')), '%Y')+0 AS anyVariableName;Apply the above syntax to calculate age from yourDateofbirth. In the above syntax, replace yourDateofbirth with your date of birth. The query is as follows −SELECT DATE_FORMAT(FROM_DAYS(DATEDIFF(now(), '2010-11-25')), '%Y')+0 AS Age;The following is the output −+------+ | Age | +------+ | 8 | +------+ 1 row in set (0.00 sec)Let ... Read More

Advertisements