Actually, MySQL NOT NULL constraint restricts a column of the table from having a NULL value. Once we applied NOT NULL constraint to a column, then we cannot pass a null value to that column. It cannot be declared on the whole table i.e., in other words, we can say that NOT NULL is a column level constraint.For declaring a field NOT NULL, we have to use NOT NULL keyword while defining the column in CREATE TABLE statement.Examplemysql> Create table Employee(ID Int NOT NULL, First_Name Varchar(20), Last_name Varchar(20), Designation Varchar(15)); Query OK, 0 rows affected (0.59 sec)In the query above, ... Read More
JavaScript allows us to write our own functions as well. To invoke a function somewhere later in the script, you would simply need to write the name of that function.ExampleYou can try to run the following code to learn how to call a function in JavaScript − function sayHello() { document.write ("Hello there!"); } Click the following button to call the function Use different text in write method and then try...
To call a function on click of a button in JavaScript, use onclick. Try to run the following code to call a function onclick in JavaScript −Example function sayHello() { document.write ("Hello there!"); } Click the following button to call the function Use different text in write method and then try...
To create empty values string in JavaScript, you can try to run the following code −Example var val; val = ""; document.write("Value: "+val); document.write("Type: "+typeof val);
The onsubmit event is an event that occurs when you try to submit a form. You can put your form validation against this event type. The following example shows how to use onsubmit. Here we are calling a validate() function before submitting a form data to the web server. If validate() function returns true, the form will be submitted, otherwise, it'll not submit the data.ExampleThe following example is a code snippet showing the usage of the onsubmit event − .......
The onkeyup event triggers when a key is released.ExampleYou can try to run the following code to learn how to work with onkeyup event in JavaScript − Enter subject below in upper case and see what happpens.
The onkeypress event triggers when a key is pressed and released. You can try to run the following code to learn how to work with onkeypress event in JavaScript −Example
To display the name of the current thread in C#, use the Name property.Firstly, use the currentThread property to display information about a thread −Thread thread = Thread.CurrentThread;Now use the thread.Name property to display name of the thread −thread.NameExampleLet us see the complete code show current thread’s name in C#.Live Demousing System; using System.Threading; namespace Demo { class MyClass { static void Main(string[] args) { Thread thread = Thread.CurrentThread; thread.Name = "My Thread"; Console.WriteLine("Thread Name = {0}", thread.Name); Console.ReadKey(); } } }OutputThread Name = My Thread
The onkeydown event triggers when a key is pressed. You can try to run the following code to learn how to work with an onkeydown event in JavaScript −Example
The onmouseup event triggers when a mouse button is released.ExampleYou can try to run the following code to learn how to work with onmouseup event in JavaScript − This is demo text for mouseup event.
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP