I created a program that uses SQL (database).
When trying to normalize the relation schema after completion,
It will be different from the finished one, but if it is different,
It will be difficult to manage, so under what conditions I created the relation schema
I want to know.
A (employee number, name, department number, department name, password,working hours number, attendance time, work hours)
* Bold is the primary key
A (Employee number, name, department number, password)
B (department number, department name)
C (working hours number, employee number, attendance time, leave time)
Employee number The same number does not exist.
Name The employee does not have the same name and department number.
Department number Employees with the same department number have the same department name.
Password The same password may exist multiple times.
Working hours number The same number does not exist.
Working hours There may be multiple employees with the same time.
Work hours There may be multiple employees with the same time.
A (Employee number, name, department number, department name, working hours number)
B (department number, department name)
C (working hours number, attendance hours)
D (working hours number, work hours)
I wanted to create a time clock to manage working hours.
A working time number is required to identify, delete or update commands.
In the schema of the created program, A and C are combined with employee numbers, so employee numbers are necessary for both, but if you disassemble them, attendance/retirement hours and employee numbers will not be combined.
Answer # 1
Attempting to normalize the relation schema
Is it done with tools or something?
I'm not sure, but it's because you are using a surrogate key called "working hours number".
Do you use natural keys?
C (employee number,attempt time, leave time)
How about making working hours numbers subordinate to employee numbers?
C (employee number,working hours number, attendance time, leaving time)
Answer # 2
employee master: employee number, name, department number (PRIMARY KEY employee number)How about
Department Master: Department Number, Department Name (PRIMARY KEY Department Number)
Attendance table: employee number, attendance date, attendance date (PRIMARY KEY employee number, attendance date)
- postgresql - database table creation fails using sqlalchemy
- Detailed PHP connection and operation of PostgreSQL database
- Tutorial for Initializing PostgreSQL Database Manually under Windows
- Cross-database access solution in PostgreSQL database
- Methods and steps to create a Postgresql database under Linux
- Java sample code to connect postgresql database
- Detailed steps to install Postgresql database in Ubuntu
- C # sample code for operating the PostgreSQL database
- Analysis of the method to connect to the postgresql database in Python
- AbpNHibernate method to connect PostgreSQl database
- PHP implementation to retrieve data from PostgreSQL database pagination display and find data based on conditions example
- Analysis of PostgreSQL database transaction implementation methods
- Java using JDBC to connect postgresql database example
- Syntax and use of window functions in PostgreSQL database
- postgresql - i want to delete a database with a database name created with special characters
- Database backup (postgresql, mysql) example code in docker environment
- SQL script function to write postgresql database to achieve parsing
- Python two database postgresql comparison
- 503 error occurs when querying database table of hergre postgresql several times
- ruby - cannot create postgresql database
- ruby - "fe_sendauth: no password supplied" occurs in development environment
- postgresql - unable to resolve error in db: create
- i want to delete a postgresql user
- postgresql - simultaneous display of the count number and its original column
- python - cannot create table with foreignkey in sqlalchemy
- postgresql - [heroku] we're sorry, but something went wrong
- python - is it possible to have relations for multiple tables
- ruby - columns other than the one you want to update are validated and the columns cannot be updated
- postgresql - an error occurred in rails db: migrate [argumenterror: wrong number of arguments (given 1, expected 0)]