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 - relation "item" does not exist at character 15 what is "15"?
- 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 - database table creation fails using sqlalchemy
- 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
- i want to delete a postgresql user
- postgresql - unable to resolve error in db: create
- postgresql - db, sequelize: when trying to get two data at the same time, there are times when both can be acquired and times wh
- postgresql - please tell me how to store a large amount of data in the db in order node, sequelize, postgrsql
- java - i want to connect postgresql to eclipse
- postgresql - i want to delete a database with a database name created with special characters
- java - cannot get value from postgresql
- postgresql - an error occurs when storing 2*10 9 or more int type data in the db defined by sequelize if it is less than this nu
- postgresql : Cryptographic key management when encrypting a database