province (
codp varchar(2),
name varchar(25) )
PK (codp)
locality (
codm varchar(4),
town varchar(50),
province varchar(2))
PK (codm,province)
FK (province) —> province
NNV (town)
uuser (
email varchar(50),
name varchar(35),
surnames varchar(55),
dni varchar(12),
telephone varchar(15),
street varchar(45),
street2 varchar(45),
postcode varchar(5),
town varchar(4),
province varchar(2),
birthday date)
PK (email)
AltK (dni)
FK (town, province) —> locality NNV
NNV (surnames)
NNV (name)
deliveryaddress (
email varchar(50),
street varchar(45),
street2 varchar(45),
postcode varchar(5),
town varchar(4),
province varchar(2))
PK (email)
FK (town, province) —> locality NNV
FK (email) —> user
brand (
brand varchar(15),
company varchar(60),
logo blob )
PK (brand)
article (
cod varchar(7),
name varchar(45),
rrp decimal(7,2),
brand varchar(15),
image blob,
urlimage varchar(100),
specifications text)
PK (cod)
FK (brand) —> brand
camera (
cod varchar(7),
resolution varchar(15),
sensor varchar(45),
type varchar(45),
factor varchar(10),
lens varchar(15),
screen varchar(20),
zoom varchar(40))
PK (cod)
FK (cod) —> article
tv (
cod varchar(7),
panel varchar(45),
screen smallint(6),
resolution varchar(15),
hdreadyfullhd varchar(6),
dtt tinyint(1) )
PK (cod)
FK (cod) —> article
mmemory (
cod varchar(7),
type varchar(30) )
PK (cod)
FK (cod) —> article
lens (
cod varchar(7),
type varchar(15),
frame varchar(15),
focal varchar(10),
aperture varchar(10),
specials varchar(35) )
PK (cod)
FK (cod) —> article
pack (
cod varchar(7) )
PK (cod)
FK (cod) —> article
part_of (
pack varchar(7),
article varchar(7))
PK (pack,article)
FK (article) —> article
FK (pack) —> pack
stock (
article varchar(7),
available int(11),
delivery varchar(20) ( 'Discontinued', 'Shortly', '24 hours', '3/4 days', '1/2 weeks' ) )
PK (article)
FK (article) —> article
basket (
article varchar(7),
user varchar(50),
date datetime )
PK (article,user)
FK (article) —> article
FK (user) —> user
orrder (
numOrder int(11),
user varchar(50),
date datetime )
PK (numOrder)
FK (user) —> user NNV
NNV (date)
linorder (
numOrder int(11),
line int(11),
article varchar(7),
price decimal(9,2),
amount int(11) )
PK (line,numOrder)
FK (article) —> article NNV
FK (numOrder) —> order
NNV (price)
To connect to the MariaDB server from anywhere with our own machine we will have to take into account the following steps:
Download and install a MariaDB /MySQL access client application suitable for your machine's operating system. For Windows we recommend HeidiSQL, DBeaver for Mac, but you can find many others in the market.
Configure the access parameters to the practice server:
Network type: MySQL (TCP/IP)
Hostname/IP: bbdd.dlsi.ua.es
Port: 3306
Username/password: The ones assigned to you by the FBDweb application to access your MariaDB database.
If you try to log in from outside the University you will probably get an access error due to a security check. In that case click here to request access and in less than a minute you should be able to enter. This permission lasts approximately 24 hours.
Backup copies include the creation of tables and the insertion of rows in such a way that you get an exact copy of the database used in FBD practices.
We assume that you have a MariaDB/MySQL server running on localhost, and a client that allows access to it. Normally, the client configuration will be similar to the one shown above, but changing the host to 127.0.0.1, and the user credentials to those set on your local server —root, if a non-admin user has not been specified.
It is important that the database server is configured according to the requirements of the subject, especially in terms of group by (aggregations) behavior. To do this, run on the client connected to your server:
SET @@GLOBAL.sql_mode=CONCAT(@@SQL_MODE,',ONLY_FULL_GROUP_BY,ANSI');
SET @@@SESSION.sql_mode=@@GLOBAL.sql_mode;
The links contain a text file (.sql) with UTF-8 character encoding. Depending on the operating system and the MariaDB server and client, you may have to convert to another character encoding if you want to keep accents and other regional characters - notepad allows you to save as in different encodings.
Download the OS202526.sql, the dump of the Online Store database. You can also download EjemploTodo20190727.sql, the database dump of the Ejemplo database used in the lessons.
Option A
From HeidiSQL, or any other client, connected with a user with permissions on your MariaDB/MySQL (localhost:3306) to create databases and tables.
"File/Execute SQL file...". Or open the file and execute.
Option B
By command line, the mysql executable needs to be able to be invoked from the path where the terminal is opened.
Extract tol.sql from the archive and place it in the same path.
Execute mysql -u xxx -pyyy (xxx is a user with permissions to create databases and tables, password yyy is assumed).
Execute \. ToLtodo2022.sql
Important note: the file is UTF-8 encoded. Depending on the operating system and client used it may be necessary to translate it to another encoding to read correctly the characters of our language. In MS Windows this can be done easily with Notepad.