> For the complete documentation index, see [llms.txt](https://learn.ziomark.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.ziomark.xyz/sql/parte-1-introduzione-a-sql.md).

# Parte 1: Introduzione a SQL

**Obiettivo:** Creare una tabella `Studenti` in un database SQL e inserire dati in essa. L'esercizio aiuterà a comprendere la sintassi per la creazione di tabelle e l'inserimento di righe.

**Istruzioni:**

1. **Accesso all'ambiente SQL:**
   * Utilizza un ambiente SQL online, come il Try-SQL Editor di W3Schools, SQLFiddle, o un sistema di gestione del database (DBMS) installato localmente, come MySQL, PostgreSQL o SQLite, per eseguire i comandi SQL.
2. **Crea la tabella `Studenti`:**
   * Usa il seguente comando SQL per creare una tabella denominata `Studenti`. La tabella dovrà avere quattro colonne: `ID`, `Nome`, `Cognome`, e `AnnoDiNascita`.

     ```sql
     CREATE TABLE Studenti (
         ID int,
         Nome varchar(255),
         Cognome varchar(255),
         AnnoDiNascita int
     );
     ```
3. **Inserisci dati nella tabella `Studenti`:**
   * Ora che hai creato la tua tabella, inserisci almeno tre record in essa. Usa il comando `INSERT INTO` per aggiungere dati.

     ```sql
     INSERT INTO Studenti (ID, Nome, Cognome, AnnoDiNascita) VALUES (1, 'Mario', 'Rossi', 2001);
     INSERT INTO Studenti (ID, Nome, Cognome, AnnoDiNascita) VALUES (2, 'Luca', 'Bianchi', 2002);
     INSERT INTO Studenti (ID, Nome, Cognome, AnnoDiNascita) VALUES (3, 'Giulia', 'Verdi', 2003);
     ```
4. **Verifica i dati inseriti:**
   * Dopo aver inserito i dati, esegui una query `SELECT` per assicurarti che tutti i dati siano stati inseriti correttamente.

     ```sql
     SELECT * FROM Studenti;
     ```
5. **Riflessione:**
   * Esamina i risultati della tua query. Ti vengono restituiti i dati di tutti gli studenti che hai inserito? Ci sono modifiche che potresti voler fare per migliorare la struttura della tua tabella o per correggere eventuali errori?

**Domande Bonus per Approfondire:**

* Come modificaresti la tabella per assicurarti che ogni studente abbia un ID unico?
* Come potresti aggiungere una colonna `Email` alla tua tabella `Studenti`?
* Puoi pensare a un modo per selezionare solo gli studenti nati dopo l'anno 2000?


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.ziomark.xyz/sql/parte-1-introduzione-a-sql.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
