Skip to main content

Questions tagged [schema]

Schema means shape, or more generally, plan. It may be XML schema or Database schema.

Filter by
Sorted by
Tagged with
1053 votes
20 answers
758k views

How can I rollback a specific migration?

I have the migration file db\migrate\20100905201547_create_blocks.rb. How can I specifically rollback that migration file?
AnApprentice's user avatar
670 votes
3 answers
367k views

Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL?

What are the differences between PRIMARY, UNIQUE, INDEX and FULLTEXT when creating MySQL tables? How would I use them?
user avatar
467 votes
31 answers
1.2m views

SQL statement to get column type

Is there a SQL statement that can return the type of a column in a table?
daniely's user avatar
  • 7,633
467 votes
5 answers
652k views

How do I show the schema of a table in a MySQL database?

From the MySQL console, what command displays the schema of any given table?
dlamblin's user avatar
  • 44.9k
387 votes
10 answers
277k views

Difference Between Schema / Database in MySQL

Is there a difference between a schema and a database in MySQL? In SQL Server, a database is a higher level container in relation to a schema. I read that Create Schema and Create Database do ...
Lloyd Banks's user avatar
  • 36.2k
360 votes
16 answers
295k views

Difference between a user and a schema in Oracle?

What is the difference between a user and a schema in Oracle?
sengs's user avatar
  • 6,717
311 votes
2 answers
209k views

How do I move a table into a schema in T-SQL

I want to move a table into a specific Schema using T-SQL? I am using SQL Server 2008.
Lukasz's user avatar
  • 8,810
308 votes
5 answers
114k views

Version of SQLite used in Android

What version of SQLite is used in Android? I'm wondering how to handle schema migrations. The newer SQLite versions support an ALTER TABLE SQL command which save me from having to copy data, drop the ...
Eno's user avatar
  • 10.8k
274 votes
14 answers
303k views

XML Schema (XSD) validation tool? [closed]

At the office we are currently writing an application that will generate XML files against a schema that we were given. We have the schema in an .XSD file. Are there tool or libraries that we can ...
Jason Dagit's user avatar
  • 13.8k
255 votes
12 answers
441k views

Change Schema Name Of Table In SQL

I want to change schema name of table Employees in Database. In the current table Employees database schema name is dbo I want to change it to exe. How can I do it ? Example: FROM dbo.Employees ...
theChampion's user avatar
  • 4,397
250 votes
11 answers
21k views

First-time database design: am I overengineering? [closed]

Background I'm a first year CS student and I work part time for my dad's small business. I don't have any experience in real world application development. I have written scripts in Python, some ...
bob esponja's user avatar
  • 4,131
241 votes
4 answers
291k views

What does GRANT USAGE ON SCHEMA do exactly?

I'm trying to create a Postgres database for the first time. I assigned basic read-only permissions to the DB role that must access the database from my PHP scripts, and I have a curiosity: If I ...
Marco Sulla's user avatar
  • 15.7k
235 votes
18 answers
324k views

What is the difference between a schema and a table and a database?

This is probably a n00blike (or worse) question. But I've always viewed a schema as a table definition in a database. This is wrong or not entirely correct. I don't remember much from my database ...
anbanm's user avatar
  • 13.7k
205 votes
11 answers
227k views

What is difference between XML Schema and DTD?

I have googled this question, but I do not understand clearly what is an XML schema and DTD (document type definition), and why the XML schema is more powerful compared to DTD. Any guidance would be ...
Rachel's user avatar
  • 102k
201 votes
12 answers
129k views

What good are SQL Server schemas?

I'm no beginner to using SQL databases, and in particular SQL Server. However, I've been primarily a SQL 2000 guy and I've always been confused by schemas in 2005+. Yes, I know the basic definition ...
Erik Funkenbusch's user avatar
185 votes
11 answers
386k views

PostgreSQL: Export the schema of a database

My computer broke down but fortunately I backed up the folder C:\Program Files\PostgreSQL. Now I'm working in a new computer and I would like to import the previous Postgres databases that are ...
programmer's user avatar
  • 4,721
178 votes
6 answers
436k views

How to define object in array in Mongoose schema correctly with 2d geo index

I'm currently having problems in creating a schema for the document below. The response from the server always returns the "trk" field values as [Object]. Somehow I have no idea how this should work, ...
niels_h's user avatar
  • 1,989
154 votes
10 answers
206k views

Any tools to generate an XSD schema from an XML instance document? [closed]

I am looking for a tool which will take an XML instance document and output a corresponding XSD schema. I certainly recognize that the generated XSD schema will be limited when compared to creating a ...
Matt Dillard's user avatar
  • 14.8k
153 votes
20 answers
138k views

Good tool to visualise database schema? [closed]

Are there any good tools for visualising a pre-existing database schema? I'm using MySQL if it matters. I'm currently using MySQL Workbench to process an SQL create script dump, but it's clunky, slow ...
Mat's user avatar
  • 85.2k
140 votes
2 answers
131k views

What's the difference between a catalog and a schema in a relational database?

I used to think schema were the "upper wrapper" object before the database itself. I mean DB.schema.<what_ever_object_name_under_schema>. Well, the catalog "wrapper" is now quite confusing. Why ...
Stephan's user avatar
  • 42.6k
138 votes
16 answers
103k views

How do you version your database schema? [closed]

How do you prepare your SQL deltas? do you manually save each schema-changing SQL to a delta folder, or do you have some kind of an automated diffing process? I am interested in conventions for ...
Eran Galperin's user avatar
132 votes
7 answers
122k views

How do I query if a database schema exists

As part of our build process we run a database update script as we deploy code to 4 different environments. Further, since the same query will get added to until we drop a release into production it ...
Pulsehead's user avatar
  • 5,130
127 votes
15 answers
174k views

Get GraphQL whole schema query

I want to get the schema from the server. I can get all entities with the types but I'm unable to get the properties. Getting all types: query { __schema { queryType { fields { ...
Aleksandrenko's user avatar
124 votes
11 answers
239k views

How do I change db schema to dbo

I imported a bunch of tables from an old sql server (2000) to my 2008 database. All the imported tables are prefixed with my username, for example: jonathan.MovieData. In the table properties it ...
jonathan hall's user avatar
120 votes
11 answers
240k views

How to create an empty DataFrame with a specified schema?

I want to create on DataFrame with a specified schema in Scala. I have tried to use JSON read (I mean reading empty file) but I don't think that's the best practice.
user1735076's user avatar
  • 3,285
118 votes
9 answers
200k views

Which SchemaType in Mongoose is best for a timestamp?

I'm using Mongoose, MongoDB, and Node.js. I would like to define a schema where one of its fields is a date\timestamp. I would like to use this field in order to return all of the records that have ...
Liatz's user avatar
  • 5,147
112 votes
7 answers
122k views

Yup schema validation password and confirmPassword doesn't work

import * as Yup from 'yup'; import User from '../models/User'; class UserController { async store(req, res) { const schema = Yup.object().shape({ name: Yup.string().required(), email: Yup.string()...
Player Josu's user avatar
  • 1,233
110 votes
3 answers
34k views

MongoDB Schema Design - Many small documents or fewer large documents?

Background I'm prototyping a conversion from our RDBMS database to MongoDB. While denormalizing, it seems as if I have two choices, one which leads to many (millions) of smaller documents or one which ...
Andre's user avatar
  • 1,631
104 votes
6 answers
63k views

YAML Schema Validation?

Is there a schema validation language for YAML? I've googled but couldn't find anything useful. Something like XSD format, using the language itself to describe the schema, would be the best choice ...
Klaim's user avatar
  • 68.7k
96 votes
3 answers
136k views

PostgreSQL: Create schema in specific database

I need to write an sql script that creates both a new database AND a new schema in the database I just created. How can I do it? Can I somehow change the current database to the new one? Or can I ...
Axel Fontaine's user avatar
94 votes
5 answers
300k views

How to create a new schema/new user in Oracle Database 11g?

I have applied for an internship in a company and as a question they have asked me to create a schema for their company with certain requirements and mail them the DDL file. I have installed Oracle ...
acoder's user avatar
  • 1,075
94 votes
9 answers
135k views

How can I tell jaxb / Maven to generate multiple schema packages?

Example: </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> &...
M.R.'s user avatar
  • 1,969
83 votes
6 answers
84k views

targetNamespace and xmlns without prefix, what is the difference?

In an xml schema document, if I have both the targetNamespace and the xmlns without a prefix. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example....
Abe's user avatar
  • 8,931
81 votes
8 answers
211k views

set default schema for a sql query

Is there a way to set the schema for a query so that in the rest of the query I can refer to tables just by their name without prepending them with a schema name? For instance, I would like to do ...
CatDadCode's user avatar
  • 58.8k
79 votes
10 answers
23k views

What are XML namespaces for?

This is something that I always find a bit hard to explain to others: Why do XML namespaces exist? When should we use them and when should we not? What are the common pitfalls when working with ...
Doron Yaacoby's user avatar
73 votes
4 answers
143k views

unable to marshal type as an element because it is missing an @XmlRootElement annotation for auto generated classes

I need to validate Class object against my schema in which I have provided regular expression to validate fields for auto generated JAXB classes. When I try to validate my class object I get below ...
user656213's user avatar
  • 1,053
71 votes
2 answers
69k views

How does the search_path influence identifier resolution and the "current schema"

Is it possible to define in which schema new tables get created by default? (Referred by "unqualified table names".) I've seen some details about using the "search path" in Postgres, but I think it ...
thyandrecardoso's user avatar
71 votes
1 answer
57k views

Does rake db:schema:dump recreate schema.rb from migrations or the database itself?

Does rake db:schema:dump recreate schema.rb from migrations or the database itself?
pingu's user avatar
  • 8,777
70 votes
10 answers
41k views

XML Attributes vs Elements [duplicate]

When should you use XML attributes and when should you use XML elements? e.g. <customData> <records> <record name="foo" description="bar" /> </records> </...
user23726's user avatar
  • 717
67 votes
8 answers
121k views

Seed multiple rows at once laravel 5

I'm currently trying to seed my users table. If I try it like this with 2 rows, it fails. It works fine if I just use a single array instead of the 2 arrays inside the $users array to create some fake ...
Stephan-v's user avatar
  • 20k
65 votes
6 answers
48k views

add_column for references (Rails)

I have the following Rails migration which works perfectly (irrelevant pieces removed): create_table :comments do |t| t.text :body t.references :post end Now I'd like to add an author column to ...
Dan Rosenstark's user avatar
65 votes
6 answers
33k views

Load a structure.sql into a rails database via rake

rake db:schema:load will load a schema.rb file into a rails database. Is there a way to load a structure.sql file into the database through rake or do I just need to do this manually?
locoboy's user avatar
  • 38.6k
64 votes
13 answers
46k views

Log4Net "Could not find schema information" messages

I decided to use log4net as a logger for a new webservice project. Everything is working fine, but I get a lot of messages like the one below, for every log4net tag I am using in my web.config: ...
xsl's user avatar
  • 17.3k
63 votes
1 answer
30k views

Why psql can't find relation name for existing table?

Here' my current state. Eonil=# \d+ List of relations Schema | Name | Type | Owner | Size | Description --------+------------+-------+-------+------------+-------...
eonil's user avatar
  • 85.2k
63 votes
2 answers
94k views

What does the ref attribute on an element in an XSD do?

Documentation seems to say that it references another element in the schema, but how could it be used - I've never seen it in schemas that I have worked with. Anyone got any nice use cases or ...
Fiona - myaccessible.website's user avatar
61 votes
8 answers
67k views

Rename SQL Server Schema

How can I rename a schema using SQL Server?
user avatar
60 votes
1 answer
22k views

PostgreSQL's schemas for multi-tenant applications

I'm learning about multi-tenant applications and how PostgreSQL's schemas can be used for this. Researching the subject, I ended up finding an article in which the author describes a poor experience ...
viniciussss's user avatar
  • 4,554
60 votes
2 answers
115k views

Json Schema example for oneOf objects

I am trying to figure out how oneOf works by building a schema which validates two different object types. For example a person (firstname, lastname, sport) and vehicles (type, cost). Here are some ...
Stanimirovv's user avatar
  • 3,114
60 votes
5 answers
110k views

Possible to set default schema from connection string?

With SQL Server 2005 and 2008 is it possible to set the default schema from the connection string? It'd be a lot easier if we didn't have to manually set the schema with SQL code.
Earlz's user avatar
  • 63.2k
59 votes
4 answers
47k views

Query to show all tables and their collation

Is there a query that can be run in mysql that shows all tables and their default collation? Even better if there was on that could show all collations on all columns of all tables.
Parris Varney's user avatar

1
2 3 4 5
153