The document shows how to set up and use a MySQL database called Avto_sola using XAMPP on a Windows system. Several tables are created within the Avto_sola database including an Instruktor table with instructor details. Various SQL queries are run to insert, select, update, and delete data from the Instruktor table.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
38 views
SQLcel
The document shows how to set up and use a MySQL database called Avto_sola using XAMPP on a Windows system. Several tables are created within the Avto_sola database including an Instruktor table with instructor details. Various SQL queries are run to insert, select, update, and delete data from the Instruktor table.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
Šola 3.R 11.05.23 Izd.
vaje pred preizkusom
Setting environment for using XAMPP for Windows.
SŠ Domžale@DESKTOP-8SNSJ8C c:\xampp # mysql -u root -p Enter password: root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 8 Server version: 10.4.27-MariaDB mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW DATABASES;
+--------------------+ | Database | +--------------------+ | information_schema | | knjiznica | | mysql | | performance_schema | | phpmyadmin | | test | +--------------------+ 6 rows in set (0.029 sec)
MariaDB [(none)]> CREATE DATABASE Avto_sola;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> SHOW DATABASES;
+--------------------+ | Database | +--------------------+ | avto_sola | | information_schema | | knjiznica | | mysql | | performance_schema | | phpmyadmin | | test | +--------------------+ 7 rows in set (0.001 sec)
MariaDB [(none)]> USE Avto_sola;
Database changed MariaDB [Avto_sola]> CREATE TABLE Instruktor -> (ID_instruktor INT PRIMARY KEY AUTO_INCREMENT NOT NULL, -> Priimek_instruktorja VARCHAR (25) NOT NULL, -> Ime_instruktorja CHAR (25) NOT NULL, -> Datum_rojstva DATE NOT NULL -> CHECK (Datum_rojstva >="1995-01-01" AND Datum_rojstva <="2000-12-31"), -> Naslov CHAR (25) NOT NULL, -> Postna_stevilka NUMERIC (4) NOT NULL); Query OK, 0 rows affected (0.029 sec)
MariaDB [Avto_sola]> DESCRIBE Instruktor;
+----------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------------+--------------+------+-----+---------+----------------+ | ID_instruktor | int(11) | NO | PRI | NULL | auto_increment | | Priimek_instruktorja | varchar(25) | NO | | NULL | | | Ime_instruktorja | char(25) | NO | | NULL | | | Datum_rojstva | date | NO | | NULL | | | Naslov | char(25) | NO | | NULL | | | Postna_stevilka | decimal(4,0) | NO | | NULL | | +----------------------+--------------+------+-----+---------+----------------+ 6 rows in set (0.034 sec)