A description of the structure of the database - including the structure of the tables, columns, constraints, views, etc, etc... that make up the database.Normally defined in the text, generally SQL in an RDBMS, the schema describes the complete blueprint for the database, defining everything about the database except that data itself.
Questions tagged [database-schema]
2784 questions
0
votes
0 answers
Build correct schema sql in cubejs
I have a Postgres table like this https://dbfiddle.uk/?rdbms=postgres_11&fiddle=b39a248ac9dde6400795e8a236e58d02 and it works as expected. but when i use that sql query into cubejs seem it work to slow or some time can not load .
cube(`State`, {
…
DavidKia
- 1
0
votes
2 answers
SQL: How to alter all varchar column in all tables to nvarchar?
I need to convert all varchar columns in about 40 tables (filled with the data) to nvarchar columns. It is planned to happen in a dedicated MS SQL server used only for the purpose. The result should be moved to Azure SQL.
Where should be the…
pepr
- 18,012
- 11
- 66
- 122
0
votes
1 answer
How can I get full data_type using DESCRIBE TABLE in Spark/Hive SQL?
We can use DESCRIBE TABLE table_name to get the schema of a table in Spark/Hive SQL. However, the data_type column might not return the full type if a data_type is too long. See below for such an example. Is there a way to get the full data types of…
Benjamin Du
- 563
- 6
- 13
0
votes
1 answer
how to retrieve the value from a submitted html form and store it inside the nested document in mongoose schema
Mongoose Schema:
const addressSchema = new Schema({
street: { type: String, trim: true },
state: { type: String, trim: true , match: [/^[a-zA-Z]{2,}/, 'Please Enter State in a Correct Format']},
zip: {type: Number,…
sancodes
- 29
- 7
0
votes
0 answers
One or Two Database Models/Schemas
I am starting a web app and I can’t decide whether to use one or multiple database models. I am using MongoDB. So companies like Amazon and OfferUp have buyers and sellers. If my app is similar would I need two models or can I get away with just…
user15344186
- 3
- 1
0
votes
0 answers
Does this 3NF decomposition have lossless join and is it also in BCNF?
I have this Relation and Functional Dependency:
R = {A, B, C, D, E, G}
FD = E->D
C->B
CBE->AG
B->A
G->E
I tried to normalize using 3NF and got:
After minimizing the FDs, I got E->D, C->B, CE->G, B->A, G->E
So resulting…
Lilith X
- 73
- 6
0
votes
0 answers
How to approach access/visibility control on specific user-generated content for other users in app?
I am really stuck with the current task that I am trying to complete. Pardon me if the format of this question is not helpful as I usually am able to find sufficient resources somewhere online when stuck and haven't asked a question on SO…
kguru
- 1
0
votes
0 answers
Create a Schema from an existing one?
I have two databases:
database A with missing indexes,constraints,foreign keys etc ...
database B with all the missing features
I have loaded the schemas of the two databases in my C# code and after comparing them I added the missing features…
A.HADDAD
- 1,463
- 4
- 19
- 41
0
votes
0 answers
Update AWS Glue schema and Crawler in Terraform
I'm using Terraform to crawl data from an S3 bucket into an AWS Glue database. However, the crawl creates a table that has duplicates as a column name and a partition column name. E.g.:
name
id
date
name (Partition (0))
Is there a way I can update…
J. Patwary
- 181
- 1
- 1
- 8
0
votes
0 answers
TIMESTAMP DEFAULT CURRENT_TIMESTAMP generates NULL instead of a timestamp
I keep on receiving NULL values for the TIMESTAMP columns in my H2 table, but the same issue occurs also for a MySql table. What am I doing wrong ?
Here is my DB Schema:
DROP TABLE IF EXISTS COUNTRY;
CREATE TABLE COUNTRY (
id VARCHAR (50) NOT…
code4fun
- 1
- 3
0
votes
2 answers
MongoDB - Looking up documents based on criteria defined by the documents themselves
Overall, I am trying to find a system design to quickly look up stored objects whose metadata matches data bundled on incoming events. Which fields are required, however, are themselves part of the stored objects, and are not fields that I can…
jason.zissman
- 2,602
- 1
- 16
- 22
0
votes
0 answers
Firebase - Update existing database schema
I have a collection on firebase which I want to modify with a new field. To be more precise,
for existing records, a field called isVideoChallenge should be replaced with a new field challengeType.
Currently, the isVideoChallenge contains a boolean…
Melodias
- 1
- 2
0
votes
1 answer
Can Azure Migrate be used similarly to Flyway for schema migration?
Our team's application is in early development and will be using our application for usage/testing purposes. There'll be changes in our SQL schema that will require dealing with schema migrations.
While I know that Liquidbase and Flyway are good…
Joseph Woolf
- 193
- 1
- 7
0
votes
2 answers
Database Design: Trouble Connecting Ideas
I've hit a bit of a wall ... here is my simplified schema:
TABLE users
id
TABLE assets
id
userid
TABLE presentations
id
userid
At this point, it's easy to create a relationship between USERS -> ASSETS and USERS -> PRESENTATIONS ... but where I…
dcolumbus
- 8,976
- 25
- 91
- 154
0
votes
3 answers
SQL Server metadata: How to get description for columns in views
SQL Server allows storing metadata like description for a table and its columns. The description for the columns can be retrieved from sys.extended_properties. There is also a way to set the description for a view (using the properties window). But…
Kangkan
- 13,787
- 9
- 64
- 107