MySQL NOT NULL Constraint and Field Declaration

Samual Sam
Updated on 19-Jun-2020 11:24:42

434 Views

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

Call a Function in JavaScript

Nancy Den
Updated on 19-Jun-2020 11:24:12

1K+ Views

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...    

Call a JavaScript Function on Click

Govinda Sai
Updated on 19-Jun-2020 11:23:44

2K+ Views

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...    

Create Empty Values String in JavaScript

seetha
Updated on 19-Jun-2020 11:20:59

3K+ Views

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);                  

What is onsubmit Event in JavaScript

V Jyothi
Updated on 19-Jun-2020 11:19:19

4K+ Views

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 −                                                  .......                    

What is onkeyup Event in JavaScript

vanithasree
Updated on 19-Jun-2020 11:18:47

403 Views

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.          

What is onkeypress Event in JavaScript

radhakrishna
Updated on 19-Jun-2020 11:18:13

392 Views

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                                            

C# Program to Display Name of Current Thread

karthikeya Boyini
Updated on 19-Jun-2020 11:17:38

256 Views

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

What is onkeydown Event in JavaScript

Priya Pallavi
Updated on 19-Jun-2020 11:17:27

407 Views

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                                            

What is onmouseup Event in JavaScript

mkotla
Updated on 19-Jun-2020 11:16:53

879 Views

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.    

Advertisements