relational-database

ER/Relational Table to Database

不羁的心 提交于 2019-12-13 09:45:28
问题 So I have the following SQL commands for the description below. I am not sure I have the constraints right especially for the foreign keys, and when to use not null and when not too. Can someone verify if the commands are correct, based on the database description? Car Dealerships have a unique business id number, dealership name, city, state, and a unique website URL. The business id is a number in the range from 1000-9999. Salespersons have a first name, last name, age, gender, and a unique

Normal forms: 4 vs 5

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 09:38:01
问题 I am struggling to understand 4NF, 5NF, and their difference. Here is the way I would describe 4/5NF (or, how I would describe the steps to achieve it) to someone who doesn't know. I am stating this because this will show what I have really understood. Typically, a N:N entity relationship should be implemented by having a join table for their possible combinations. If there are 3 or more entities connected with N:N relationships, one should consider carefully: The more general(including)

How to join section table with ERDigram

本秂侑毒 提交于 2019-12-13 08:08:29
问题 Problem Which is correct when join section table with class table OR with course table OR with instructor Table . Details section is group of student classified to ( aa,bb,cc )can take one course or more courses. section can teach in one or more class(lab or class room) . Instructor can teach to more sections and section can have more instructor raltion is many to many and made in third table Inst_Course My ER diagram as following : section table join Database Schema as following : CREATE

“All Entries In Group” Database Design Aproach

安稳与你 提交于 2019-12-13 07:11:46
问题 Due to the Nature of the Question , searching for similar questions or articles is quite difficult because keywords have a wide range of meaning. So if there is a similar question, pardon me. The Problem . (Simplified) I have a table of users. ( Table User ) Each user Has his own assets (Table Asset Foreign key to user Id) 2 Users can be cooperators. Each user selects the assets he wants to share with the other. For use in this cooperation a Shared Group Is created containing the assets of

Canonical cover is in which normal form?

依然范特西╮ 提交于 2019-12-13 07:00:04
问题 I want to know which normal form a canonical cover is in. I know before doing normalization we find the canonical cover so I think it is in first normal form. But it may be in no normal form as the definition of 1NF by Wikipedia is no row should have a duplicate: First normal form enforces below criteria: Eliminate repeating groups in individual tables. Create a separate table for each set of related data. Identify each set of related data with a primary key 回答1: Normal forms apply to

Duplications of a relational table

二次信任 提交于 2019-12-13 06:59:59
问题 After this question, I think I will go for Entity-relationship modelling to solve the issue of my image table that serves many other tables. But now I have another bigger problem as there are groups/ categories in each uploaded/ inserted image, page, user, etc. The reason I have these category tables is to allow an admin to change the category name and add more categories in whenever is need. I use category tables to categorise each of them, for instance, categories for image, category_id

Database schema pattern for grouping records

和自甴很熟 提交于 2019-12-13 06:27:45
问题 I'm looking for a design pattern to manage records in a relational database which belong together, e.g. grouping multiple contacts. The group itself does not need to be an entity. A group should have an unlimited count of members. It should be possible to run a query to get other group members of a given record. My idea is to manage it in one table: GROUPINGS integer group integer member_id primary_key (group, member_id) foreign_key (member_id) EDIT: Beware that group is not a foreign key. It

IS_A relationship primary key validation rules

大兔子大兔子 提交于 2019-12-13 06:17:14
问题 So I am building a database for a police station in access. I have a reports super-class that is divided into several sub-classes.From what my books tell me the supper-class should be the one with the "ID" that is the primary key and that the ID should be passed onto the sub classes so that there are no 2 sub-classes with the same ID .How do I make a validation rule that doesn't allow to make a new sub-clas report if that ID doesn't exists or is being used by other sub classes 回答1: There is

Table design about sets of data collection elements

穿精又带淫゛_ 提交于 2019-12-13 04:28:58
问题 Let me know if you need additional information as this is my first post to the forums. The design is for clinical studies. Easiest way to explain would be to give an example to a scenario which applies to all studies/protocols in some shape or form. Say I have: Study1, Study2, Study3 Study1 has Protocol1, Protocol2, Protocol3 Each protocol has "data collection" (set of forms, questions and sample collections, which can overlap across studies and/or protocols) All these data collections are

sqlite database architecture - referencing multiple rows

佐手、 提交于 2019-12-13 04:23:48
问题 I have a table materials which contains (I'm using web2py): materials_db.define_table('materials', Field('name','string'), Field('reference','string'), Field('manufacturer','string'), Field('date_added','date'), Field('density','double'), # Density - kg/m³ Field('emissivity','double'), Field('specific_heat','double'), # Specific Heat - kJ/kg.K Field('thermal_conductivity','double') # Thermal conductivity - W/m.K ) I now would like to create a table constructions . Each construction is an