-- Script zum Überprüfen der echten Tabellennamen
USE trainingsdiary;

-- Alle Tabellen in der Datenbank anzeigen
SHOW TABLES;

-- Detaillierte Informationen über alle Tabellen
SELECT 
    TABLE_NAME,
    TABLE_ROWS,
    DATA_LENGTH,
    INDEX_LENGTH
FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_SCHEMA = 'trainingsdiary' 
ORDER BY TABLE_NAME;

-- Alle INDEX und Keys pro Tabelle anzeigen
SELECT 
    TABLE_NAME,
    INDEX_NAME,
    COLUMN_NAME,
    NON_UNIQUE,
    SEQ_IN_INDEX
FROM INFORMATION_SCHEMA.STATISTICS 
WHERE TABLE_SCHEMA = 'trainingsdiary' 
ORDER BY TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX;

-- Anzahl der Keys pro Tabelle
SELECT 
    TABLE_NAME,
    COUNT(*) as key_count
FROM INFORMATION_SCHEMA.STATISTICS 
WHERE TABLE_SCHEMA = 'trainingsdiary' 
GROUP BY TABLE_NAME
ORDER BY key_count DESC;
