Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint
Cover Image
Cover Image
Drag to reposition
Contributed Answers

What function in MySQL can be used to get the number code of a specific character?

I need the number code of characters. Is there any MySQL function with the help of which I can obtain the number code of a specific character?
Answered on 19th Feb, 2018, 0 Views

String function ASCII() in MySQL returns the ASCII number code of the specific character. , Here, str, the argument of ASCII() function, is the string whose ASCII value of the first character to be retrieved. It is pertinent to mention here that it will return the number code the left the most character i.e. first character of the string given as argument. ,

How can we add values into the columns of a MySQL table?

I have created a new MySQL table with some columns but not inserted any record in it yet. I want to know about the MySQL statement that can be used to insert new records in MySQL table.
Answered on 19th Feb, 2018, 0 Views

INSERT command is used to add values to the columns of a MySQL table. We need to specify the values in INSERT command for all the columns as follows: , Suppose we have a table named ‘Stock’ with three columns ‘Item_id’, ‘Item_name’ and ‘Item_rate’ then with the help of following query we can add values in these columns. ,

How can we put comments in a column of existing MySQL table?

I have created a MySQL table but now want to add some comments on a column then how MySQL table can be amended to so.
Answered on 19th Feb, 2018, 0 Views

It can be done by using ‘COMMENT’ keyword while modifying the column with ALTER TABLE command. For example if we want to add comment in column ‘id’ of table ‘testing’ then following query will do it , With following query it can be checked in the comment field of a column. ,

What is MySQL TRUNCATE command used for?

I have created a MySQL table say with three columns and want to eradicate all the columns then which MySQL statement can be used.
Answered on 19th Feb, 2018, 0 Views

As the name explains, it is used to remove all the record from the MySQL table. , , The query above deleted all the records from the ‘Student’ table. We can observe as MySQL returns empty set after running the following query: ,

How can we modify column/s of MySQL table?

I have created a MySQL table say with three columns but now want to amend one or more existing columns then how it can be done with ALTER table statement.
Answered on 19th Feb, 2018, 0 Views

By using MODIFY keyword with ALTER TABLE command we can modify the column/s of MySQL table. The syntax for the same is as follows; , In the example below, with the help of MODIFY keyword in ALTER Command, the size of column ‘Address’ and ‘Grade’ has been modified. ,

How can I see the constraints which are applied to a table stored in the database I am currently using?

Suppose if I am using say ‘ABC’ database and want to see which constraints are applied to ‘ABC’ database then which statement can be used?
Answered on 19th Feb, 2018, 0 Views

MySQL SHOW CREATE TABLE statement will provide us the constraints applied to a particular table along with some other details about that table. Its syntax would be as follows: , Here table_name is the name of the table on which we want to see the constraints. In this example we are getting the detail of the table named ‘employees’: , The above result set shows that there is a PR.....

How can we remove multicolumn UNIQUE indexes?

Which MySQL statement can be used to eradicate UNIQUE index from more than one column?
Answered on 16th Feb, 2018, 0 Views

Multicolumn UNIQUE indexes can also be removed in the same as we remove UNIQUE constraint from the table. In this example, with the following query we have removed the multicolumn UNIQUE indexes on table ‘employee’: , The removal of UNIQUE indexes can be observed from the result sets of the following query: ,

What is MySQL UNIQUE constraint and how can we apply it to the field of a table?

How to elaborate UNIQUE constraint in MySQL and is it possible to declare a field of MySQL table, UNIQUE?
Answered on 16th Feb, 2018, 0 Views

As the name suggests, MySQL UNIQUE constraint maintains the uniqueness of a column in the table and does not allow inserting the duplicate value. Basically, UNIQUE constraint creates an index such that all the values in the index column must be unique. It is pertinent to mention here that we can have more than one UNIQUE column in a MySQL table. We can apply UNIQUE constraint by mentioning .....

What is MySQL NOT NULL constraint and how can we declare a field NOT NULL while creating a table?

How to elaborate NOT NULL constraint in MySQL and is it possible to declare a field of MySQL table, NOT NULL?
Answered on 16th Feb, 2018, 0 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 .....

What are local variables and global variables in C++?

What are local variables and global variables in C++ language? Please explain them with an example?
Answered on 16th Feb, 2018, 0 Views

A scope is a region of the program and broadly speaking there are three places, where variables can be declared −  Inside a function or a block which is called local variables, In the definition of function parameters which is called formal parameters. Outside of all functions which are called global variables.Local variables can be used only by statements that are insi.....

loader
Advertisements
Contribution

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.