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

Is using DDL statements in ETL script right approach?

I'm working on redesigning DWH solution previously based on Teradata with lots of BTEQ scripts performing transformations on mirror tables loaded from source DBs. New solutions will be based on Snowflake and as a transformation tool set of SQL…
0
votes
1 answer

How to use DELETE ON CASCADE in this senario?

so I have 3 tables, Applicant, Vacancy and a Link table. I am trying to have the applicant data removed when the vacancy is removed. Here is the current SQL code I have, would this remove the applicant? CREATE TABLE Applicant( ID INT PRIMARY KEY, …
0
votes
2 answers

alter statements failing on oracle

I'm new to Oracle (have a SQL Server background). I'm trying to execute this anonymous block but it is failing with ORA-06550. I feel like that I may not understand what can be done and not done in an anonymous block. If someone would be so kind to…
0
votes
0 answers

Two tables in Postgres DB with Unique data maintained across the tables

I am using Postgres 10 and Need to create the two table like below. CREATE TABLE puplic.test1( id character varying(8) NOT NULL, name character varying(36) NOT NULL, status character varying(36) NOT NULL, CONSTRAINT pk_test1 PRIMARY…
0
votes
2 answers

PostgreSQL UNIQUE for JOINed table

Given the following example: CREATE TABLE bom ( id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) NOT NULL ); CREATE TABLE bom_item ( id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, bom_id_fk INT REFERENCES bom(id)…
mxcd
  • 1,954
  • 2
  • 25
  • 38
0
votes
4 answers

Auto increment syntax errors

Here's the code to my simple database: CREATE TABLE [dbo].[User_Info] ( [Username] NVARCHAR (50) NOT NULL, [Password] NVARCHAR (50) NOT NULL, [Firstname] NVARCHAR (50) NOT NULL, [Lastname] NVARCHAR (50) NOT NULL, [Email] NVARCHAR (50) NOT…
kfir ezer
  • 159
  • 1
  • 11
0
votes
1 answer

Azure Data Studio data script for indexes

I can't access the option "Scrip as Create" for indexes using Azure Data Studio. I just have the refresh option I think that should be like that, no? I've searched on Internet some solution, but I didn't found anything. Someone could help me?
Raul Britto
  • 47
  • 1
  • 5
0
votes
2 answers

How to create table with computed column and if statement?

As in title, I'm trying to create a table on SQL Server that includes computed column with if statement. I have already created basic columns, co currently trying to add computed column using ALTER TABLE. In statement: ALTER table zgodnosc add…
0
votes
0 answers

How to implement subclass only Specialization EER

According to book: FUNDAMENTALS OF Database Systems SEVENTH EDITION by Ramez & Navathe. In Chapter 9 which is related to converting EER to relational diagram there is a topic named: mapping of specialization or generalization to relational model and…
0
votes
0 answers

Alterar una columna, para cambiar "nulo" a "no nulo", cuando no se conoce el tipo de datos

I need to allow nulls in a column, but I don't know its data type. In oracle its possible to do this: alter table MyTable modify MyField null; the SQL server homologous statement requires the data type (in this example INT): alter table MyTable…
GatoSoft
  • 106
  • 1
  • 3
0
votes
1 answer

Flink1.10 why does DDL not support create view and create function?

Flink1.10 why does DDL not support create view and create function ?
Ceaser
  • 1
0
votes
1 answer

Error : OSError: [WinError 126] Le module spécifié est introuvable

I am trying to install pytorch on Windows 10 in a virtual env and I am getting this error : (test) C:\Users\Emmanuelle>py Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Warning: This Python…
EMMAKENJI
  • 359
  • 2
  • 5
  • 14
0
votes
1 answer

ERROR: relation "schema.TableName_Id_seq" does not exist - when creating table in a new database

I'm having an issue where I used pgAdmin4's GUI to create a SQL table, and I want to use to generated CREATE TABLE script to create this same table in another database. When I run the CREATE TABLE script generated by pgAdmin4 in my new database, I…
Joshua Schlichting
  • 3,110
  • 6
  • 28
  • 54
0
votes
1 answer

MYSQL: Strings in DDL of VIEW turned into garbled symbols several hours later

I recently modified the DDL of a VIEW with Workbench by adding a filter with strings of Chinese characters. The DDL can be saved successfully and worked perfectly right after being modified. However, the modification itself in the DDL became garbled…
Henry Tsai
  • 21
  • 2
0
votes
2 answers

Oracle PLSQL Cascade Delete doesn't work?

I have some tables with foreign keys which should be deleted. I Put the "on delete cascade" everywhere I needed it, but when I try to Drop the Table i get following error: *Cause: An attempt was made to drop a table with unique or …
Samuel
  • 13
  • 3
1 2 3
99
100