heretoinfinity
heretoinfinity

Reputation: 1746

SQLite: Primary keys not showing up

I am beginning with SQL and started with SQLite.

I created a database and 2 tables: Employees and Managers. Creating Managers table

Create Employees table and populate Managers and Employees table

I then decided to check my work by looking at the schema and then displaying the contents of both tables.

Check schema and display all content in Managers table Check schema again and display all content in Employees table + separate query for just ID(Primary Key)

What I fail to understand is why the primary keys in both tables aren't showing up when I check all of the content in the tables. The keys appear blank for the managers table even when I make the query to check the ID's specifically (image 4).

What is going on? I created a similar table for practice and the primary keys were automatically populated for me.

Upvotes: 0

Views: 1297

Answers (1)

varro
varro

Reputation: 2492

You must use the form INTEGER PRIMARY KEY explicitly - INT PRIMARY KEY is not sufficient. (See "ROWIDs and the INTEGER PRIMARY KEY" in the SQLite documentation.)

Upvotes: 4

Related Questions