New answers tagged constraint
0
Constraints will basically allow you to enforce data integrity - limiting the values that may be inserted into a column and there by enforcing business rules. The database engine (SQL Server) will automatically enforce integrity of a database based on the constraints defined
e.g. NOT NULL, CHECK constraints, UNIQUE constraints, PRIMARY KEY constraints, ...
1
Whenever you dump a mysql table that has an AUTO_INCREMENT column, the next value is always attached to the definition of the table. You should see something like:
) ENGINE=InnoDB AUTO_INCREMENT=<some-number> ...
You may want to consider one of three(3) things
SUGGESTION #1 : mysqldump the database with table structure
imac2011:Desktop allendar$ ...
2
From a design perspective, why would the Student_Education table be needed at all?
The information that a specific student follows a certain type of education is implied by the existence of the corresponding row in the <type>Education table.
If Student_Education's reason for being is for SQL joins, it could be a view returning the union of all the ...
0
Why not place the data that is relevant to the Student_education connection into that table ? Is there vast difference in the data being kept for each education type ? I'd think it would be mostly the same.
Won't the following model work ?
CREATE TABLE Education_Types
(
id integer primary key,
name varchar(20),
details varchar(30)
...
1
Another approach is to adopt the position that it is the transfer of the financial amount that comprises a single record.
Thus you might have the structure:
create table ... (
id integer,
debit_account_id not null REFERENCES accounts (account_id),
credit_account_id not null REFERENCES accounts (account_id),
amount numeric ...
3
Assuming the following table definition
CREATE TABLE T
(
Name VARCHAR(50) NOT NULL,
IsDeleted BIT NOT NULL
)
Then you can achieve this with a unique index filtered to only include those Names that you wish to apply the constraint on.
CREATE UNIQUE INDEX ix ON T(Name) WHERE IsDeleted = 'false'
Top 50 recent answers are included

