Study repository for Uni Bremen course "Search Technology for Media & Web (Winter Semester 2024/2025)"
-
Open docker container
docker start -ai pa1_container
-
Go to directory where the batch file stored
cd student_workspace
-
Restart MySQL server inside docker (somehow it's needed to resolve some MySQL server error)
service mysql restart
-
Setup local-infile inside MySQL
mysql
-
Run the bash script
./CustomRunLoad.sh
- There is an error in
Bids
table as I misseditemID
column
Items:
ItemID
(Primary Key)Name
Currently
Buy_Price
First_Bid
Number_of_Bids
Location
Country
Started
Ends
Description
ItemCategory:
ItemID
(Foreign Key)Category
(Composite Primary Key withItemID
)
Bids:
ItemID
(Foreign Key)BidderID
(Composite Primary Key withItemID
andTime
)Time
Amount
Bidder:
UserID
(Primary Key)Rating
Location
Country
Seller:
UserID
(Primary Key)Rating
Let's list the non-trivial functional dependencies for each relation:
-
Items:
ItemID → Name, Currently, Buy_Price, First_Bid, Number_of_Bids, Location, Country, Started, Ends, Description
-
ItemCategory:
ItemID, Category → (Item is identified by the combination of ItemID and Category)
-
Bids:
ItemID, BidderID, Time → Amount
-
Bidder:
UserID → Rating, Location, Country
-
Seller:
UserID → Rating
These dependencies capture the relationships and constraints in your data.
Checking if the relations are in BCNF:
- Items: Already in BCNF, as all non-trivial FDs have a superkey as their determinant.
- ItemCategory: In BCNF, as the combination of ItemID and Category forms a composite key.
- Bids: In BCNF, as all non-trivial FDs have a superkey as their determinant.
- Bidder: In BCNF, as all non-trivial FDs have a superkey as their determinant.
- Seller: In BCNF, as all non-trivial FDs have a superkey as their determinant.
There are no multi-valued dependencies for all five columns
-
Items table:
- Contains all essential attributes of an item.
ItemID
as the primary key.
-
ItemCategory table:
- Handles the relationship between items and categories.
- Composite primary key consisting of
ItemID
andCategory
.
-
Bids table:
- Records bid information.
- Composite primary key of
ItemID
,BidderID
, andTime
.
-
Bidder table:
- Details about each bidder.
UserID
as the primary key.
-
Seller table:
- Details about each seller.
UserID
as the primary key.
-
How to use
dos2unix
in Windows https://unix.stackexchange.com/questions/721844/linux-bash-shell-script-error-cannot-execute-required-file-not-found -
Got this error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
- Restart
mysql
inside docker container:service mysql restart
and try to runmysql
again - Example:
- Source: https://forum.hestiacp.com/t/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-run-mysqld-mysqld-sock-2/10239
- Restart
-
MySQL - ERROR: Loading local data is disabled - this must be enabled on both the client and server sides
-
After searching online, I fixed it by these steps:
- set the global variables by using this command:
mysql> SET GLOBAL local_infile=1; Query OK, 0 rows affected (0.00 sec)
- quit current server:
mysql> quit Bye
- connect to the server with local-infile system variable :
mysql --local-infile=1 -u root -p1
-