how to edit a libreoffice base table

I opened libreOfficebase, selected “connect to an existing database, selected " spreadsheet”. filled in the path to the spreadsheet file to be used, then selected " finish. It built my data base and the table but I cannot edit the table to set a primary key

Hello,

Connecting to a spreadsheet does not make it a database. Is is just linked data most often used for Mail Merge/Labels. These are not editable tables. For that you need to create a new Base file and use an actual database such as HSQLDB embedded or Firebird embedded (experimental features need enabling for Firebird). Then you can copy the data in Calc and paste into actual database tables.

For further information, see Base documentation here → LibreOffice Base Guide. See Chapter 3 - Tables. There is a section Importing data from other sources which discusses importing data from a spreadsheet. Covers Primary key also.