> For the complete documentation index, see [llms.txt](https://docs.creams-productions.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.creams-productions.nl/help_vakken/notities/software-ontwikeling-avans/database-wip/drop-and-create-table-stament.md).

# Drop & Create table stament

***

## Drop Statement

***

### Example

***

#### Drop table

```sql
DROP Table TableName;
```

Removes a table from a database

***

#### Drop database

```sql
DROP DATABASE DatabaseName;
```

Deletes the whole database

***

## Create statement

***

### Create Database

```sql
CREATE DATABASE databasename;
```

***

### Create table

#### syntax

```sql
CREATE TABLE TableName(
    Columname0 DataType,
    Columname1 DataType,
    Columname3 DataType,
    ...
);
```

this creates a table with 3 colums \
\
Columname is how we want the collum to be called&#x20;

the datatype speseficy what we would like to be stored in a collums fields\
for available Datatype check [datatype page](/help_vakken/notities/software-ontwikeling-avans/database-wip/datatypes-wip.md)

***

#### Example

```sql
CREATE TABLE peopleInfo(
    personID int,
    LastName varchar(255),
    firstName varchar(255),
    adress varchar(255)
    city varchar(255)
);
```

this creates a table called peopleinfo with five collums which can store information

***

### Create table from other table

***

#### syntax

```sql
CREATE TABLE NewTable as 
SELECT Colum1,Colum2,...
FROM ExistingTable
WHERE ...;
```

{% hint style="warning" %}
the WHERE statement is NOT needed when creating tables from other tables
{% endhint %}

***

#### Example

```sql
CREATE TABLE TestTable AS
SELECT CustomorNAME,ContactEmail
FROM Customors;
```


---

# 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:

```
GET https://docs.creams-productions.nl/help_vakken/notities/software-ontwikeling-avans/database-wip/drop-and-create-table-stament.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
