Questions tagged [database-schema]

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.

2931 questions
1358
votes
18 answers

How can I list the tables in a SQLite database file that was opened with ATTACH?

What SQL can be used to list the tables, and the rows within those tables in an SQLite database file – once I have attached it with the ATTACH command on the sqlite3 command line tool?
izb
  • 50,101
  • 39
  • 117
  • 168
1032
votes
19 answers

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
  • 108,152
  • 195
  • 629
  • 1,012
595
votes
14 answers

How to see indexes for a database or table in MySQL?

How do I see if my database has any indexes on it? How about for a specific table?
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
495
votes
8 answers

Is there an SQLite equivalent to MySQL's DESCRIBE [table]?

I'm just getting started learning SQLite. It would be nice to be able to see the details for a table, like MySQL's DESCRIBE [table]. PRAGMA table_info [table] isn't good enough, as it only has basic information (for example, it doesn't show if a…
Matthew
  • 28,056
  • 26
  • 104
  • 170
443
votes
5 answers

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
  • 43,965
  • 20
  • 101
  • 140
380
votes
10 answers

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 essentially the same thing in MySQL, which leads me to…
Lloyd Banks
  • 35,740
  • 58
  • 156
  • 248
365
votes
4 answers

What are OLTP and OLAP. What is the difference between them?

Actually what do they mean? All articles I find about them don't give me an idea, or my knowledge is too insufficient to understand it. Will some one give me some resources with which I can learn this from scratch.
Amarnath R Shenoy
  • 5,121
  • 8
  • 24
  • 32
248
votes
12 answers

How to get all columns' names for all the tables in MySQL?

Is there a fast way of getting all column names from all tables in MySQL, without having to list all the tables?
dieter
  • 2,551
  • 3
  • 17
  • 6
232
votes
11 answers

How can I initialize a MySQL database with schema in a Docker container?

I am trying to create a container with a MySQL database and add a schema to these database. My current Dockerfile is: FROM mysql MAINTAINER (me) # Copy the database schema to the /data directory COPY files/epcis_schema.sql…
Marcus Gomes
  • 2,534
  • 2
  • 13
  • 15
223
votes
9 answers

Is it possible to specify the schema when connecting to postgres with JDBC?

Is it possible? Can i specify it on the connection URL? How to do that?
marcosbeirigo
  • 11,098
  • 6
  • 39
  • 57
210
votes
6 answers

schema builder laravel migrations unique on two columns

How can I set a unique constraints on two columns? class MyModel extends Migration { public function up() { Schema::create('storage_trackers', function(Blueprint $table) { $table->increments('id'); $table->string('mytext'); …
user391986
  • 29,536
  • 39
  • 126
  • 205
209
votes
5 answers

Difference between database and schema

What's the difference between a Database and a Schema in SQL Server? Both are the containers of tables and data. If a Schema is deleted, then are all the tables contained in that schema also deleted automatically or are they deleted when the…
sqlchild
  • 8,754
  • 28
  • 105
  • 167
197
votes
7 answers

How to store arrays in MySQL?

I have two tables in MySQL. Table Person has the following columns: id name fruits The fruits column may hold null or an array of strings like ('apple', 'orange', 'banana'), or ('strawberry'), etc. The second table is Table Fruit and has the…
tonga
  • 11,749
  • 25
  • 75
  • 96
173
votes
4 answers

How to design a product table for many kinds of product where each product has many parameters

I do not have much experience in table design. My goal is to create one or more product tables that meet the requirements below: Support many kinds of products (TV, Phone, PC, ...). Each kind of product has a different set of parameters,…
StoneHeart
  • 15,790
  • 32
  • 67
  • 84
157
votes
10 answers

How to fix Error: "Could not find schema information for the attribute/element" by creating schema

I have a windows forms application written in VS2010 with C# and get the following errors in the app.config file: Message 4 Could not find schema information for the attribute 'name' Message 8 Could not find schema information for the attribute…
Brian McCarthy
  • 4,658
  • 16
  • 49
  • 66
1
2 3
99 100