write the step to create a primary key in a table
Answers
Answered by
8
Answer:
To create a primary key
In Table Designer, click the row selector for the database column you want to define as the primary key. If you want to select multiple columns, hold down the CTRL key while you click the row selectors for the other columns. Right-click the row selector for the column and select Set Primary Key......
Explanation:
mark brainlist
follow me,if answer helps you
press thanks button must
Answered by
2
A Primary Key constraint can be added to a database table with the help of CREATE TABLE or ALTER TABLE SQL commands.
- Primary Key constraint is a combination of unique and not null values. On the basis of this constraint it becomes very easy to retrieve any record from a database table with large number of rows.
- A Primary Key may be specified at the time of table creation, by using CREATE TABLE command. We need to specify the constraint name and use keyword PRIMARY KEY, with the column name that needs to be made a PK. For example- After CREATE TABLE command, suppose we wish to create PK on column EMP_ID , then we need to specify keyword CONSTRAINT followed by a constraint name like pk_emp_id followed by keyword PRIMARY KEY.
- Alternatively, we may also add the PK constraint after the table has been created. This can be done by using ALTER TABLE ADD CONSTRAINT command.
- Primary key may also be dropped, using ALTER TABLE command. It is not necessary to specify the constraint name while dropping Primary Key as a table can have one and only one Primary Key. However, Primary Key can be a combination of more than one column, called as Composite key.
To know more about Primary Key, visit:
https://brainly.in/question/11240784
Similar questions