Questions tagged [ddl]

Data Definition Language is a subset of SQL to manipulate structural elements of a database, not the content of tables. CREATE, DROP, ALTER and related statements.

Data Definition Language is a subset of SQL to manipulate structural elements of a database, not the content of tables. CREATE, DROP, ALTER and related statements. It is often restricted to database users with administrative privileges.

Related tags

2245 questions
0
votes
1 answer

Can not execute the following query because of the '-' in mysql?

ALTER TABLE hotel_availability CHANGE idhotel-availability idhotel_availability INT; Need to execute above query but it can not execute because of "-" symbol?how can i fixed it? err: ERROR 1064 (42000): You have an error in your SQL syntax;…
0
votes
0 answers

How can I use subquery in DDL? Question related to Oracle SQL Developer

I want to know, is it possible and if it possible, then I need a few examples about. In which statement I can do this operation? I know about subquery in Create statement, but I have no information about Drop, Alter and Truncate. Please help me…
Tgy
  • 5
  • 6
0
votes
2 answers

Inserting To Table With Auto Increment MYSQL

Let's say I have created the following dimension table: create table schema1.DOMAIN ( ID INT AUTO_INCREMENT PRIMARY KEY NOT NULL, DOMAIN_NAME VARCHAR(10) ); And I have a table of logs with records where DOMAIN_NAME is a column. My goal…
ben890
  • 1,097
  • 5
  • 25
  • 56
0
votes
1 answer

Will a SQL view filtered by large datetime always provide current data?

If I create a view today for a table that continuously keeps getting data, using date filtering from 1900 and 2100, for example, will that "copy" become truncated to the moment that I build the view or since it is being filtered to a very large date…
Eunito
  • 416
  • 5
  • 22
0
votes
1 answer

MySQL Set default field value concat with record id

I have MySQL table with the following structure: ------------- | id | name | ------------- Where ID is int auto_increment and name is just varchar(255). So I need to set using database default value for the name (if it's empty after insert…
xercool
  • 883
  • 1
  • 8
  • 24
0
votes
1 answer

How to change the data type of column in oracle

I have a master table.It contains 1300000 records.I want to change a column type from VARCHAR(100 CHAR) to VARCHAR2(300 CHAR). I planned a way to do this. I will create a new column with a new name then I will copy data from old column to new…
hagi10
  • 23
  • 7
0
votes
1 answer

Delegate Translator Chaining

I am trying to delegate a translator by chaining in the VDB.xml but getting an error after making a call. The delegate translator suppose intercept calls to the actual delegate translator underneath and performs a calculation. Calculation is driven…
ASAFDAR
  • 19
  • 1
  • 7
0
votes
2 answers

Oracle- creating dynamic function for deleting tables based on cursor

I'm trying to build a dynamic function in Oracle using a cursor for all the tables that need to be dropped and re-created again. For example, I have the following example table structure: CREATE TABLE All_tmp_DATA AS (SELECT 'T_tmp_test1' As…
Yen Ching
  • 11
  • 1
  • 4
0
votes
1 answer

Native Function Return from Geography Data Type

I am creating a DDL file to be deployed as VDB using TEIID. The source model is MS SQl. In the source database there is geography data type column. I am trying to read the lat and long from geography data type. To retrieve the lat/long in sql…
ASAFDAR
  • 19
  • 1
  • 7
0
votes
1 answer

Error Code: 1215. Cannot add foreign key constraint. Foreign key problem

create table methodology( method_id int primary key, date_added date, description varchar(1000) character set utf8); create table text_item( t_id int primary key, date_written date, original_language varchar(2), description varchar(1000) character…
0
votes
1 answer

Failing create table in Redshift

I pgdumped a redshift table and I am trying to restore it. however, I get an error when restoring. I've even attempted to run the create table command manually and it produces an error. I can't figure out what is wrong. Thanks. CREATE TABLE report…
sebastian
  • 2,008
  • 4
  • 31
  • 49
0
votes
1 answer

How to add a column in the existing table and update all the existing data in postgresql?

I have an existing table, I want to insert a new column and update values in the whole table so that I do not have to refill the table again. But the problem is, I have a route column which is present in the format shown below. I want to add a new…
psygo
  • 95
  • 2
  • 10
0
votes
2 answers

How to view the Create Table SQL command after a table has been created in mySQL phpMyAdmin

When you create a mySQL table using the GUI in phpAdmin there is an option to preview the SQL create table command. Once you have created a table, made adjustments and finalised the structure, is it possible to review the SQL create command for the…
dancingbush
  • 2,131
  • 5
  • 30
  • 66
0
votes
1 answer

I cannot create a table on PostgreSQL

I was trying to create the following table on PostgreSQL: CREATE TABLE movies ( movie_name VARCHAR(200), movie_year INTEGER, country VARCHAR(100), genre VARCHAR PRIMARY KEY (movie_name, movie_year) ); But received the…
JMarcos87
  • 183
  • 3
  • 11
0
votes
2 answers

How to rename a column in SQL?

The code that i tried is ALTER TABLE "STUDENT" RENAME COLUMN "Roll" TO "Num"; Its syntax is correct but it shows a error. Whats the problem? Error Static analysis: 1 errors were found during analysis. Missing comma before start of a new alter…
1 2 3
99
100