Query: tables with indexes / introductory keys / correlated data

I am currently working with a MySQL database table structure. I found an excellent table structure on the Internet, but I'm not sure how to duplicate such a thing. I am new to this, and I ask for help in creating a query that will create all tables (that have correlated data (index), foreign keys, many, many relationships, etc.).

Random I was able to make a request to select all fields:

SELECT * FROM schedule INNER JOIN semester ON schedule.semester_id = semester.id INNER JOIN office_hours ON office_hours.schedule_id = schedule.semester_id INNER JOIN faculty ON faculty.id = office_hours.faculty_id INNER JOIN faculty_titles ON faculty_titles.faculty_id = faculty.id INNER JOIN faculty_education ON faculty_education.faculty_id = faculty.id INNER JOIN section ON section.faculty_id = faculty.id INNER JOIN class ON class.id = section.class_id INNER JOIN major_class_br 
+4
source share
1 answer

You will find good documentation on how to create tables in the relevant MySQL documentation:

You can MySQL Workbench if you want to play a little with the GUI. You can download it from the link or install it from the Linux repository.

There are three sections in the workplace: SQL Development, Data Modeling, and Server Administration. Select Create a New EER Model in the Data Modeling section and then Add Chart. You can insert new tables by dragging them from the left pane and applying your model to your database, clicking on the database menu item and then "Forward Engineer ...".

The table structure that you linked in your querstion was also created by MySQL Workbench. Therefore, it will be easy for you to compare it.

+1
source

Source: https://habr.com/ru/post/1444490/


All Articles