Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
CEC@user:~$ sudo bash [sudo] password for CEC: root@user:/home/CEC# sqlplus sys as sysdba SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 17 09:18:15 2022 Copyright (c) 1982, 2011, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production SQL> create table exp6(Eid UNIQUE varchar(2), FName varchar(10), LName varchar(10),Email varchar(20), Phone int, Hdate DATE, JId varchar(2),DId varchar(2)); create table exp6(Eid UNIQUE varchar(2), FName varchar(10), LName varchar(10),Email varchar(20), Phone int, Hdate DATE, JId varchar(2),DId varchar(2)) * ERROR at line 1: ORA-00907: missing right parenthesis SQL> create table exp6(Eid varchar(2), FName varchar(10), LName varchar(10),Email varchar(20), Phone int, Hdate DATE, JId varchar(2),DId varchar(2)); Table created. SQL> desc exp6 Name Null? Type ----------------------------------------- -------- ---------------------------- EID VARCHAR2(2) FNAME VARCHAR2(10) LNAME VARCHAR2(10) EMAIL VARCHAR2(20) PHONE NUMBER(38) HDATE DATE JID VARCHAR2(2) DID VARCHAR2(2) SQL> create table exp6dept as select DId from exp6; Table created. SQL> alter table exp6dept add(DName varchar(15), LId varchar(3)); Table altered. SQL> desc exp6dept; Name Null? Type ----------------------------------------- -------- ---------------------------- DID VARCHAR2(2) DNAME VARCHAR2(15) LID VARCHAR2(3) SQL> create table exp6job(Eid varchar(2), SDate DATE, EDate DATE, JId varchar(2), DId varchar(2)); Table created. SQL> rename table exp6job as exp6jobhist; rename table exp6job as exp6jobhist * ERROR at line 1: ORA-00903: invalid table name SQL> rename exp6job to exp6jobhist; Table renamed. SQL> create table exp6job(JId varchar(2), Title varchar(20), MinSalary int, MaxSalary int); Table created. SQL> create table region(RId varchar(3), RegionName varchar(10), Country varchar(2)); Table created. SQL> rename region to exp6region; Table renamed. SQL> create table exp6loc(LId varchar(2), Laddress varchar(10), Cid varchar(2)); Table created. SQL> create table exxp6country(Cid varchar(2), Cname varchar(10)); Table created. SQL> insert into exp6 values("E1","Mini","P.K","mini@gmail.com",9955,'12-04-1987',"J1","D1"); insert into exp6 values("E1","Mini","P.K","mini@gmail.com",9955,'12-04-1987',"J1","D1") * ERROR at line 1: ORA-00984: column not allowed here SQL> desc exp6; Name Null? Type ----------------------------------------- -------- ---------------------------- EID VARCHAR2(2) FNAME VARCHAR2(10) LNAME VARCHAR2(10) EMAIL VARCHAR2(20) PHONE NUMBER(38) HDATE DATE JID VARCHAR2(2) DID VARCHAR2(2) SQL> insert into exp6 values("E1","Mini","P.K","mini@gmail.com",9955,'12-04-1987',"J1","D1"); insert into exp6 values("E1","Mini","P.K","mini@gmail.com",9955,'12-04-1987',"J1","D1") * ERROR at line 1: ORA-00984: column not allowed here SQL> insert into exp6 values('E1','Mini','P.K','mini@gmail.com',9955,'12-04-1987','J1','D1'); 1 row created. SQL> insert into exp6 values('E2','Savanth','Kumar','savanth@gmail.com',9867,'22-07-1990','J2','D2'); 1 row created. SQL> insert into exp6 values('E3','Jane','Joy','jane@gmail.com',9765,'23-04-1999','J2','D3'); 1 row created. SQL> insert into exp6 values('E4','Suhail','Haroon','suhail@gmail.com',9234,'01-05-2003','J3','D3'); 1 row created. SQL> insert into exp6 values('E5','Radha','Soman','radha@gmail.com',9976,'09-02-2011','J2','D1'); 1 row created. SQL> select * from exp6; EI FNAME LNAME EMAIL PHONE HDATE JI DI -- ---------- ---------- -------------------- ---------- -------- -- -- E1 Mini P.K mini@gmail.com 9955 12-04-87 J1 D1 E2 Savanth Kumar savanth@gmail.com 9867 22-07-90 J2 D2 E3 Jane Joy jane@gmail.com 9765 23-04-99 J2 D3 E4 Suhail Haroon suhail@gmail.com 9234 01-05-03 J3 D3 E5 Radha Soman radha@gmail.com 9976 09-02-11 J2 D1 SQL> insert into exp6dept values('D1','Production','L1'); 1 row created. SQL> insert into exp6dept values('D2','Marketing','L1'); 1 row created. SQL> insert into exp6dept values('D3','RandD','L1'); 1 row created. SQL> insert into exp6dept values('D1','Marketing','L2'); 1 row created. SQL> insert into exp6dept values('D2','HR','L2'); 1 row created. SQL> insert into exp6dept values('D1','Production','L3'); 1 row created. SQL> insert into exp6dept values('D2','RandD','L3'); 1 row created. SQL> insert into exp6dept values('D3','HR','L3'); 1 row created. SQL> select * from exp6dept; DI DNAME LID -- --------------- --- D1 Production L1 D2 Marketing L1 D3 RandD L1 D1 Marketing L2 D2 HR L2 D1 Production L3 D2 RandD L3 D3 HR L3 8 rows selected. SQL> insert into exp6jobhist values('E1','12-04-1987','02-05-1993','J1','D1'); 1 row created. SQL> insert into exp6jobhist values('E1','02-05-1993','30-03-2008','J2','D1'); 1 row created. SQL> insert into exp6jobhist values('E1','30-03-2008','null','J3','D1'); insert into exp6jobhist values('E1','30-03-2008','null','J3','D1') * ERROR at line 1: ORA-01858: a non-numeric character was found where a numeric was expected SQL> insert into exp6jobhist values('E2','22-07-1990','05-06-2001','J7','D2'); 1 row created. SQL> delete from exp6jobhist where EId=E2; delete from exp6jobhist where EId=E2 * ERROR at line 1: ORA-00904: "E2": invalid identifier SQL> delete from exp6jobhist where EId='E2'; 1 row deleted. SQL> select * from exp6jobhist; EI SDATE EDATE JI DI -- -------- -------- -- -- E1 12-04-87 02-05-93 J1 D1 E1 02-05-93 30-03-08 J2 D1 SQL> insert into exp6jobhist values('E1','30-03-2008',null,'J3','D1'); 1 row created. SQL> insert into exp6jobhist values('E2','22-07-1990','05-06-2001','J7','D2'); 1 row created. SQL> insert into exp6jobhist values('E2','05-06-2001',null,'J8','D3'); 1 row created. SQL> insert into exp6jobhist values('E3','23-04-1999','09-11-2004','J5','D1'); 1 row created. SQL> insert into exp6jobhist values('E3','09-11-2004',null,'J6','D3'); 1 row created. SQL> insert into exp6jobhist values('E4','01-05-2003',null,'J7','D3'); 1 row created. SQL> select * from exp6jobhist; EI SDATE EDATE JI DI -- -------- -------- -- -- E1 12-04-87 02-05-93 J1 D1 E1 02-05-93 30-03-08 J2 D1 E1 30-03-08 J3 D1 E2 22-07-90 05-06-01 J7 D2 E2 05-06-01 J8 D3 E3 23-04-99 09-11-04 J5 D1 E3 09-11-04 J6 D3 E4 01-05-03 J7 D3 8 rows selected. SQL> insert into exp6job values('J1','Junior Programmer',24000,45000); 1 row created. SQL> insert into exp6job values('J2','Senior Programmer',45000,112000); 1 row created. SQL> insert into exp6job values('J3','Project Manager',67000,135000); 1 row created. SQL> insert into exp6job values('J4','Junior Researcher',35000,67000); 1 row created. SQL> insert into exp6job values('J5','Senior Researcher',65000,132000); 1 row created. SQL> insert into exp6job values('J6','Scientist',78000,178000); 1 row created. SQL> insert into exp6job values('J7','Manager',32000,56000); 1 row created. SQL> insert into exp6job values('J8','Marketing Head',21000,45000);insert into exp6job values('J8','Marketing Head',21000,45000); insert into exp6job values('J8','Marketing Head',21000,45000);insert into exp6job values('J8','Marketing Head',21000,45000) * ERROR at line 1: ORA-00911: invalid character SQL> insert into exp6job values('J8','Marketing Head',21000,45000); 1 row created. SQL> insert into exp6job values('J9','HR Head',34000,45000); 1 row created. SQL> select * from exp6job; JI TITLE MINSALARY MAXSALARY -- -------------------- ---------- ---------- J1 Junior Programmer 24000 45000 J2 Senior Programmer 45000 112000 J3 Project Manager 67000 135000 J4 Junior Researcher 35000 67000 J5 Senior Researcher 65000 132000 J6 Scientist 78000 178000 J7 Manager 32000 56000 J8 Marketing Head 21000 45000 J9 HR Head 34000 45000 9 rows selected. SQL> insert into exp6region values('R1','North East','C1'); 1 row created. SQL> insert into exp6region values('R2','North India','C2'); insert into exp6region values('R2','North India','C2') * ERROR at line 1: ORA-12899: value too large for column "SYS"."EXP6REGION"."REGIONNAME" (actual: 11, maximum: 10) SQL> desc exp6region; Name Null? Type ----------------------------------------- -------- ---------------------------- RID VARCHAR2(3) REGIONNAME VARCHAR2(10) COUNTRY VARCHAR2(2) SQL> alter table exp6region MODIFY regionname varchar(20); Table altered. SQL> desc exp6region Name Null? Type ----------------------------------------- -------- ---------------------------- RID VARCHAR2(3) REGIONNAME VARCHAR2(20) COUNTRY VARCHAR2(2) SQL> insert into exp6region values('R2','North India','C2'); 1 row created. SQL> insert into exp6region values('R33','South India','C2'); 1 row created. SQL> select * from exp6region; RID REGIONNAME CO --- -------------------- -- R1 North East C1 R2 North India C2 R33 South India C2 SQL> insert into exp6loc values('L1','New York','C1'); 1 row created. SQL> insert into exp6loc values('L2','Delhi','C2'); 1 row created. SQL> insert into exp6loc values('L3','Kochi','C2'); 1 row created. SQL> select * from exp6loc; LI LADDRESS CI -- ---------- -- L1 New York C1 L2 Delhi C2 L3 Kochi C2 SQL> insert into exp6loc values('C1','India'); insert into exp6loc values('C1','India') * ERROR at line 1: ORA-00947: not enough values SQL> insert into exp6country values('C1','India'); insert into exp6country values('C1','India') * ERROR at line 1: ORA-00942: table or view does not exist SQL> rename exxp6country to exp6country; Table renamed. SQL> insert into exp6country values('C1','India'); 1 row created. SQL> insert into exp6country values('C2','USA'); 1 row created. SQL> select * from exp6country; CI CNAME -- ---------- C1 India C2 USA alter table exp6 add primary key(eid); alter table exp6dept add primary key(did,lid); alter table exp6job add primary key(jid); alter table exp6region add primary key(rid); alter table exp6loc add primary key(lid); alter table exp6country add primary key(cid); alter table exp6jobhist add foreign key(eid) references exp6(eid); alter table exp6dept add foreign key(lid) references exp6loc(lid); alter table exp6loc add foreign key(cid) references exp6country(cid); alter table exp6region add foreign key(cid) references exp6country(cid); SQL> DBMS lab nov 17 2022
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
SNLINE list
mIRC | 45 min ago | 1.15 KB
Die 7 wichtigsten Aktionen diese Woche
1 hour ago | 4.17 KB
Untitled
1 hour ago | 13.34 KB
Untitled
3 hours ago | 13.59 KB
VNC SCRIPT 2/2: autoinput.vbs
VBScript | 12 hours ago | 0.23 KB
VNC SCRIPT 1/2: vncauto.bat
Batch | 12 hours ago | 0.72 KB
videoscheomedia
XML | 14 hours ago | 1.00 KB
Untitled
19 hours ago | 14.91 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!