- Esecutori
-
Impara
Impara Python Esempi eseguibili, NumPy, pandas e altro Impara l'IA / Machine LearningReti neurali, ML e LLM da zero Impara C e C++ Puntatori, memoria, STL e C++ moderno Impara C#Fondamenti, OOP, LINQ, async ed esercizi .NET Impara MatplotlibGrafici a linee, barre, dispersione e torta con visualizzatori Impara RustOwnership, trait, gestione degli errori e thread Impara GoSlice, interfacce, goroutine e canali Algoritmi Python Ricerca, ordinamento, ricorsione e visualizzazioni O(n) Algoritmi C e C++ Confronta le implementazioni in C e C++ Programmazione per bambini Impara a programmare giocando!
- QuizNuovo
- SfideNuovo
- Per docentiNuovo
- Aggiornamenti
- Offrimi un caffè
Quiz di SQL: Constraints & Keys
This SQL quiz tests the constraints that keep bad data out of your tables. You will decide which inserts and deletes fail, how primary and foreign keys behave, and where SQLite, MySQL and PostgreSQL disagree.
Domanda di esempio
Domanda 1 di 10What happens when this runs?
CREATE TABLE users (id INTEGER PRIMARY KEY, email TEXT NOT NULL);
INSERT INTO users (id) VALUES (1);
SELECT COUNT(*) FROM users;
Mostra la risposta
A. Error email has no default, so leaving it out would store NULL, which NOT NULL rejects. The insert fails with a constraint error instead of quietly saving an empty email.
Cosa copre questo quiz
NOT NULL,UNIQUEandCHECKconstraints- Primary keys, composite keys and auto-generated ids
- Foreign keys and
ON DELETE CASCADE - Upserts with
ON CONFLICT ... DO UPDATE - Engine differences, like SQLite's foreign key switch
Domande frequenti
Serve un account?
No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.
Posso rifarlo?
Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.