DEV Community

Cover image for Basics SQL - CREATE Database
Anne Quinkenstein
Anne Quinkenstein

Posted on

Basics SQL - CREATE Database

Words

DBMS (Data Base Management System): software for creating and administering databases.
RDBMs (Relational Data Base Management System), such as MySQL, PostgreSQL, Oracle, etc.
Database container for storing, managing and retrieving data inside structured tables.
Table element of a database containing data that is grouped by common properties, which allows for structure and organisation.
Field property that characterises data in a table.
Primary Key This is a unique identifier that allows you to quickly identify a record.
Tuple (or record) values ​​in a table.

The data structure (tables, fields, relations...) that defines how the data will be organized. The creation of the database and its tables, but also the manipulation of the data (reading, adding, modification, deletion), are performed via queries sent to the DBMS, written in a particular
language called SQL (Structured Query Language).

Install SQL Server

on Ubuntu

Get started

  1. Create a Database
    mysql > CREATE DATABASE my-database;

  2. Move onto Database
    mysql -u root -D my-database -p

  • load a file
    mysql -u root -D my-database -p < file.sql

  • create table

CREATE TABLE `wizard` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `firstname` VARCHAR(100) NOT NULL,
  `lastname` VARCHAR(100) NOT NULL,
  `birthday` DATE NOT NULL,
  `birth_place` VARCHAR(255) NULL,
  `biography` TEXT NULL,
  PRIMARY KEY (`id`)
);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)