New answers tagged schema
0
votes
How do I move all tables from one Postgres schema to another
--move all tables from schema 'b' to schema 'a':
select 'ALTER TABLE ' || table_name || ' SET SCHEMA b' from information_schema.tables where table_schema = 'a';
run all altered statements
set ...
2
votes
Accepted
How to implement/architect a SQL database schema which can handle types/tables with many optional properties?
It's a pretty common idea to abstract the database layer, but in doing so you lose a lot of the relational aspect of the database system (which surprise surprise is not a good idea in a Relational ...
3
votes
How to implement/architect a SQL database schema which can handle types/tables with many optional properties?
In general you resist adding so many attributes to the model, and normalize the model. For each attribute ask 1) is it really necessary to add to your data model, and 2) does it really belong as an ...
0
votes
In Postgres 12, how do I set a default schema when logging in using psql?
To formalize the answer given in comments, I logged in as the "postgres" (admin) user and ran
ALTER USER myuser SET SEARCH_PATH = 'my_schema';
1
vote
Multiple tables for many-to-many mappings or one table with multiple columns?
Your list of Pros and Cons need further refinement
Table-per-mapping
This does not need an id column, you can create a primary key across the other two.
Pros
Each row has only three two columns, each ...
0
votes
Opinion on my schema
I don't know what you mean by plan in student table. But you could add a bool or varchar column that can handle the case of actual students or potential students.
Since you connected student table ...
-2
votes
Oracle: Simple way to compare all objects of a schema in two databases?
I found this script on Github which seems to answer your question: oracle_compare_schemas.sql
Top 50 recent answers are included
Related Tags
schema × 1006database-design × 421
mysql × 221
postgresql × 175
sql-server × 164
oracle × 74
permissions × 62
normalization × 36
performance × 30
erd × 30
sql-server-2008 × 27
mongodb × 27
sql-server-2008-r2 × 23
migration × 22
foreign-key × 20
nosql × 20
users × 20
primary-key × 18
table × 18
relational-theory × 18
index × 17
security × 17
best-practices × 17
sql-server-2012 × 16
t-sql × 14