Creams productions
ProjectsNotities
  • main
    • Creams Productions
  • Notities
    • Notities
      • software ontwikeling Avans
        • Database(WIP)
          • Drop & Create table stament
          • Alter
          • INSERT INTO/ UPDATE / DELETE
          • Subquerys
          • DataTypes(WIP)
      • Scheikunde
        • Scheikunde(Havo 4) h1 & h2
        • Scheikunde(Havo 4) H3
        • Scheikunde Havo 5 h7
        • scheikunde havo 5 h8
        • scheikunde Havo 5 h9
        • scheikunde Havo 5 h10
        • scheikunde Havo 5 h11
      • Wiskunde
        • 10. Functies bewerken
        • 9. Afstand en hoeken
        • 8. Logaritmische functies
        • 7. Goniometrie
      • Informatica
        • D1 toets Arduino (mail opdracht)
          • voorbeeld 1
          • voorbeeld 2
          • voorbeeld 3
        • co-teach c2 (SQL)
      • Nederlands
        • formuleren h7
      • Natuurkunde
        • H7 natuurkunde golven
        • H5 Radioactief verval
        • sport en verkeer
      • Bedrijfs economie examen formules havo
  • Projects
    • Creams Console Utilities package documentation
      • Version 2
        • valueBar
        • Consoleout
        • writingstyle (text styling)
        • conBox(console boxes)
          • conboxFunc (functions to use with conbox)
          • Page 1
      • release 1(never finsished)
        • Selection menu
        • multiSelection menu
    • Projects
      • Project: Focus
      • chess ai 3.0
Powered by GitBook
On this page
  • Drop Statement
  • Example
  • Create statement
  • Create Database
  • Create table
  • Create table from other table
  1. Notities
  2. Notities
  3. software ontwikeling Avans
  4. Database(WIP)

Drop & Create table stament

A simple mysql documentation of the avans software development notes


Drop Statement


Example


Drop table

DROP Table TableName;

Removes a table from a database


Drop database

DROP DATABASE DatabaseName;

Deletes the whole database


Create statement


Create Database

CREATE DATABASE databasename;

Create table

syntax

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


Example

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

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

the WHERE statement is NOT needed when creating tables from other tables


Example

CREATE TABLE TestTable AS
SELECT CustomorNAME,ContactEmail
FROM Customors;

Last updated 8 months ago

the datatype speseficy what we would like to be stored in a collums fields for available Datatype check

datatype page