Skip to main content
2642 votes
28 answers
3.4m views

What's the equivalent to show tables (from MySQL) in PostgreSQL?
flybywire's user avatar
  • 276k
1132 votes
22 answers
2.4m views

What is the best way to get the names of all of the tables in a specific database on SQL Server?
Ray's user avatar
  • 194k
1060 votes
15 answers
730k views

I have a table: table votes ( id, user, email, address, primary key(id), ); How can I make the columns user, email, address unique - i.e., ensure that there isn't any pair of rows ...
Niyaz's user avatar
  • 55k
648 votes
26 answers
904k views

I want to migrate my iPhone app to a new database version. Since I don't have some version saved, I need to check if certain column names exist. This Stackoverflow entry suggests doing the select ...
luebken's user avatar
  • 7,021
621 votes
21 answers
584k views

I'm looking for a way to find the row count for all my tables in PostgreSQL. I know I can do this one table at a time with SELECT COUNT(*) FROM table_name; …but I'd like to see the row count for all ...
mmrobins's user avatar
  • 14k
402 votes
10 answers
418k views

I am looking for the syntax for dumping all data in my mysql database. I don't want any table information.
Lizard's user avatar
  • 45.3k
380 votes
2 answers
322k views

I want to create a table in a SQLite database only if doesn't exist already. Is there any way to do this? I don't want to drop the table if it exists, only create it if it doesn't.
user461112's user avatar
  • 4,211
355 votes
8 answers
969k views

I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do ...
RyanKeeter's user avatar
  • 6,219
336 votes
6 answers
523k views

In a MySQL script you can write: CREATE TABLE IF NOT EXISTS foo ...; ... other stuff ... and then you can run the script many times without re-creating the table. How do you do this in PostgreSQL?
peter2108's user avatar
  • 6,180
322 votes
7 answers
293k views

If I want to save any changes in a table, previously saved in SQL Server Management Studio (no data in table present) I get an error message: Saving changes is not permitted. The changes you have ...
rem's user avatar
  • 17.2k
308 votes
17 answers
730k views

I know the statement: create table xyz_new as select * from xyz; Which copies the structure and the data, but what if I just want the structure?
Andrew's user avatar
  • 13.3k
308 votes
34 answers
688k views

I changed the datadir of a MySQL installation and all the bases moved correctly except for one. I can connect and USE the database. SHOW TABLES also returns me all the tables correctly, and the files ...
johnsmith's user avatar
  • 3,149
249 votes
18 answers
352k views

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.9k
236 votes
14 answers
317k views

I regularly need to delete all the data from my PostgreSQL database before a rebuild. How would I do this directly in SQL? At the moment I've managed to come up with a SQL statement that returns all ...
Sig's user avatar
  • 5,188
234 votes
15 answers
293k views

How do I dump the data, and only the data, not the schema, of some SQLite3 tables of a database (not all the tables)? The dump should be in SQL format, as it should be easily re-entered into the ...

15 30 50 per page
1
2 3 4 5
21