Questions tagged [create-table]

The statement that creates a table in SQL (`CREATE TABLE ...`).

The statement that creates a table in SQL (CREATE TABLE ...). Use this tag if your question refers to a problem that might have a relation with an SQL statement that involves a CREATE TABLE statement. Do not use this tag if you have no indication that the CREATE TABLE statement has no relation to the error you are asking about.

1935 questions
0
votes
1 answer

Need clarification on mysql syntax

CREATE TABLE `table1` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `email` varchar(128) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`) ) - CREATE TABLE `table2` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY…
CoR
  • 3,826
  • 5
  • 35
  • 42
0
votes
1 answer

error while creating table in mysql for generating auto serial number

I just want to create the serial number into the table not just for view only for example: table ConfirmationNumber: SerialNo -------------- 00000001 00000002 00000003 and so on (the serial number will be increase each time i execute the…
Sai Kiran
  • 11
  • 2
0
votes
1 answer

PHP-autogenerated MySQL Create Table statement returns error

mysql> CREATE TABLE metadata ( id int, created_by int, modified_by int, deleted_by int, created_at datetime, modified_at datetime, deleted_at datetime, key varchar(45), definition_type varchar(1), metadata_type varchar(1), no_of_decimals…
0
votes
0 answers

How to include spaces in attribute names in sqlite

I am having trouble creating a table in sqlite. In particular, I can't seem to make a table with attributes names that have spaces in them. The following works: create table Store(e varchar, t varchar, v int, s varchar, a int); The follow DOES not…
0
votes
1 answer

How to get Year only in Default Value or Binding

I am using SQL Server Management Studio to create a new table. I have a "HistoryYear" column that has a data type of datetime2. How do I get the year only as the output? Do I change the data type? Or what do I put into the Default Value or Binding…
BillyMadison
  • 93
  • 2
  • 10
0
votes
2 answers

Query failed: ERROR: invalid byte sequence for encoding "UTF8": 0x91

I've been trying to create this table but keep getting the following error Query failed: ERROR: invalid byte sequence for encoding "UTF8": 0x91 The code I've been working with is: CREATE TABLE test ( clientNo CHAR(4) NOT NULL, onDate …
Bosssuperod
  • 1
  • 1
  • 2
0
votes
1 answer

mysql create table help with unique

I'm trying to create a table, and can't figure out how to assign two columns to be unique.. I know how to alter a table thats already created, but how do you do it in the create.. im after a create if not exist col1 TEXT, col2 TEXT, col3 TEXT…
Matt
  • 4,140
  • 9
  • 40
  • 64
0
votes
4 answers

Table name containing special characters '[' and ']'

I want to create table in sql server with using [ ] in the name.it's mean [ ] symbol is a part of table name.how can i do it?i use sql server 2008 r2
0
votes
2 answers

Creating table in Oracle then inserting multiple fors with select

I am using Oracle 11G with Toad 10.6. I am trying to create a table, then insert rows from a select statement that will pull records from 1 primary table (Product - shown below), and several secondary tables (which I did not include) which are…
Mark Justice
  • 35
  • 1
  • 9
0
votes
2 answers

SQL plus two tables select method

This is what I have done in SQL plus. So far I'm very new to this: CREATE TABLE u (); CREATE TABLE a (); Essentially a user can have one or more avatars linked to its email address, but I want to know how I can link the avatars from the second…
Sultan Ahmed
  • 73
  • 1
  • 8
0
votes
0 answers

Can't Create Table in SQL

I'm trying to create a table by executing the script in SP. Portion of Creating Table: SET @SQL = 'CREATE TABLE #TEMPS' + '( ID VARCHAR(100), ' + 'CUR_SUPVR_ID VARCHAR(100), ' + 'CUR_SUPVR_NAME VARCHAR(100), ' + 'CUR_SUPVR_LVL…
Stuart
  • 711
  • 1
  • 11
  • 35
0
votes
1 answer

reference a foreign key to a primary key within the same table

I would like to reference a foreign key to a primary key within the same table, using the query design mode in ms access. This is what I tried to do: CREATE TABLE Employees ( P_Id INTEGER PRIMARY KEY, super_Id INTEGER FOREIGN KEY REFERENCES…
0
votes
1 answer

Import Data to a new table that has a nested table in it

INSERT INTO OrderNew ( SalesOrderID, OrderDate, DueDate, ShipDate, OnlineOrderFlag, CustomerID, CreditCardID, SubTotal, TaxAmt, Freight, TotalDue, OrderInfo.salesorderdetail, OrderInfo.orderqty , OrderInfo.productid,…
Filippos
  • 134
  • 1
  • 10
0
votes
1 answer

MySQL 1064 Error Creating a Linking Table (Many-to-Many)

I'm trying to understand why a parsing error occurred (1064) with the following code. <#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line…
XYZ Rose
  • 53
  • 1
  • 1
  • 8
0
votes
0 answers

Multiple tables not getting created in sqllite3 + iOS

I am developing an iOS application in objective-c and i am using sqllite3 as local DB to hold some data. There are multiple tables that I need to use but it not happening. If I try to create multiple tables in same DB {db path as DB1} then the…
madhavan
  • 115
  • 1
  • 8
1 2 3
99
100