How do you create a primary key?
Answer / Iltifat Ali Khan
To create a primary key in MySQL, you add the PRIMARY KEY keyword after the column names in the CREATE TABLE statement. Here is an example:n`nCREATE TABLE myTable (id INT PRIMARY KEY);n`
| Is This Answer Correct ? | 0 Yes | 0 No |
How can you see all indexes defined for a table?
Write a query to fetch common records between two tables using mysql?
How do I setup a mysql database?
What can you do with mysql?
What's new in mysql 8?
I want to insert userid of a customer,order time,etc in a table called ordermaster with orderid as primary key.Same time the product codes and required quantities (a1,2 and a2 4 and so on)inserted in another table orderdetails with same orderid reference.How the code will be in JSP using MySQL?
What are the reasons for selecting lamp (linux, apache, mysql, php) instead of combination of other software programs, servers and operating systems?
Why to use char instead of varchar in the database?
What is the difference between mysql_fetch_array and mysql_fetch_object?
What is msql?
How many ways we can we find the current date using MySQL?
What is the difference between the DELETE TABLE and TRUNCATE TABLE commands in MySQL?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)