Questions tagged [table]

A data structure that organizes information into rows and columns.

Tables are used to organize data into a structured format defined by a fixed number of columns, and an unlimited number of rows. This allows a specific value to be retrieved for an individual column/row cell. In addition to storing data, a table can have associated metadata which may constrain/restrict the data it contains.

To CREATE a table, use the CREATE TABLE command,

To ALTER a table, use the ALTER TABLE command,

To delete or DROP a table, use the DROP TABLE command,

See: Table (database)

541 questions
8
votes
5 answers

How to retrieve closest value based on look-up table?

I'm attempting to create a query that will find the closest value from one table and return its ID into the resulting table. Below is an example that should describe the situation better. Sample Data These two tables will exist in the SQL…
pjbollinger
  • 81
  • 1
  • 1
  • 3
2
votes
2 answers

Table Transformation with SQL?

I got a set of tables which have been imported into a database by transforming them like shown in the following picture: Now it is necessary to get the former tables back. Unfortunately the guy who did the importing finished school and is thus is…
mikkael
  • 21
  • 2
1
vote
1 answer

Methods for identifying differences in accumulating history table?

This question will probably be elementary to most DBAs. I'm doing light DB work which isn't my specialty and I'd like to create some kind of "change log" for a table that is copy/appended to a history table each morning. The table is being created…
1
vote
0 answers

In Interactive SQL 12.0.1, How do I declare a temporary table and then run a compound statement in a single SQL Statement?

I am trying to load a csv file into a temporary table and then run a compound SQL Statement on that table. I can get the DECLARE LOCAL TEMPORARY TABLE ... INPUT INTO ... FROM [filename] to work on its own, but trying to run a compound statement…
aquasheep
  • 11
  • 2
1
vote
1 answer

How do I remove the excess white space from the values in my SQL table?

still kinda new to SQL. My problem is this, say I created a table with one of its columns at nchar(200). This column contains the value 'Logged in.'. Every time I called it from the front-end, it returns 'Logged in …
Chris
  • 13
  • 3
0
votes
1 answer

Recommendations for how I should create my table based on data given?

I'm asking this as I'm kinda overwhelmed by the data presented to me (I'm still fairly new in programming and SQL). Basically I need to create a database to store warehouse equipment information, and of course to make it as simple as possible when…
Dex
  • 1
0
votes
0 answers

Storing nationality options

We have a table for countries, using ISO 3166-1 standard, also languages, using ISO 639-1. Now we need a table for nationalities, but I can't find a standard for abbreviating or indexing them. Country and nationality does not always relate, i.e.…
arnaslu
  • 141
  • 4
0
votes
1 answer

SQL Summing a column value based conditional on another table's value

I'm working on a SQL query that returns a SUM of a value in a column/table based off a related value in another table's column being met. I'm getting an error: The multi-part identifier "Charges.JR_LocalSEllAmt" could not be bound. The multi-part…
user212215