New answers tagged

0

You are assuming a close coupling (between the table PHPMyAdmin is "showing" you and the database itself) that does not exist. You might be looking at a table but the commands that you execute are only that - SQL commands - and, as such, they have to be complete. The syntax for truncate table includes the name of the table to be truncated (even if ...


4

I've seen it mentioned in blogs and tutorials that a weak entity "doesn't have a primary key," but this is misleading. You are correct that every table needs a primary key. This is necessary for the table to qualify as a relation. Every relation has one or more candidate keys, and one of the candidate keys is chosen as the table's primary key. The ...


0

Did some more research....I guess these details are already stored in a catalog view that you can just query: SELECT T.name TableName,i.Rows NumberOfRows FROM sys.tables T JOIN sys.sysindexes I ON T.OBJECT_ID = I.ID WHERE indid IN (0,1) AND t.name LIKE '%20170101%' ORDER BY i.Rows DESC,T.name


3

These are called System Catalogs. And Chapter 52. System Catalogs says that they are represented by regular tables in PostgreSQL: The system catalogs are the place where a relational database management system stores schema metadata, such as information about tables and columns, and internal bookkeeping information. PostgreSQL's system catalogs are regular ...


Top 50 recent answers are included