Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Microsoft Windows [Version 10.0.19043.1288]
- (c) Microsoft Corporation. All rights reserved.
- C:\Users\nelly>mysql -u root
- Welcome to the MariaDB monitor. Commands end with ; or \g.
- Your MariaDB connection id is 16
- Server version: 10.4.21-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 |
- | mysql |
- | performance_schema |
- | phpmyadmin |
- | reservations |
- | shoot |
- | test |
- +--------------------+
- 7 rows in set (0.015 sec)
- MariaDB [(none)]> create database Uni;
- Query OK, 1 row affected (0.008 sec)
- MariaDB [(none)]> use Uni;
- Database changed
- MariaDB [Uni]> create table departament(
- -> depname VARCHAR (100) NOT NULL);
- Query OK, 0 rows affected (0.021 sec)
- MariaDB [Uni]> create table proff(
- -> egn CHAR (10) NOT NULL,
- -> proffname VARCHAR (50) NOT NULL,
- -> degree VARCHAR (100) NOT NULL,
- -> title VARCHAR (100) NOT NULL,
- -> depname VARCHAR (100) referances departament(depname));
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'departament(depname))' at line 6
- MariaDB [Uni]> create table proff(
- -> -> egn CHAR (10) NOT NULL,
- -> -> proffname VARCHAR (50) NOT NULL,
- -> -> degree VARCHAR (100) NOT NULL,
- -> -> title VARCHAR (100) NOT NULL,
- -> -> depname VARCHAR (100) references departament(depname));
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-> egn CHAR (10) NOT NULL,
- -> proffname VARCHAR (50) NOT NULL,
- -> deg...' at line 2
- MariaDB [Uni]> create table proff(
- -> -> -> egn CHAR (10) NOT NULL,
- -> -> -> proffname VARCHAR (50) NOT NULL,
- -> -> -> degree VARCHAR (100) NOT NULL,
- -> -> -> title VARCHAR (100) NOT NULL,
- -> ;
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-> -> egn CHAR (10) NOT NULL,
- -> -> proffname VARCHAR (50) NOT NU...' at line 2
- MariaDB [Uni]>
- MariaDB [Uni]> create table proff(
- -> egn CHAR (10) NOT NULL,
- -> proffname VARCHAR (50) NOT NULL,
- -> degree VARCHAR (100) NOT NULL,
- -> title VARCHAR (100) NOT NULL,
- -> depname VARCHAR (100) references departament(depname));
- Query OK, 0 rows affected (0.016 sec)
- MariaDB [Uni]> create table student(
- -> egnstu CHAR (10) NOT NULL,
- -> num CHAR (10) NOT NULL,
- -> stuname VARCHAR (100) NOT NULL);
- Query OK, 0 rows affected (0.015 sec)
- MariaDB [Uni]> create table class–
- -> ;
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-' at line 1
- MariaDB [Uni]> create table class(
- -> classnum CHAR (5) NOT NULL,
- -> classname VARCHAR (30) NOT NULL,
- -> classdesc VARCHAR (100) NOT NULL,
- -> egn CHAR (10) references proff(egn));
- Query OK, 0 rows affected (0.055 sec)
- MariaDB [Uni]> create table attend(
- -> egnstu CHAR (10) references students(egnstu)
- -> classnum CHAR (5) references class(classnum));
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'classnum CHAR (5) references class(classnum))' at line 3
- MariaDB [Uni]> create table attend(
- -> egnstu CHAR (10) references students(egnstu),
- -> classnum CHAR (5) references class(classnum));
- Query OK, 0 rows affected (0.011 sec)
- MariaDB [Uni]>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement