FAQ Database Discussion Community


Firebird: Adding Index in Create Table Statement

indexing,firebird,create-table
I've serach the many websites about firebird, but couldn't find an answer to my question. I'm using ado .net for creating a table in firebird. And I want to create an index for one of the fields while creating the table: Fbsql = "CREATE TABLE TEST( " + "TEST_ID Integer...

Database CREATE TABLE for 2 similar tables

mysql,database,mysql-workbench,create-table
I have the following information in 2 *.CSV files. There are many more rows but I have included a small set here as an example. file_id descrip Date file_heat_value_1 1 ABC 2015-02-11 1.02500 1 ABC 2014-11-19 0.85500 1 ABC 2014-05-22 17.20 2 DEF 2014-08-20 1.3700 2 DEF 2014-05-21 15.5500 2...

Create Table - Time Statement

sql,datetime,ms-access,ddl,create-table
I am having trouble trying to create a table using MS Access. I know for sure my problem lies in the "datetime" field but I can not figure what I am missing or doing wrong. When I click "run" I get the "Syntax Error in Field Definition" Create Table Appointments...

Databse migration throws error while seeding two timestamp columns laravel 5

php,mysql,laravel-5,create-table,laravel-migrations
I extended the default migration to include some additional table fields for my user table. I wanted to have created_at and updated_at fields with timestamps as values. Here is my code <?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateUsersTable extends Migration { /** * Run the migrations. * * @return void...

Getting an ORA - 00907 error on the following at ON UPDATE

database,oracle,constraints,create-table
When implementing my oracle database I receive an ORA-00907 error on line 8 at ON UPDATE. Its complaining about right parenthesis but I don't see this error anywhere. whats my issue? CREATE TABLE Result ( Rid number, Hid number, Jid number, Jweight number(5), Place number(3), CONSTRAINT Result_PK PRIMARY KEY(Rid, Hid,...

MySQL: How to create table with auto incrementing column via script

mysql,auto-increment,create-table
I am new to MySQL and hope someone can help me with this. I want to create a simple table with two special settings: a two-column primary key including the columns "de" and "location" an auto incrementing column "tID" that generates a unique ID, starting with 1 I tried the...

Creating Table in Oracle, SQL

sql,oracle,oracle11g,sqldatatypes,create-table
ORA-00907: missing right parenthesis I can't figure out what is going wrong with my dataypes and/or commas. Any help would be awesome. Thank you! CREATE TABLE RIDERS (RIDER_ID VARCHAR2(4) CONSTRAINT RIDERS_RIDER_ID_PK PRIMARY KEY, FIRSTRIDER VARCHAR2(20) CONSTRAINT RIDERS_FIRSTRIDER_NN NOT NULL, LASTRIDER VARCHAR2(20) CONSTRAINT RIDERS_LASTRIDER_NN NOT NULL, ADDRESS VARCHAR2(25), CITY VARCHAR2(15), STATE...

How to specify input format in SQL create table?

sql,sql-server,create-table
I'm new in SQL and I need to create table with specified field format. How to add CHECK condition that will assure that input will be formatted e.g. [LLLDD] where L is a letter and D is a digit?...

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

mysql,sql,mysql-error-1064,create-table
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 3> CREATE TABLE Party_Library ( Party...

how to copy a table without importing data and constraints in Oracle?

import,oracle11g,create-table
I want to create a new table called table2 from another table called table1 without importing data and constraints. I used this query: create table2 as select * from table1 where 1=2; this code created table2 without any data, but imports constraints from table1. Is there a way not to...