I’m starting to learn PLSQL and created a very very simple table, I’m trying to get familiar with functions and triggers. My table: Now to the question, I want to limit before insert or update new row (biuefer) so that the first name must be 8 characters, not less, not more. If you try to insert a…
Tag: create-table
Trying to run script through Oracle 11g
I am trying to run SQL statements in the Oracle 11g Express edition, where I am to create tables. Here is my SQL code: It only ends up processing 4 statements and I keep getting these error messages: I am wholly unfamiliar with Oracle 11g. I am unsure if I am using the correct application in it for my assignm…
Why MariaDB refuses to create a simple table with error [42000][1064]?
I just want to know how to fix this, or why MariaDB server keeps me returning an error. I just install the database, create a user, a new schema, I’m pointing to that database with use database testing; and I’m ready to create a simple table on a database with this query: The user in the database …
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 current version of the table? Answer SHOW CREATE TABLE Shows …
add not null column take values from other column
I have an existing table say, Items with Id | CreateDate (as DateTime) columns; want to add Year int not null, take the default year from the CreateDate column. The Year value will be futer updated …
SQL – Generate column from sum of columns from different table
I have two tables: The first one contains numeral values, it looks like this: The id column is the primary key; it has the attribute AUTO_INCREMENT. All columns have the datatype INT. Now my …
postgresql ERROR: syntax error at or near “PRIMARY”
I’m new to PostgreSQL. I’ve been trying to create tables in a database but some queries give weird errors. the first snippet throws a syntax error but when I add “serial” on the problematic column the error is resolved. Should all primary keys auto-increment in PostgreSQL? This works a…
What’s wrong with this SQL CREATE + INSERT batch?
What is wrong with this SQL statement? Create table JaretsSchedule ( ScheduleID Int Primary Key NOT NULL, FieldID Int NOT NULL, HomeTeamID Int NOT NULL, AwayTeamID Int NOT NULL, …
ORACLE CREATE TABLE with FOREIGN KEY error
I am a beginner to Oracle and have been having problems creating a table with a foreign key, I have created the parent table region as well and have been receiving the same error. I have researched on W3school and used the same syntax but still no help. Answer Leave “FOREIGN KEY” out, if you want …
Change empty string to NULL when column has DATE constraint
This might be impossible but I was wondering if someone more experienced knew if this is possible to do in postgresql. I have a column in my create statement CREATE table IF NOT EXISTS (other cols, …