Instruction
name sql
countries
CREATE TABLE countries(
country_id varchar(2) primary key not null,
country_name varchar(40) not null,
region_id integer(2) not null)
regions
CREATE TABLE regions(
region_id integer(2) primary key not null,
region_name varchar(25) not null)
locations
CREATE TABLE locations(
location_id integer(4) primary key not null,
street_address varchar(25) not null,
postal_code varchar(12),
city varchar(30) not null,
state_province varchar(12),
country_id varchar(2))
departments
CREATE TABLE departments(
department_id integer(3) primary key not null,
depart_name varchar(20) not null,
manager_id integer(3) not null,
location_id integer(4))
jobs
CREATE TABLE jobs(
job_id varchar(10) primary key not null,
job_title varchar(25) not null,
min_salary decimal,
max_salary decimal)
employees
CREATE TABLE employees(
employee_id integer(3) primary key not null,
first_name varchar(20),
last_name varchar(25),
email varchar(25),
phone_number varchar(20),
hire_date date,
job_id varchar(10) not null,
salary decimal,
commission_pct number,
manager_id integer(3),
department_id integer(3), Avg_Salary NUMERIC)
department
CREATE TABLE department(
"department_id" TEXT,
"department_name" TEXT,
"manager_id" TEXT,
"location_id" TEXT
)
job_history
CREATE TABLE job_history(
employee_id integer(3) not null,
start_date date not null,
end_date date not null,
job_id varchar(10) not null,
department_id integer(3) not null)
prod_mast
CREATE TABLE prod_mast(
prod_id integer PRIMARY KEY,
prod_name text(20),
prod_rate integer,
prod_qc text(20) DEFAULT 'OK')
prod_backup
CREATE TABLE prod_backup(
prod_id integer PRIMARY KEY,
prod_name text(20),
prod_rate integer,
prod_qc text(10) DEFAULT 'OK')
orders
CREATE TABLE orders(
ord_no integer PRIMARY KEY,
item_id integer ,
item_name text(20),
ord_qty integer,
cost integer)
tb1
CREATE TABLE tb1 (c1 INT, c2 CHAR(5), c3 FLOAT)
ESERCICIO1
CREATE TABLE ESERCICIO1(C TEXT, D TEXT)
users
CREATE TABLE users(name varchar(128), email varchar(128))
tags
CREATE TABLE tags (
title TEXT,
description TEXT,
created TEXT
)
s
CREATE TABLE s( A int, D int, E int)
r
CREATE TABLE r (A int, B int)
Emor
CREATE TABLE Emor(
ID INT PRIMARY KEY NOT NULL,
NAME TEXT)
MIN_SALARY
CREATE TABLE MIN_SALARY(job_id TEXT,MIN_SALARY)
employee_data
CREATE TABLE employee_data (employee_name TEXT, item TEXT, rate REAL, quantity INTEGER, date TEXT, id INTEGER PRIMARY KEY)
STUDENT
CREATE TABLE STUDENT(
ID INT PRIMARY KEY NOT NULL,
NAME TEXT NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR(50),
FEES REAL
)
EMPLOYEE_INCOME
CREATE TABLE EMPLOYEE_INCOME
(EMPID NUMBER(10),
NAME VARCHAR2(20),
SALARY NUMBER(10))
details CREATE TABLE details
(id number(8,0),
name varchar2(50),
weight number(8,0),
turn number(8,0)
)