text stringlengths 6 9.38M |
|---|
-- phpMyAdmin SQL Dump
-- version 4.7.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: 2019-04-01 21:25:38
-- 服务器版本: 5.6.35
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `treehole`
--
-- --------------------------------------------------------
--
-- 表的结构 `message`
--
CREATE TABLE `message` (
`id` int(11) NOT NULL COMMENT '自增id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`username` varchar(50) NOT NULL COMMENT '用户名',
`face_url` varchar(250) NULL COMMENT '用户头像',
`content` varchar(500) NOT NULL COMMENT '树洞消息内容',
`total_likes` int(11) NOT NULL DEFAULT '0' COMMENT '点赞数',
`send_timestamp` int(11) NOT NULL COMMENT '发布的时间戳'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='树洞消息表';
-- --------------------------------------------------------
--
-- 表的结构 `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL COMMENT '自增id',
`username` varchar(50) NOT NULL COMMENT '用户名',
`phone` varchar(11) NOT NULL COMMENT '手机号',
`password` varchar(32) NOT NULL COMMENT '密码,md5加密',
`face_url` varchar(250) NULL COMMENT '用户头像'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表';
--
-- Indexes for dumped tables
--
--
-- Indexes for table `message`
--
ALTER TABLE `message`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `phone` (`phone`);
--
-- 在导出的表使用AUTO_INCREMENT
--
--
-- 使用表AUTO_INCREMENT `message`
--
ALTER TABLE `message`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id';
--
-- 使用表AUTO_INCREMENT `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id'; |
SET DATABASE TRANSACTION CONTROL MVCC;
|
-- Sep 29, 2010 4:27:48 PM CDT
-- Fix Manufacturing Order Print
UPDATE AD_Ref_Table SET WhereClause='AD_PrintFormat.AD_Table_ID=53197',Updated=TO_TIMESTAMP('2010-09-29 16:27:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=53281
;
|
insert into notes (name, modified, content, folderId)
values
('Dogs','2019-01-03T00:00:00.000Z', 'Dogs are very sweet', 1),
('Cats', '2018-08-15T23:00:00.000Z', 'Cats have a motto: If I fits I sits', 1),
('Pigs', '2018-03-01T00:00:00.000Z', 'Pigs are very one of the most useful farm animals', 2),
('Birds','2019-01-04T00:00:00.000Z', 'Birds of a feather flock together', 2),
('Bears', '2018-07-12T23:00:00.000Z', 'Bears are notorious for stealing food', 3);
-- ('Horses'),
-- ('Tigers'),
-- ('Wolves'),
-- ('Elephants'),
-- ('Lions'),
-- ('Monkeys'),
-- ('Bats'),
-- ('Turtles'),
-- ('Zebras'),; |
MERGE ImageResources.ImageTypes AS Target
USING
(
VALUES
(N'Ingredients', N'Ingredients', 1300, 1300)
,(N'Recipes', N'Recipes', 1300, 1300)
,(N'Articles', N'Articles', 1300, 1300)
,(N'Avatars', N'Avatars', 200, 200)
,(N'Task', N'Tasks', 1300, 1300)
) AS Source (Name, FolderName, MaxOriginWidth, MaxOriginHeight)
ON Target.Name = Source.Name
WHEN MATCHED THEN
UPDATE SET
MaxOriginWidth = Source.MaxOriginWidth
,MaxOriginHeight = Source.MaxOriginHeight
,FolderName = Source.FolderName
WHEN NOT MATCHED BY TARGET THEN
INSERT
(
Name
,MaxOriginWidth
,MaxOriginHeight
,FolderName
)
VALUES
(
Name
,MaxOriginWidth
,MaxOriginHeight
,FolderName
)
WHEN NOT MATCHED BY SOURCE THEN
DELETE
;
MERGE ImageResources.ImageTypeSizes AS Target
USING
(
SELECT
ImageTypeId = imgType.Id
,Name = items.Name
,Width = items.Width
,Height = items.Height
,VerticalWidth = items.VerticalWidth
,VerticalHeight = items.VerticalHeight
,Prefix = items.Prefix
,Blend = items.Blend
,IsFit = items.IsFit
,IsVerticalFit = items.IsVerticalFit
,IsSystem = items.IsSystem
,IsOptional = items.IsOptional
FROM
(VALUES
/*
Prev - изображение картинки в выборе картинки
DisplayHeader - отображение картинки в превью итема
*/
-- Articles
(N'Articles', N'Prev', 100, 100, NULL, NULL, N'Prev_', 1, 1, 0, 1, 0) -- для выбора
,(N'Articles', N'DisplayHeader', 150, 150, NULL, NULL, N'DisplayHeader_', 1, 1, 0, 1, 0) -- для првью
,(N'Articles', N'DisplayHeaderBig', 400, 300, 300, 400, N'DisplayHeaderBig_', 1, 1, 0, 1, 0) -- для првью (большое, на маленьких экранах)
,(N'Articles', N'SlideShow', 1000, 600, 600, 1000, N'SlideShow_', 0, 0, 1, 1, 0) -- полный размер, слайд шоу
,(N'Articles', N'SmallSlideShow', 200, 120, 120, 200, N'SmallSlideShow_', 0, 0, 1, 1, 0) -- полный размер, слайд шоу
--
,(N'Articles', N'Header', 846, 500, 846, 650, N'Header_', 1, 0, 1, 1, 1) -- картинка для установки в заголовок (в самый верх)
,(N'Articles', N'FullPage', 775, 500, 500, 775, N'FullPage_', 1, 1, 1, 0, 0) -- полная ширина колонки, о левой границы до правой
,(N'Articles', N'NotFit', 775, 500, 500, 775, N'NotFit_', 0, 0, 1, 0, 1) -- как есть только не растягя
-- Recipes
,(N'Recipes', N'Prev', 100, 100, NULL, NULL, N'Prev_', 1, 1, 0, 1, 0) -- для выбора
,(N'Recipes', N'DisplayHeader', 200, 150, 150, 200, N'DisplayHeader_', 1, 1, 0, 1, 0) -- для првью
,(N'Recipes', N'DisplayHeaderBig', 400, 300, 300, 400, N'DisplayHeaderBig_', 1, 1, 0, 1, 0) -- для првью (большое, на маленьких экранах)
,(N'Recipes', N'DisplayInStep', 120, 120, NULL, NULL, N'DisplayInStep_', 1, 1, 0, 1, 0) -- для првью в шагах при редактировании рецепта
,(N'Recipes', N'SlideShow', 1000, 600, 600, 1000, N'SlideShow_', 0, 0, 1, 1, 0) -- полный размер, слайд шоу
,(N'Recipes', N'SmallSlideShow', 200, 120, 120, 200, N'SmallSlideShow_', 0, 0, 1, 1, 0) -- полный размер, слайд шоу
--
,(N'Recipes', N'Header', 846, 600, 846, 650, N'Header_', 1, 0, 1, 0, 1) -- полная ширина колонки, о левой границы до правой
,(N'Recipes', N'Step', 615, 500, NULL, NULL, N'Step_', 0, 0, 1, 0, 1) -- не полная ширина, отступы справа и слева
,(N'Recipes', N'Pinned', 358, 230, NULL, NULL, N'Pinned_', 1, 1, 1, 0, 1) -- на главной странице прикрепленыые рецепты
,(N'Recipes', N'Recommended', 750, 450, NULL, NULL, N'Recommended_', 1, 1, 1, 0, 1) -- на главной рекомендованые
,(N'Recipes', N'RecommendedNav', 115, 85, NULL, NULL, N'RecommendedNav_', 1, 1, 0, 0, 1) -- на главной рекомендованые, колонка навигации
,(N'Recipes', N'Releated', 170, 170, NULL, NULL, N'Releated_', 1, 1, 0, 0, 1) -- на странице рецепта, связанные рецепты
,(N'Recipes', N'FiveLatest', 75, 50, NULL, NULL, N'FiveLatest_', 1, 1, 0, 0, 1) -- на панели справа, последние 5 рецептов
,(N'Recipes', N'Day', 360, 286, NULL, NULL, N'Day_', 1, 1, 0, 0, 1) -- рецепт дня
-- Ingredients
,(N'Ingredients', N'Prev', 100, 100, NULL, NULL, N'Prev_', 1, 1, 0, 1, 0) -- для выбора
,(N'Ingredients', N'DisplayHeader', 150, 150, NULL, NULL, N'DisplayHeader_', 1, 1, 0, 1, 0) -- для првью
,(N'Ingredients', N'DisplayHeaderBig', 400, 300, 300, 400, N'DisplayHeaderBig_', 1, 1, 0, 1, 0) -- для првью (большое, на маленьких экранах)
,(N'Ingredients', N'SlideShow', 1000, 600, 600, 1000, N'SlideShow_', 0, 0, 1, 1, 0) -- полный размер, слайд шоу
,(N'Ingredients', N'SmallSlideShow', 200, 120, 120, 200, N'SmallSlideShow_', 0, 0, 1, 1, 0) -- полный размер, слайд шоу
--
,(N'Ingredients', N'Header', 300, 300, NULL, NULL, N'Header_', 1, 1, 1, 0, 1) -- полная ширина колонки, о левой границы до правой
,(N'Ingredients', N'FullPage', 775, 500, NULL, NULL, N'FullPage_', 1, 1, 1, 0, 1) -- полная ширина колонки, о левой границы до правой
,(N'Ingredients', N'HalfPage', 380, 500, NULL, NULL, N'HalfPage_', 1, 1, 1, 0, 1) -- ровно половина страницы
,(N'Ingredients', N'Cool', 600, 500, NULL, NULL, N'Cool_', 1, 1, 1, 0, 1) -- не полная ширина, отступы справа и слева
-- Avatars
,(N'Avatars', N'Prev', 100, 100, NULL, NULL, N'Prev_', 1, 1, 0, 1, 0) -- для выбора
,(N'Avatars', N'Comment', 45, 45, NULL, NULL, N'Com_', 1, 1, 0, 1, 0) -- для чата
,(N'Avatars', N'SideBar', 160, 160, NULL, NULL, N'Bar_', 1, 1, 0, 1, 0) -- для отображение в сайд баре
)
AS items (ImageType, Name, Width, Height, VerticalWidth, VerticalHeight, Prefix, IsFit, IsVerticalFit, Blend, IsSystem, IsOptional)
JOIN ImageResources.ImageTypes imgType ON items.ImageType = imgType.Name
) AS Source
ON Target.ImageTypeId = Source.ImageTypeId
AND Target.Name = Source.Name
WHEN MATCHED THEN
UPDATE SET
Prefix = Source.Prefix
,Width = Source.Width
,Height = Source.Height
,VerticalWidth = Source.VerticalWidth
,VerticalHeight = Source.VerticalHeight
,Blend = Source.Blend
,IsSystem = Source.IsSystem
,IsOptional = Source.IsOptional
,IsFit = Source.IsFit
,IsVerticalFit = Source.IsVerticalFit
WHEN NOT MATCHED BY TARGET THEN
INSERT (ImageTypeId, Name, Prefix, Width, Height, VerticalWidth, VerticalHeight, Blend, IsSystem, IsOptional, IsFit, IsVerticalFit)
VALUES (ImageTypeId, Name, Prefix, Width, Height, VerticalWidth, VerticalHeight, Blend, IsSystem, IsOptional, IsFit, IsVerticalFit)
WHEN NOT MATCHED BY SOURCE THEN
DELETE
;
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.3 (Ubuntu 13.3-1.pgdg20.04+1)
-- Dumped by pg_dump version 13.3 (Ubuntu 13.3-1.pgdg20.04+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: Gender; Type: TYPE; Schema: public; Owner: abosamra
--
CREATE TYPE public."Gender" AS ENUM (
'MALE',
'FEMALE'
);
ALTER TYPE public."Gender" OWNER TO abosamra;
--
-- Name: SemesterStatus; Type: TYPE; Schema: public; Owner: abosamra
--
CREATE TYPE public."SemesterStatus" AS ENUM (
'open',
'closed',
'current',
'finished'
);
ALTER TYPE public."SemesterStatus" OWNER TO abosamra;
--
-- Name: SemesterType; Type: TYPE; Schema: public; Owner: abosamra
--
CREATE TYPE public."SemesterType" AS ENUM (
'FALL',
'SPRING',
'SUMMER'
);
ALTER TYPE public."SemesterType" OWNER TO abosamra;
--
-- Name: Type; Type: TYPE; Schema: public; Owner: abosamra
--
CREATE TYPE public."Type" AS ENUM (
'majorElective',
'majorRequirment',
'minorRequirment',
'universityRequirment',
'facultyRequirment',
'universityElective'
);
ALTER TYPE public."Type" OWNER TO abosamra;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: Coordinator; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."Coordinator" (
id integer NOT NULL,
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
fname character varying(255) NOT NULL,
lname character varying(255) NOT NULL,
phone text,
gender public."Gender",
password text,
email text NOT NULL,
avatar text,
role text DEFAULT 'coordinator'::text NOT NULL
);
ALTER TABLE public."Coordinator" OWNER TO abosamra;
--
-- Name: Coordinator_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."Coordinator_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Coordinator_id_seq" OWNER TO abosamra;
--
-- Name: Coordinator_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."Coordinator_id_seq" OWNED BY public."Coordinator".id;
--
-- Name: Course; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."Course" (
id integer NOT NULL,
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
discreption text,
credit integer,
available boolean DEFAULT true NOT NULL,
"courseCode" text,
name text NOT NULL,
level integer,
"majorId" integer,
"minorId" integer,
"coordinatorId" integer,
"isElective" boolean DEFAULT false NOT NULL,
type public."Type",
"instructorId" integer
);
ALTER TABLE public."Course" OWNER TO abosamra;
--
-- Name: Course_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."Course_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Course_id_seq" OWNER TO abosamra;
--
-- Name: Course_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."Course_id_seq" OWNED BY public."Course".id;
--
-- Name: Enrollment; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."Enrollment" (
id integer NOT NULL,
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
"supervisorId" integer,
"studentID" integer,
"courseID" integer,
"isAproved" boolean DEFAULT false NOT NULL,
status text DEFAULT 'in review'::text NOT NULL,
"semesterId" integer,
credit integer DEFAULT 0 NOT NULL
);
ALTER TABLE public."Enrollment" OWNER TO abosamra;
--
-- Name: Enrollment_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."Enrollment_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Enrollment_id_seq" OWNER TO abosamra;
--
-- Name: Enrollment_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."Enrollment_id_seq" OWNED BY public."Enrollment".id;
--
-- Name: FinishedCourses; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."FinishedCourses" (
"courseId" integer NOT NULL,
"studentID" integer NOT NULL,
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
grade double precision,
id integer NOT NULL,
"semesterId" integer,
credit integer,
"instructorId" integer
);
ALTER TABLE public."FinishedCourses" OWNER TO abosamra;
--
-- Name: FinishedCourses_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."FinishedCourses_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."FinishedCourses_id_seq" OWNER TO abosamra;
--
-- Name: FinishedCourses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."FinishedCourses_id_seq" OWNED BY public."FinishedCourses".id;
--
-- Name: Major; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."Major" (
id integer NOT NULL,
code text NOT NULL,
name text
);
ALTER TABLE public."Major" OWNER TO abosamra;
--
-- Name: Major_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."Major_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Major_id_seq" OWNER TO abosamra;
--
-- Name: Major_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."Major_id_seq" OWNED BY public."Major".id;
--
-- Name: Notifications; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."Notifications" (
id integer NOT NULL,
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
"supervisorId" integer,
"studentID" integer,
status integer DEFAULT 0,
data jsonb NOT NULL,
"coordinatorId" integer
);
ALTER TABLE public."Notifications" OWNER TO abosamra;
--
-- Name: Notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."Notifications_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Notifications_id_seq" OWNER TO abosamra;
--
-- Name: Notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."Notifications_id_seq" OWNED BY public."Notifications".id;
--
-- Name: Semester; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."Semester" (
id integer NOT NULL,
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
type public."SemesterType" DEFAULT 'FALL'::public."SemesterType" NOT NULL,
"coordinatorId" integer,
year integer DEFAULT 2021,
status public."SemesterStatus" DEFAULT 'open'::public."SemesterStatus" NOT NULL
);
ALTER TABLE public."Semester" OWNER TO abosamra;
--
-- Name: Semester_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."Semester_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Semester_id_seq" OWNER TO abosamra;
--
-- Name: Semester_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."Semester_id_seq" OWNED BY public."Semester".id;
--
-- Name: Student; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."Student" (
id integer NOT NULL,
"uniCode" text NOT NULL,
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
fname character varying(255) NOT NULL,
lname character varying(255) NOT NULL,
gender public."Gender",
password text,
email text NOT NULL,
"supervisorId" integer,
avatar text DEFAULT '/static/images/avatars/avatar_4'::text,
"majorId" integer,
"minorId" integer,
"coordinatorId" integer,
role text DEFAULT 'student'::text NOT NULL,
"numericalGPA" double precision DEFAULT 4 NOT NULL,
"numericalLastTermGPA" double precision DEFAULT 4,
"creditDone" integer DEFAULT 0 NOT NULL,
level integer DEFAULT 1 NOT NULL
);
ALTER TABLE public."Student" OWNER TO abosamra;
--
-- Name: StudentSemester; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."StudentSemester" (
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
"studentId" integer NOT NULL,
"semesterId" integer NOT NULL,
"semesterGPA" double precision DEFAULT 4,
"creditDone" integer DEFAULT 0,
"creditHave" integer DEFAULT 18
);
ALTER TABLE public."StudentSemester" OWNER TO abosamra;
--
-- Name: Student_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."Student_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Student_id_seq" OWNER TO abosamra;
--
-- Name: Student_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."Student_id_seq" OWNED BY public."Student".id;
--
-- Name: Supervisor; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."Supervisor" (
id integer NOT NULL,
"createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updatedAt" timestamp(3) without time zone NOT NULL,
fname character varying(255) NOT NULL,
lname character varying(255) NOT NULL,
gender public."Gender",
password text,
email text NOT NULL,
phone text,
avatar text,
"coordinatorId" integer,
role text DEFAULT 'supervisor'::text NOT NULL
);
ALTER TABLE public."Supervisor" OWNER TO abosamra;
--
-- Name: Supervisor_id_seq; Type: SEQUENCE; Schema: public; Owner: abosamra
--
CREATE SEQUENCE public."Supervisor_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Supervisor_id_seq" OWNER TO abosamra;
--
-- Name: Supervisor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abosamra
--
ALTER SEQUENCE public."Supervisor_id_seq" OWNED BY public."Supervisor".id;
--
-- Name: _CoursePrerequisites; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."_CoursePrerequisites" (
"A" integer NOT NULL,
"B" integer NOT NULL
);
ALTER TABLE public."_CoursePrerequisites" OWNER TO abosamra;
--
-- Name: _CourseToSemester; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public."_CourseToSemester" (
"A" integer NOT NULL,
"B" integer NOT NULL
);
ALTER TABLE public."_CourseToSemester" OWNER TO abosamra;
--
-- Name: _prisma_migrations; Type: TABLE; Schema: public; Owner: abosamra
--
CREATE TABLE public._prisma_migrations (
id character varying(36) NOT NULL,
checksum character varying(64) NOT NULL,
finished_at timestamp with time zone,
migration_name character varying(255) NOT NULL,
logs text,
rolled_back_at timestamp with time zone,
started_at timestamp with time zone DEFAULT now() NOT NULL,
applied_steps_count integer DEFAULT 0 NOT NULL
);
ALTER TABLE public._prisma_migrations OWNER TO abosamra;
--
-- Name: Coordinator id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Coordinator" ALTER COLUMN id SET DEFAULT nextval('public."Coordinator_id_seq"'::regclass);
--
-- Name: Course id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Course" ALTER COLUMN id SET DEFAULT nextval('public."Course_id_seq"'::regclass);
--
-- Name: Enrollment id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Enrollment" ALTER COLUMN id SET DEFAULT nextval('public."Enrollment_id_seq"'::regclass);
--
-- Name: FinishedCourses id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."FinishedCourses" ALTER COLUMN id SET DEFAULT nextval('public."FinishedCourses_id_seq"'::regclass);
--
-- Name: Major id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Major" ALTER COLUMN id SET DEFAULT nextval('public."Major_id_seq"'::regclass);
--
-- Name: Notifications id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Notifications" ALTER COLUMN id SET DEFAULT nextval('public."Notifications_id_seq"'::regclass);
--
-- Name: Semester id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Semester" ALTER COLUMN id SET DEFAULT nextval('public."Semester_id_seq"'::regclass);
--
-- Name: Student id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Student" ALTER COLUMN id SET DEFAULT nextval('public."Student_id_seq"'::regclass);
--
-- Name: Supervisor id; Type: DEFAULT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Supervisor" ALTER COLUMN id SET DEFAULT nextval('public."Supervisor_id_seq"'::regclass);
--
-- Data for Name: Coordinator; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."Coordinator" (id, "createdAt", "updatedAt", fname, lname, phone, gender, password, email, avatar, role) FROM stdin;
1 2021-06-21 01:03:46.422 2021-06-21 01:03:46.423 Karim Karim 628-572-3860 MALE 9_UaRTOAzwi2kiA Rahsaan33@yahoo.com /static/images/avatars/avatar_0.png coordinator
2 2021-06-21 01:03:46.422 2021-06-21 01:03:46.423 Ahmed Hosni 736.545.2297 MALE iB0tGOA3xUJ9Iu5 Perry_Leannon@hotmail.com /static/images/avatars/avatar_0.png coordinator
3 2021-06-21 01:03:46.422 2021-06-21 01:03:46.423 Kamal Hosni 700.686.6586 x35399 MALE x0UR31TmU6uEZoz Alene_Romaguera@yahoo.com /static/images/avatars/avatar_2.png coordinator
4 2021-06-21 01:03:46.423 2021-06-21 01:03:46.423 Abdelrahman Abdelrahman 432-520-2825 x2710 MALE 1Pv_3ZDXEdKhE2E Millie_Brekke27@gmail.com /static/images/avatars/avatar_0.png coordinator
5 2021-06-21 01:03:46.423 2021-06-21 01:03:46.423 Hussin Karim 1-279-938-0345 x3036 MALE sSEtIASdTPd5Rln Rigoberto46@hotmail.com /static/images/avatars/avatar_2.png coordinator
6 2021-06-21 01:03:46.423 2021-06-21 01:03:46.423 Ali Abdelrahman 523.232.4605 x0639 MALE KFIU13uDBO41g4i Nico_Lehner43@gmail.com /static/images/avatars/avatar_3.png coordinator
7 2021-06-21 01:03:46.423 2021-06-21 01:03:46.423 Mahmoud Ahmed 421-263-8447 MALE l5bC9h1Xq2g7gG4 Emmie94@gmail.com /static/images/avatars/avatar_1.png coordinator
8 2021-06-21 01:03:46.423 2021-06-21 01:03:46.423 Mohamed Abdelrahman (989) 600-8673 MALE MkbRQzpubyHhSFd Aiyana.Smith@hotmail.com /static/images/avatars/avatar_3.png coordinator
9 2021-06-21 01:03:46.423 2021-06-21 01:03:46.423 Ali Kamal 775-632-0770 x653 MALE v_3k4KG1xg3_CmY Roma19@yahoo.com /static/images/avatars/avatar_3.png coordinator
10 2021-06-21 01:03:46.423 2021-06-21 01:03:46.423 Ahmed Mahmoud (897) 954-7548 MALE owcsDU6Nmr_yXG0 Kim_Ortiz82@yahoo.com /static/images/avatars/avatar_0.png coordinator
\.
--
-- Data for Name: Course; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."Course" (id, "createdAt", "updatedAt", discreption, credit, available, "courseCode", name, level, "majorId", "minorId", "coordinatorId", "isElective", type, "instructorId") FROM stdin;
83 2021-07-04 16:18:20.487 2021-07-04 16:18:20.488 test 2 t MK33 test 1 2 \N 1 t majorElective 9
1 2021-06-21 01:23:17.181 2021-07-04 16:34:17.459 English Elementary 0 t ENG EL English Elementary 1 \N \N 1 f universityRequirment 9
2 2021-06-21 01:25:27.261 2021-07-04 16:34:17.464 English KET/KET Advanced 2 t ENG KET English KET/KET Advanced 1 \N \N 1 f universityRequirment 9
3 2021-06-21 01:26:44.603 2021-07-04 16:34:17.466 English PET/PET Advanced 2 t ENG PET English PET/PET Advanced 1 \N \N 1 f universityRequirment 9
4 2021-06-21 01:27:29.612 2021-07-04 16:34:17.468 Introduction to Computer 2 t CSC101 Introduction to Computer 1 \N \N 1 f universityRequirment 9
5 2021-06-21 01:28:02.191 2021-07-04 16:34:17.47 Human Rights 2 t PSC110 Human Rights 1 \N \N 1 f universityRequirment 9
6 2021-06-21 01:36:09.762 2021-07-04 16:34:17.471 Small Business Management 2 t MGT100 Small Business Management 1 \N \N 1 f universityElective 9
7 2021-06-21 01:47:36.021 2021-07-04 16:34:17.473 Introduction to Psychology 2 t PSY101 Introduction to Psychology 1 \N \N 1 f universityElective 1
8 2021-06-21 01:48:14.117 2021-07-04 16:34:17.474 Introduction to Sociology 2 t SOC101 Introduction to Sociology 1 \N \N 1 f universityElective 1
9 2021-06-21 01:48:33.563 2021-07-04 16:34:17.476 Introduction to Environmental Science 2 t ENV101 Introduction to Environmental Science 1 \N \N 1 f universityElective 9
10 2021-06-21 01:49:06.737 2021-07-04 16:34:17.477 Specialized Computer Applications 2 t CSC102 Specialized Computer Applications 1 \N \N 1 f universityElective 9
11 2021-06-21 01:49:46.557 2021-07-04 16:34:17.479 Scientific Thinking 2 t SCT101 Scientific Thinking 1 \N \N 1 f universityElective 9
12 2021-06-21 01:49:59.125 2021-07-04 16:34:17.48 Communication and Presentation Skills 2 t CPS101 Communication and Presentation Skills 1 \N \N 1 f universityElective 1
13 2021-06-21 01:56:01.082 2021-07-04 16:34:17.481 Introduction to Management 3 t MGT101 Introduction to Management 1 \N \N 1 f facultyRequirment 1
14 2021-06-21 01:56:21.807 2021-07-04 16:34:17.483 Introduction to Accounting 3 t ACT101 Introduction to Accounting 1 \N \N 1 f facultyRequirment 1
15 2021-06-21 01:57:21.883 2021-07-04 16:34:17.484 Business Mathematics 3 t MAT101 Business Mathematics 1 \N \N 1 f facultyRequirment 1
16 2021-06-21 01:57:42.664 2021-07-04 16:34:17.485 Business Law 3 t LAW101 Business Law 1 \N \N 1 f facultyRequirment 1
17 2021-06-21 01:58:03.024 2021-07-04 16:34:17.486 Introduction to Macroeconomics 3 t ECN102 Introduction to Macroeconomics 1 \N \N 1 f facultyRequirment 1
18 2021-06-21 01:58:30.91 2021-07-04 16:34:17.487 Organization Behavior 3 t MGT102 Organization Behavior 1 \N \N 1 f facultyRequirment 1
19 2021-06-21 01:58:54.731 2021-07-04 16:34:17.488 Introduction to Business Statistics 3 t SAT101 Introduction to Business Statistics 1 \N \N 1 f facultyRequirment 1
20 2021-06-21 01:59:34.192 2021-07-04 16:34:17.489 Financial Accounting 3 t ACT102 Financial Accounting 1 \N \N 1 f facultyRequirment 1
21 2021-06-21 01:59:56.481 2021-07-04 16:34:17.49 Research Methodology 3 t REM101 Research Methodology 1 \N \N 1 f facultyRequirment 1
22 2021-06-21 02:00:25.827 2021-07-04 16:34:17.492 Corporate Finance (1) 3 t FIN201 Corporate Finance (1) 2 \N \N 1 f facultyRequirment 1
23 2021-06-21 02:00:57.194 2021-07-04 16:34:17.493 Production and Operations Management 3 t MGT201 Production and Operations Management 2 \N \N 1 f facultyRequirment 1
24 2021-06-21 02:01:31.648 2021-07-04 16:34:17.494 Cost Accounting 3 t ACT201 Cost Accounting 2 \N \N 1 f facultyRequirment 1
25 2021-06-21 02:01:55.155 2021-07-04 16:34:17.495 Introduction to Management Information Systems 3 t MIS201 Introduction to Management Information Systems 2 \N \N 1 f facultyRequirment 1
26 2021-06-21 02:02:18.532 2021-07-04 16:34:17.496 Introduction to Programming 3 t MIS202 Introduction to Programming 2 \N \N 1 f facultyRequirment 1
27 2021-06-21 02:02:45.322 2021-07-04 16:34:17.497 Introduction to Marketing 3 t MKT201 Introduction to Marketing 2 \N \N 1 f facultyRequirment 1
28 2021-06-21 02:03:09.088 2021-07-04 16:34:17.498 Advanced Statistics 3 t SAT201 Advanced Statistics 2 \N \N 1 f facultyRequirment 1
29 2021-06-21 02:03:32.04 2021-07-04 16:34:17.499 Money and Banking 3 t ECN201 Money and Banking 2 \N \N 1 f facultyRequirment 1
30 2021-06-21 02:03:56.141 2021-07-04 16:34:17.501 Introduction to Human Resources Management 3 t HRM201 Introduction to Human Resources Management 2 \N \N 1 f facultyRequirment 1
31 2021-06-21 02:04:15.866 2021-07-04 16:34:17.502 Strategic Management 3 t MGT401 Strategic Management 2 \N \N 1 f facultyRequirment 1
32 2021-06-21 02:04:39.469 2021-07-04 16:34:17.518 Feasibility Studies 3 t MGT402 Feasibility Studies 2 \N \N 1 f facultyRequirment 1
33 2021-06-21 02:05:40.807 2021-07-04 16:34:17.519 Services Marketing 3 t MKT301 Services Marketing 3 2 \N 1 f majorRequirment 1
34 2021-06-21 02:07:01.978 2021-07-04 16:34:17.52 Consumer Behavior 3 t MKT302 Consumer Behavior 3 2 \N 1 f majorRequirment 1
35 2021-06-21 02:07:12.792 2021-07-04 16:34:17.522 Marketing Research 3 t MKT303 Marketing Research 3 2 \N 1 f majorRequirment 1
36 2021-06-21 02:07:24.042 2021-07-04 16:34:17.523 Integrated Marketing Communication 3 t MKT304 Integrated Marketing Communication 3 2 \N 1 f majorRequirment 1
37 2021-06-21 02:07:49.829 2021-07-04 16:34:17.524 International Marketing 3 t MKT305 International Marketing 3 2 \N 1 f majorRequirment 1
38 2021-06-21 02:08:06.893 2021-07-04 16:34:17.526 E-Marketing 3 t MKT306 E-Marketing 3 2 \N 1 f majorRequirment 1
39 2021-06-21 02:08:40.68 2021-07-04 16:34:17.527 Strategic Marketing 3 t MKT401 Strategic Marketing 4 2 \N 1 f majorRequirment 1
40 2021-06-21 02:09:01.907 2021-07-04 16:34:17.528 Sales Management 3 t MKT402 Sales Management 4 2 \N 1 f majorRequirment 1
41 2021-06-21 02:09:55.761 2021-07-04 16:34:17.529 Graduation Project 1 3 t GMK401 Graduation Project 1 4 2 \N 1 f majorRequirment 1
42 2021-06-21 02:10:05.158 2021-07-04 16:34:17.53 Graduation Project 2 3 t GMK402 Graduation Project 2 4 2 \N 1 f majorRequirment 1
43 2021-06-21 02:11:09.407 2021-07-04 16:34:17.531 Insurance and Risk Management 3 t MAT301 Insurance and Risk Management 3 3 \N 1 f majorRequirment 1
44 2021-06-21 02:11:43.246 2021-07-04 16:34:17.533 Corporate Finance (2) 3 t FIN301 Corporate Finance (2) 3 3 \N 1 f majorRequirment 1
45 2021-06-21 02:12:05.806 2021-07-04 16:34:17.534 Bank Management 3 t FIN302 Bank Management 3 3 \N 1 f majorRequirment 1
46 2021-06-21 02:12:26.231 2021-07-04 16:34:17.535 Investment and Portfolio Management 3 t FIN303 Investment and Portfolio Management 3 3 \N 1 f majorRequirment 1
47 2021-06-21 02:12:46.349 2021-07-04 16:34:17.536 Financial Institutions 3 t FIN304 Financial Institutions 3 3 \N 1 f majorRequirment 1
48 2021-06-21 02:13:06.673 2021-07-04 16:34:17.537 Financial Markets 3 t FIN305 Financial Markets 3 3 \N 1 f majorRequirment 1
49 2021-06-21 02:13:48.102 2021-07-04 16:34:17.538 Financial Statements Analysis 3 t FIN401 Financial Statements Analysis 4 3 \N 1 f majorRequirment 1
50 2021-06-21 02:14:08.771 2021-07-04 16:34:17.539 International Finance 3 t FIN402 International Finance 4 3 \N 1 f majorRequirment 1
51 2021-06-21 02:14:45.306 2021-07-04 16:34:17.54 Graduation Project 1 3 t GFI401 Graduation Project 1 4 3 \N 1 f majorRequirment 1
52 2021-06-21 02:15:10.105 2021-07-04 16:34:17.541 Graduation Project 2 3 t GFI402 Graduation Project 2 4 3 \N 1 f majorRequirment 1
53 2021-06-21 02:15:56.398 2021-07-04 16:34:17.542 Performance Management 3 t HRM301 Performance Management 3 4 \N 1 f majorRequirment 1
55 2021-06-21 02:16:35.244 2021-07-04 16:34:17.544 Human Resources Planning 3 t HRM303 Human Resources Planning 3 4 \N 1 f majorRequirment 1
54 2021-06-21 02:16:17.283 2021-07-04 16:34:17.545 Recruitment and Selection 3 t HRM302 Recruitment and Selection 3 4 \N 1 f majorRequirment 1
56 2021-06-21 02:17:36.526 2021-07-04 16:34:17.546 Training and Development 3 t HRM304 Training and Development 3 4 \N 1 f majorRequirment 1
57 2021-06-21 02:18:55.776 2021-07-04 16:34:17.547 International Human Resources Management 3 t HRM305 International Human Resources Management 3 4 \N 1 f majorRequirment 1
58 2021-06-21 02:19:09.74 2021-07-04 16:34:17.548 Job Analysis and Design 3 t HRM306 Job Analysis and Design 3 4 \N 1 f majorRequirment 1
59 2021-06-21 02:19:43.992 2021-07-04 16:34:17.549 Strategic Human Resources Management 3 t HRM401 Strategic Human Resources Management 4 4 \N 1 f majorRequirment 1
60 2021-06-21 02:20:07.267 2021-07-04 16:34:17.55 Compensation and Rewards 3 t HRM402 Compensation and Rewards 4 4 \N 1 f majorRequirment 1
61 2021-06-21 02:20:35.62 2021-07-04 16:34:17.551 Graduation Project 1 3 t GHR401 Graduation Project 1 4 4 \N 1 f majorRequirment 1
62 2021-06-21 02:20:49.153 2021-07-04 16:34:17.552 Graduation Project 2 3 t GHR402 Graduation Project 2 4 4 \N 1 f majorRequirment 1
63 2021-06-21 02:21:44.149 2021-07-04 16:34:17.553 Auditing 3 t ACT301 Auditing 3 5 \N 1 f majorRequirment 1
64 2021-06-21 02:21:55.487 2021-07-04 16:34:17.555 Intermediate Accounting 3 t ACT302 Intermediate Accounting 3 5 \N 1 f majorRequirment 1
65 2021-06-21 02:22:11.976 2021-07-04 16:34:17.556 Advanced Cost Accounting 3 t ACT303 Advanced Cost Accounting 3 5 \N 1 f majorRequirment 1
66 2021-06-21 02:22:28.918 2021-07-04 16:34:17.557 Managerial Accounting and Budgeting 3 t ACT304 Managerial Accounting and Budgeting 3 5 \N 1 f majorRequirment 1
67 2021-06-21 02:22:50.12 2021-07-04 16:34:17.558 Governmental Accounting 3 t ACT305 Governmental Accounting 3 5 \N 1 f majorRequirment 1
68 2021-06-21 02:23:12.341 2021-07-04 16:34:17.559 Tax Accounting 3 t ACT306 Tax Accounting 3 5 \N 1 f majorRequirment 1
69 2021-06-21 02:27:00.043 2021-07-04 16:34:17.561 Advanced Auditing 3 t ACT401 Advanced Auditing 4 5 \N 1 f majorRequirment 1
70 2021-06-21 02:27:21.873 2021-07-04 16:34:17.562 Specialized Accounting 3 t ACT402 Specialized Accounting 4 5 \N 1 f majorRequirment 1
71 2021-06-21 02:28:14.25 2021-07-04 16:34:17.563 Graduation Project 1 3 t GAC401 Graduation Project 1 4 5 \N 1 f majorRequirment 9
72 2021-06-21 02:28:25.208 2021-07-04 16:34:17.564 Graduation Project 2 3 t GAC402 Graduation Project 2 4 5 \N 1 f majorRequirment 9
73 2021-06-21 02:29:08.969 2021-07-04 16:34:17.565 Advanced Programming 3 t MIS301 Advanced Programming 3 1 \N 1 f majorRequirment 9
74 2021-06-21 02:29:54.766 2021-07-04 16:34:17.566 E-Commerce 3 t MIS302 E-Commerce 3 1 \N 1 f majorRequirment 9
75 2021-06-21 02:30:13.153 2021-07-04 16:34:17.568 Data Base Systems 3 t MIS303 Data Base Systems 3 1 \N 1 f majorRequirment 9
76 2021-06-21 02:30:35.339 2021-07-04 16:34:17.569 Advanced Data Base 3 t MIS305 Advanced Data Base 3 1 \N 1 f majorRequirment 9
77 2021-06-21 02:30:49.536 2021-07-04 16:34:17.57 System Analysis and Design 3 t MIS306 System Analysis and Design 3 1 \N 1 f majorRequirment 9
78 2021-06-21 02:31:03.92 2021-07-04 16:34:17.571 Operating Systems 3 t MIS307 Operating Systems 3 1 \N 1 f majorRequirment 9
79 2021-06-21 02:31:21.162 2021-07-04 16:34:17.572 Decision Support Systems 3 t MIS401 Decision Support Systems 4 1 \N 1 f majorRequirment 9
80 2021-06-21 02:31:38.313 2021-07-04 16:34:17.574 Computer Networks 3 t MIS402 Computer Networks 4 1 \N 1 f majorRequirment 9
81 2021-06-21 02:32:17.51 2021-07-04 16:34:17.575 Graduation Project 1 3 t GIS401 Graduation Project 1 4 1 \N 1 f majorRequirment 9
82 2021-06-21 02:32:32.955 2021-07-04 16:34:17.576 Graduation Project 2 3 t GIS402 Graduation Project 2 4 1 \N 1 f majorRequirment 9
\.
--
-- Data for Name: Enrollment; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."Enrollment" (id, "createdAt", "updatedAt", "supervisorId", "studentID", "courseID", "isAproved", status, "semesterId", credit) FROM stdin;
\.
--
-- Data for Name: FinishedCourses; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."FinishedCourses" ("courseId", "studentID", "createdAt", "updatedAt", grade, id, "semesterId", credit, "instructorId") FROM stdin;
\.
--
-- Data for Name: Major; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."Major" (id, code, name) FROM stdin;
1 MIS Management Information Systems
2 MKT Marketing
3 FIN Finance
4 HRM Human Resources Management
5 ACT Accounting
\.
--
-- Data for Name: Notifications; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."Notifications" (id, "createdAt", "updatedAt", "supervisorId", "studentID", status, data, "coordinatorId") FROM stdin;
\.
--
-- Data for Name: Semester; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."Semester" (id, "createdAt", "updatedAt", type, "coordinatorId", year, status) FROM stdin;
\.
--
-- Data for Name: Student; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."Student" (id, "uniCode", "createdAt", "updatedAt", fname, lname, gender, password, email, "supervisorId", avatar, "majorId", "minorId", "coordinatorId", role, "numericalGPA", "numericalLastTermGPA", "creditDone", level) FROM stdin;
2 28f1aab7-5689-43f5-a34d-764b234dc995 2021-06-21 01:03:46.475 2021-06-21 01:03:46.488 Abdelrahman Mohamed MALE LQ5cDpRxrAskL6O Darren82@hotmail.com 1 /static/images/avatars/avatar_4.png 1 4 9 student 4 4 0 1
3 f46ef056-0bf5-424c-9b2a-061598b89422 2021-06-21 01:03:46.475 2021-06-21 01:03:46.488 Ali Abdelrahman MALE NdztJCA9AW2aYWd Yessenia53@yahoo.com 8 /static/images/avatars/avatar_5.png 3 5 5 student 4 4 0 1
4 1c55671e-76ca-4536-80ca-26d33b8246ba 2021-06-21 01:03:46.475 2021-06-21 01:03:46.488 Omar Hussin MALE KlfSkP4VdGZ7uD2 Aida.Goldner@yahoo.com 5 /static/images/avatars/avatar_4.png 3 5 8 student 4 4 0 1
5 7a8272d5-3386-457d-ad52-44184272e615 2021-06-21 01:03:46.475 2021-06-21 01:03:46.488 Omar Ahmed MALE Xd5f5BXRyY7TA9z Gino67@gmail.com 5 /static/images/avatars/avatar_6.png 3 4 2 student 4 4 0 1
6 dd9a0714-7543-44a0-896d-85ff79d2fd0b 2021-06-21 01:03:46.475 2021-06-21 01:03:46.488 Ali Hosni MALE aR1nzaSbdGjXypT Camilla.Bins79@yahoo.com 10 /static/images/avatars/avatar_4.png 3 5 9 student 4 4 0 1
7 2dcbecac-2d86-4100-b583-7f9b3217de46 2021-06-21 01:03:46.475 2021-06-21 01:03:46.488 Ahmed Hosni MALE saw60Fv_iWTgHWM Angelo36@hotmail.com 6 /static/images/avatars/avatar_5.png 3 5 8 student 4 4 0 1
8 95b2c389-2468-40cd-9cc5-7ff680da6de7 2021-06-21 01:03:46.476 2021-06-21 01:03:46.488 Mahmoud Ali MALE F0zSMLywtD0AvhK Lafayette.Stehr@yahoo.com 4 /static/images/avatars/avatar_4.png 1 5 10 student 4 4 0 1
9 079f22b4-8943-4287-91ce-ecbf9760b064 2021-06-21 01:03:46.476 2021-06-21 01:03:46.488 Abdelrahman Hosni MALE lfGqJAdiq0Y9PEN Mariam_Ebert@hotmail.com 9 /static/images/avatars/avatar_4.png 3 5 1 student 4 4 0 1
10 5c654b8e-b872-4bfa-8434-2f6ba37a8a44 2021-06-21 01:03:46.476 2021-06-21 01:03:46.488 Karim Mohamed MALE KWw2Lqjw5dPNuXd Kraig_Rogahn@hotmail.com 3 /static/images/avatars/avatar_6.png 1 4 7 student 4 4 0 1
11 0416fc35-a20b-4f8c-8888-2f5b537c8454 2021-06-21 01:03:46.476 2021-06-21 01:03:46.488 Mohamed Abdelrahman MALE ug5WZDxdoUtONGz Brooke_Hermann@gmail.com 9 /static/images/avatars/avatar_6.png 3 4 6 student 4 4 0 1
12 046a63d0-1075-4a7a-87bc-b0caa4d081e0 2021-06-21 01:03:46.476 2021-06-21 01:03:46.488 Ali Sameh MALE Lz4pOWRqMwZa9gx Herminia71@hotmail.com 8 /static/images/avatars/avatar_6.png 2 4 7 student 4 4 0 1
14 c36fcddd-d9f7-4ff4-a887-12d8b1e26e2f 2021-06-21 01:03:46.477 2021-06-21 01:03:46.488 Mahmoud Ahmed MALE bd0fjoaUFxcUpAZ Taurean.Parker@hotmail.com 1 /static/images/avatars/avatar_5.png 3 4 9 student 4 4 0 1
15 cce02cb4-6a74-4132-822c-38af2d51af49 2021-06-21 01:03:46.477 2021-06-21 01:03:46.488 Kamal Ali MALE 816EtB_UMFuqirm Aliya_Yundt74@hotmail.com 4 /static/images/avatars/avatar_6.png 1 4 1 student 4 4 0 1
16 42a43f9b-793a-4184-80ac-674ff2de12f8 2021-06-21 01:03:46.477 2021-06-21 01:03:46.488 Mahmoud Mahmoud MALE qhJbzptuAWxU_Pa Mertie_Rohan97@gmail.com 2 /static/images/avatars/avatar_6.png 3 4 9 student 4 4 0 1
17 065aa16e-d7b5-4aff-a99f-cf1b51124faf 2021-06-21 01:03:46.477 2021-06-21 01:03:46.488 Mohamed Omar MALE h1O_EOOZ2MQrWXz Julie.Lowe@hotmail.com 2 /static/images/avatars/avatar_6.png 2 4 4 student 4 4 0 1
18 cf222147-8606-4824-8e94-7d02ea61000e 2021-06-21 01:03:46.477 2021-06-21 01:03:46.488 Kamal Abdelrahman MALE oNWqBZQR4mMiAeY Garnett55@gmail.com 1 /static/images/avatars/avatar_4.png 3 4 7 student 4 4 0 1
19 78e92948-9b22-4ca5-8766-acf956bdd71b 2021-06-21 01:03:46.477 2021-06-21 01:03:46.488 Abdelrahman Ali MALE GEviNCCcn3yELT0 Luz.Leannon79@hotmail.com 6 /static/images/avatars/avatar_4.png 3 5 2 student 4 4 0 1
20 704c091e-2ba6-494f-b7ff-5418e4e00300 2021-06-21 01:03:46.478 2021-06-21 01:03:46.488 Ahmed Ali MALE gZ694mc7UrCBMhX Elena94@gmail.com 3 /static/images/avatars/avatar_4.png 2 4 5 student 4 4 0 1
21 558d5ca3-94e2-4d18-bdde-6341c6bb262d 2021-06-21 01:03:46.478 2021-06-21 01:03:46.488 Hussin Hussin MALE aYh4HlXRKClDcSz Faye29@gmail.com 2 /static/images/avatars/avatar_4.png 2 5 2 student 4 4 0 1
22 9cc812ca-c651-4a81-b104-4dbbf402d544 2021-06-21 01:03:46.478 2021-06-21 01:03:46.488 Mahmoud Omar MALE GCYb_LiXUokYCEp Alba32@yahoo.com 2 /static/images/avatars/avatar_6.png 1 4 5 student 4 4 0 1
23 bce97107-7eca-4487-8041-cc5eda1932d3 2021-06-21 01:03:46.478 2021-06-21 01:03:46.488 Abdelrahman Hussin MALE M8chbifkXWaetsH Lonie.Ziemann@hotmail.com 4 /static/images/avatars/avatar_4.png 2 4 2 student 4 4 0 1
24 1f9ce629-8607-49b4-83b5-8d089d960740 2021-06-21 01:03:46.478 2021-06-21 01:03:46.488 Abdelrahman Hussin MALE qf7uFtmS4oYYALE Freddy.Crooks50@hotmail.com 4 /static/images/avatars/avatar_6.png 1 5 7 student 4 4 0 1
25 284d60f3-384b-42ab-8f52-5ae6bef66764 2021-06-21 01:03:46.478 2021-06-21 01:03:46.488 Mahmoud Ahmed MALE 32C5md12XBaF_XT Leland85@hotmail.com 3 /static/images/avatars/avatar_5.png 1 5 3 student 4 4 0 1
26 0639ed2d-7307-4c12-a576-799d7dafea81 2021-06-21 01:03:46.479 2021-06-21 01:03:46.488 Hussin Abdelrahman MALE xA1jwgpUyVvvaYv Gabe_Barrows35@gmail.com 5 /static/images/avatars/avatar_4.png 2 4 1 student 4 4 0 1
27 d8b36ff6-dbba-4c12-a3fc-3c7bb3940472 2021-06-21 01:03:46.479 2021-06-21 01:03:46.488 Mohamed Ahmed MALE 2FdOzhEGgLJxrCv Hollis.Hamill@gmail.com 10 /static/images/avatars/avatar_5.png 1 5 7 student 4 4 0 1
28 461db074-9d5f-4461-a7bc-c4251d7e8e55 2021-06-21 01:03:46.479 2021-06-21 01:03:46.488 Karim Ahmed MALE WQ44rf8YyEGhTen Bernard_Gusikowski@gmail.com 1 /static/images/avatars/avatar_5.png 2 4 6 student 4 4 0 1
29 12f25c95-76c5-4bb7-b24e-e48e14135e29 2021-06-21 01:03:46.479 2021-06-21 01:03:46.488 Mohamed Ahmed MALE FYYXO3TyUjIfEMu Dax89@gmail.com 8 /static/images/avatars/avatar_6.png 2 4 2 student 4 4 0 1
30 e7cd6110-9bb7-4ce7-bfe9-27466ddd939a 2021-06-21 01:03:46.479 2021-06-21 01:03:46.488 Mohamed Kamal MALE l2O4iTyssUtxN6e Ophelia.Bradtke@yahoo.com 1 /static/images/avatars/avatar_5.png 3 4 1 student 4 4 0 1
31 ebd6756f-039c-4a16-8c71-f89389fafc27 2021-06-21 01:03:46.479 2021-06-21 01:03:46.488 Ahmed Ahmed MALE XOA0r24XByoxMoi Colten.Trantow2@gmail.com 5 /static/images/avatars/avatar_4.png 2 4 1 student 4 4 0 1
32 e11b0fbe-f7f7-4ae0-978c-506c3ae50bc4 2021-06-21 01:03:46.479 2021-06-21 01:03:46.488 Sameh Omar MALE cDkgCdbMPYMmYA3 Jace_Kub23@yahoo.com 3 /static/images/avatars/avatar_4.png 1 4 3 student 4 4 0 1
33 c64a3160-fe2e-409a-83eb-96f42db37b42 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Karim Hussin MALE 8kwkOICxtmUgGnw Jefferey.Wuckert@gmail.com 8 /static/images/avatars/avatar_4.png 3 5 6 student 4 4 0 1
34 ab176dd3-0c4e-4b47-9fe9-5e54e378b9d9 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Karim Kamal MALE Q_rxR85wVfNUVNI Ezequiel7@hotmail.com 4 /static/images/avatars/avatar_4.png 3 4 3 student 4 4 0 1
13 19a0ac5a-1028-4aa8-b92c-874033512d74 2021-06-21 01:03:46.476 2021-07-04 18:31:25.889 Ahmed Karim MALE Kj_mmPF4VNjnl20 Giuseppe.Kunde46@hotmail.com 9 /static/images/avatars/avatar_4.png 3 2 1 student 4 4 0 1
35 9c4e4067-76c7-462b-b2da-c3d65c475189 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Sameh Hussin MALE H8YRYBwNrvPONFi Deion.Lemke72@yahoo.com 1 /static/images/avatars/avatar_5.png 3 5 10 student 4 4 0 1
36 bbcc19a2-732c-4b9b-a986-7ad8e738fc89 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Abdelrahman Ali MALE 12Ytqi1EFXSe3Dc Avery78@gmail.com 2 /static/images/avatars/avatar_6.png 3 4 8 student 4 4 0 1
37 6cb08ac0-407e-4056-b59c-eb32b4731063 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Hosni Ahmed MALE e6C5KYgH0OLnaNQ Ryan.Kshlerin@gmail.com 10 /static/images/avatars/avatar_5.png 1 4 4 student 4 4 0 1
38 c237b8cb-d0e8-4a40-bec5-705d14ed50f3 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Hussin Sameh MALE HQ0NJuZTwGD_Jkk Julie.Hahn49@gmail.com 8 /static/images/avatars/avatar_5.png 1 5 6 student 4 4 0 1
39 5c53e029-0bf2-474c-999d-b7f9ffeab28c 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Sameh Karim MALE dwkuD9hNiY1S8XM Emely_Gulgowski@gmail.com 8 /static/images/avatars/avatar_4.png 1 4 8 student 4 4 0 1
40 160319c9-2b2b-4026-aa1b-3ce531d10266 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Hosni Mahmoud MALE c6mqo1Eka_wZ_28 Floyd.Wilderman@yahoo.com 3 /static/images/avatars/avatar_5.png 1 5 4 student 4 4 0 1
41 907ca044-4813-4e93-9632-a0805b633a32 2021-06-21 01:03:46.48 2021-06-21 01:03:46.488 Hosni Kamal MALE nVRWxkKv7dZP5Ir Mac43@yahoo.com 1 /static/images/avatars/avatar_5.png 2 4 4 student 4 4 0 1
42 94ee4295-c397-4f4d-96e0-07e3b398881e 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Sameh Abdelrahman MALE rLArmgcfXGc6N1P Alivia.Borer18@yahoo.com 7 /static/images/avatars/avatar_6.png 2 5 7 student 4 4 0 1
43 5b064f98-e7e3-451f-a0aa-3f56c764cdd5 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Hussin Karim MALE fb8Gs3cDpoZItg6 Alejandra36@hotmail.com 4 /static/images/avatars/avatar_4.png 1 4 7 student 4 4 0 1
44 50e565d6-f614-4b7b-bb49-9fe0791d4fb4 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Sameh Mohamed MALE j0uxdXH0yKdE0bn Raphaelle.Cruickshank@yahoo.com 3 /static/images/avatars/avatar_5.png 3 4 1 student 4 4 0 1
45 cb444df2-d3db-412f-86ff-716dce8027ff 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Ali Mohamed MALE C2BoYtkIDa9P4Se Dakota_Hermann@hotmail.com 3 /static/images/avatars/avatar_5.png 1 5 2 student 4 4 0 1
46 6f5638be-c223-4807-a35f-5ed7fd1b02f8 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Mohamed Abdelrahman MALE 6a3ycYLHBOxOEWY Anabelle_Sanford72@yahoo.com 4 /static/images/avatars/avatar_4.png 2 4 8 student 4 4 0 1
47 49818bec-31ae-4648-b5d7-287c5543f582 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Ahmed Hosni MALE x8xR5mMPCPAwO2r Elissa40@yahoo.com 3 /static/images/avatars/avatar_4.png 3 4 3 student 4 4 0 1
48 70e9068a-4967-4929-b9fe-a47f214fec69 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Hussin Omar MALE qJxRVsAC3MsXjHf Breanne.Abshire87@hotmail.com 4 /static/images/avatars/avatar_6.png 3 4 9 student 4 4 0 1
49 04c23fef-5c60-40d6-a8ad-c54c9cf2fba8 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Mohamed Sameh MALE qeu57xcm5FLaqY_ Birdie.Torphy10@gmail.com 2 /static/images/avatars/avatar_5.png 2 4 9 student 4 4 0 1
50 c7072c05-f232-4b9f-8706-7ae95db9e41e 2021-06-21 01:03:46.481 2021-06-21 01:03:46.488 Ali Hosni MALE PWVEREa7DXTjYRc Krista32@gmail.com 2 /static/images/avatars/avatar_6.png 1 5 8 student 4 4 0 1
51 9e202955-bc6b-4bcc-a9b0-ffd0745f5ee9 2021-06-21 01:03:46.482 2021-06-21 01:03:46.488 Ali Ahmed MALE 2fvjapeUPtCkhjm Buddy38@hotmail.com 2 /static/images/avatars/avatar_5.png 1 4 7 student 4 4 0 1
52 b5bb7802-cc61-429c-a5b0-93d9a99b7190 2021-06-21 01:03:46.482 2021-06-21 01:03:46.488 Kamal Karim MALE GKoy2tO2g4rvGoK Amara23@hotmail.com 2 /static/images/avatars/avatar_6.png 2 5 9 student 4 4 0 1
53 bc72be12-9cdb-461f-9e7a-84fc5213279f 2021-06-21 01:03:46.482 2021-06-21 01:03:46.488 Hosni Mohamed MALE nnooBXBNw4tqm5F Ford.Torphy30@gmail.com 3 /static/images/avatars/avatar_4.png 3 4 2 student 4 4 0 1
54 ab662291-1648-43e3-852c-f45a18378db3 2021-06-21 01:03:46.482 2021-06-21 01:03:46.488 Mohamed Omar MALE XBVmrffqWCKbHfS Cleo60@gmail.com 1 /static/images/avatars/avatar_4.png 1 4 10 student 4 4 0 1
55 b92d4528-63b7-4597-86a5-b03817496ee7 2021-06-21 01:03:46.482 2021-06-21 01:03:46.488 Ali Sameh MALE QcKdqhq8CUPi63L Cary_Cruickshank52@yahoo.com 7 /static/images/avatars/avatar_5.png 1 5 4 student 4 4 0 1
56 502687c4-1357-499c-9a6c-64f12fec996c 2021-06-21 01:03:46.482 2021-06-21 01:03:46.488 Ali Karim MALE Zvi1nRPhMJGA6cg Hank99@gmail.com 3 /static/images/avatars/avatar_4.png 2 4 1 student 4 4 0 1
57 da5a35c5-3ea2-45d9-b740-2434e8ed102c 2021-06-21 01:03:46.482 2021-06-21 01:03:46.488 Abdelrahman Mohamed MALE JReQ97CsvfotMG4 Stephany32@yahoo.com 6 /static/images/avatars/avatar_5.png 1 5 5 student 4 4 0 1
58 1a6f472b-a2d1-4b58-a3e3-592634e9350c 2021-06-21 01:03:46.482 2021-06-21 01:03:46.488 Kamal Ali MALE qtGOBDPGjfsLCZH Vergie_Beer@hotmail.com 8 /static/images/avatars/avatar_5.png 3 5 2 student 4 4 0 1
59 5ea4a110-8e30-4b57-bff3-ef8ec9777835 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Kamal Mohamed MALE M_mV2QcgWKz1qyu Jaylin79@hotmail.com 4 /static/images/avatars/avatar_6.png 2 4 4 student 4 4 0 1
60 7e2e67bf-d149-445c-bf87-b4b8f49f906d 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Hosni Kamal MALE QeH5IMoMdFJtbS8 Demetrius.Kovacek@hotmail.com 10 /static/images/avatars/avatar_6.png 1 4 7 student 4 4 0 1
61 c472d362-6e52-4270-b256-0fca01697f41 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Karim Karim MALE IKUC7c97MLinVoh Callie.DuBuque25@gmail.com 3 /static/images/avatars/avatar_5.png 2 4 3 student 4 4 0 1
62 56bfd582-2b07-4817-a91d-6310583c3b29 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Ahmed Omar MALE 5JT027gunP2meKM Velva.Weimann@yahoo.com 8 /static/images/avatars/avatar_5.png 3 4 9 student 4 4 0 1
63 fb376ec6-7c8e-43a6-9286-b8ae73da8cc1 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Hosni Mohamed MALE Bw_992hOBvXUDKv Linwood82@yahoo.com 9 /static/images/avatars/avatar_5.png 1 4 10 student 4 4 0 1
64 4c70fbde-28b5-4c5e-b8bb-60b76eeee5c9 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Ahmed Ali MALE HuzAhvPk70Ta9q2 Carmella69@hotmail.com 8 /static/images/avatars/avatar_5.png 1 4 4 student 4 4 0 1
65 07fcb142-fa6c-44f1-a647-5b7460a71b9c 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Hussin Abdelrahman MALE 6KbdCRMRARXd2Ao Jaren.Parker97@gmail.com 9 /static/images/avatars/avatar_4.png 1 5 10 student 4 4 0 1
66 7ebc16b4-1245-481a-bc67-a006d032aca7 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Mohamed Ahmed MALE DmhxVEzfr2hDXsz Jett.Bayer75@hotmail.com 1 /static/images/avatars/avatar_4.png 2 5 6 student 4 4 0 1
67 4808f46d-4494-4476-ac6f-2a51f95ece46 2021-06-21 01:03:46.483 2021-06-21 01:03:46.488 Abdelrahman Kamal MALE VGWjaLbB6K8V7Uz Skylar_McDermott19@gmail.com 3 /static/images/avatars/avatar_6.png 1 5 7 student 4 4 0 1
68 abc9d262-7447-4205-9c7a-527d5648aea5 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Abdelrahman Omar MALE cdRxJzHEdivT9m_ Dasia63@gmail.com 7 /static/images/avatars/avatar_4.png 1 5 2 student 4 4 0 1
69 f634c1eb-8623-4ae3-9406-8525bfc17f6f 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Kamal Ali MALE OvEnZYgJzTifAff Oceane54@gmail.com 6 /static/images/avatars/avatar_5.png 2 5 7 student 4 4 0 1
70 018497b1-f3c7-49bd-89fd-3bfbbc03b64b 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Hussin Kamal MALE mSwSJz9asTdyXDj Eldora.Feeney@gmail.com 10 /static/images/avatars/avatar_6.png 2 5 5 student 4 4 0 1
71 ab7c94a6-4c4b-4e18-93f8-1d5f0ee3f75b 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Karim Kamal MALE cacDNVlUWoasXei Dolly82@gmail.com 1 /static/images/avatars/avatar_5.png 3 5 7 student 4 4 0 1
72 609ae855-9514-4d65-8251-a175042d28c7 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Ali Mahmoud MALE n7PdXfMR2bGwUY4 Dorothy_Davis51@gmail.com 8 /static/images/avatars/avatar_5.png 2 4 3 student 4 4 0 1
73 d95ea9a3-7aca-4b4a-ba94-8730596ea8b3 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Mahmoud Sameh MALE CRlEmYdjWCrhWng Alphonso_Cremin@gmail.com 1 /static/images/avatars/avatar_4.png 1 5 6 student 4 4 0 1
74 2fbe3c04-cd4f-44c7-8dad-055e0bf02d41 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Ali Hosni MALE y4YNyjVGq0SA4_m Tyler81@gmail.com 8 /static/images/avatars/avatar_4.png 1 4 4 student 4 4 0 1
75 0b92dee2-f68c-410b-83da-7c78daaf2391 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Mohamed Hosni MALE Kj7J3ciXwGDh0Ku Nova93@hotmail.com 3 /static/images/avatars/avatar_6.png 2 4 2 student 4 4 0 1
76 8d52c333-6a56-453b-92f2-bca45e28b7b7 2021-06-21 01:03:46.484 2021-06-21 01:03:46.488 Hosni Mohamed MALE w5AgJYCuddT8BGN Kevin.Olson@gmail.com 3 /static/images/avatars/avatar_4.png 2 4 9 student 4 4 0 1
77 3d6afaf9-acd6-46a2-b715-af5595a53782 2021-06-21 01:03:46.485 2021-06-21 01:03:46.488 Mahmoud Ali MALE Q1tcT76oOlFBKs1 Maureen21@yahoo.com 1 /static/images/avatars/avatar_4.png 2 4 1 student 4 4 0 1
78 dffd3783-eafc-49c0-bdce-25ee780a20df 2021-06-21 01:03:46.485 2021-06-21 01:03:46.488 Hosni Ali MALE Cniqob7230AH1ly Sheila86@hotmail.com 5 /static/images/avatars/avatar_4.png 2 5 8 student 4 4 0 1
79 2088629f-f872-4c9c-b09a-0b1ba9bac02f 2021-06-21 01:03:46.485 2021-06-21 01:03:46.488 Kamal Mahmoud MALE p_ZXvo7IElHrmKX Jayme_Macejkovic74@yahoo.com 4 /static/images/avatars/avatar_6.png 3 5 3 student 4 4 0 1
80 e577f472-1d22-4090-b3bd-89bcf37dca3a 2021-06-21 01:03:46.485 2021-06-21 01:03:46.488 Hussin Abdelrahman MALE qLQI5E9pwG8EC2U Jamarcus50@gmail.com 2 /static/images/avatars/avatar_6.png 3 5 9 student 4 4 0 1
81 f5c98144-d8b0-46f0-a352-97cd0e084ab9 2021-06-21 01:03:46.485 2021-06-21 01:03:46.488 Mohamed Ahmed MALE uYIOTohPMdRgGh8 Leif.Roberts@gmail.com 8 /static/images/avatars/avatar_4.png 3 5 4 student 4 4 0 1
82 b9961371-9f1f-4d2c-b3e3-f01cafa1e61a 2021-06-21 01:03:46.485 2021-06-21 01:03:46.488 Karim Abdelrahman MALE I9v_rOYM5PQlU44 Marina_Durgan81@hotmail.com 4 /static/images/avatars/avatar_6.png 2 4 5 student 4 4 0 1
83 80dd7069-5ca4-482a-a9f4-c8d5880a4f6f 2021-06-21 01:03:46.485 2021-06-21 01:03:46.489 Karim Mahmoud MALE vdzcNL6sSzKdJ6c Georgiana35@hotmail.com 4 /static/images/avatars/avatar_6.png 2 4 8 student 4 4 0 1
84 cbf57982-6599-4ffc-9576-7dbdba3f50e7 2021-06-21 01:03:46.485 2021-06-21 01:03:46.489 Mohamed Hosni MALE LgJ2gZVP1hKgTDf Annette_Morissette34@yahoo.com 2 /static/images/avatars/avatar_6.png 2 4 5 student 4 4 0 1
85 df012c6b-40e7-48d9-acc1-585fad44ceca 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Mahmoud Sameh MALE pYuUFe_Oqao9ffZ Kaci.Braun68@gmail.com 7 /static/images/avatars/avatar_5.png 3 5 10 student 4 4 0 1
86 5d704f12-9d0b-4d9d-abde-f83707408a43 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Ali Abdelrahman MALE yHv_O8rkOYCDc7w Mateo.Cartwright@yahoo.com 8 /static/images/avatars/avatar_5.png 1 4 1 student 4 4 0 1
87 e3effe62-dc2e-4cf1-894b-ad4b72c8fbd5 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Ali Karim MALE _AyF_jKGEYzb46e Shyann.Stokes@yahoo.com 3 /static/images/avatars/avatar_4.png 1 4 1 student 4 4 0 1
88 e5be09bf-9d0f-4f45-b518-6f68854281bd 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Hosni Hosni MALE s1Fw4GVIYlUoYf6 Napoleon_Kling@yahoo.com 6 /static/images/avatars/avatar_5.png 2 4 10 student 4 4 0 1
89 2f529f0e-ba14-4655-8882-160b162a2d03 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Karim Hussin MALE UaHnjWSlA_EPde2 Quincy.Macejkovic72@yahoo.com 6 /static/images/avatars/avatar_5.png 3 5 8 student 4 4 0 1
90 ab0f68cf-4b31-4136-a7f2-823388505071 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Hosni Hussin MALE gzArO09F6wY2dOK Oleta.Langosh86@gmail.com 2 /static/images/avatars/avatar_5.png 1 4 1 student 4 4 0 1
91 78a12364-c779-4edc-9629-0d63b4a51e29 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Kamal Mohamed MALE Wme9KwvqPJhsrxw Micah_Cronin92@hotmail.com 5 /static/images/avatars/avatar_6.png 2 5 6 student 4 4 0 1
92 10108d83-4b2c-4dbf-a005-ae24d5f33daf 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Abdelrahman Hosni MALE FVxxEXinuUJ5gZk Haylee_Hessel91@gmail.com 7 /static/images/avatars/avatar_5.png 3 4 1 student 4 4 0 1
93 5ac7c133-8c82-4fd7-a94f-62aa53549bfb 2021-06-21 01:03:46.486 2021-06-21 01:03:46.489 Kamal Sameh MALE z3IpSmTLgyjOjRz Cecelia38@yahoo.com 9 /static/images/avatars/avatar_4.png 3 5 7 student 4 4 0 1
94 d6955aa6-88b0-4642-a780-9cb19b1a799d 2021-06-21 01:03:46.487 2021-06-21 01:03:46.489 Abdelrahman Karim MALE 2F_vl6aE0EieUDT Brycen_Corkery@yahoo.com 1 /static/images/avatars/avatar_4.png 2 5 1 student 4 4 0 1
95 f4425924-6267-45a2-ac36-fe73280fff78 2021-06-21 01:03:46.487 2021-06-21 01:03:46.489 Mahmoud Mahmoud MALE yCiLV_RgLv6dQS2 Donato.Wehner72@hotmail.com 8 /static/images/avatars/avatar_4.png 3 5 9 student 4 4 0 1
96 a080701f-52ce-451a-9a74-1ee7750dfa66 2021-06-21 01:03:46.487 2021-06-21 01:03:46.489 Karim Sameh MALE Lwa5QMUs3gPetAk Fae53@yahoo.com 10 /static/images/avatars/avatar_6.png 3 5 4 student 4 4 0 1
97 9b60fe41-915a-417f-8e33-8d2c42497f33 2021-06-21 01:03:46.487 2021-06-21 01:03:46.489 Ali Mohamed MALE qIFRE48x06xXjtl Tania11@hotmail.com 6 /static/images/avatars/avatar_4.png 2 4 2 student 4 4 0 1
98 a72a2069-7539-447e-9646-af87612477a6 2021-06-21 01:03:46.487 2021-06-21 01:03:46.489 Abdelrahman Ali MALE 4XLA3pIKgatvAUn Sonya46@gmail.com 3 /static/images/avatars/avatar_5.png 3 4 1 student 4 4 0 1
99 e661a4c1-b40b-48f8-b680-becbb33457ca 2021-06-21 01:03:46.487 2021-06-21 01:03:46.489 Hussin Ali MALE 0h0A9EYIzKIcCac Rachael.Rowe7@gmail.com 9 /static/images/avatars/avatar_4.png 1 4 3 student 4 4 0 1
100 c8eec2dc-cf32-486e-8844-a96791dac83e 2021-06-21 01:03:46.487 2021-06-21 01:03:46.489 Sameh Sameh MALE Pr1gbFD8A0RveAF Christy_Goldner@yahoo.com 4 /static/images/avatars/avatar_5.png 3 5 9 student 4 4 0 1
101 6583be8f-04f6-40ba-ae72-8e9376c3b796 2021-07-03 21:18:21.877 1970-01-01 00:00:00 test test MALE fdfd test@gmail.com 1 /static/images/avatars/avatar_4 \N \N 1 student 4 4 0 1
102 113ddde7-f14b-4108-934e-3057e35b4aaa 2021-07-04 16:20:00.76 2021-07-04 16:20:00.761 test test MALE 9_UaRTOAzwi2kiA testtest@yahoo.com 9 /static/images/avatars/avatar_4 \N \N 1 student 4 4 0 1
1 5c1212a5-5599-4d43-adff-f9b34df42b21 2021-06-21 01:03:46.474 2021-07-04 20:27:18.508 Ali Sameh MALE 0b7Ce0tZKxqnIEx Isabell_Altenwerth96@gmail.com 9 /static/images/avatars/avatar_4.png 2 3 1 student 4 4 0 1
\.
--
-- Data for Name: StudentSemester; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."StudentSemester" ("createdAt", "updatedAt", "studentId", "semesterId", "semesterGPA", "creditDone", "creditHave") FROM stdin;
\.
--
-- Data for Name: Supervisor; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."Supervisor" (id, "createdAt", "updatedAt", fname, lname, gender, password, email, phone, avatar, "coordinatorId", role) FROM stdin;
1 2021-06-21 01:03:46.447 2021-06-21 01:03:46.449 Hosni Kamal MALE iO21kYpmrHOm4B8 Marielle5@yahoo.com 1-742-693-7025 /static/images/avatars/avatar_3.png 5 supervisor
2 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Ahmed Ahmed MALE 6It3zJJmxGa1uYe Joanie_Keebler@hotmail.com 1-454-834-6956 x6087 /static/images/avatars/avatar_0.png 8 supervisor
3 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Mahmoud Ali MALE _w2nVRDgCD46eUb Richie_Reichel@hotmail.com 822.258.7285 /static/images/avatars/avatar_2.png 4 supervisor
4 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Ahmed Ahmed MALE 9Qs2HZSUMccoM0r Wilton16@hotmail.com 873.803.1163 /static/images/avatars/avatar_0.png 2 supervisor
5 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Kamal Karim MALE B07_dJ5sTjcQxLN Melany.Brown13@hotmail.com 971.501.6995 x637 /static/images/avatars/avatar_3.png 1 supervisor
6 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Hosni Mohamed MALE MupTfT6VldBb_4C Shaun.Macejkovic4@gmail.com 467.908.9484 /static/images/avatars/avatar_2.png 7 supervisor
7 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Ahmed Abdelrahman MALE i6VX02bAD17bftY Augustus.Gutmann@yahoo.com 278.273.0327 /static/images/avatars/avatar_3.png 7 supervisor
8 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Kamal Mahmoud MALE gKmakHc71_bPew0 Naomi89@yahoo.com 644.861.2148 /static/images/avatars/avatar_1.png 1 supervisor
9 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Ahmed Mahmoud MALE OXxslUjkAn7Fv60 Emmalee.Fahey99@yahoo.com 1-212-824-3540 x9248 /static/images/avatars/avatar_1.png 9 supervisor
10 2021-06-21 01:03:46.448 2021-06-21 01:03:46.449 Mohamed Omar MALE K8OgjmJydyXfvuj Vanessa94@yahoo.com 1-520-333-2401 /static/images/avatars/avatar_1.png 7 supervisor
\.
--
-- Data for Name: _CoursePrerequisites; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."_CoursePrerequisites" ("A", "B") FROM stdin;
1 2
2 3
4 10
13 18
14 20
13 23
20 24
25 26
13 27
19 28
17 29
13 30
13 31
27 33
27 34
27 35
27 36
35 37
27 38
27 39
27 40
15 43
22 44
14 45
22 46
22 48
14 49
44 49
44 50
51 52
30 54
30 55
55 56
55 57
54 57
55 58
54 58
61 62
20 63
20 64
24 65
24 66
20 67
64 70
71 72
26 73
25 74
25 75
75 76
75 77
75 78
25 79
77 80
81 82
\.
--
-- Data for Name: _CourseToSemester; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public."_CourseToSemester" ("A", "B") FROM stdin;
\.
--
-- Data for Name: _prisma_migrations; Type: TABLE DATA; Schema: public; Owner: abosamra
--
COPY public._prisma_migrations (id, checksum, finished_at, migration_name, logs, rolled_back_at, started_at, applied_steps_count) FROM stdin;
03624aa8-8420-42db-a861-c48c4e4ac615 039872cf54c0651259532e26484c72f1db89bdf9480d9380f238f17496575658 2021-06-21 03:03:44.094719+02 20210529130750_fixnotifications \N \N 2021-06-21 03:03:44.019667+02 1
e2ff1543-da6c-4e08-9001-a81563f85808 5d0a1dbe3c7f8dee91c412286bad3a0a434fab62f6e3571f2b6b96f5bb0671e1 2021-06-21 03:03:42.893089+02 20210415233134_init \N \N 2021-06-21 03:03:42.62701+02 1
8305f962-e263-482f-b644-4fccaafd5daf 4a31511c4dc25ac8d32f234b454ac08b9c2dbe75cb5fd23c99a8c3cbd34f6b39 2021-06-21 03:03:43.293986+02 20210418005159_first \N \N 2021-06-21 03:03:42.901637+02 1
a3ca845d-1620-4165-83fe-491e50747263 adb9e45c3fb68efc83ab56ec3fd2958c99accbb416ec196df5158a2606d47ed8 2021-06-21 03:03:43.360541+02 20210418024452_second \N \N 2021-06-21 03:03:43.302385+02 1
fc094eef-d88c-41e3-9fa6-1d0f01fe0d88 ab94903ba2bbb1671e930f6f98a29652621f9cdb8d1f89d81236934674430359 2021-06-21 03:03:44.20326+02 20210601084916_add_major \N \N 2021-06-21 03:03:44.10326+02 1
360a86c6-5aa2-40fa-ae15-722b40771014 f94dbd675f3fe87ddb40688c50b4f4273c3d434251f63b8d928b79bf39d843c5 2021-06-21 03:03:43.418962+02 20210503052956_add_gpa \N \N 2021-06-21 03:03:43.368997+02 1
c6761130-21b9-4569-ad1a-08cb2e808324 6073ce0556e320dbcd27ad751d2ed5e50838cfd1ee9ffdbd37d378c1fbd6dcd2 2021-06-21 03:03:43.452285+02 20210503053431_add_mis \N \N 2021-06-21 03:03:43.427351+02 1
54867973-ef5a-49e6-a26e-a91e1851a7c1 cb720737207a1084b8acd3df87de5d952c5fd43857622e8694cdbcaa9fba7fac 2021-06-21 03:03:43.485943+02 20210503055655_add_level \N \N 2021-06-21 03:03:43.460733+02 1
84a31f54-8a3e-4fed-94e5-5db3671922ee 6253a1cce740e7ef549cb4f4fc9907c744540886ea01271ee98c3d2c1433dfb6 2021-06-21 03:03:44.328498+02 20210619225039_addcoordinator \N \N 2021-06-21 03:03:44.211737+02 1
7b9bedd6-196c-4119-a3b0-4f11a9306e31 ac3e1dd7c3758b7e80b2955f3aeb76630bd57b9e369d46c3845f353de6d1e9c4 2021-06-21 03:03:43.619097+02 20210503055802_addgpafloat \N \N 2021-06-21 03:03:43.494349+02 1
c4106b1e-a6e3-4fba-9736-500012b5a7ac 5f385757cf338bbfe98374eff6fd2e9903f1524c2c05d4943b045ad21ec6c45a 2021-06-21 03:03:43.710934+02 20210504025726_addfinishedcourses \N \N 2021-06-21 03:03:43.627583+02 1
46bef6e2-4c58-4155-a99e-de14118bf876 0ba7aaa4b4b9f2a058450247ba6119b2a9e6dfa0c9efd0bcb1fd7330de768b82 2021-06-21 03:03:43.744334+02 20210504231028_adddefaultpassword \N \N 2021-06-21 03:03:43.719355+02 1
27033ed0-1120-49f7-b626-8421d55cdbdb d338778b4db2af1e4f6fe72530734db0c85dd63978c49024ad982e4825d7d0be 2021-06-21 03:03:44.36182+02 20210620002951_addrole \N \N 2021-06-21 03:03:44.336958+02 1
e3db72d5-dd67-4c57-9292-98dedbf7d55d 64cc4b3ebfc65c9205acc03da7a662c88f68f9fed1d6bf46aa5265135d7fb651 2021-06-21 03:03:43.777578+02 20210505031559_optionalpassword \N \N 2021-06-21 03:03:43.752685+02 1
a177c9a7-57d0-4c4c-b55d-55a9493f2906 61c609d51929becff204aa98543acf8e055023d8f3529d8be30bd2d1b723730a 2021-06-21 03:03:43.835896+02 20210511163132_coursecodeunique \N \N 2021-06-21 03:03:43.785946+02 1
f2d396b3-abcc-431d-bfb1-416c9c89299c b1830e1f9afb69ea7a61d8dd4af8ce3a587c0a12cdde7608254677f9e9439434 2021-06-21 03:03:43.927754+02 20210520032319_idforfinishedcourses \N \N 2021-06-21 03:03:43.844291+02 1
343bb6fd-e330-43fc-b597-ff755ad93ef2 691ee83d23342a36449c78eb97953b7b1de1a8113c4386e6e9fe891e58bc9e89 2021-06-21 03:03:44.395163+02 20210620202458_addtypeforcourse \N \N 2021-06-21 03:03:44.370234+02 1
a52a523f-9e87-411f-a393-cc0f75301b42 5d3783e2256b0dcf3969151bb11a6261311ad21b272d95e54936d55520f7bc02 2021-06-21 03:03:44.011205+02 20210529121638_addnotifications \N \N 2021-06-21 03:03:43.936204+02 1
cb80b2a6-b17e-4609-a9c6-0694db86cbd2 99f8d81a054a37ef99aa630484a774dbf649c866b9bb163f654691e7e419a8be 2021-06-21 03:03:44.428577+02 20210620204048_add_type_enum \N \N 2021-06-21 03:03:44.403624+02 1
6cb8e99a-7ca6-46cb-9ff1-f317f96c5b9e 9b55aab63e9efaf95ea8aca556f4ad982d1b5ca0085e3d24e946ef8712f1c6a5 2021-06-21 03:03:44.595412+02 20210621005249_adddefaults \N \N 2021-06-21 03:03:44.436974+02 1
b3f10482-cb93-4964-a419-feb8e080908f a860d70fd4c8b96aeeb19978159ff1165aabbe17360749b893a216705e0ab619 2021-06-21 03:33:06.171006+02 20210621013306_adduniversityelective \N \N 2021-06-21 03:33:06.144751+02 1
72de7dd2-683a-48c4-85dc-c29f49fff421 f8443daf979127a0ddf471d2c0aaea5e4a1513d451c2bd1f6c1d89d6d97df747 2021-07-01 17:36:23.088701+02 20210701153622_addsemester \N \N 2021-07-01 17:36:22.788406+02 1
398d79ea-178e-47bd-8273-df550c6aefaf 0957c62498ddedd65b146416a7eaddb22b393e028864ad8b2071c75091201a81 2021-07-03 15:12:12.665488+02 20210703131212_add_credit_tofinishedcourses \N \N 2021-07-03 15:12:12.584847+02 1
b523f515-1511-4405-961d-71d6a688c627 a5672239d0990f0063151ed5ce5309e266e70388c6c2fa2f0d98c79218828098 2021-07-01 19:00:28.504144+02 20210701170028_addstudentsemester \N \N 2021-07-01 19:00:28.413955+02 1
0dc4f469-bafc-476f-8890-cb7644e81c2c 8af5874385e6f051d08e368e1e3bc5e001bb9f61edd0beca4abbc57df7ee6def 2021-07-01 21:14:18.673902+02 20210701191418_addstudentsemester2 \N \N 2021-07-01 21:14:18.591113+02 1
4d0f85fd-00d3-4661-a8a7-51ba813041cf 8a331ec4485c4c87c843c98d4493b582252ee12e7d17723b70fb99944f34d1d1 2021-07-04 21:13:03.797745+02 20210704191303_add_student_credit_done \N \N 2021-07-04 21:13:03.77052+02 1
7fe64f7d-ae9e-400e-8ed5-625d25ea5e28 aa42776bae7c167cf38aa575bc88a58b2ae905645109b8bdbb2d11c3972e5e73 2021-07-02 16:31:42.692236+02 20210702143142_numerical_gpa \N \N 2021-07-02 16:31:42.627487+02 1
faffc937-0530-4c30-b219-7a67ce5b7a1b 8f67b4623e46d205337156212659843b84615b3dff55c85ba8e741d19055d159 2021-07-03 16:07:51.611339+02 20210703140751_add_enrollmentsto_semesters \N \N 2021-07-03 16:07:51.459085+02 1
cd1db5c1-f125-4bf2-85b0-a8062c0c27d0 1b09f6e351de06d9eb63fbaccb196b8012e58401c65f59edc4e4813e9b58dd00 2021-07-02 16:33:30.617137+02 20210702143330_numerical_gpafloat \N \N 2021-07-02 16:33:30.586624+02 1
9d970070-2495-482b-a61e-12a13335d7b0 7bb358d0adea84994164c64cf576172ad4d3e1471b7c3483f8072b688acd01b5 2021-07-03 00:51:39.79633+02 20210702225139_add_credit_to_enrollment \N \N 2021-07-03 00:51:39.766929+02 1
d6e5f139-60be-4988-8674-562be26238bc 2524dc4bfb8d482f00f6df23ca1f64f570069d8655af1c528351252ef560ca44 2021-07-04 17:55:52.844277+02 20210704155552_addinstructorrelation \N \N 2021-07-04 17:55:52.696235+02 1
07ab4818-b006-4803-9217-35dd8a21469a ae41e26cb9047bc2b0d3da2edaa0e6046336dc2346074b13bda936128a9524a7 2021-07-04 00:49:12.969587+02 20210703224912_addclosedstatusforsemester \N \N 2021-07-04 00:49:12.895356+02 1
097e4f2a-b209-492b-8301-1c2350e42d72 2d434442d5a3a4ffcdced5d6e44c03b4ce179ae3f13c5b99605a01ac30d7246b 2021-07-04 16:49:57.528157+02 20210704144957_defaultsemester_gpa_initial \N \N 2021-07-04 16:49:57.47245+02 1
087af622-b5f5-4110-93be-1ea604a6dbf6 d38cce4dd2499122e219bad6ff76c9cf70ec11331712b0e61a8e6e5e939d15fd 2021-07-04 21:12:21.553655+02 20210704191221_removestudent_credit_have \N \N 2021-07-04 21:12:21.518184+02 1
c2afa1a7-7830-481a-b229-ff1f85e9ada3 91f5dbb7f6c6922b5add01f96badfe0adf88a73ec09858ba5be727c8f745ce30 2021-07-04 22:20:07.280289+02 20210704202007_resetlevel \N \N 2021-07-04 22:20:07.251935+02 1
7bdd3dbc-0603-4a1e-8940-2b5dd770f1cc 6184e3baf8f250016757f0a4634afb75bc43299a7a36143b062c43924cfa1726 2021-07-04 22:04:04.731858+02 20210704200404_remove_gpa \N \N 2021-07-04 22:04:04.703831+02 1
20bd336d-d34b-4154-b10e-8f9be2870100 d862919440ba84f25de5895150e0a581415a2537080fd91504d49473a0587251 2021-07-04 22:20:48.80141+02 20210704202048_resetlevel2 \N \N 2021-07-04 22:20:48.774547+02 1
\.
--
-- Name: Coordinator_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."Coordinator_id_seq"', 10, true);
--
-- Name: Course_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."Course_id_seq"', 83, true);
--
-- Name: Enrollment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."Enrollment_id_seq"', 39, true);
--
-- Name: FinishedCourses_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."FinishedCourses_id_seq"', 25, true);
--
-- Name: Major_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."Major_id_seq"', 5, true);
--
-- Name: Notifications_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."Notifications_id_seq"', 79, true);
--
-- Name: Semester_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."Semester_id_seq"', 9, true);
--
-- Name: Student_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."Student_id_seq"', 102, true);
--
-- Name: Supervisor_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abosamra
--
SELECT pg_catalog.setval('public."Supervisor_id_seq"', 10, true);
--
-- Name: Coordinator Coordinator_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Coordinator"
ADD CONSTRAINT "Coordinator_pkey" PRIMARY KEY (id);
--
-- Name: Course Course_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Course"
ADD CONSTRAINT "Course_pkey" PRIMARY KEY (id);
--
-- Name: Enrollment Enrollment_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Enrollment"
ADD CONSTRAINT "Enrollment_pkey" PRIMARY KEY (id);
--
-- Name: FinishedCourses FinishedCourses_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."FinishedCourses"
ADD CONSTRAINT "FinishedCourses_pkey" PRIMARY KEY (id);
--
-- Name: Major Major_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Major"
ADD CONSTRAINT "Major_pkey" PRIMARY KEY (id);
--
-- Name: Notifications Notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Notifications"
ADD CONSTRAINT "Notifications_pkey" PRIMARY KEY (id);
--
-- Name: Semester Semester_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Semester"
ADD CONSTRAINT "Semester_pkey" PRIMARY KEY (id);
--
-- Name: StudentSemester StudentSemester_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."StudentSemester"
ADD CONSTRAINT "StudentSemester_pkey" PRIMARY KEY ("studentId", "semesterId");
--
-- Name: Student Student_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Student"
ADD CONSTRAINT "Student_pkey" PRIMARY KEY (id);
--
-- Name: Supervisor Supervisor_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Supervisor"
ADD CONSTRAINT "Supervisor_pkey" PRIMARY KEY (id);
--
-- Name: _prisma_migrations _prisma_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public._prisma_migrations
ADD CONSTRAINT _prisma_migrations_pkey PRIMARY KEY (id);
--
-- Name: Coordinator.email_unique; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE UNIQUE INDEX "Coordinator.email_unique" ON public."Coordinator" USING btree (email);
--
-- Name: Major.code_unique; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE UNIQUE INDEX "Major.code_unique" ON public."Major" USING btree (code);
--
-- Name: Student.email_unique; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE UNIQUE INDEX "Student.email_unique" ON public."Student" USING btree (email);
--
-- Name: Student.uniCode_unique; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE UNIQUE INDEX "Student.uniCode_unique" ON public."Student" USING btree ("uniCode");
--
-- Name: Supervisor.email_unique; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE UNIQUE INDEX "Supervisor.email_unique" ON public."Supervisor" USING btree (email);
--
-- Name: _CoursePrerequisites_AB_unique; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE UNIQUE INDEX "_CoursePrerequisites_AB_unique" ON public."_CoursePrerequisites" USING btree ("A", "B");
--
-- Name: _CoursePrerequisites_B_index; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE INDEX "_CoursePrerequisites_B_index" ON public."_CoursePrerequisites" USING btree ("B");
--
-- Name: _CourseToSemester_AB_unique; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE UNIQUE INDEX "_CourseToSemester_AB_unique" ON public."_CourseToSemester" USING btree ("A", "B");
--
-- Name: _CourseToSemester_B_index; Type: INDEX; Schema: public; Owner: abosamra
--
CREATE INDEX "_CourseToSemester_B_index" ON public."_CourseToSemester" USING btree ("B");
--
-- Name: Course Course_coordinatorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Course"
ADD CONSTRAINT "Course_coordinatorId_fkey" FOREIGN KEY ("coordinatorId") REFERENCES public."Coordinator"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Course Course_instructorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Course"
ADD CONSTRAINT "Course_instructorId_fkey" FOREIGN KEY ("instructorId") REFERENCES public."Supervisor"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Course Course_majorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Course"
ADD CONSTRAINT "Course_majorId_fkey" FOREIGN KEY ("majorId") REFERENCES public."Major"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Course Course_minorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Course"
ADD CONSTRAINT "Course_minorId_fkey" FOREIGN KEY ("minorId") REFERENCES public."Major"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Enrollment Enrollment_courseID_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Enrollment"
ADD CONSTRAINT "Enrollment_courseID_fkey" FOREIGN KEY ("courseID") REFERENCES public."Course"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: Enrollment Enrollment_semesterId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Enrollment"
ADD CONSTRAINT "Enrollment_semesterId_fkey" FOREIGN KEY ("semesterId") REFERENCES public."Semester"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Enrollment Enrollment_studentID_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Enrollment"
ADD CONSTRAINT "Enrollment_studentID_fkey" FOREIGN KEY ("studentID") REFERENCES public."Student"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: Enrollment Enrollment_studentID_semesterId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Enrollment"
ADD CONSTRAINT "Enrollment_studentID_semesterId_fkey" FOREIGN KEY ("studentID", "semesterId") REFERENCES public."StudentSemester"("studentId", "semesterId") ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Enrollment Enrollment_supervisorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Enrollment"
ADD CONSTRAINT "Enrollment_supervisorId_fkey" FOREIGN KEY ("supervisorId") REFERENCES public."Supervisor"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: FinishedCourses FinishedCourses_courseId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."FinishedCourses"
ADD CONSTRAINT "FinishedCourses_courseId_fkey" FOREIGN KEY ("courseId") REFERENCES public."Course"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: FinishedCourses FinishedCourses_instructorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."FinishedCourses"
ADD CONSTRAINT "FinishedCourses_instructorId_fkey" FOREIGN KEY ("instructorId") REFERENCES public."Supervisor"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: FinishedCourses FinishedCourses_studentID_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."FinishedCourses"
ADD CONSTRAINT "FinishedCourses_studentID_fkey" FOREIGN KEY ("studentID") REFERENCES public."Student"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: FinishedCourses FinishedCourses_studentID_semesterId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."FinishedCourses"
ADD CONSTRAINT "FinishedCourses_studentID_semesterId_fkey" FOREIGN KEY ("studentID", "semesterId") REFERENCES public."StudentSemester"("studentId", "semesterId") ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: Notifications Notifications_coordinatorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Notifications"
ADD CONSTRAINT "Notifications_coordinatorId_fkey" FOREIGN KEY ("coordinatorId") REFERENCES public."Coordinator"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Notifications Notifications_studentID_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Notifications"
ADD CONSTRAINT "Notifications_studentID_fkey" FOREIGN KEY ("studentID") REFERENCES public."Student"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Notifications Notifications_supervisorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Notifications"
ADD CONSTRAINT "Notifications_supervisorId_fkey" FOREIGN KEY ("supervisorId") REFERENCES public."Supervisor"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Semester Semester_coordinatorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Semester"
ADD CONSTRAINT "Semester_coordinatorId_fkey" FOREIGN KEY ("coordinatorId") REFERENCES public."Coordinator"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: StudentSemester StudentSemester_semesterId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."StudentSemester"
ADD CONSTRAINT "StudentSemester_semesterId_fkey" FOREIGN KEY ("semesterId") REFERENCES public."Semester"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: StudentSemester StudentSemester_studentId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."StudentSemester"
ADD CONSTRAINT "StudentSemester_studentId_fkey" FOREIGN KEY ("studentId") REFERENCES public."Student"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: Student Student_coordinatorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Student"
ADD CONSTRAINT "Student_coordinatorId_fkey" FOREIGN KEY ("coordinatorId") REFERENCES public."Coordinator"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Student Student_majorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Student"
ADD CONSTRAINT "Student_majorId_fkey" FOREIGN KEY ("majorId") REFERENCES public."Major"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Student Student_minorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Student"
ADD CONSTRAINT "Student_minorId_fkey" FOREIGN KEY ("minorId") REFERENCES public."Major"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Student Student_supervisorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Student"
ADD CONSTRAINT "Student_supervisorId_fkey" FOREIGN KEY ("supervisorId") REFERENCES public."Supervisor"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: Supervisor Supervisor_coordinatorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."Supervisor"
ADD CONSTRAINT "Supervisor_coordinatorId_fkey" FOREIGN KEY ("coordinatorId") REFERENCES public."Coordinator"(id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: _CoursePrerequisites _CoursePrerequisites_A_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."_CoursePrerequisites"
ADD CONSTRAINT "_CoursePrerequisites_A_fkey" FOREIGN KEY ("A") REFERENCES public."Course"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: _CoursePrerequisites _CoursePrerequisites_B_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."_CoursePrerequisites"
ADD CONSTRAINT "_CoursePrerequisites_B_fkey" FOREIGN KEY ("B") REFERENCES public."Course"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: _CourseToSemester _CourseToSemester_A_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."_CourseToSemester"
ADD CONSTRAINT "_CourseToSemester_A_fkey" FOREIGN KEY ("A") REFERENCES public."Course"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: _CourseToSemester _CourseToSemester_B_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abosamra
--
ALTER TABLE ONLY public."_CourseToSemester"
ADD CONSTRAINT "_CourseToSemester_B_fkey" FOREIGN KEY ("B") REFERENCES public."Semester"(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: abosamra
--
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
|
CREATE TABLE messages(
id INTEGER PRIMARY KEY UNIQUE NOT NULL,
chat_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
message TEXT NOT NULL,
created TEXT NOT NULL,
FOREIGN KEY(chat_id) REFERENCES chats(id),
FOREIGN KEY (user_id) REFERENCES users(id)
);
|
insert into demande ( id,nom,prenom,adresse,datenaiss,revenu,credit,duree,etat) values('1234','Toto', 'Titi','Nancy','16/07/1992',100,20,3,'OK');
INSERT INTO demande_actions_id VALUES ('1234', '1'); |
SELECT cust_id FROM Customers; |
CREATE Procedure sp_acc_Update_PartnerInfo
(@NAME NVARCHAR (50),
@AGE INT,
@GENDER INT,
@ADDRESS NVARCHAR(255),
@ITPAN NVARCHAR(50),
@ITGRNO NVARCHAR(50),
@SALARYPAYABLE INT,
@PHONE NVARCHAR(50),
@EMAIL NVARCHAR(50),
@HIDDENNAME NVARCHAR(50),
@ACCOUNTID INT,
@DRAWINGACCOUNTID INT)
AS
UPDATE SetupDetail SET Name=@NAME,
Age=@AGE,
Gender=@GENDER,
Address=@ADDRESS,
ITPAN=@ITPAN,
ITGRNo=@ITGRNO,
SalaryPayable=@SALARYPAYABLE,
Phone=@PHONE,
EMail=@EMAIL
Where Name=@HIDDENNAME
If IsNull(@AccountID,0) <>0
Begin
Update AccountsMaster Set AccountName=@Name Where AccountID = @AccountID
End
If IsNull(@DRawingAccountID,0) <>0
Begin
Update AccountsMaster Set AccountName=dbo.LookUpdictionaryItem('Drawing-',Default) + @Name Where AccountID = @DRawingAccountID
End
|
/* *** static char rscid[] = "@(#) [item] [version] [crtime] [author]"; *** */
CREATE OR REPLACE PROCEDURE T_SP_RKP4290_OGA
/* ************************************************************************* **
** PROGRAM NAME : RKP4290_OGA.SQL **
** **
** MODULE NAME : T_SP_RKP4290_OGA **
** **
** AUTHOR : KAVIN J STUCKLY **
** CREATED : 06 DECEMBER 2000 **
** PURPOSE : This procedure should be executed from within Stored **
** Procedure T_SP_RKP4290. This procedure is to validate **
** OGA (Other Government Agencies) information. **
** **
** ************************************************************************* */
(
p_table IN VARCHAR2,
p_owner IN ENTRY_INV.OWNER%TYPE,
p_entry_no IN ENTRY_HDR.ENTRY_NO%TYPE,
p_bill_of_lading_no IN ENTRY_INV.BILL_OF_LADING_NO%TYPE,
p_import_date IN ENTRY_HDR.IMPORT_DATE%TYPE,
p_export_country IN PRECLASS_DTL.EXPORT_COUNTRY%TYPE,
p_item IN ENTRY_DTL.ITEM%TYPE,
p_hts_no IN ENTRY_DTL.HTS_NO%TYPE,
p_hts_line_no IN PRECLASS_DTL.LINE_NO%TYPE,
p_nonchargeable_sample IN VARCHAR2,
p_origin_country IN ENTRY_DTL.ORIGIN_COUNTRY%TYPE,
p_med_check IN OUT VARCHAR2,
p_load_status OUT VARCHAR2
)
AS
/* ************************************************************************* **
** variables declaration. **
** ************************************************************************* */
c_unit_1 HTS.UNIT_1%TYPE;
c_unit_2 HTS.UNIT_2%TYPE;
c_unit_3 HTS.UNIT_3%TYPE;
c_oga_1 HTS.OGA_1%TYPE;
c_oga_2 HTS.OGA_2%TYPE;
c_oga_3 HTS.OGA_3%TYPE;
c_oga_4 HTS.OGA_4%TYPE;
c_oga_5 HTS.OGA_5%TYPE;
c_link_tbl_name SPECCOND.LINK_TBL_NAME%TYPE;
c_link_key_val SPECCOND.LINK_KEY_VAL%TYPE;
c_doc_msg_code SPECCOND.DOC_MSG_CODE%TYPE;
c_count NUMBER(5);
p3 NUMBER;
/* ************************************************************************** **
** Constants for Performance Tunning **
** ************************************************************************** */
g_doc_msg_code_ac1 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'AC1';
g_doc_msg_code_ac2 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'AC2';
g_doc_msg_code_ac3 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'AC3';
g_doc_msg_code_ac4 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'AC4';
g_doc_msg_code_aq1 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'AQ1';
g_doc_msg_code_aq2 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'AQ2';
g_doc_msg_code_aq3 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'AQ3';
g_doc_msg_code_aq4 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'AQ4';
g_doc_msg_code_doc CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'DOC';
g_doc_msg_code_dod CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'DOD';
g_doc_msg_code_dot CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'DOT';
g_doc_msg_code_fca CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FCA';
g_doc_msg_code_fcc CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FCC';
g_doc_msg_code_fc1 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FC1';
g_doc_msg_code_fc2 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FC2';
g_doc_msg_code_fc3 CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FC3';
g_doc_msg_code_fcd CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FCD';
g_doc_msg_code_fcn CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FCN';
g_doc_msg_code_fcr CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FCR';
g_doc_msg_code_fcv CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FCV';
g_doc_msg_code_fdd CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'FDD';
g_doc_msg_code_med CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'MED';
g_doc_msg_code_mtc CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'MTC';
g_doc_msg_code_pdc CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'PDC';
g_doc_msg_code_vnf CONSTANT SPECCOND.DOC_MSG_CODE%TYPE := 'VNF';
g_speccond_ltn CONSTANT SPECCOND.LINK_TBL_NAME%TYPE := 'PRECLASS - ';
g_speccond_item_ltn CONSTANT SPECCOND.LINK_TBL_NAME%TYPE := 'ITEM - ';
g_hts_ctry_code_us CONSTANT HTS.COUNTRY_CODE%TYPE := 'US';
/* ************************************************************************** **
** End of Constants for Performance Tunning **
** ************************************************************************** */
SKIP_OGA_CHECKS EXCEPTION;
OGA_CHECKS_ERR EXCEPTION;
/* ************************************************************************* */
/* ************************************************************************* **
** BEGIN OF LOCAL FUNCTION SET_LOAD_STATUS **
Load Status translation for end users
ERROR - Shipments Clumping was unsuccessful (Contact RSTS)
FALSE - Shipments Clumping was unsuccessful (Check error rpt)
WARN - Shipments Clumped with Warnings
TRUE - Shipments Clumped Successfully
** ************************************************************************* */
FUNCTION SET_LOAD_STATUS
(
l_status IN VARCHAR2
)
RETURN VARCHAR2
IS
BEGIN
IF l_status NOT IN ('ERROR', 'FALSE', 'WARN', 'TRUE') THEN
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '201', 'IF', USER,
'CE', '1', 'ERR', NULL,
'Internal Stored Procedure Error',
'Load status of ' || l_status || ' is invalid',
'Load status must be WARN, FALSE, TRUE or ERROR',
NULL
);
RETURN('ERROR');
END IF;
IF l_status = 'ERROR' THEN
RETURN(l_status);
ELSIF l_status = 'FALSE' THEN
IF p_load_status = 'ERROR' THEN
RETURN(p_load_status);
ELSE
RETURN(l_status);
END IF;
ELSIF l_status = 'WARN' THEN
IF p_load_status in ('ERROR', 'FALSE') THEN
RETURN(p_load_status);
ELSE
RETURN(l_status);
END IF;
ELSE
IF p_load_status in ('ERROR', 'FALSE', 'WARN') THEN
RETURN(p_load_status);
ELSE
RETURN(l_status);
END IF;
END IF;
END;
/* ************************************************************************* **
END OF LOCAL FUNCTION SET_LOAD_STATUS
** ************************************************************************* */
/* ************************************************************************* **
** BEGIN OF LOCAL STORED PROCEDURE MEDIA_CHECK **
** ************************************************************************* */
PROCEDURE MEDIA_CHECK IS
BEGIN
IF (c_unit_1 IN ('LNM', 'FBM', 'M2') OR
c_unit_2 IN ('LNM', 'FBM', 'M2') OR
c_unit_3 IN ('LNM', 'FBM', 'M2')) THEN
c_count := 0;
IF p_med_check = 'FALSE' THEN
if p_nonchargeable_sample = 'TRUE' and p_table != 'ITEM' THEN
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = g_speccond_ltn || LTRIM(RTRIM(p_item))
AND LINK_KEY_VAL = LTRIM(RTRIM(p_item)) || ' + ' ||
LTRIM(RTRIM(p_item)) || ' + ' ||
p_origin_country || ' + 1'
AND DOC_MSG_CODE = g_doc_msg_code_med;
IF c_count = 0 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '202', 'IF',
USER, 'CW', '1', 'INF', NULL,
p_table || ' '|| p_item,
'MED Cond/Doc indicator for Sample is missing.',
'Docs/Cond Booster should be updated.', NULL
);
END IF;
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '203', 'SELECT',
USER, 'CE', TO_CHAR(SQLCODE), 'ERR', SQLERRM,
p_table || ' '|| p_item,
'Error Select MED Cond/Doc Booster for Sample',
NULL, NULL
);
RAISE OGA_CHECKS_ERR;
END;
ELSE
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = g_speccond_item_ltn || LTRIM(RTRIM(p_item))
AND LINK_KEY_VAL = LTRIM(RTRIM(p_item))
AND DOC_MSG_CODE = g_doc_msg_code_med;
IF c_count = 0 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '204', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'MED Cond/Doc indicator off Item is missing',
'Docs/Cond Booster should be updated.', NULL
);
END IF;
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '205',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
p_table || ' '|| p_item,
'Error Select MED Cond/Doc Booster off Item',
NULL, NULL
);
RAISE OGA_CHECKS_ERR;
END;
END IF;
p_med_check := 'TRUE';
END IF;
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE = g_doc_msg_code_mtc;
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '206',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
p_table || ' '|| p_item,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting MTC Cond/Doc Booster'
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count = 0 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '207', 'IF',
USER, 'CW', '1', 'INF', NULL,
p_table || ' ' || p_item,
'MTC Cond/Doc indicator is missing.',
'Docs/Cond Booster should be updated.', NULL
);
END IF;
END IF;
END;
/* ************************************************************************* **
** END OF LOCAL STORED PROCEDURE MEDIA_CHECK **
** ************************************************************************* */
/* ************************************************************************* **
** BEGIN OF LOCAL STORED PROCEDURE FCC_CHECK **
** ************************************************************************* */
PROCEDURE FCC_CHECK IS
BEGIN
c_count := 0;
IF (c_oga_1 LIKE 'FC%' OR c_oga_2 LIKE 'FC%' OR
c_oga_3 LIKE 'FC%' OR c_oga_4 LIKE 'FC%' OR
c_oga_5 LIKE 'FC%') THEN
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE = g_doc_msg_code_fcd;
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '208',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting FCD Cond/Doc Booster',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count > 0 AND (c_oga_1 = 'FC4' OR
c_oga_2 = 'FC4' OR c_oga_3 = 'FC4' OR
c_oga_4 = 'FC4' OR c_oga_5 = 'FC4'
) THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '209', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'HTS# requires FCC information, FCC disclaimer ' ||
'is indicated.',
'Update FCC information in the Docs/Cond Booster', NULL
);
ELSIF c_count = 0 THEN
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_fcc,
g_doc_msg_code_fca,
g_doc_msg_code_fcn);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '210',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting FCC, FCA, FCN Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count > 0 THEN
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_fc1,
g_doc_msg_code_fc2,
g_doc_msg_code_fc3);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '211',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting FC1, FC2, FC3 Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count = 0 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '212', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'FCC identifier is missing in the '||
'Docs/Cond Booster',
NULL, NULL
);
END IF;
ELSE
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_doc,
g_doc_msg_code_fcv,
g_doc_msg_code_fcr);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '213',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting DOC, FCV, FCR Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF (c_count = 0) THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '214', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'FCC Identifiers not found ' ||
'in OGA Docs/Cond Booster.',
NULL, NULL
);
END IF;
END IF;
END IF;
END IF;
END;
/* ************************************************************************* **
** END OF LOCAL STORED PROCEDURE FCC_CHECK **
** ************************************************************************* */
/* ************************************************************************* **
** BEGIN OF LOCAL STORED PROCEDURE FDA_CHECK **
** ************************************************************************* */
PROCEDURE FDA_CHECK IS
BEGIN
c_count := 0;
IF (c_oga_1 != 'FD0' AND c_oga_2 != 'FD0' AND c_oga_3 != 'FD0'
AND c_oga_4 != 'FD0' AND c_oga_5 != 'FD0') THEN
IF (c_oga_1 LIKE 'FD%' OR c_oga_2 LIKE 'FD%' OR c_oga_3 LIKE 'FD%'
OR c_oga_4 LIKE 'FD%' OR c_oga_5 LIKE 'FD%') THEN
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE = g_doc_msg_code_fdd;
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '215',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting FDD Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count > 0 THEN
IF (c_oga_1 = 'FD2' OR c_oga_2 = 'FD2' OR c_oga_3 = 'FD2'
OR c_oga_4 = 'FD2' OR c_oga_5 = 'FD2') THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '216', 'IF', USER,
'CW', '1', 'INF', NULL,
'Item '|| p_item,
'HTS # requires FDA information, FDA ' ||
'disclaimer is indicated.',
'Update FDA information in the Docs/Cond Booster.',
NULL
);
END IF;
ELSE
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_vnf, g_doc_msg_code_pdc);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '217',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting VNF, PDC Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count = 0 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '218', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'FDA information is missing in Docs/Cond Booster',
NULL, NULL
);
ELSIF c_count = 1 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '219', 'IF', USER,
'CW', '1', 'INF', NULL,
'Item '|| p_item,
'FDA Product Code or Actual Manufacturer (VNF)',
'of product is missing in OGA Docs/Cond Booster.',
NULL
);
ELSIF c_count = 2 THEN
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_ac1, g_doc_msg_code_aq1);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '220',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting AC1, AQ1 Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count = 1 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '221', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'Both codes (AC1) and qualifiers (AQ1) '||
'are required. One is missing.',
'Update the OGA Docs/Cond Booster.', NULL
);
END IF;
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_ac2, g_doc_msg_code_aq2);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '222',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting AC2, AQ2 Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count = 1 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '223', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'Both codes (AC2) and qualifiers (AQ2) ' ||
'are required. One is missing.',
'Update the OGA Docs/Cond Booster.', NULL
);
END IF;
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_ac3, g_doc_msg_code_aq3);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '224',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting AC3, AQ3 Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count = 1 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '225', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'Both codes (AC3) and qualifiers (AQ3) '||
'are required. One is missing.',
'Update the OGA Docs/Cond Booster.', NULL
);
END IF;
c_count := 0;
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_ac4, g_doc_msg_code_aq4);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '226',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting AC4, AQ4 Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count = 1 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '227', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item, 'Both codes (AC4) and ' ||
'qualifiers (AQ4) are required. ' ||
'One is missing.',
'Update the OGA Docs/Cond Booster.', NULL
);
END IF;
END IF;
END IF;
END IF;
END IF;
END;
/* ************************************************************************* **
** END OF LOCAL STORED PROCEDURE FDA_CHECK **
** ************************************************************************* */
/* ************************************************************************* **
** BEGIN OF LOCAL STORED PROCEDURE DOT_CHECK **
** ************************************************************************* */
PROCEDURE DOT_CHECK IS
BEGIN
c_count := 0;
IF (c_oga_1 LIKE 'DT%' OR c_oga_2 LIKE 'DT%' OR c_oga_3 LIKE 'DT%' OR
c_oga_4 LIKE 'DT%' OR c_oga_5 LIKE 'DT%') THEN
BEGIN
SELECT COUNT(1) INTO c_count
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_dod, g_doc_msg_code_dot);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '228',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting DOD, DOT Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF c_count = 1 THEN
c_doc_msg_code := NULL;
BEGIN
SELECT DOC_MSG_CODE INTO c_doc_msg_code
FROM SPECCOND
WHERE OWNER = p_owner
AND LINK_TBL_NAME = LTRIM(RTRIM(c_link_tbl_name))
AND LINK_KEY_VAL = LTRIM(RTRIM(c_link_key_val))
AND DOC_MSG_CODE IN (g_doc_msg_code_dod, g_doc_msg_code_dot);
EXCEPTION
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '229',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR',
SQLERRM,
'Ltn ' || c_link_tbl_name,
'Lkv ' || c_link_key_val,
'Error Selecting DOD, DOT Cond/Doc Boosters',
NULL
);
RAISE OGA_CHECKS_ERR;
END;
IF (c_doc_msg_code = 'DOD' AND (c_oga_1 = 'DT2' OR
c_oga_2 = 'DT2' OR
c_oga_3 = 'DT2' OR
c_oga_4 = 'DT2' OR
c_oga_5 = 'DT2')) THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '230', 'IF',
USER, 'CW', '1', 'INF', NULL,
'Item '|| p_item,
'HTS# requires DOT information. DOT disclaimer ' ||
'is found.',
'Update the OGA Docs/Cond Booster.', NULL
);
END IF;
ELSIF c_count != 1 THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '231', 'IF',
USER, 'CW', '1', 'INF', NULL, 'Item '|| p_item,
'HTS# requires DOT information. ' ||
'DOT information is invalid or does not exist.',
'Update OGA in Docs/Cond Booster.', NULL
);
END IF;
END IF;
END;
/* ************************************************************************* **
** END OF LOCAL STORED PROCEDURE DOT_CHECK **
** ************************************************************************* */
/* ************************************************************************* **
** BEGIN OF CONTROL AREA FOR STORED PROCEDRE T_SP_RKP4290_OGA **
** ************************************************************************* */
BEGIN
c_count := 0;
p_load_status := 'TRUE';
IF LTRIM(RTRIM(p_hts_no)) IS NULL OR RTRIM(p_hts_no) = 'MULTI' THEN
RAISE SKIP_OGA_CHECKS;
END IF;
c_link_tbl_name := p_table||' - '||LTRIM(RTRIM(p_item));
IF (p_table = 'ITEM') THEN
c_link_key_val := LTRIM(RTRIM(p_item));
ELSE
c_link_key_val:=LTRIM(RTRIM(p_item))||' + '||LTRIM(RTRIM(p_item));
c_link_key_val:=c_link_key_val||' + '||LTRIM(RTRIM(p_export_country));
c_link_key_val:=c_link_key_val ||' + '|| LTRIM(RTRIM(p_hts_line_no));
END IF;
BEGIN
SELECT NVL(UNIT_1, 'X'), NVL(UNIT_2, 'X'), NVL(UNIT_3, 'X'),
NVL(OGA_1, 'X'), NVL(OGA_2, 'X'), NVL(OGA_3, 'X'),
NVL(OGA_4, 'X'), NVL(OGA_5, 'X')
INTO c_unit_1, c_unit_2, c_unit_3, c_oga_1, c_oga_2, c_oga_3,
c_oga_4, c_oga_5
FROM HTS
WHERE HTS_NO = p_hts_no
AND COUNTRY_CODE = g_hts_ctry_code_us
AND BEG_EFFECT_DATE <= p_import_date
AND END_EFFECT_DATE >= p_import_date;
EXCEPTION
WHEN NO_DATA_FOUND THEN
p_load_status := SET_LOAD_STATUS('WARN');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '232', 'SELECT', USER, 'CW',
TO_CHAR(SQLCODE), 'INF', SQLERRM,
'B/L ' || LTRIM(RTRIM(p_bill_of_lading_no)),
'Item ' || LTRIM(RTRIM(p_item)),
'HTS# ' || LTRIM(RTRIM(p_hts_no)) || ' Import Date '
|| RTRIM(p_import_date),
'No effective tariff date range found'
);
RAISE SKIP_OGA_CHECKS;
WHEN TOO_MANY_ROWS THEN
p_load_status := SET_LOAD_STATUS('FALSE');
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '233',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR', SQLERRM,
'B/L ' || LTRIM(RTRIM(p_bill_of_lading_no)),
'Item ' || LTRIM(RTRIM(p_item)),
'HTS# ' || LTRIM(RTRIM(p_hts_no)) || ' Import Date '
|| RTRIM(p_import_date),
'Overlapping Effective Tariff Date ranges exist'
);
RAISE SKIP_OGA_CHECKS;
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '234',
'SELECT', USER, 'CE', TO_CHAR(SQLCODE), 'ERR', SQLERRM,
'B/L ' || LTRIM(RTRIM(p_bill_of_lading_no)),
'Item ' || LTRIM(RTRIM(p_item)),
'HTS# ' || LTRIM(RTRIM(p_hts_no)) || ' Import Date '
|| RTRIM(p_import_date),
'Error Selecting Tariff information.'
);
RAISE OGA_CHECKS_ERR;
END;
MEDIA_CHECK( );
FCC_CHECK( );
FDA_CHECK( );
DOT_CHECK( );
EXCEPTION
WHEN SKIP_OGA_CHECKS OR OGA_CHECKS_ERR THEN
NULL;
WHEN OTHERS THEN
p_load_status := 'ERROR';
p3 := shrmsglog_pkg.snd_log_msg
('T_SP_RKP4290_OGA', p_entry_no, '235', 'OGA CHECK',
USER, 'CE', TO_CHAR(SQLCODE), 'ERR', SQLERRM,
'B/L ' || LTRIM(RTRIM(p_bill_of_lading_no)),
p_table || ', Item No ' || LTRIM(RTRIM(p_item)),
'HTS# ' || LTRIM(RTRIM(p_hts_no)),
'Unexpected SQL error in OGA stored procedure'
);
END T_SP_RKP4290_OGA;
/* ************************************************************************* **
END OF STORED PROCEDURE T_SP_RKP4290_OGA
** ************************************************************************* */
/
EXIT
|
-- Flask To-Do Database Schema
--
-- This file will drop and recreate all tables necessary for
-- the application and can be run with the `flask init-db`
-- command in your terminal.
-- Drop existing tables
DROP TABLE IF EXISTS schedule;
-- Add query to drop users table here
-- Add query to create users table here
-- To-Do Items
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id bigserial PRIMARY KEY,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE schedule (
id bigserial PRIMARY KEY,
author_id INTEGER,
years bigserial,
months text,
days text,
date bigserial,
shift varchar(225),
description varchar(140) NOT NULL,
FOREIGN KEY (author_id) REFERENCES users (id)
-- Add Foreign Key to users table here
);
|
-- 1. Untuk Melihat Total Kasus, Total Kematian, dan Persentase kematian per kasus pada Covid-19
SELECT SUM(new_cases) AS TotalCases, SUM(new_deaths) AS TotalDeaths,
(SUM(new_deaths)/SUM(new_cases))*100 AS DeathPercentage
FROM `belajar-328708.Portfolio.CovidDeaths`
WHERE NOT continent = '';
-- 2. Total Kematian di setiap Benua
SELECT continent, SUM(new_deaths) AS TotalDeathCount
FROM `belajar-328708.Portfolio.CovidDeaths`
WHERE NOT continent = ''
AND location NOT IN ('World', 'European Union', 'International')
GROUP BY continent
ORDER BY TotalDeathCount DESC;
-- 3. Melihat Negara dengan tingkat infeksi tertinggi dibandingkan dengan Populasi
SELECT location, population, MAX(total_cases) AS HighestInfectionCount,
MAX(total_cases/population)*100 AS PercentPopulationInfected
FROM `belajar-328708.Portfolio.CovidDeaths`
GROUP BY location, population
ORDER BY PercentPopulationInfected DESC;
-- 4. Tingkat infeksi dari tiap negara berdasarkan tanggal
SELECT location, population, date, MAX(total_cases) AS HighestInfectionCount,
MAX(total_cases/population)*100 AS PercentPopulationInfected
FROM `belajar-328708.Portfolio.CovidDeaths`
GROUP BY location, population, date
ORDER BY location, date DESC;
-- 5. Urutan negara dengan populasi terbanyak
SELECT location,MAX(population) AS NumberPopulation
FROM `belajar-328708.Portfolio.CovidDeaths`
WHERE NOT continent = ''
GROUP BY location
ORDER BY NumberPopulation DESC;
-- 6. Negara yang sudah mendapatkan vaksin penuh
WITH vaccin AS
(
SELECT vac.location, dea.population ,MAX(vac.people_fully_vaccinated) AS vaccinations
FROM `belajar-328708.Portfolio.CovidVaccinations` vac
JOIN `belajar-328708.Portfolio.CovidDeaths` dea
ON vac.location = dea.location
AND vac.date = dea.date
WHERE NOT vac.continent = ''
GROUP BY vac.location, dea.population)
SELECT *, (vaccinations/population)*100 AS PercentVaccinations
FROM vaccin
ORDER BY 4 DESC;
-- 7. Total Populasi Dunia yang sudah di vaksin penuh
SELECT vac.location, MAX(dea.population) AS Population, MAX(vac.people_fully_vaccinated) AS TotalFullyVaccinated
FROM `belajar-328708.Portfolio.CovidDeaths`dea
JOIN `belajar-328708.Portfolio.CovidVaccinations` vac
ON dea.date = vac.date AND dea.location = vac.location
GROUP BY vac.location
HAVING vac.location = 'World';
|
--- URI Online Judge SQL
--- Copyright URI Online Judge
--- www.urionlinejudge.com.br
--- Problem 2604
SELECT products.id, products.name FROM products WHERE products.price < 10 OR products.price > 100;
|
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 17, 2018 at 07:11 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `dila`
--
-- --------------------------------------------------------
--
-- Table structure for table `data_catin`
--
CREATE TABLE `data_catin` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`nama_lengkap` varchar(255) DEFAULT NULL,
`tempat_tgl_lahir` varchar(255) DEFAULT NULL,
`no_ktp` varchar(255) DEFAULT NULL,
`kewarganearaan` varchar(255) DEFAULT NULL,
`pekerjaan` varchar(255) DEFAULT NULL,
`agama` varchar(255) DEFAULT NULL,
`alamat` text,
`status_data` smallint(6) DEFAULT NULL,
`foto` varchar(255) DEFAULT NULL,
`nasab_a` varchar(255) DEFAULT NULL,
`nasab_b` varchar(255) DEFAULT NULL,
`nasab_c` varchar(255) DEFAULT NULL,
`nama_pejabat_pemberi_izin` varchar(255) DEFAULT NULL,
`nomor_izin_pejabat` varchar(255) DEFAULT NULL,
`tgl_izin_surat` varchar(255) DEFAULT NULL,
`wna_instansi` varchar(255) DEFAULT NULL,
`wna_no_izin` varchar(255) DEFAULT NULL,
`wna_tgl_surat` varchar(255) DEFAULT NULL,
`izin_pengadilan_belum_umur` varchar(255) DEFAULT NULL,
`no_izin_pengadilan_belum_umur` varchar(255) DEFAULT NULL,
`tgl_izin_pengadilan_belum_umur` varchar(255) DEFAULT NULL,
`nama_pemeberi_izin` varchar(255) DEFAULT NULL,
`hubungan_keluarga` varchar(255) DEFAULT NULL,
`tgl_surat` varchar(255) DEFAULT NULL,
`tempat_lahir` varchar(255) DEFAULT NULL,
`status_perkawinan` smallint(6) DEFAULT NULL,
`nama_pasangan_sebelumnya` varchar(255) DEFAULT NULL,
`bukti_carai_instansi` varchar(255) DEFAULT NULL,
`bukti_cerai_no` varchar(255) DEFAULT NULL,
`tanggal_cerai` varchar(255) DEFAULT NULL,
`pernikahan_ke` int(11) DEFAULT NULL,
`file_ktp` varchar(255) DEFAULT NULL,
`file_kk` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `data_catin`
--
INSERT INTO `data_catin` (`id`, `user_id`, `nama_lengkap`, `tempat_tgl_lahir`, `no_ktp`, `kewarganearaan`, `pekerjaan`, `agama`, `alamat`, `status_data`, `foto`, `nasab_a`, `nasab_b`, `nasab_c`, `nama_pejabat_pemberi_izin`, `nomor_izin_pejabat`, `tgl_izin_surat`, `wna_instansi`, `wna_no_izin`, `wna_tgl_surat`, `izin_pengadilan_belum_umur`, `no_izin_pengadilan_belum_umur`, `tgl_izin_pengadilan_belum_umur`, `nama_pemeberi_izin`, `hubungan_keluarga`, `tgl_surat`, `tempat_lahir`, `status_perkawinan`, `nama_pasangan_sebelumnya`, `bukti_carai_instansi`, `bukti_cerai_no`, `tanggal_cerai`, `pernikahan_ke`, `file_ktp`, `file_kk`) VALUES
(1, 6, 'Sodo', '09-Jul-2018', '1962819762918', 'Indonesia', 'Swasta', 'Islam', '<p>aksndlkansd</p>', 1, 'KBMDG 004 - Cominfo - Julisman - DKV 12 UNP.jpg', 'a', 'a', 'a', 'a', '001.jpg', '02-Jul-2018', 'a', '', '20-Jul-2018', 'a', '001.jpg', '02-Jul-2018', 'a', 'a', '30-Jul-2018', 'Padang', 12, 'Chika', 'KUA', '001.jpg', '17-Jul-2018', 5, '001.jpg', NULL),
(2, 6, 'ril', '30-Jul-2018', '1926981', 'Indonesia', 'Swasta', 'Islam', '<p>as,dbajksdn andlkasdlaksdhauhdsasd asdalsd</p>', 2, 'KBMDG 010 - Multimedia - Gusdanela - PTIK 12 UNP.jpg', 'a', 'a', 'a', 'a', '001.jpg', '10-Jul-2018', 'a', '', '24-Jul-2018', 'a', '001.jpg', '30-Jul-2018', 'a', 'a', '18-Jul-2018', 'Depok', 15, 'Mr X', 'KUA', '001.jpg', '17-Jul-2018', 2, '001.jpg', '001.jpg'),
(3, 7, 'Solo', '09-Jul-2018', '19826198', 'Indonesia', 'Swasta', 'Islam', '<p>asnalksndalskd</p>', 1, 'WhatsApp Image 2017-11-12 at 23.58.46.jpeg', 'aa', '', '', '', NULL, '', '', '', '', '', NULL, '', '', '', '', 'Depok', 11, NULL, NULL, NULL, NULL, 1, NULL, NULL),
(4, 7, 'Sili', '23-Jul-2018', '19826912', 'Indonesia', 'Swasta', 'Islam', '<p>laksndlasdlkad</p>', 2, 'WhatsApp Image 2017-11-12 at 23.58.45 (1).jpeg', '', '', '', '', NULL, '', '', '', '', '', NULL, '', '', '', '', 'Depo', 14, NULL, NULL, NULL, NULL, 2, NULL, NULL),
(5, 8, 'Restu Sianta', '24-Jul-2018', '112341', 'Indonesia', 'Swasta', 'Islam', '<p>laknslkansdlansldad</p>', 1, 'download-2.jpg', 'a', 'a', 'a', '', NULL, '', '', '', '', '', NULL, '', '', '', '', 'Depok', 12, 'Resty', 'KUA', 'Koala.jpg', '31-Jul-2018', 2, 'download-2.jpg', NULL),
(6, 8, 'Fenny', '23-Jul-2018', '11212', 'Indonesia', 'Swasta', 'Islam', '<p>landlaksndlaksd</p>', 2, 'e6aa26bcba9a72ac1fce0726f971e9bddcef9eca_hq.jpg', 'a', '', '', '', NULL, '', '', '', '', '', NULL, '', '', '', '', 'Depok', 14, NULL, NULL, NULL, NULL, 1, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `detail_catin`
--
CREATE TABLE `detail_catin` (
`id` int(11) NOT NULL,
`data_catin_id` int(11) DEFAULT NULL,
`nama_istri_pertama` varchar(255) DEFAULT NULL,
`k_akta_nikah_pertama` varchar(255) DEFAULT NULL,
`no_akta_pertama` varchar(255) DEFAULT NULL,
`tgl_akta_pertama` varchar(255) DEFAULT NULL,
`nama_istri_kedua` varchar(255) DEFAULT NULL,
`k_akta_nikah_kedua` varchar(255) DEFAULT NULL,
`no_akta_kedua` varchar(255) DEFAULT NULL,
`tgl_akta_kedua` varchar(255) DEFAULT NULL,
`nama_istri_ketiga` varchar(255) DEFAULT NULL,
`k_akta_nikah_ketiga` varchar(255) DEFAULT NULL,
`no_akta_ketiga` varchar(255) DEFAULT NULL,
`tgl_akta_ketiga` varchar(255) DEFAULT NULL,
`izin_pengadilan` varchar(255) DEFAULT NULL,
`no_izin` varchar(255) DEFAULT NULL,
`tgl_izin` varchar(255) DEFAULT NULL,
`persetujuan_istri` varchar(255) DEFAULT NULL,
`tgl_persetujuan_istri` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `kecamatan`
--
CREATE TABLE `kecamatan` (
`id` int(11) NOT NULL,
`nama_kec` varchar(255) DEFAULT NULL,
`kepala_desa` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kecamatan`
--
INSERT INTO `kecamatan` (`id`, `nama_kec`, `kepala_desa`) VALUES
(1, 'Padang', 'Samsul Goli'),
(2, 'Pariaman', NULL),
(3, 'bukittinggi', NULL),
(4, 'Kampung Kandang', 'Aguslim');
-- --------------------------------------------------------
--
-- Table structure for table `migration`
--
CREATE TABLE `migration` (
`version` varchar(180) NOT NULL,
`apply_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `migration`
--
INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1523277363),
('m130524_201442_init', 1523277366),
('m180316_193516_tabel_catin', 1523277373),
('m180319_084404_tambah_kolom_tempat_lahir', 1523277377),
('m180321_024050_tabel_pelaksanaan_nikah', 1523277401),
('m180409_123025_penghulu_id_to_profil', 1523277402),
('m180511_223401_tambah_upload_ktp_kk', 1526078466),
('m180513_184420_tambah_status', 1526237249),
('m180624_041318_tambah_status_kepengurusan', 1529813654),
('m180624_041936_hapus_status_kepengurusan', 1529814014),
('m180624_065554_tambah_catin_dipelakasaan', 1529836263),
('m180625_011825_hapus_penghulu_id', 1529889553),
('m180706_031543_tambahan_field_inputan', 1530848197);
-- --------------------------------------------------------
--
-- Table structure for table `orang_tua_catin`
--
CREATE TABLE `orang_tua_catin` (
`id` int(11) NOT NULL,
`data_catin_id` int(11) DEFAULT NULL,
`nama_lengkap` varchar(255) DEFAULT NULL,
`tempat_tgl_lahir` varchar(255) DEFAULT NULL,
`no_ktp` varchar(255) DEFAULT NULL,
`kewarganearaan` varchar(255) DEFAULT NULL,
`pekerjaan` varchar(255) DEFAULT NULL,
`agama` varchar(255) DEFAULT NULL,
`alamat` text,
`status_keluarga` smallint(6) DEFAULT NULL,
`tempat_lahir` varchar(255) DEFAULT NULL,
`file_ktp` varchar(255) DEFAULT NULL,
`file_kk` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `orang_tua_catin`
--
INSERT INTO `orang_tua_catin` (`id`, `data_catin_id`, `nama_lengkap`, `tempat_tgl_lahir`, `no_ktp`, `kewarganearaan`, `pekerjaan`, `agama`, `alamat`, `status_keluarga`, `tempat_lahir`, `file_ktp`, `file_kk`) VALUES
(1, 1, 'Pada', '13-Jul-2018', '9186218982', 'Indonesia', 'Swasta', 'Islam', '<p>alksdnalsdnalksd</p>', 1, 'Depok', 'KBMDG 109 - Programming - Sandy Putra Effendi - PTIK 15 UNP.jpg', NULL),
(2, 1, 'loli', '04-Jul-2018', '10927091290', 'Indonesia', 'Ibu Rumah Tangga', 'prompt', '<p>alsnlkansdlkand</p>', 2, 'Depok', 'KBMDG 007 - Human Resources Development - Amalia Sholiha - Pend Matematika 12 UNP.jpg', NULL),
(3, 5, 'Reza', '12-Jul-2018', '12123', 'Indonesia', 'Swasta', 'Islam', '<p>a.s,da.,sd</p>', 1, 'Depok', 'foto.png', NULL),
(4, 5, 'Sri', '19-Jul-2018', '123123', 'Indonesia', 'Ibu Rumah Tangga', 'Islam', '<p>alksjdalksd</p>', 2, 'Depok', 'BnC3ihmCUAEeO0N.jpg', NULL),
(5, 6, 'Purwo', '05-Jul-2018', '1231', 'alknsdlaksndl', 'a;lsmdal;', 'Islam', '<p>a.snda.,dla;sdalkndlaksbndlakdn</p>', 1, 'Depok', 'foto.png', NULL),
(6, 6, 'nurli', '10-Jul-2018', '19286319', 'Indonesia', 'Ibu Rumah Tangga', 'Islam', '<p>anmbs,abdkjadb</p>', 2, 'Depok', 'niku.jpg', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `pelaksanaan_nikah`
--
CREATE TABLE `pelaksanaan_nikah` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`hari_nikah` varchar(10) DEFAULT NULL,
`tgl_nikah` varchar(255) DEFAULT NULL,
`waktu` varchar(25) DEFAULT NULL,
`tempat` text,
`tgl_daftar` varchar(255) DEFAULT NULL,
`kec_id` int(11) DEFAULT NULL,
`kota` varchar(50) DEFAULT NULL,
`mas_kawin` varchar(255) DEFAULT NULL,
`pembayaran` varchar(255) DEFAULT NULL,
`no_perjanjian_kawin` varchar(255) DEFAULT NULL,
`tgl_surat_perjanjian` varchar(255) DEFAULT NULL,
`nama_notaris` varchar(255) DEFAULT NULL,
`status_nikah` smallint(6) DEFAULT NULL,
`id_suami` int(11) DEFAULT NULL,
`id_istri` int(11) DEFAULT NULL,
`note_kelengkapan` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pelaksanaan_nikah`
--
INSERT INTO `pelaksanaan_nikah` (`id`, `user_id`, `hari_nikah`, `tgl_nikah`, `waktu`, `tempat`, `tgl_daftar`, `kec_id`, `kota`, `mas_kawin`, `pembayaran`, `no_perjanjian_kawin`, `tgl_surat_perjanjian`, `nama_notaris`, `status_nikah`, `id_suami`, `id_istri`, `note_kelengkapan`) VALUES
(2, 6, 'lsknl', '24-Juli-2018', '07.00', '<p>a,smda,d</p>', '06 July 2018', 1, 'Padang', 'Emas 3 Gram', 'Tunai', '11/1121//1al,sdd', '13-Juli-2018', 'asdalkds', 5, 1, 2, NULL),
(3, 8, 'Jum\'at', '11-07-2018', '13.00', '<p>jkabskdjabkjdajbsdabdkjabkajsd</p>', '15 July 2018', 2, 'alndlasdnalkd', 'Emas 3 gram', 'Tunai', '182973192', '25-07-2018', 'alnsldand', 5, 5, 6, '<p>Tolong lengkapi bagian abc</p>');
-- --------------------------------------------------------
--
-- Table structure for table `profil`
--
CREATE TABLE `profil` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`nama` varchar(255) DEFAULT NULL,
`tempat_tgl_lahir` varchar(255) DEFAULT NULL,
`no_ktp` varchar(255) DEFAULT NULL,
`alamat` text,
`agama` varchar(255) DEFAULT NULL,
`no_telp` varchar(255) DEFAULT NULL,
`foto` varchar(255) DEFAULT NULL,
`tempat_lahir` varchar(255) DEFAULT NULL,
`jabatan` varchar(255) DEFAULT NULL,
`kec_id` int(11) DEFAULT NULL,
`file_ktp` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `profil`
--
INSERT INTO `profil` (`id`, `user_id`, `nama`, `tempat_tgl_lahir`, `no_ktp`, `alamat`, `agama`, `no_telp`, `foto`, `tempat_lahir`, `jabatan`, `kec_id`, `file_ktp`) VALUES
(1, 6, 'Argi', '', '190201', '', 'prompt', '', 'WhatsApp Image 2017-11-12 at 23.58.47 (1).jpeg', '', NULL, NULL, NULL),
(2, 1, 'Admin', '25-Jul-2018', NULL, '<p>laslasndlasd</p>', 'Islam', '081224166684', 'images1.jpeg', 'Depok', '0', NULL, NULL),
(3, 8, 'Restu Sianta', '18-Jul-2018', '112345', '<p>lakjdlkasnlkasd</p>', 'Islam', '081224166684', 'download-2.jpg', 'Depok', NULL, 2, NULL),
(4, 2, 'Pegawai Desa', '01-Aug-2018', '12312312', '<p>alksndlakndlak</p>', 'Islam', '0987090', 'foto.png', 'Depok', '6', 2, NULL),
(5, 3, 'Kepala Desa', '12-Jul-2018', '121212', '<p>a,jsbdasdk</p>', 'Islam', '00081212131', 'foto.png', 'Depok', '2', 1, NULL),
(6, 4, 'Pegawai KUA', '01-Aug-2018', '1213', '<p>alsjhdakljsdnakjdad</p>', 'Islam', '7896987', 'foto.png', 'Depok', '3', 1, NULL),
(7, 5, 'Kepala KUA', '11-Jul-2018', '19823719', '<p>akjshdkadkjasdk</p>', 'Islam', '198263918', 'foto.png', 'Depok', '4', 1, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` smallint(6) NOT NULL DEFAULT '10',
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
`level` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `status`, `created_at`, `updated_at`, `level`) VALUES
(1, 'admin', 'l4OgIJRsbdazr8lqLE_e25eun-TafhKK', '$2y$13$5lKbMMoKhb4SPS8s.jglYOzgs0N90K5vVdLbI0WDeZlmRQZ4pCajC', NULL, 'admin@gmail.com', 10, 1530508056, 1530508056, 0),
(2, 'pegdes', 'HiXMqXFqcfhmMUTjAPXQiy9L3kU9vygk', '$2y$13$dFrMqSNMOQ/mSQFeOwn06O74NVr6mHEljL.hcCUXMX3Xro.s6J8mS', NULL, 'pegdes@gmail.com', 10, 1530508502, 1530508502, 6),
(3, 'kepdes', 'ni58nAiXZfOq78UaXxcJbcl5jQCrcAM_', '$2y$13$d26FU1hh549/um39.MVFqu3gYMeYt0i3V3wauzzzNr7xaop9EMI1i', NULL, 'kepdes@gmail.com', 10, 1530508529, 1530508529, 2),
(4, 'pegkua', 'e9gbsxhANUvb1M1x7f1pOedORUnQeiV-', '$2y$13$NUEDRRhaIQOD0ddpmFeGwOnFcbvd2a/NwPfGBzPMPRyIEyMBlvopC', NULL, 'pegkua@gmail.com', 10, 1530508545, 1530508545, 3),
(5, 'kepkua', 'OMXouYp5fFJmzQzIRCLKD6d5P4wzJJny', '$2y$13$CiycYox.u2.Yi4qz.Ppx4.oaBCnzGElgkNWm7FlisKD7/qXBYdal6', NULL, 'kepkua@gmail.com', 10, 1530508570, 1530508570, 4),
(6, 'argi', 'Yah8ZCNrHS8aSyHiNdi88Az3E0In0rKB', '$2y$13$x9w8AtBjZsluAy4.vFzo4uvMu548RX6MmWD7OgDGAvqx2bhaszd4u', NULL, 'argigarnadi@gmail.com', 10, 1530508620, 1530508620, 1),
(7, 'dila', 'mntU9W6G7RB6VbFySvajVKqCji9AN4cv', '$2y$13$W9CGYkG3ipZk0EKEbUNkiuFtx01Y.CD72C1YYC.WdYNE82c3vp6Wa', NULL, 'dila@gmail.com', 10, 1530843961, 1530843961, 1),
(8, 'reztu', 'ou8NJSl5eu-vRVnyEYsHwqfFG4tizyi3', '$2y$13$2MXqPmU4iqqOg2x9hMCAJedZCCE0uNBYdCR53/6x5jayWIKmaS6im', NULL, 'reztu@gmail.com', 10, 1531594467, 1531594467, 1);
-- --------------------------------------------------------
--
-- Table structure for table `wali_nikah`
--
CREATE TABLE `wali_nikah` (
`id` int(11) NOT NULL,
`data_catin_id` int(11) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`status_wali` varchar(255) DEFAULT NULL,
`hubungan_wali` varchar(255) DEFAULT NULL,
`sebab_wali` varchar(255) DEFAULT NULL,
`nama` varchar(255) DEFAULT NULL,
`bin` varchar(255) DEFAULT NULL,
`tempat_lahir` varchar(255) DEFAULT NULL,
`tgl_lahir` varchar(255) DEFAULT NULL,
`no_ktp` varchar(255) DEFAULT NULL,
`kewarganegaraan` varchar(255) DEFAULT NULL,
`agama` varchar(255) DEFAULT NULL,
`pekerjaan` varchar(255) DEFAULT NULL,
`alamat` text,
`tanggal_surat` varchar(255) DEFAULT NULL,
`nama_pejabat_kua` varchar(255) DEFAULT NULL,
`file_ktp` varchar(255) DEFAULT NULL,
`file_kk` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `data_catin`
--
ALTER TABLE `data_catin`
ADD PRIMARY KEY (`id`),
ADD KEY `fk-data_catin-user-id-user-id` (`user_id`);
--
-- Indexes for table `detail_catin`
--
ALTER TABLE `detail_catin`
ADD PRIMARY KEY (`id`),
ADD KEY `fk-detail_catin-data_catin_id-data_catin-id` (`data_catin_id`);
--
-- Indexes for table `kecamatan`
--
ALTER TABLE `kecamatan`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migration`
--
ALTER TABLE `migration`
ADD PRIMARY KEY (`version`);
--
-- Indexes for table `orang_tua_catin`
--
ALTER TABLE `orang_tua_catin`
ADD PRIMARY KEY (`id`),
ADD KEY `fk-orang_tua_catin-data_catin_id-data_catin-id` (`data_catin_id`);
--
-- Indexes for table `pelaksanaan_nikah`
--
ALTER TABLE `pelaksanaan_nikah`
ADD PRIMARY KEY (`id`),
ADD KEY `fk-pelaksanaan_nikah-user_id-user-id` (`user_id`),
ADD KEY `fk-pelaksanaan_nikah-kec_id-kecamatan-id` (`kec_id`),
ADD KEY `fk-pelaksanaan_nikah-id_suami-data_catin-id` (`id_suami`),
ADD KEY `fk-pelaksanaan_nikah-id_istri-data_catin-id` (`id_istri`);
--
-- Indexes for table `profil`
--
ALTER TABLE `profil`
ADD PRIMARY KEY (`id`),
ADD KEY `fk-profil-user_id-user-id` (`user_id`),
ADD KEY `fk-profil-kec_id-kecamatan-id` (`kec_id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `password_reset_token` (`password_reset_token`);
--
-- Indexes for table `wali_nikah`
--
ALTER TABLE `wali_nikah`
ADD PRIMARY KEY (`id`),
ADD KEY `fk-wali_nikah-data_catin_id-data_catin_id` (`data_catin_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `data_catin`
--
ALTER TABLE `data_catin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `detail_catin`
--
ALTER TABLE `detail_catin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `kecamatan`
--
ALTER TABLE `kecamatan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `orang_tua_catin`
--
ALTER TABLE `orang_tua_catin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `pelaksanaan_nikah`
--
ALTER TABLE `pelaksanaan_nikah`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `profil`
--
ALTER TABLE `profil`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `wali_nikah`
--
ALTER TABLE `wali_nikah`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `data_catin`
--
ALTER TABLE `data_catin`
ADD CONSTRAINT `fk-data_catin-user-id-user-id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `detail_catin`
--
ALTER TABLE `detail_catin`
ADD CONSTRAINT `fk-detail_catin-data_catin_id-data_catin-id` FOREIGN KEY (`data_catin_id`) REFERENCES `data_catin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `orang_tua_catin`
--
ALTER TABLE `orang_tua_catin`
ADD CONSTRAINT `fk-orang_tua_catin-data_catin_id-data_catin-id` FOREIGN KEY (`data_catin_id`) REFERENCES `data_catin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `pelaksanaan_nikah`
--
ALTER TABLE `pelaksanaan_nikah`
ADD CONSTRAINT `fk-pelaksanaan_nikah-id_istri-data_catin-id` FOREIGN KEY (`id_istri`) REFERENCES `data_catin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk-pelaksanaan_nikah-id_suami-data_catin-id` FOREIGN KEY (`id_suami`) REFERENCES `data_catin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk-pelaksanaan_nikah-kec_id-kecamatan-id` FOREIGN KEY (`kec_id`) REFERENCES `kecamatan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk-pelaksanaan_nikah-user_id-user-id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `profil`
--
ALTER TABLE `profil`
ADD CONSTRAINT `fk-profil-kec_id-kecamatan-id` FOREIGN KEY (`kec_id`) REFERENCES `kecamatan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk-profil-user_id-user-id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `wali_nikah`
--
ALTER TABLE `wali_nikah`
ADD CONSTRAINT `fk-wali_nikah-data_catin_id-data_catin_id` FOREIGN KEY (`data_catin_id`) REFERENCES `data_catin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Report by Product Category per Month',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=132
;
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Report by Product Vendor per Month',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=133
;
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Report by Product Category per Week',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=131
;
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Report per Week',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=130
;
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Report per Month',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=129
;
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Report per Day',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=128
;
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Transactions by Accounting Date',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=127
;
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Report by Product per Month',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=340
;
-- Dez 02, 2008 12:03:00 PM ECT
-- fix Correct Misspelling
update ad_process set Description='Invoice Report by Product per Quarter',Updated=TO_TIMESTAMP('2008-12-02 12:03:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 where ad_process_id=341
;
-- Jan 2, 2009 9:11:36 PM COT
UPDATE GL_Category SET Name='Manufacturing',Updated=TO_TIMESTAMP('2009-01-02 21:11:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE GL_Category_ID=50001
;
|
select * from V_$FLASHBACK_DATABASE_STAT
/
|
# luodaan devuser käyttäjä ja graphbook_dev tietokanta
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
CREATE DATABASE graphbook_dev CHARACTER SET utf8 COLLATE utf8_general_ci; |
CONNECT localhost;
INVALIDATE METADATA;
USE power_rangers;
CREATE external TABLE if not exists users (
id BIGINT,
age INT,
gender STRING,
occupation STRING
)
comment "Table to store user info." row format delimited fields
TERMINATED BY '|' stored
AS
textfile location '/userinfo/';
SELECT * FROM users;
SELECT COUNT(*) FROM users;
SELECT DISTINCT occupation FROM users ORDER BY occupation;
SELECT * FROM users WHERE occupation='doctor';
SELECT * FROM users WHERE age < 25;
SELECT * FROM users WHERE age < 40 AND occupation='doctor';
SELECT occupation, COUNT(*) amount FROM users GROUP BY occupation;
SELECT AVG(age) from users WHERE gender='M';
create table if not exists dummy (
movie_id bigint,
title string,
release_date string,
empty string,
url string
)
ROW FORMAT delimited
fields TERMINATED BY '|';
CREATE TABLE if not exists movies (
movie_id BIGINT,
title STRING,
release_date STRING,
url STRING
)
ROW FORMAT delimited
fields TERMINATED BY '|';
DESC movies;
LOAD DATA INPATH '/movieinfo/u.item' OVERWRITE INTO TABLE dummy;
INSERT INTO TABLE movies SELECT movie_id, title, release_date, url FROM dummy;
SELECT COUNT(*) FROM movies;
SELECT * FROM movies WHERE title LIKE '%Story%';
SELECT * FROM movies ORDER BY title;
SELECT COUNT(*) FROM movies; where release_date='(1995)';
CREATE TABLE if not exists customers (
cust_id INT,
fname STRING,
lname STRING,
email STRING,
phone MAP<STRING, STRING>,
order_ids ARRAY<INT>,
order_value STRUCT<min:INT,max:INT,avg:INT,total:INT>
)
STORED AS PARQUET;
desc customers;
ALTER TABLE customers CHANGE fname fullname STRING;
desc customers; |
CREATE TABLE IF NOT EXISTS vehicle (
VIN UUID NOT NULL PRIMARY KEY,
regnr VARCHAR(100) NOT NULL UNIQUE,
status VARCHAR(100)
);
CREATE TABLE IF NOT EXISTS customer_vehicle (
customer_id BIGINT NOT NULL REFERENCES customer (customer_id),
VIN UUID NOT NULL REFERENCES vehicle (VIN),
UNIQUE (customer_id, VIN)
); |
DROP TABLE Tuotos_taloon;
DROP TABLE Tuotos_laatikkoon;
DROP TABLE Hiekkalaatikko;
DROP TABLE Talonomistaja;
DROP TABLE Talo;
DROP TABLE Kissanomistaja;
DROP TABLE Kissa;
DROP TABLE Kayttaja;
DROP TYPE Tuotos;
|
CREATE PROCEDURE sp_consolidate_beat(@BEAT nvarchar(50),
@ACTIVE int)
AS
IF NOT EXISTS (SELECT BeatID FROM Beat WHERE Description = @BEAT)
BEGIN
Insert Beat(Description, Active)
VALUES(@BEAT, @ACTIVE)
END
|
CREATE DATABASE exercicio2 COLLATE 'utf8mb4_unicode_ci';
CREATE TABLE mensagens (
id INT NOT NULL AUTO_INCREMENT ,
mesa VARCHAR(255) NOT NULL ,
quantidade INT(55) NOT NULL ,
PRIMARY KEY (id)
)
ENGINE = InnoDB;
|
CREATE OR REPLACE PUBLIC SYNONYM vehicle_endor_pkg FOR orient.vehicle_endor_pkg; |
create table usersaddrs(
id int(6) not null auto_increment,
u_id int(6) not null,
mailing_line1 varchar(75) not null,
mailing_line2 varchar(75),
mailing_line3 varchar(75),
mailing_line4 varchar(75),
mailing_city varchar(50) not null,
mailing_state varchar(6) not null,
mailing_locality varchar(60),
mailing_postal varchar(10) not null,
mailing_country varchar(3) not null,
home_line1 varchar(75) not null,
home_line2 varchar(75),
home_line3 varchar(75),
home_line4 varchar(75),
home_city varchar(50) not null,
home_state varchar(6) not null,
home_locality varchar(60),
home_postal varchar(10) not null,
home_country varchar(3) not null,
billing_line1 varchar(75) not null,
billing_line2 varchar(75),
billing_line3 varchar(75),
billing_line4 varchar(75),
billing_city varchar(50) not null,
billing_state varchar(6) not null,
billing_locality varchar(60),
billing_postal varchar(10) not null,
billing_country varchar(3) not null,
primary_address varchar(15) not null,
home_phone varchar(12) not null,
mobile_phone varchar(12) not null,
business_phone varchar(12) not null,
other_phone varchar(12) not null,
primary_phone varchar(15) not null,
personal_email varchar(128) not null,
work_email varchar(128) not null,
billing_email varchar(128) not null,
bpp_email varchar(128) not null,
other_email varchar(128) not null,
primary_email varchar(15) not null,
PRIMARY KEY(id)
)ENGINE=InnoDB; |
ALTER TABLE dbo.ForecastingResults ADD CONSTRAINT
FK_ForecastingResults_ForecastingTree FOREIGN KEY
(
TreeRef
) REFERENCES dbo.ForecastingTree
(
Id
) ON UPDATE NO ACTION
ON DELETE NO ACTION
|
alter table NEWS_NEWS add column STATUS integer ;
|
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,1,"스페인","다비드 데헤아 킨타나","David de Gea Quintana","1990년 11월 7일","골키퍼",192,76);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,2,"스웨덴","빅토르 외르겐 닐손 린델뢰프","Victor Jörgen Nilsson Lindelöf","1994년 7월 17일","센터백",187,80);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,3,"코트디부아르","에리크 베르트랑 바이","Eric Bertrand Bailly","1994년 4월 12일","센터백",187,77);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,4,"잉글랜드","필립 앤서니 존스","Philip Anthony Jones","1992년 2월 21일","센터백, 라이트백, 수비형 미드필더",185,81);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,6,"프랑스","폴 라빌 포그바","Paul Labile Pogba","1993년 3월 15일","중앙 미드필더",191,84);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,7,"칠레","알렉시스 알레한드로 산체스 산체스","Alexis Alejandro Sánchez Sánchez","1988년 12월 19일","공격수",168,62);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,8,"스페인","후안 마누엘 마타 가르시아","Juan Manuel Mata García","1988년 4월 28일","공격형 미드필더",170,63);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,9,"벨기에","로멜루 메나마 루카쿠","Romelu Menama Lukaku","1993년 5월 13일 ","스트라이커",190,94);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,10,"잉글랜드","마커스 래시포드","Marcus Rashford","1997년 10월 31일","스트라이커,윙어",185,70);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,11,"프랑스","앙토니 조란 마르시알","Anthony Joran Martial","1995년 12월 5일","윙어, 스트라이커",184,76);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,12,"잉글랜드","크리스토퍼 로이드 스몰링","Christopher Lloyd Smalling","1989년 11월 22일","센터백, 라이트백",194,81);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,13,"잉글랜드","리 앤더슨 그랜트","Lee Anderson Grant","1983년 1월 27일","골키퍼",193,83);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,14,"잉글랜드","제시 엘리스 린가드","Jesse Ellis Lingard","1992년 12월 15일","공격형 미드필더, 윙어",175,62);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,15,"브라질","안드레아스 우구 훌헤바윔 페레이라","Andreas Hugo Hoelgebaum Pereira","1996년 1월 1일","중앙 미드필더, 공격형 미드필더, 윙어",178,71);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,16,"아르헨티나","파우스티노 마르코스 알베르토 로호","Faustino Marcos Alberto Rojo","1990년 3월 20일","센터백, 레프트백",187,80);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,17,"브라질","프레데리쿠 호드리게스 지파울라 산투스","Frederico Rodrigues de Paula Santos","1993년 3월 5일","중앙 미드필더",169,64);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,18,"잉글랜드,자메이카","애슐리 사이먼 영","Ashley Simon Young","1985년 7월 9일","측면 모든 포지션",175,65);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,19,"포르투갈","주제 디오구 달로트 테이셰이라","José Diogo Dalot Teixeira","1999년 3월 18일","라이트백",183,71);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,21,"스페인","안데르 에레라 아궤라","Ander Herrera Agüera","1989년 8월 14일","중앙 미드필더, 수비형 미드필더",182,70);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,22,"아르헨티나","세르히오 헤르만 로메로","Sergio Germán Romero","1987년 2월 22일 ","골키퍼",192,87);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,23,"잉글랜드","루크 폴 호어 쇼","Luke Paul Hoare Shaw","1995년 7월 12일","레프트백",181,75);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,25,"에콰도르","루이스 안토니오 발렌시아 모스케라 ","Luis Antonio Valencia Mosquera","1985년 8월 4일","라이트백, 윙어",180,83);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,27,"벨기에","마루안 펠라이니-바키우이","Marouane Fellaini-Bakkioui","1987년 11월 22일","중앙 미드필더",194,85);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,31,"세르비아","네마냐 마티치","Nemanja Matić","1988년 8월 1일","수비형 미드필더",194,85);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,36,"이탈리아","마테오 다르미안","Matteo Darmian","1989년 12월 2일","라이트백, 레프트백",182,70);
insert into player(team_no,back_no,country,name_kr,name_en,birthday,position,height,weight) values(1,39,"스코틀랜드","스콧 프란시스 맥토미니","Scott Francis McTominay","1996년 12월 8일","중앙 미드필더",193,88);
|
SELECT empno, ename, deptno
FROM employees
WHERE deptno != 10 AND deptno != 20
/
|
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `uasp_seatallocation`(
p_allocationid int,
p_seatid int,
p_employeeno int,
p_startdate varchar(20),
p_enddate varchar(20)
)
BEGIN
if not exists(select allocationid from seatallocation where seatid=p_seatid and ((STR_TO_DATE(p_startdate, '%d/%m/%Y') between startdate and enddate)
or (STR_TO_DATE(p_enddate, '%d/%m/%Y') between startdate and enddate))) then
INSERT INTO `seatallocation`
(`associateid`,
`seatid`,
`startdate`,
`enddate`,
`days`,
`isactive`)
VALUES
(p_employeeno,
p_seatid,
STR_TO_DATE(p_startdate, '%d/%m/%Y'),
STR_TO_DATE(p_enddate, '%d/%m/%Y'),
datediff(STR_TO_DATE(p_enddate, '%d/%m/%Y'),STR_TO_DATE(p_startdate, '%d/%m/%Y')) ,
1
);
else
call raise_error(30006,'Error!: seat is not available for selected date range ');
end if;
END$$
DELIMITER ;
|
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Creato il: Mar 31, 2021 alle 09:41
-- Versione del server: 10.4.17-MariaDB
-- Versione PHP: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `prova_esame_2017`
--
-- --------------------------------------------------------
--
-- Struttura della tabella `autisti`
--
CREATE TABLE `autisti` (
`Npatente` char(10) NOT NULL,
`Scadenza` char(10) DEFAULT NULL,
`nick` char(40) DEFAULT NULL,
`CF` char(16) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dump dei dati per la tabella `autisti`
--
INSERT INTO `autisti` (`Npatente`, `Scadenza`, `nick`, `CF`) VALUES
('VE12121121', NULL, 'MegaClaudio69', '\"=\"=\"=\"'),
('VE1234567B', '31/12/2030', 'Spissa in testa', 'GRTNCL02D01L736B');
-- --------------------------------------------------------
--
-- Struttura della tabella `auto`
--
CREATE TABLE `auto` (
`targa` char(7) NOT NULL,
`modello` char(22) DEFAULT NULL,
`alimentazione` char(22) DEFAULT NULL,
`Npatente` char(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dump dei dati per la tabella `auto`
--
INSERT INTO `auto` (`targa`, `modello`, `alimentazione`, `Npatente`) VALUES
('FD132BD', 'B.M.B. / Menarinibus \"', 'Metano', 'VE1234567B'),
('FF123DB', 'Mercedes Vito 9 Posti', 'Diesel', 'VE1234567B');
-- --------------------------------------------------------
--
-- Struttura della tabella `av`
--
CREATE TABLE `av` (
`Npatente` char(10) NOT NULL,
`CodV` int(22) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dump dei dati per la tabella `av`
--
INSERT INTO `av` (`Npatente`, `CodV`) VALUES
('VE12121121', 8),
('VE1234567B', 1),
('VE1234567B', 2),
('VE1234567B', 3),
('VE1234567B', 4),
('VE1234567B', 5),
('VE1234567B', 6),
('VE1234567B', 7);
-- --------------------------------------------------------
--
-- Struttura della tabella `passegieri`
--
CREATE TABLE `passegieri` (
`CodP` char(22) NOT NULL,
`nick` char(40) DEFAULT NULL,
`CF` char(16) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dump dei dati per la tabella `passegieri`
--
INSERT INTO `passegieri` (`CodP`, `nick`, `CF`) VALUES
('1', 'LordDermatite', 'GRTNCL02D01L736B'),
('2', 'MegaClaudio69', '\"=\"=\"=\"');
-- --------------------------------------------------------
--
-- Struttura della tabella `prenotazione`
--
CREATE TABLE `prenotazione` (
`Nprenotazione` int(22) NOT NULL,
`codV` int(22) DEFAULT NULL,
`CodR` int(22) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dump dei dati per la tabella `prenotazione`
--
INSERT INTO `prenotazione` (`Nprenotazione`, `codV`, `CodR`) VALUES
(1, NULL, NULL),
(2, NULL, NULL),
(3, NULL, NULL),
(4, NULL, NULL);
-- --------------------------------------------------------
--
-- Struttura della tabella `recensioni`
--
CREATE TABLE `recensioni` (
`CodRec` int(16) NOT NULL,
`numerico` char(22) DEFAULT NULL,
`note` char(40) DEFAULT NULL,
`tipo` char(22) DEFAULT NULL,
`CF` char(16) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dump dei dati per la tabella `recensioni`
--
INSERT INTO `recensioni` (`CodRec`, `numerico`, `note`, `tipo`, `CF`) VALUES
(1, '4', 'Sarebbe il TOP se non si grattasse la te', 'passeggero', 'GRTNCL02D01L736B'),
(2, '5', '', 'passeggero', 'GRTNCL02D01L736B'),
(3, '3', '', 'autista', 'GRTNCL02D01L736B'),
(4, '4', '', 'autista', 'GRTNCL02D01L736B'),
(5, '5', '', 'autista', 'GRTNCL02D01L736B');
-- --------------------------------------------------------
--
-- Struttura della tabella `richiesta`
--
CREATE TABLE `richiesta` (
`CodR` int(22) NOT NULL,
`partenza` char(22) DEFAULT NULL,
`destinazione` char(22) DEFAULT NULL,
`data` char(10) DEFAULT NULL,
`CodV` int(22) DEFAULT NULL,
`CodP` char(22) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Struttura della tabella `utente`
--
CREATE TABLE `utente` (
`CF` char(16) NOT NULL,
`nome` char(22) DEFAULT NULL,
`cognome` char(22) DEFAULT NULL,
`tel` char(22) DEFAULT NULL,
`foto` char(30) DEFAULT NULL,
`email` char(22) DEFAULT NULL,
`Npatente` char(10) DEFAULT NULL,
`CodP` char(22) DEFAULT NULL,
`Password` varchar(22) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dump dei dati per la tabella `utente`
--
INSERT INTO `utente` (`CF`, `nome`, `cognome`, `tel`, `foto`, `email`, `Npatente`, `CodP`, `Password`) VALUES
('\"=\"=\"=\"', 'Claudio', 'Franchin', '6969696', NULL, 'dio@gmail.com', 'VE12121121', '2', 'cazziMii'),
('fjei dsfus0èd,of', 'Paolo', 'Paolli', 'f', NULL, 'gesdasd@dasdas', NULL, NULL, 'cazziMii'),
('GRTNCL02D01L736B', 'Nicolo', 'Grattatesta', '3331234567', '', 'GrattatestaNick@gmail', 'VE1234567B', '1', 'MiGrattoLaTesta');
-- --------------------------------------------------------
--
-- Struttura della tabella `viaggio`
--
CREATE TABLE `viaggio` (
`codV` int(22) NOT NULL,
`partenza` char(22) DEFAULT NULL,
`destinazione` char(22) DEFAULT NULL,
`data` char(10) DEFAULT NULL,
`oraP` time DEFAULT NULL,
`oraA` time DEFAULT NULL,
`Costo` char(6) DEFAULT NULL,
`disponibilita` int(10) DEFAULT NULL,
`note` char(22) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dump dei dati per la tabella `viaggio`
--
INSERT INTO `viaggio` (`codV`, `partenza`, `destinazione`, `data`, `oraP`, `oraA`, `Costo`, `disponibilita`, `note`) VALUES
(1, 'Venezia', 'Milano', '1/4/2020', '08:00:00', '11:00:00', '200', 3, ''),
(2, 'Venezia', 'Milano', '1/4/2020', '06:00:00', '09:00:00', '100', 7, ''),
(3, 'Venezia', 'Milano', '1/4/2020', '12:00:00', '16:00:00', '250', 8, ''),
(4, 'Venezia', 'Milano', '1/4/2020', '15:00:00', '21:00:00', '40', 35, 'Bus'),
(5, 'Sabaudi', 'oriago', '12/02', '10:00:00', '11:00:00', '200$', 3, 'nienete cani o messica'),
(6, 'Venezia', 'Norvegia', '12/02', '10:00:00', '11:00:00', '200$', 4, 'niente Messicani'),
(7, 'Venezia', 'Norvegia', '12/02', '10:00:00', '11:00:00', '200$', 4, 'niente Messicani'),
(8, 'Sabaudi', 'Norvegia', '12/02', '10:00:00', '11:00:00', '3£', 2, 'nienete cani o messica');
--
-- Indici per le tabelle scaricate
--
--
-- Indici per le tabelle `autisti`
--
ALTER TABLE `autisti`
ADD PRIMARY KEY (`Npatente`),
ADD KEY `CF` (`CF`);
--
-- Indici per le tabelle `auto`
--
ALTER TABLE `auto`
ADD PRIMARY KEY (`targa`),
ADD KEY `Npatente` (`Npatente`);
--
-- Indici per le tabelle `av`
--
ALTER TABLE `av`
ADD PRIMARY KEY (`Npatente`,`CodV`),
ADD KEY `CodV` (`CodV`),
ADD KEY `Npatente` (`Npatente`);
--
-- Indici per le tabelle `passegieri`
--
ALTER TABLE `passegieri`
ADD PRIMARY KEY (`CodP`),
ADD KEY `CF` (`CF`);
--
-- Indici per le tabelle `prenotazione`
--
ALTER TABLE `prenotazione`
ADD PRIMARY KEY (`Nprenotazione`),
ADD KEY `codV` (`codV`),
ADD KEY `CodR` (`CodR`);
--
-- Indici per le tabelle `recensioni`
--
ALTER TABLE `recensioni`
ADD PRIMARY KEY (`CodRec`),
ADD KEY `CF` (`CF`);
--
-- Indici per le tabelle `richiesta`
--
ALTER TABLE `richiesta`
ADD PRIMARY KEY (`CodR`),
ADD KEY `CodV` (`CodV`),
ADD KEY `CodP` (`CodP`);
--
-- Indici per le tabelle `utente`
--
ALTER TABLE `utente`
ADD PRIMARY KEY (`CF`),
ADD KEY `CodP` (`CodP`),
ADD KEY `Npatente` (`Npatente`);
--
-- Indici per le tabelle `viaggio`
--
ALTER TABLE `viaggio`
ADD PRIMARY KEY (`codV`);
--
-- Limiti per le tabelle scaricate
--
--
-- Limiti per la tabella `autisti`
--
ALTER TABLE `autisti`
ADD CONSTRAINT `autisti_ibfk_1` FOREIGN KEY (`CF`) REFERENCES `utente` (`CF`);
--
-- Limiti per la tabella `auto`
--
ALTER TABLE `auto`
ADD CONSTRAINT `auto_ibfk_1` FOREIGN KEY (`Npatente`) REFERENCES `autisti` (`Npatente`);
--
-- Limiti per la tabella `av`
--
ALTER TABLE `av`
ADD CONSTRAINT `av_ibfk_1` FOREIGN KEY (`CodV`) REFERENCES `viaggio` (`codV`),
ADD CONSTRAINT `av_ibfk_2` FOREIGN KEY (`Npatente`) REFERENCES `autisti` (`Npatente`);
--
-- Limiti per la tabella `passegieri`
--
ALTER TABLE `passegieri`
ADD CONSTRAINT `passegieri_ibfk_1` FOREIGN KEY (`CF`) REFERENCES `utente` (`CF`);
--
-- Limiti per la tabella `prenotazione`
--
ALTER TABLE `prenotazione`
ADD CONSTRAINT `prenotazione_ibfk_1` FOREIGN KEY (`codV`) REFERENCES `viaggio` (`codV`),
ADD CONSTRAINT `prenotazione_ibfk_2` FOREIGN KEY (`CodR`) REFERENCES `richiesta` (`CodR`);
--
-- Limiti per la tabella `recensioni`
--
ALTER TABLE `recensioni`
ADD CONSTRAINT `recensioni_ibfk_1` FOREIGN KEY (`CF`) REFERENCES `utente` (`CF`);
--
-- Limiti per la tabella `richiesta`
--
ALTER TABLE `richiesta`
ADD CONSTRAINT `richiesta_ibfk_1` FOREIGN KEY (`CodV`) REFERENCES `viaggio` (`codV`),
ADD CONSTRAINT `richiesta_ibfk_2` FOREIGN KEY (`CodP`) REFERENCES `passegieri` (`CodP`);
--
-- Limiti per la tabella `utente`
--
ALTER TABLE `utente`
ADD CONSTRAINT `utente_ibfk_1` FOREIGN KEY (`CodP`) REFERENCES `passegieri` (`CodP`),
ADD CONSTRAINT `utente_ibfk_2` FOREIGN KEY (`Npatente`) REFERENCES `autisti` (`Npatente`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*
A테이블의 외래키가 B테이블과 연결된 상태
select * from A join B on A.외래키명 = B.기본키명;
*/
/* 학번이 2019160160인 학생이 수강한 목록과 학생 이름을 출력하는 쿼리를 join을 이용하여 작성하세요.
1. 학생이름 강의번호 총점
2. 학생이름 과목명 총점
3. 학생이름 과목명 교수이름 총점
*/
select student_name,subject_title, course_total, professor_name
from (select *
from course where course_student_num = 2019160160) as c
join student
on course_student_num = student_num
join class
on class_num = course_class_num
join subject
on subject_code = class_subject_code
join professor
on professor_num = class_professor_num; |
CREATE TABLE `gossip_ticket` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`priority` enum('low', 'normal', 'high', 'urgent') NOT NULL DEFAULT 'normal',
`status` enum('pending', 'closed') NOT NULL DEFAULT 'pending',
`uid` int(10) UNSIGNED NOT NULL DEFAULT 0,
`title` varchar(255) NOT NULL,
`message` text,
`time` int(10) UNSIGNED NOT NULL DEFAULT 0,
`rating` enum('valid', 'invalid', 'undefined') NOT NULL DEFAULT 'undefined',
`service` int(10) UNSIGNED NOT NULL DEFAULT 0,
`ip` bigint(11) UNSIGNED DEFAULT NULL,
`source` enum('local', 'weibo', 'weixin', 'email') NOT NULL DEFAULT 'local',
`question_id` int(10) UNSIGNED DEFAULT NULL,
`weibo_msg_id` bigint(20) UNSIGNED DEFAULT NULL,
`received_email_id` int(10) UNSIGNED DEFAULT NULL,
`reply_time` int(10) UNSIGNED NOT NULL DEFAULT 0,
`close_time` int(10) UNSIGNED NOT NULL DEFAULT 0,
`has_attach` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `priority` (`priority`),
KEY `status` (`status`),
KEY `uid` (`uid`),
KEY `time` (`time`),
KEY `rating` (`rating`),
KEY `service` (`service`),
KEY `source` (`source`),
KEY `question_id` (`question_id`),
KEY `weibo_msg_id` (`weibo_msg_id`),
KEY `received_email_id` (`received_email_id`),
KEY `reply_time` (`reply_time`),
KEY `close_time` (`close_time`)
) ENGINE=innodb DEFAULT CHARSET=utf8;
CREATE TABLE `gossip_ticket_reply` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`ticket_id` int(10) UNSIGNED NOT NULL,
`message` text,
`uid` int(10) UNSIGNED NOT NULL DEFAULT 0,
`time` int(10) UNSIGNED NOT NULL DEFAULT 0,
`ip` bigint(11) UNSIGNED DEFAULT NULL,
`has_attach` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `ticket_id` (`ticket_id`),
KEY `uid` (`uid`),
KEY `time` (`time`)
) ENGINE=innodb DEFAULT CHARSET=utf8;
CREATE TABLE `gossip_ticket_log` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`ticket_id` int(10) UNSIGNED NOT NULL,
`uid` int(10) UNSIGNED NOT NULL DEFAULT 0,
`action` varchar(255) NOT NULL,
`data` text,
`time` int(10) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `ticket_id` (`ticket_id`),
KEY `uid` (`uid`),
KEY `action` (`action`),
KEY `time` (`time`)
) ENGINE=innodb DEFAULT CHARSET=utf8;
CREATE TABLE `gossip_ticket_invite` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`ticket_id` int(10) UNSIGNED NOT NULL,
`sender_uid` int(10) UNSIGNED NOT NULL DEFAULT 0,
`recipient_uid` int(10) UNSIGNED NOT NULL DEFAULT 0,
`time` int(10) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `ticket_id` (`ticket_id`),
KEY `sender_uid` (`sender_uid`),
KEY `recipient_uid` (`recipient_uid`),
KEY `time` (`time`)
) ENGINE=innodb DEFAULT CHARSET=utf8;
INSERT INTO `gossip_system_setting` (`varname`, `value`) VALUES ('ticket_enabled', 's:1:"N";');
ALTER TABLE `gossip_question` ADD `ticket_id` int(10) UNSIGNED DEFAULT NULL, ADD INDEX (`ticket_id`);
|
CREATE SCHEMA IF NOT EXISTS ums
AUTHORIZATION postgres;
GRANT ALL ON SCHEMA ums TO PUBLIC;
GRANT ALL ON SCHEMA ums TO postgres;
CREATE TABLE IF NOT EXISTS ums.user_account
(
id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ),
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
first_name character varying(16) COLLATE pg_catalog."default" NOT NULL,
last_name character varying(16) COLLATE pg_catalog."default" NOT NULL,
password character varying(255) COLLATE pg_catalog."default" NOT NULL,
role character varying(255) COLLATE pg_catalog."default" NOT NULL,
status character varying(255) COLLATE pg_catalog."default" NOT NULL,
username character varying(16) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT user_account_pkey PRIMARY KEY (id),
CONSTRAINT uk_castjbvpeeus0r8lbpehiu0e4 UNIQUE (username)
)
TABLESPACE pg_default;
ALTER TABLE ums.user_account
OWNER to postgres; |
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2018/5/23 0:39:21 */
/*==============================================================*/
drop table if exists t_dept;
drop table if exists t_document;
drop table if exists t_employee;
drop table if exists t_job;
drop table if exists t_notice;
drop table if exists t_user;
/*==============================================================*/
/* Table: t_dept */
/*==============================================================*/
create table t_dept
(
id int not null auto_increment,
remark varchar(32),
name varchar(320),
primary key (id)
);
alter table t_dept comment '部门表';
/*==============================================================*/
/* Table: t_document */
/*==============================================================*/
create table t_document
(
id int not null auto_increment,
filename varchar(64),
create_date timestamp default CURRENT_TIMESTAMP,
path varchar(320),
user_id int,
remark varchar(300),
primary key (id)
);
alter table t_document comment '文件表';
/*==============================================================*/
/* Table: t_employee */
/*==============================================================*/
create table t_employee
(
id int not null auto_increment,
name varchar(32),
card_id varchar(32),
address varchar(32),
phone varchar(32),
sex varchar(16),
birthday date,
hobby varchar(64),
dept_id int,
job_id int,
primary key (id)
);
alter table t_employee comment '员工表';
/*==============================================================*/
/* Table: t_job */
/*==============================================================*/
create table t_job
(
id int not null auto_increment,
name varchar(32),
remark varchar(320),
primary key (id)
);
alter table t_job comment '职位表';
/*==============================================================*/
/* Table: t_notice */
/*==============================================================*/
create table t_notice
(
id int not null auto_increment,
title varchar(64),
content longtext,
create_date timestamp default CURRENT_TIMESTAMP,
user_id int,
primary key (id)
);
alter table t_notice comment '通知表';
/*==============================================================*/
/* Table: t_user */
/*==============================================================*/
create table t_user
(
id int not null auto_increment,
loginname varchar(32),
password varchar(32),
status int default 1,
createdate timestamp default CURRENT_TIMESTAMP,
username varchar(32),
primary key (id)
);
alter table t_user comment '用户表';
alter table t_document add constraint FK_document_user foreign key (user_id)
references t_user (id) on delete restrict on update restrict;
alter table t_employee add constraint FK_employee_dept foreign key (dept_id)
references t_dept (id) on delete restrict on update restrict;
alter table t_employee add constraint FK_employee_job foreign key (job_id)
references t_job (id) on delete restrict on update restrict;
alter table t_notice add constraint FK_notice_user foreign key (user_id)
references t_user (id) on delete restrict on update restrict;
|
create table cliente (
id bigserial not null,
email varchar(255),
nome varchar(255),
senha varchar(255),
endereco_id int8,
primary key (id)
);
create table endereco (
id bigserial not null,
bairro varchar(255),
cep varchar(255),
cidade varchar(255),
estado varchar(255),
rua varchar(255),
primary key (id)
);
create table pedido (
id bigserial not null,
data_do_pedido timestamp,
status_do_pedido int4,
cliente_id int8,
primary key (id)
);
create table pedido_item (
id bigserial not null,
quantidade int4,
total numeric(19, 2),
valor numeric(19, 2),
pedido_id int8,
produto_id int8,
primary key (id)
);
alter table if exists cliente
add constraint FK64nr9yt889by5lufr1boo5i4s
foreign key (endereco_id)
references endereco;
alter table if exists pedido
add constraint FK30s8j2ktpay6of18lbyqn3632
foreign key (cliente_id)
references cliente;
alter table if exists pedido_item
add constraint FKeyouxfvoi291lpo5168e6wpej
foreign key (pedido_id)
references pedido;
alter table if exists pedido_item
add constraint FK8eyfr31j751fjws2y012awmpg
foreign key (produto_id)
references produto; |
USE sql_intro;
-- CREATE TABLE student (
-- s_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-- s_name VARCHAR(20),
-- is_brilliant BOOLEAN
-- );
-- CREATE TABLE teacher (
-- t_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-- t_name VARCHAR(20),
-- is_tenured BOOLEAN
-- );
-- CREATE TABLE student_teacher (
-- student_id INT,
-- teacher_id INT,
-- FOREIGN KEY(student_id) REFERENCES student(s_id),
-- FOREIGN KEY(teacher_id) REFERENCES teacher(t_id)
-- );
-- INSERT INTO Student VALUES (1, 'Ryan', 1); -- note the use of 1 for TRUE
-- INSERT INTO Student VALUES (2, 'Leo', 1);
-- INSERT INTO Student VALUES (3, 'Ernie', 0); -- and 0 for FALSE in SQL
-- INSERT INTO Teacher VALUES (1, 'Levine', 1);
-- INSERT INTO Teacher VALUES (2, 'Foster', 0);
-- INSERT INTO Teacher VALUES (3, 'Schwimmer', 0);
-- INSERT INTO student_teacher VALUES (1,1);
-- INSERT INTO student_teacher VALUES (1,2);
-- INSERT INTO student_teacher VALUES (2,1);
-- INSERT INTO student_teacher VALUES (2,2);
-- INSERT INTO student_teacher VALUES (2,3);
-- INSERT INTO student_teacher VALUES (3,1);
|
CREATE TABLE ProcessFileTask
(
ID int IDENTITY PRIMARY KEY NOT NULL,
PIDs nvarchar(max) NOT NULL,
CIDs nvarchar(max) NULL,
[Status] int NOT NULL,
EmailTo nvarchar(250) NOT NULL,
ConvertedFilePath nvarchar(250) NULL,
[Description] nvarchar(250) NULL,
RequestedDate datetime NOT NULL,
ConvertedDate datetime NULL,
SentDate datetime NULL
) |
create table osm_protected_area as select osm_id, boundary, leisure, name, tourism, osm_timestamp::TIMESTAMPTZ, way_area, way as geometry from planet_osm_polygon with no data;
grant all on osm_protected_area to deegree;
create sequence osm_protected_area_seq;
grant all on osm_protected_area_seq to deegree;
alter table osm_protected_area add column id integer default nextval('osm_protected_area_seq');
ALTER TABLE osm_protected_area ADD COLUMN gml_description varchar;
ALTER TABLE osm_protected_area ADD COLUMN gml_identifier varchar;
ALTER TABLE osm_protected_area ADD COLUMN gml_identifier_codespace varchar;
ALTER TABLE osm_protected_area ADD COLUMN gml_name varchar;
ALTER TABLE osm_protected_area ADD COLUMN osm_timestamp_modified_id varchar;
ALTER TABLE osm_protected_area ADD COLUMN osm_timestamp_modified timestamptz;
ALTER TABLE osm_protected_area ADD PRIMARY KEY (id);
SELECT * FROM versions.pgvsinit('public.osm_protected_area');
GRANT ALL ON osm_protected_area_version to deegree;
GRANT ALL ON versions.public_osm_protected_area_version_log to deegree;
GRANT USAGE ON SEQUENCE versions.public_osm_protected_area_version_log_version_log_id_seq TO deegree;
GRANT ALL ON versions.public_osm_protected_area_version_log to deegree;
CREATE OR REPLACE RULE insert AS
ON INSERT TO osm_protected_area_version DO INSTEAD INSERT INTO versions.public_osm_protected_area_version_log (id, osm_id, boundary, leisure, name, tourism, osm_timestamp, way_area, geometry, gml_description, gml_identifier, gml_identifier_codespace, gml_name, osm_timestamp_modified_id, osm_timestamp_modified, action)
VALUES (new.id, new.osm_id, new.boundary, new.leisure, new.name, new.tourism, new.osm_timestamp, new.way_area, new.geometry, new.gml_description, new.gml_identifier, new.gml_identifier_codespace, new.gml_name, new.osm_timestamp_modified_id, new.osm_timestamp_modified, 'insert'::character varying)
RETURNING public_osm_protected_area_version_log.id,
public_osm_protected_area_version_log.osm_id,
public_osm_protected_area_version_log.boundary,
public_osm_protected_area_version_log.leisure,
public_osm_protected_area_version_log.name,
public_osm_protected_area_version_log.tourism,
public_osm_protected_area_version_log.osm_timestamp,
public_osm_protected_area_version_log.way_area,
public_osm_protected_area_version_log.geometry,
public_osm_protected_area_version_log.gml_description,
public_osm_protected_area_version_log.gml_identifier,
public_osm_protected_area_version_log.gml_identifier_codespace,
public_osm_protected_area_version_log.gml_name,
public_osm_protected_area_version_log.osm_timestamp_modified_id,
public_osm_protected_area_version_log.osm_timestamp_modified,
public_osm_protected_area_version_log.version_log_id,
public_osm_protected_area_version_log.action,
to_timestamp((public_osm_protected_area_version_log.systime / 1000)::double precision) AS to_timestamp;
|
----------------------------------------------------------------------------------------
--
-- File name: cs_sysmetric_current.sql
--
-- Purpose: All System Metrics current value (text report)
--
-- Author: Carlos Sierra
--
-- Version: 2020/12/09
--
-- Usage: Execute connected to CDB or PDB
--
-- Example: $ sqlplus / as sysdba
-- SQL> @cs_sysmetric_current.sql
--
-- Notes: Developed and tested on 12.1.0.2.
--
---------------------------------------------------------------------------------------
--
@@cs_internal/cs_primary.sql
@@cs_internal/cs_set.sql
@@cs_internal/cs_def.sql
@@cs_internal/cs_file_prefix.sql
--
DEF cs_script_name = 'cs_sysmetric_current';
--
SELECT '&&cs_file_prefix._&&cs_script_name.' cs_file_name FROM DUAL;
--
@@cs_internal/cs_spool_head.sql
PRO SQL> @&&cs_script_name..sql
@@cs_internal/cs_spool_id.sql
--
COL metric_name FOR A45 TRUN;
COL metric_unit FOR A41 TRUN;
COL seconds FOR 900.00;
--
PRO
PRO System Metrics by Name
PRO ~~~~~~~~~~~~~~~~~~~~~~
SELECT metric_name,
value,
metric_unit,
begin_time,
end_time,
intsize_csec/100 seconds
FROM v$sysmetric
ORDER BY
metric_name
/
--
PRO
PRO System Metrics by Unit and Name
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SELECT metric_unit,
metric_name,
value,
begin_time,
end_time,
intsize_csec/100 seconds
FROM v$sysmetric
ORDER BY
metric_unit,
metric_name
/
--
PRO
PRO SQL> @&&cs_script_name..sql
--
@@cs_internal/cs_spool_tail.sql
--
@@cs_internal/cs_undef.sql
@@cs_internal/cs_reset.sql
-- |
-- 11-24-2010 11:51:52 AM CST
-- correct BOM Import
UPDATE AD_Column SET DefaultValue='N',Updated=TO_DATE('2010-11-24 11:51:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=60000
;
-- 11-24-2010 11:51:57 AM CST
-- correct BOM Import
ALTER TABLE I_Product_BOM MODIFY I_IsImported CHAR(1) DEFAULT 'N'
;
-- 11-24-2010 11:51:58 AM CST
-- correct BOM Import
UPDATE I_Product_BOM SET I_IsImported='N' WHERE I_IsImported IS NULL
;
|
INSERT INTO burgers (name) VALUES ('BlackBean Burger');
INSERT INTO burgers (name) VALUES ('Spicy Southwest Burger');
INSERT INTO burgers (name) VALUES ('All American Bacon Cheeseburger');
INSERT INTO burgers (name) VALUES ('Sweet Teryaki Burger');
INSERT INTO burgers (name) VALUES ('Chop House Burger'); |
SELECT * FROM tasks WHERE id = :id:
|
CREATE VIEW lsHistoricoPaciente AS
SELECT CONVERT(VARCHAR,a.datahora,103) data, CONVERT(VARCHAR(5),a.datahora,108) hora, f.nome, p.id FROM agenda a
INNER JOIN pessoas p ON p.id = a.paciente_id
INNER JOIN funcionarios f ON f.id = a.funcionario_id |
create or replace procedure p2
is
cursor curso is
select a.cust_first_name, a.cust_last_name,a.cust_city,
t.calendar_month_name,sum(s.quantity_sold) as qsold,sum(s.amount_sold) as asold
from customers a, sales s, times t
where a.cust_id=s.cust_id and
s.time_id=t.time_id and
a.country_name='United_kingdom'and
t.calendar_quarter_number <=2;
group by a.cust_first_name, a.cust_last_name, a.cust_city, t.calendar_month_name;
var curso%rowtype;
begin
open curso;
loop
fetch curso into var;
exit when curso%notfound;
insert into custtest(cust_first_name,cust_last_name,cust_city,calendar_month_name,quantity_sold,amount_sold)
values(area.cust_first_name,area.cust_last_name,area.cust_city,area.calendar_month_name,area.quantity_sold,area.amount_sold);
end loop;
close curso;
end p2 |
# Host: localhost (Version 5.7.26-log)
# Date: 2019-11-11 18:55:04
# Generator: MySQL-Front 6.1 (Build 1.26)
#
# Structure for table "order_detail"
#
DROP TABLE IF EXISTS `order_detail`;
CREATE TABLE `order_detail` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`order_id` bigint(20) NOT NULL DEFAULT '0',
`product_id` bigint(20) NOT NULL DEFAULT '0',
`product_name` varchar(64) NOT NULL COMMENT '商品名称',
`product_price` decimal(8,2) NOT NULL COMMENT '当前价格,单位分',
`product_quantity` int(11) NOT NULL COMMENT '数量',
`product_icon` varchar(512) DEFAULT NULL COMMENT '小图',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1573227951939137222 DEFAULT CHARSET=utf8mb4;
#
# Data for table "order_detail"
#
INSERT INTO `order_detail` VALUES (1573227449902312991,1573227449562543494,1,'徐睿',668.68,1,NULL,'2019-11-08 22:43:52','2019-11-08 22:43:52'),(1573227449932438933,1573227449562543494,2,'范冰冰',568.89,2,NULL,'2019-11-08 22:45:39','2019-11-08 22:45:39'),(1573227579754262356,1573227579392274798,1,'徐睿',668.68,1,NULL,'2019-11-08 22:43:52','2019-11-08 22:43:52'),(1573227579780654563,1573227579392274798,2,'范冰冰',568.89,2,NULL,'2019-11-08 22:45:39','2019-11-08 22:45:39'),(1573227951915309764,1573227951619768099,1,'徐睿',668.68,3,NULL,'2019-11-08 22:43:52','2019-11-08 22:43:52'),(1573227951939137221,1573227951619768099,2,'范冰冰',568.89,4,NULL,'2019-11-08 22:45:39','2019-11-08 22:45:39');
#
# Structure for table "ordertable"
#
DROP TABLE IF EXISTS `ordertable`;
CREATE TABLE `ordertable` (
`id` bigint(20) NOT NULL DEFAULT '0',
`buyer_name` varchar(32) NOT NULL COMMENT '买家名字',
`buyer_phone` varchar(32) NOT NULL COMMENT '买家电话',
`buyer_address` varchar(128) NOT NULL COMMENT '买家地址',
`buyer_openid` varchar(64) NOT NULL COMMENT '买家微信openid',
`order_amount` decimal(8,2) NOT NULL COMMENT '订单总金额',
`order_status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '订单状态, 默认为新下单',
`pay_status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '支付状态, 默认未支付',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_buyer_openid` (`buyer_openid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
#
# Data for table "ordertable"
#
INSERT INTO `ordertable` VALUES (1573227449562543494,'梁晟','123456789012','工业学院','110119',1806.46,0,0,'2019-11-08 23:37:29','2019-11-08 23:37:29'),(1573227579392274798,'梁晟','123456789012','工业学院','110119',1806.46,0,0,'2019-11-08 23:39:39','2019-11-08 23:39:39'),(1573227951619768099,'梁晟','123456789012','工业学院','110119',4281.60,0,0,'2019-11-08 23:45:51','2019-11-08 23:45:51');
#
# Structure for table "product"
#
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`product_name` varchar(64) NOT NULL COMMENT '商品名称',
`product_price` decimal(8,2) NOT NULL COMMENT '单价',
`product_stock` int(11) NOT NULL COMMENT '库存',
`product_description` varchar(64) DEFAULT NULL COMMENT '描述',
`product_icon` varchar(512) DEFAULT NULL COMMENT '小图',
`product_status` tinyint(3) DEFAULT '0' COMMENT '商品状态,0正常1下架',
`category_type` int(11) NOT NULL COMMENT '类目编号',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
#
# Data for table "product"
#
INSERT INTO `product` VALUES (1,'徐睿',668.68,5,NULL,NULL,0,1,'2019-11-08 22:43:52','2019-11-08 22:43:52'),(2,'范冰冰',568.89,12,NULL,NULL,0,2,'2019-11-08 22:45:39','2019-11-08 22:45:39');
#
# Structure for table "product_category"
#
DROP TABLE IF EXISTS `product_category`;
CREATE TABLE `product_category` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`category_name` varchar(64) NOT NULL COMMENT '类目名字',
`category_type` int(11) NOT NULL COMMENT '类目编号',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
#
# Data for table "product_category"
#
INSERT INTO `product_category` VALUES (1,'爱宠',1,'2019-11-08 22:44:24','2019-11-08 22:44:24'),(2,'玩物',2,'2019-11-08 22:44:53','2019-11-08 22:44:53');
#
# Structure for table "seller_info"
#
DROP TABLE IF EXISTS `seller_info`;
CREATE TABLE `seller_info` (
`id` varchar(32) NOT NULL,
`username` varchar(32) NOT NULL,
`password` varchar(32) NOT NULL,
`openid` varchar(64) NOT NULL COMMENT '微信openid',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='卖家信息表';
#
# Data for table "seller_info"
#
|
USE sakila;
CREATE VIEW film_info AS
SELECT
a.actor_id,
CONCAT(a.first_name,' ',a.last_name) AS 'actor',
f.title
FROM
actor AS a
INNER JOIN
film_actor AS fa
ON
a.actor_id = fa.actor_id
INNER JOIN
film AS f
ON
f.film_id = fa.film_id
ORDER BY
actor;
|
USE netrade;
# Set the share price of a stock (for simulating market fluctuations in share price)
DELIMITER //
CREATE PROCEDURE updateStockPrice(IN stockPrice INTEGER, stockSymbol CHAR(20))
BEGIN
UPDATE Stock
SET Stock.PricePerShare = stockPrice
WHERE Stock.StockSymbol = stockSymbol;
END//
# Add, Edit and Delete information for an employee
DELIMITER //
CREATE PROCEDURE addEmployee(IN ID INTEGER, SSN INTEGER, StartDate DATE, HourlyRate INTEGER)
BEGIN
INSERT INTO Employee
VALUES(ID, SSN, StartDate, HourlyRate);
END//
# EDIT
DELIMITER //
CREATE PROCEDURE editEmployee(IN ID INTEGER, StartDate DATE, HourlyRate INTEGER)
BEGIN
UPDATE Employee
SET Employee.StartDate = StartDate,
HourlyRate = HourlyRate
WHERE Employee.ID = ID;
END//
DELIMITER //
CREATE PROCEDURE editEmployeeStartDate(IN ID INTEGER, StartDate DATE)
BEGIN
UPDATE Employee
SET Employee.StartDate = StartDate
WHERE Employee.ID = ID;
END//
DELIMITER //
CREATE PROCEDURE editEmployeeHourlyRate(IN ID INTEGER, HourlyRate INTEGER)
BEGIN
UPDATE Employee
SET HourlyRate = HourlyRate
WHERE Employee.ID = ID;
END//
#delete
DELIMITER //
CREATE PROCEDURE deleteEmployeeSSN(IN ID INTEGER)
BEGIN
UPDATE Employee
SET Employee.SSN = NULL
WHERE Employee.ID = ID;
END//
DELIMITER //
CREATE PROCEDURE deleteEmployeeStartDate(IN ID INTEGER)
BEGIN
UPDATE Employee
SET Employee.StartDate = NULL
WHERE Employee.ID = ID;
END//
DELIMITER //
CREATE PROCEDURE deleteEmployeeHourlyRate(IN ID INTEGER)
BEGIN
UPDATE Employee
SET Employee.HourlyRate = NULL
WHERE Employee.ID = ID;
END //
#Obtain a sales report for a particular month
DELIMITER //
CREATE PROCEDURE monthlySalesReport(IN month INTEGER)
BEGIN
SELECT T.*
FROM Trade T, StockOrder O
WHERE MONTH(O.DateTime) = month
AND T.OrderId = O.Id;
END//
drop procedure monthlySalesReport;
#Produce a comprehensive listing of all stocks
DELIMITER //
CREATE PROCEDURE stockListing()
BEGIN
SELECT* FROM Stock;
END//
#Produce a list of orders by stock symbol
DELIMITER //
CREATE PROCEDURE stockListingBySymbol()
BEGIN
SELECT * FROM Stock
ORDER BY Stock.StockSymbol;
END //
#Produce a list of orders by customer name
DELIMITER //
CREATE PROCEDURE stockListingByName()
BEGIN
SELECT * FROM Stock
ORDER BY Stock.CompanyName;
END //
#Produce a summary listing of revenue generated by a particular stock
DELIMITER //
CREATE PROCEDURE revenueByStockSymbol(IN Symbol CHAR(20))
BEGIN
SELECT S.*, SUM(R.Fee) AS 'Revenue'
FROM Stock S, Trade T, Transaction R, StockOrder O
WHERE S.StockSymbol = Symbol AND O.ID = T.OrderId
AND R.ID = T.TransactionId
AND T.StockId = S.StockSymbol
GROUP BY S.StockSymbol;
END //
#Produce a summary listing of revenue generated by a particular stock type
DELIMITER //
CREATE PROCEDURE revenueByStockType(IN SType CHAR(20))
BEGIN
SELECT S.*, SUM(R.Fee) AS 'Revenue'
FROM Stock S, Trade T, Transaction R, StockOrder O
WHERE S.Type = SType AND O.ID = T.OrderId
AND R.ID = T.TransactionId
AND T.StockId = S.StockSymbol
GROUP BY S.StockSymbol;
END //
#Produce a summary listing of revenue generated by a particular customer
DELIMITER //
CREATE PROCEDURE revenueByCustID(IN CID INTEGER)
BEGIN
SELECT C.*, SUM(R.Fee) AS 'Revenue'
FROM Transaction R, Trade T, Account A, Client C, Stock S
WHERE T.TransactionId = R.ID
AND A.ID = T.AccountId
AND C.ID = A.ClientID
AND C.ID = CID;
END //
#Determine which customer representative generated most total revenue
DELIMITER //
CREATE PROCEDURE mostRevenue_CustomerRepresentative()
BEGIN
SELECT E.SSN AS 'Employee SSN', E.ID AS 'Employee ID', (R.PricePerShare - S.PricePerShare) * O.NumShares AS MaxRevenue
FROM Employee E, Transaction R, StockOrder O, Stock S, Trade T
WHERE T.StockId = S.StockSymbol
AND T.TransactionId = R.ID
AND T.OrderId = O.ID
AND T.BrokerId = E.ID
ORDER BY MaxRevenue DESC LIMIT 1;
END //
drop procedure mostRevenue_CustomerRepresentative;
#Determine which customer generated most total revenue
DELIMITER //
CREATE PROCEDURE customer_mostRevenue()
BEGIN
SELECT C.ID AS 'Client ID', (R.PricePerShare - S.PricePerShare) * O.NumShares AS MaxRevenue
FROM Client C, Transaction R, StockOrder O, Stock S, Trade T, Account A
WHERE T.StockId = S.StockSymbol AND T.AccountId = A.ID
AND T.TransactionId = R.ID AND T.OrderId = O.ID
AND A.ClientID = C.ID
ORDER BY MaxRevenue DESC LIMIT 1;
END //
drop procedure customer_mostRevenue;
#Produce a list of most actively traded stocks
DELIMITER //
CREATE PROCEDURE activeStocks()
BEGIN
SELECT Trade.StockId AS 'Active Stocks'
FROM Trade
GROUP BY Trade.StockId
ORDER BY COUNT(Trade.StockId) DESC;
END //
|
/* Formatted on 10/10/2016 10:39:36 AM (QP5 v5.149.1003.31008) */
SELECT 'ERC' || NP.REDEEM_ID "Voucher Instance SID",
NP.VOUCHER_SERIALNUM "Voucher SID",
NP.VOUCHER_PARTNER_ID "Voucher Partner SID",
NP.VOUCHER_ISSUER_ID "Voucher Issuer Party ID",
NP.VOUCHER_PRINTER_ID "Voucher Printer ID",
NP.VOUCHER_STATUS_DATE "Last Voucher Status Change",
NP.VOUCHER_EXP_DATE "Voucher Expiry DateTime",
NP.VOUCHER_STATUS_DATE "Status Change DateTime",
NP.SKU "Voucher SKU ID",
NP.VOUCHER_MEDIA_TYPE "Voucher Type Code",
NP.ENTRY_DATE "Vendor Transaction DateTime"
FROM NK_VOUCHER_REDEMPTION NP |
USE Hotel
UPDATE Payments
SET TaxRate *= 0.97
SELECT TaxRate FROM Payments |
CREATE procedure spr_get_ItemSalesSummary_Detail (@ProductCode nvarchar(50), @FromDate DateTime, @ToDate DateTime)
as
begin
select distinct DBO.StripDateFromTime(IA.InvoiceDate), "Invoice Date" = DBO.StripDateFromTime(IA.InvoiceDate),
"Quantity" = sum(case IA.InvoiceType when 4 then -IDt.Quantity else IDt.Quantity end),
"Value" = Sum(case IA.InvoiceType when 4 then -IDt.Amount else IDt.Amount end)
from InvoiceAbstract IA, InvoiceDetail IDt
where
IA.InvoiceID = IDt.InvoiceID and
IDt.Product_Code like @ProductCode and
IA.InvoiceDate between @FromDate and @ToDate and
(IA.Status & 128) = 0 and
(IA.Status & 192) = 0
group by DBO.StripDateFromTime(IA.InvoiceDate)
end
|
/*
Navicat MySQL Data Transfer
Source Host : localhost:3306
Source Database : mytest
Target Host : localhost:3306
Target Database : mytest
Date: 2017-06-15 09:33:51
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for package
-- ----------------------------
DROP TABLE IF EXISTS `package`;
CREATE TABLE `package` (
`Name` varchar(32) default NULL,
`ID` int(11) default NULL,
`senderName` varchar(20) default NULL,
`State` varchar(20) default NULL,
`Fee` float default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of package
-- ----------------------------
-- ----------------------------
-- Table structure for person
-- ----------------------------
DROP TABLE IF EXISTS `person`;
CREATE TABLE `person` (
`id` varchar(255) default NULL,
`name` varchar(255) default NULL,
`gender` varchar(255) default NULL,
`major` varchar(255) default NULL,
`phone` varchar(255) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of person
-- ----------------------------
INSERT INTO `person` VALUES ('1', 'zhangsan', 'dddd', 'eeee', '8665855443');
-- ----------------------------
-- Table structure for personnel
-- ----------------------------
DROP TABLE IF EXISTS `personnel`;
CREATE TABLE `personnel` (
`Name` varchar(32) default NULL,
`ID` int(11) default NULL,
`Salary` float default NULL,
`Gender` varchar(20) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of personnel
-- ----------------------------
|
SELECT
fdmail.id
, fdmail.head
, fdmail.body
, fdmail.d_cr
, fdmail.d_snt
, fdmail.d_rcv
, fdmail.d_read
, fdmail.del_r
, fdmail.del_s
, fdmail.sndr
, fdmail.rcvr
, senders.nick AS sndr_nick
, receivers.nick AS rcvr_nick
FROM
((fdmail
LEFT JOIN users AS senders ON fdmail.sndr = senders.id)
LEFT JOIN users AS receivers ON fdmail.rcvr = receivers.id)
WHERE
(fdmail.rcvr = ? OR fdmail.sndr = ?)
AND fdmail.del_s <> 1
AND fdmail.id = ?
|
update emp_copy
set job = (select job from employees where empno = 1010),
sal = (select sal from employees where empno = 1010)
where empno = (select empno from employees where ename = '加藤')
/
select job, sal, empno
from emp_copy
/
rollback
/
select job, sal, empno
from emp_copy
/
|
INSERT INTO orders (
user_id,
total
)VALUES (
${id},
${total}
)
returning order_id; |
--
-- Table structure for table `user_detail`
--
CREATE TABLE `user_detail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`country` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`mobile` varchar(20) NOT NULL,
`aboutyou` varchar(255) NOT NULL,
`birthday` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
CREATE TABLE `ref_user_type` (
`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'id,自增长',
`userId` varchar(36) CHARACTER SET utf8mb4 NOT NULL COMMENT 'userId',
`type` varchar(20) NOT NULL COMMENT '角色',
`createTime` timestamp NOT NULL default CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
)ENGINE = InnoDB DEFAULT CHARSET = utf8 COMMENT = '用户身份关联表'; |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: db
-- Generation Time: Feb 01, 2021 at 11:09 AM
-- Server version: 8.0.23
-- PHP Version: 7.4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `camagru_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE `comments` (
`id` int NOT NULL,
`user_id` int NOT NULL,
`post_id` int NOT NULL,
`content` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `likes`
--
CREATE TABLE `likes` (
`id` int NOT NULL,
`user_id` int NOT NULL,
`post_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `posts`
--
CREATE TABLE `posts` (
`id` int NOT NULL,
`user_id` int NOT NULL,
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'camagru',
`content` varchar(255) NOT NULL,
`create_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`comments` int NOT NULL DEFAULT '0',
`likes` int NOT NULL DEFAULT '0',
`like_nbr` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int NOT NULL,
`fullname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`profile_img` varchar(255) NOT NULL DEFAULT 'https://www.washingtonfirechiefs.com/Portals/20/EasyDNNnews/3584/img-blank-profile-picture-973460_1280.png',
`password` varchar(255) NOT NULL,
`token` varchar(255) NOT NULL,
`create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`verified` int NOT NULL DEFAULT '0',
`notification` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `likes`
--
ALTER TABLE `likes`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT for table `likes`
--
ALTER TABLE `likes`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=74;
--
-- AUTO_INCREMENT for table `posts`
--
ALTER TABLE `posts`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=74;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
insert into friends (user_id, friend_id, status)
values ($1, $2, 'accepted');
insert into friends (user_id, friend_id)
values ($2, $1, 'pending'); |
CREATE VIEW voter_org_types_v (voter_id, org_type_id, user_id, created_ts, user_name,
org_type_name, last_name, first_name, middle_name, address, city, state, zipcode,
org_id) AS
SELECT vt.voter_id, vt.org_type_id, vt.user_id, vt.created_ts, u.name,
t.name, v.last_name, v.first_name, v.middle_name, v.address, v.city, v.state, v.zipcode,
t.org_id
FROM voter_org_type vt
JOIN users u ON vt.user_id=u.user_id
JOIN org_types t ON vt.org_type_id=t.org_type_id
JOIN voters v ON vt.voter_id=v.voter_id
AND v.inactive IS NULL;
GRANT ALL ON voter_org_types_v TO sdnfw;
|
■問題
アンケート回答テーブル(quest)から20歳以上の人間の回答を取り出してみましょう。
なお取り出すのはanswer1,answer2列だけとします。
SELECT
[①空欄]
FROM
quest
WHERE
[②空欄]
;
■実行文
# answer1,answer2列だけ取り出す
SELECT
answer1, answer2
# アンケート回答テーブルから取得
FROM
quest
# 20歳以上の人間の回答を取得
WHERE
age >= 20
;
■返却値
mysql> SELECT
-> answer1, answer2
-> FROM
-> quest
-> WHERE
-> age >= 20
-> ;
+---------+--------------------------+
| answer1 | answer2 |
+---------+--------------------------+
| 3 | 重宝しています。 |
| 2 | 面白いです。 |
| 1 | ちょっと難しいです。 |
| 3 | 次回作に期待しています。 |
| 2 | わかりやすいです。 |
| 1 | 絵が少ない。 |
| 2 | NULL |
| 3 | 買ってよかった。 |
| 1 | NULL |
| 2 | NULL |
| 2 | |
| 3 | 文字が小さい。 |
| 3 | 読みやすいです。 |
| 3 | 絵がかわいい。 |
+---------+--------------------------+
14 rows in set (0.00 sec)
|
create table OAUTH_ACCESS_TOKEN
(
TOKEN_ID VARCHAR2(256),
AUTHENTICATION_ID VARCHAR2(256) not null,
USER_NAME VARCHAR2(256),
CLIENT_ID VARCHAR2(256),
REFRESH_TOKEN VARCHAR2(256),
TOKEN BLOB,
AUTHENTICATION BLOB
);
create table OAUTH_APPROVALS
(
USERID VARCHAR2(256),
CLIENTID VARCHAR2(256),
SCOPE VARCHAR2(256),
STATUS VARCHAR2(10),
EXPIRESAT TIMESTAMP(6),
LASTMODIFIEDAT TIMESTAMP(6)
);
create table OAUTH_CLIENT_DETAILS
(
CLIENT_ID VARCHAR2(256) not null,
RESOURCE_IDS VARCHAR2(256),
CLIENT_SECRET VARCHAR2(256),
SCOPE VARCHAR2(256),
AUTHORIZED_GRANT_TYPES VARCHAR2(256),
WEB_SERVER_REDIRECT_URI VARCHAR2(256),
AUTHORITIES VARCHAR2(256),
ACCESS_TOKEN_VALIDITY INTEGER,
REFRESH_TOKEN_VALIDITY INTEGER,
ADDITIONAL_INFORMATION VARCHAR2(1024),
AUTOAPPROVE VARCHAR2(256)
);
create table OAUTH_CLIENT_TOKEN
(
TOKEN_ID VARCHAR2(256),
TOKEN NUMBER(30),
AUTHENTICATION_ID VARCHAR2(256) not null,
USER_NAME VARCHAR2(256),
CLIENT_ID VARCHAR2(256)
);
create table OAUTH_CODE
(
CODE VARCHAR2(256),
AUTHENTICATION NUMBER(30)
);
create table OAUTH_REFRESH_TOKEN
(
TOKEN_ID VARCHAR2(256),
TOKEN NUMBER(30),
AUTHENTICATION NUMBER(30)
); |
DROP VIEW IF EXISTS vg_stock_location_make_model_hdd_grade_color_ageing_3 cascade;
DROP VIEW IF EXISTS vg_stock_location_make_model_hdd_ageing_3 cascade;
DROP VIEW IF EXISTS vg_stock_location_make_model_hdd_ageing_2 cascade;
DROP VIEW IF EXISTS vg_xxx_stock_location_product_serial_make_model_3 cascade;
DROP VIEW IF EXISTS vg_xxx_stock_move_by_location cascade;
DROP VIEW IF EXISTS vg_stock_location_make_model_with_grade cascade;
DROP VIEW IF EXISTS vg_stock_locations_users cascade;
DROP VIEW IF EXISTS vg_users_stock_locations cascade;
DROP VIEW IF EXISTS vg_stock_location_make_model_hdd_grade_color_ageing_2 cascade;
DROP VIEW IF EXISTS vg_xxx_stock_location_product_serial_make_model_2 cascade;
DROP VIEW IF EXISTS vg_stock_location_make_model_hdd_ageing cascade;
DROP VIEW IF EXISTS vg_stock_location_make_model_hdd_grade_color_ageing cascade;
DROP VIEW IF EXISTS vg_xxx_stock_location_product_serial_make_model cascade;
DROP VIEW IF EXISTS vg_xxx_location_product_last_sale_date cascade;
DROP VIEW IF EXISTS vg_xxx_location_product_sale_date cascade;
DROP VIEW IF EXISTS vg_xxx_stock_location_make_model_2 cascade;
DROP VIEW IF EXISTS vg_xxx_stock_location_make_model_1 cascade;
DROP VIEW IF EXISTS view_grpl_xxx_stock_product_by_prodlot cascade;
DROP VIEW IF EXISTS view_grpl_xxx_stock_by_location cascade;
DROP VIEW IF EXISTS view_grpl_xxx_serial_lot cascade;
DROP VIEW IF EXISTS view_grpl_sale_order cascade;
DROP VIEW IF EXISTS view_grpl_product_gtr_with_location cascade;
DROP VIEW IF EXISTS view_grpl_invoice cascade;
DROP VIEW IF EXISTS view_grpl_gtr_no_product_name_status cascade;
DROP VIEW IF EXISTS vg_sale_order_details cascade;
DROP VIEW IF EXISTS vg_invoice_portal cascade;
DROP VIEW IF EXISTS vg_invoice_line_serial_no cascade;
DROP VIEW IF EXISTS vg_duplicate_product_product_names_with_qty cascade;
DROP VIEW IF EXISTS vg_stock_by_product cascade;
DROP VIEW IF EXISTS vg_stock_by_location_with_price cascade;
DROP VIEW IF EXISTS vg_stock_by_location_product_serial cascade;
DROP VIEW IF EXISTS view_grpl_user_name cascade;
DROP VIEW IF EXISTS vg_user_name cascade;
|
SELECT CustomerID, Name, COUNT( DISTINCT OrderID ) AS ORDS
FROM Customer INNER JOIN
Ordered ON Customer.CustomerID = Ordered.Customer INNER JOIN
ItemOrdered USING( OrderID )
GROUP BY CustomerID, Name
ORDER BY ORDS DESC;
|
CREATE OR REPLACE PUBLIC SYNONYM gen_calims_report_pkg FOR orient.gen_calims_report_pkg; |
Create NonClustered Index IX_tblEmployee_Name
ON tblEmployee(Name) |
-- the second script that will be run by Ninja's migration engine script
CREATE TABLE AdapterConfigFile (
id SERIAL,
Adapter_id BIGINT NOT NULL,
configFile VARCHAR(255),
PRIMARY KEY (id)
);
CREATE TABLE AdapterConfigFile_keys (
AdapterConfigFile_id BIGINT NOT NULL,
propertyname VARCHAR(255),
propertyvalue VARCHAR(500)
);
ALTER TABLE AdapterConfigFile
ADD CONSTRAINT "fk_adapter_1"
FOREIGN KEY ("adapter_id")
REFERENCES adapter ("id")
ON DELETE CASCADE;
ALTER TABLE AdapterConfigFile_keys
ADD CONSTRAINT "fk_adapterconfigfile_1"
FOREIGN KEY (AdapterConfigFile_id)
REFERENCES AdapterConfigFile ("id")
ON DELETE CASCADE;
--insert into UserAuth (fullname, isAdmin, "password", username)
--values('Admin', true, 'q1', 'admin'); |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 04, 2020 at 08:12 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `amazon`
--
-- --------------------------------------------------------
--
-- Table structure for table `autor`
--
CREATE TABLE `autor` (
`id_autor` int(11) NOT NULL,
`direcció` varchar(255) NOT NULL,
`llibre` enum('0','1','2') DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `autor`
--
INSERT INTO `autor` (`id_autor`, `direcció`, `llibre`) VALUES
(0, 'Jay Alphey', '1'),
(0, '', '2'),
(1591293698, 'The Power of Agile Teams-Jay Alphey', '1'),
(1591293567, 'Python para Principiantes- Programming Languages A.', '2');
-- --------------------------------------------------------
--
-- Table structure for table `cataleg_de_llibres`
--
CREATE TABLE `cataleg_de_llibres` (
`id_llibres` int(11) NOT NULL,
`unitats_disponible` int(11) DEFAULT 0,
`preu` smallint(11) NOT NULL,
`autor` varchar(255) DEFAULT 'anonim'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `cataleg_de_llibres`
--
INSERT INTO `cataleg_de_llibres` (`id_llibres`, `unitats_disponible`, `preu`, `autor`) VALUES
(1591293567, 3, 17, 'Python para Principiantes- Programming Languages Academy'),
(1591293698, 8, 18, 'The Power of Agile Teams-Jay Alphey');
-- --------------------------------------------------------
--
-- Table structure for table `compra`
--
CREATE TABLE `compra` (
`id_usuari` int(11) NOT NULL,
`llibre` enum('1','1+') DEFAULT '1',
`factura` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `compra`
--
INSERT INTO `compra` (`id_usuari`, `llibre`, `factura`) VALUES
(1, '1', 'The Power of Agile Teams-Jay Alphey'),
(2, '1+', 'Python para Principiantes- Programming Languages A.');
-- --------------------------------------------------------
--
-- Table structure for table `usuari`
--
CREATE TABLE `usuari` (
`nom` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`contraseny` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `usuari`
--
INSERT INTO `usuari` (`nom`, `email`, `contraseny`) VALUES
('Agatha', 'agatha.Brown@gmail.com', 214748364),
('Bertomeu', 'Bertomeu.Vera@gmail.com', 364721474);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `compra`
--
ALTER TABLE `compra`
ADD PRIMARY KEY (`id_usuari`),
ADD KEY `id_usuari` (`id_usuari`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `compra`
--
ALTER TABLE `compra`
MODIFY `id_usuari` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE TABLE SAKSSTATISTIKK_MELLOMLAGRING
(
ID BIGINT NOT NULL PRIMARY KEY,
OFFSET_VERDI BIGINT NOT NULL,
FUNKSJONELL_ID VARCHAR NOT NULL,
TYPE VARCHAR NOT NULL,
KONTRAKT_VERSJON VARCHAR NOT NULL,
JSON text NOT NULL,
KONVERTERT_TID TIMESTAMP(3) DEFAULT LOCALTIMESTAMP,
OPPRETTET_TID TIMESTAMP(3) DEFAULT LOCALTIMESTAMP NOT NULL
);
CREATE SEQUENCE SAKSSTATISTIKK_MELLOMLAGRING_SEQ INCREMENT BY 50 START WITH 1000000 NO CYCLE; |
Create Procedure sp_isAnyFailedSO
AS
BEGIN
If exists (Select 'x' from Order_header where month(order_date)=month(getdate()) and year(order_date)=year(getdate()) and day(order_date)=day(getdate())
And isnull(processed,0)=1 and ordernumber not in
(select POreference from SOAbstract where month(SODate)=month(getdate()) and year(SODate)=year(getdate()) and day(SODate)=day(getdate())))
Select 1
Else
Select 0
END
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Oct 17, 2021 at 12:33 AM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.4.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `courier`
--
-- --------------------------------------------------------
--
-- Table structure for table `branches`
--
CREATE TABLE `branches` (
`id` int(30) NOT NULL,
`branch_code` varchar(50) NOT NULL,
`street` text NOT NULL,
`city` text NOT NULL,
`state` text NOT NULL,
`zip_code` varchar(50) NOT NULL,
`country` text NOT NULL,
`contact` varchar(100) NOT NULL,
`date_created` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `system_settings`
--
CREATE TABLE `system_settings` (
`id` int(30) NOT NULL,
`name` text NOT NULL,
`email` varchar(200) NOT NULL,
`contact` varchar(20) NOT NULL,
`address` text NOT NULL,
`cover_img` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `system_settings`
--
INSERT INTO `system_settings` (`id`, `name`, `email`, `contact`, `address`, `cover_img`) VALUES
(1, 'Courier Management System', 'info@sample.comm', '+88012345678901', '2102 Caldwell Road, Rochester, New York, 14608', '');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(30) NOT NULL,
`firstname` varchar(200) NOT NULL,
`lastname` varchar(200) NOT NULL,
`email` varchar(200) NOT NULL,
`password` text NOT NULL,
`type` tinyint(1) NOT NULL DEFAULT 2 COMMENT '1 = admin, 2 = staff',
`branch_id` int(30) NOT NULL,
`date_created` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `firstname`, `lastname`, `email`, `password`, `type`, `branch_id`, `date_created`) VALUES
(1, 'Administrator', '', 'admin@admin.com', '0192023a7bbd73250516f069df18b500', 1, 0, '2020-11-26 10:57:04');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `branches`
--
ALTER TABLE `branches`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `system_settings`
--
ALTER TABLE `system_settings`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `branches`
--
ALTER TABLE `branches`
MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `system_settings`
--
ALTER TABLE `system_settings`
MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE PROCEDURE spr_list_expiryitem_detail( @ITEMCODE nvarchar(15),
@EXPDATE datetime)
AS
SELECT Batch_Number, "Batch" = Batch_Number, "Expiry" = Expiry, "Quantity" = Quantity,
"Value" = (PurchasePrice * Quantity) FROM Batch_products
WHERE Product_Code = @ITEMCODE AND Expiry IS NOT NULL AND Expiry <= @EXPDATE
and Quantity > 0
|
CREATE TABLE `customer` (
`Id` int(11) NOT NULL,
`Name` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`PersonalId` varchar(10) NOT NULL,
`Birthday` date NOT NULL,
`Address` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL,
`Phone` varchar(10) NOT NULL,
`EmergencyContact` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`EmergencyPhone` varchar(10) NOT NULL,
`GuardianName` varchar(10) DEFAULT NULL,
`GuardianPersonalId` varchar(10) DEFAULT NULL,
`GuardianBirthday` datetime DEFAULT NULL,
`GuardianPhone` varchar(10) DEFAULT NULL,
`CreateOn` datetime DEFAULT CURRENT_TIMESTAMP,
`ModifiedOn` datetime DEFAULT CURRENT_TIMESTAMP,
`MedicalCase` varchar(45) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
set @userId = 42;
select id, serial, last_login_ip, last_login_date, userid from serial_whitelist
where userid = @userId and last_login_date is not null and status = 1
order by last_login_date desc;
|
select extract(month from tijdstip) as tijd, sum(wattuur) as wh
from dagdeel
where extract(year from tijdstip) = ?
group by tijd |
select sum(`cs_ext_discount_amt`) as `excess discount amount`
from `catalog_sales`
where `i_manufact_id` = 977 and `i_item_sk` = `cs_item_sk` and `d_date` between asymmetric cast('2000-01-27' as date) and cast('2000-01-27' as date) + interval '90' day and `d_date_sk` = `cs_sold_date_sk` and `cs_ext_discount_amt` > (select 1.3 * avg(`cs_ext_discount_amt`)
from `catalog_sales`
where `cs_item_sk` = `i_item_sk` and `d_date` between asymmetric cast('2000-01-27' as date) and cast('2000-01-27' as date) + interval '90' day and `d_date_sk` = `cs_sold_date_sk`)
order by
fetch next 100 rows only |
--1. 用户表 user
create table user(
userid varchar(20) not null,
tel varchar(20) not null,
password varchar(20) not null,
ortherinfo varchar(50) DEFAULT'',
PRIMARY KEY(userid)
);
insert into user values('000','fjb','123456','i have nothing to say');
--2. 用户信息表 userinfo
create table userinfo(
userid varchar(20) not null,
tel varchar(20) not null,
username varchar(20) DEFAULT'',
email varchar(50) DEFAULT'',
ortherinfo varchar(50) DEFAULT'',
PRIMARY KEY(userid)
);
--3. 用户收货地址表 useraddress
create table useraddress(
userid varchar(20) not null,
address varchar(100) not null,
ifdefault int(1) DEFAULT 0
);
alter table useraddress add index index_userid(userid);
--4. 店铺商品上架信息表 commaininfo
create table commaininfo(
shopid varchar(20) not null,
categoryid varchar(20) not null,
comid varchar(20) not null,
showphoto varchar(100) not null,
shortmsg varchar(100) not null,
ifrecommend int(1) DEFAULT 0,
addtime datetime not null,
PRIMARY KEY(shopid,comid)
);
--5. 商品参数表 comtotalinfo
create table comtotalinfo(
shopid varchar(20) not null,
categoryid varchar(20) not null,
comid varchar(20) not null,
photos varchar(500) not null,
comparas varchar(500) not null,
PRIMARY KEY(shopid,comid)
);
--6. 首页推荐商品表(由平台维护) indexrecommend
create table indexrecommend(
shopid varchar(20) not null,
comid varchar(20) not null,
showphoto varchar(100) not null,
shortmsg varchar(100) not null,
begintime datetime not null,
endtime datetime not null,
PRIMARY KEY(shopid,comid)
);
--7. 店铺推荐商品表(由平台维护) indexrecommendofcetagory
create table indexrecommendofcetagory(
shopid varchar(20) not null,
categoryid varchar(20) not null,
comid varchar(20) not null,
showphoto varchar(100) not null,
shortmsg varchar(100) not null,
begintime datetime not null,
endtime datetime not null,
PRIMARY KEY(shopid,comid)
);
--8. 商品详情表 comdetials
create table comdetials(
shopid varchar(20) not null,
categoryid varchar(20) not null,
comid varchar(20) not null,
detials text default '',
PRIMARY KEY(shopid,comid)
);
--9. 商品评价表 evaluation
create table evaluation(
orderid Varchar(40) not null,
shopid varchar(20) not null,
categoryid varchar(20) not null,
comid varchar(20) not null,
goodlevel int(1) default 5,
evaluations varchar(500) default '',
PRIMARY KEY(orderid)
);
alter table evaluation add index index_evaluation(shopid,comid);
--10. 购物车表 shopcart
create table shopcart(
cartid Varchar(40) not null,
userid varchar(20) not null,
comid varchar(20) not null,
selectedparas varchar(500) not null,
quantity int not null,
addtime datetime not null,
PRIMARY KEY(cartid)
);
alter table shopcart add index index_shopcart(userid);
--11. 订单表 userorder
create table userorder(
orderid Varchar(40) not null,
userid varchar(20) not null,
comid varchar(20) not null,
selectedparas varchar(500) not null,
quantity int not null,
address varchar(100) not null,
recipient varchar(20) not null,
recipientphone varchar(20) not null,
cost Decimal(12,2) not null,
orderdate datetime not null,
primary key(orderid)
);
alter table userorder add index index_userorder(userid);
|
SELECT * FROM items
WHERE id = $1; |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 16, 2017 at 11:50 AM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `shishimai`
--
-- --------------------------------------------------------
--
-- Table structure for table `ssm_report_slides`
--
CREATE TABLE `ssm_report_slides` (
`id` int(11) NOT NULL,
`report_id` int(11) NOT NULL,
`title` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`data` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`options` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`order_num` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `ssm_report_slides`
--
INSERT INTO `ssm_report_slides` (`id`, `report_id`, `title`, `description`, `data`, `options`, `order_num`) VALUES
(10, 21, 'Titte 1', 'Description 1', NULL, 'title_slide', 1),
(11, 21, 'Titte 2', 'Description 2', NULL, 'chart_slide', 2),
(12, 21, 'Titte 3', 'Description 3', NULL, 'kpi1_slide', 3);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `ssm_report_slides`
--
ALTER TABLE `ssm_report_slides`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `ssm_report_slides`
--
ALTER TABLE `ssm_report_slides`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
create or replace function wxhf_find_why_SP60101(ip_wo_nbr number,arc_lvl varchar2)return varchar2
/**
* 功能 :查找待装原因
* @usage :<STRIKE></STRIKE>
* @author :王新海
* @created :
* @param :
* @return :
*/
is
begin
if arc_lvl='ARC'THEN
RETURN Wxhf_find_why_SP60101_ARC(IP_WO_NBR);
ELSE
RETURN Wxhf_find_why_SP60101_CUR(IP_WO_NBR);
END IF;
end;
/
|
create or replace view v1_mq_3301 as
select "VOUCHERWITHINCODE","VOUCHERNO","BUDGETYEAR","YEAR","MONTH","AGENCYNAME","EXPFUNCCODE","EXPFUNCNAME","PAYERNAME","PAYERACCT","PAYERBANKNAME","PAYEENAME","PAYEEACCT","PAYEEBANKNAME","AGENCYCODE","PROJECTCODE","PROJECTNAME","AMOUNT","PAYDATE","INDEXNO","EXPSOURCECODE","USE","NOTE","PAYTYPE","QUOTANO","EXPSOURCE","TRANSACTIONTYPE","OLDVOUCHERWITHINCODE","OLDVOUCHERNO","JSDE317" from (
select b.jsde302 VoucherWithinCode, b.de151 VoucherNo,b.de011 BudgetYear, nvl(b.czde183,b.de011) Year,to_number(b.de007) Month ,c.de041 AgencyName ,d.de084 ExpFuncCode,d.de083 ExpFuncName
,b.jsde305 PayerName,b.de195 PayerAcct,b.jsde364 PayerBankName,b.jsde306 PayeeName,b.jsde307 PayeeAcct ,b.jsde308 PayeeBankName,
c.jsde955 AgencyCode,nvl(a.JSDE802,'99') ProjectCode,decode(nvl(a.JSDE802,'99'),'99','基本支出',a.jsde821) ProjectName,a.de181 Amount,to_char(e.de001,'YYYYMMDD') PayDate,a.zbde151 IndexNo,a.czde951 ExpSourceCode,b.jsde901 Use,a.zbjsde901 Note,a.de200 PayType,
a.hdde147 QuotaNo,decode(nvl(a.czde183,d.de011) ,d.de011,1,9) ExpSource,1 TransactionType,
--0 OldVoucherWithinCode,'' OldVoucherNo, by zhuwy 2013-03-14 增加退款凭证的原始内码和编号
nvl((select jsde302 from zf001 x where x.jsde301=a.hdde246),0) OldVoucherWithinCode,
(select y.de151 from zf001 x, zf002 y where x.jsde302= y.jsde302 and x.jsde301=a.hdde246) OldVoucherNo,
e.JSDE317
from zf001 a,zf002 b ,czcs041 c ,cs083 d,zf005 e
where a.jsde302 = b.jsde302 and a.de011 = b.de011 and a.de022= b.de022 and b.de022 = 110108 and a.de011 = c.de011 and a.de022 = c.de022 and b.de042 = c.de042 and
c.jsde070 = 2 and d.de011 = a.de011 and a.de022 = d.de022 and b.de084 = d.de084 and e.de011 = b.de011 and e.de022 = b.de022 and e.jsde317 = b.jsde317 order by b.jsde302)
/*
VoucherWithinCode 凭证内码
VoucherNo 凭证号
Year 额度年份
BudgetYear 预算年份
Month 月份
AgencyCode 单位代码
AgencyName 单位名称
ExpFuncCode 功能科目代码
ExpFuncName 功能科目名称
PayerName 付款人名称
PayerAcct 付款人帐号
PayerBankName 付款人开户行
PayeeName 收款人名称
PayeeBankName 收款人开户行
PayeeAcct 收款单位帐号
ProjectCode 项目代码
ProjectName 项目名称
Amount 金额
Date 支付日期
IndexNo 指标文号
ExpSourceCode 资金来源代码
Use 用途
Note 备注
PayType 支付类别
QuotaNo 额度号
ExpSource 资金性质
TransactionType 交易类型
OldVoucherWithinCode 原凭证内码
OldVoucherNo 原凭证号
JSDE317 汇总凭证的内码
create by xiazhong 2012.12.14
*/;
|
DROP SCHEMA IF EXISTS zenetar;
CREATE SCHEMA zenetar DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE zenetar;
CREATE TABLE track(
Id INT AUTO_INCREMENT PRIMARY KEY,
Title VARCHAR(100) NOT NULL,
Length INT,
About VARCHAR(500),
Navigation VARCHAR (200) NOT NULL
);
CREATE TABLE artists(
Id INT AUTO_INCREMENT PRIMARY KEY,
Artist VARCHAR(100) NOT NULL
);
CREATE TABLE genres(
Id INT AUTO_INCREMENT PRIMARY KEY,
Genre VARCHAR(25)
);
CREATE TABLE album(
Id INT AUTO_INCREMENT PRIMARY KEY,
Title VARCHAR (100) NOT NULL,
Artist INT REFERENCES artists(Id),
PublishingTime YEAR,
Genre INT REFERENCES genres(Id),
About VARCHAR(1000)
);
CREATE TABLE tracklist(
AlbumId INT REFERENCES album(Id),
TrackId INT REFERENCES track(Id),
Number INT
);
INSERT INTO artists (Artist) VALUE('Pendulum');
INSERT INTO artists (Artist) VALUE('Bon Jovi');
INSERT INTO artists (Artist) VALUE('Imagine Dragons');
INSERT INTO genres (Genre) VALUE('Drum and Bass');
INSERT INTO genres (Genre) VALUE('Rock');
INSERT INTO genres (Genre) VALUE('Alternative Rock');
INSERT INTO album (Title, Artist, PublishingTime, Genre) VALUES('Immersion', 1, 2010, 1);
INSERT INTO album (Title, Artist, PublishingTime, Genre) VALUES('Slippery When Wet', 2, 1986, 2);
INSERT INTO album (Title, Artist, PublishingTime, Genre) VALUES('The Best of Bon Jovi', 2, 1994, 2);
INSERT INTO album (Title, Artist, PublishingTime, Genre) VALUES('One Wild Night', 2, 2011, 2);
INSERT INTO album (Title, Artist, PublishingTime, Genre) VALUES('Night Visions', 3, 2012, 3);
INSERT INTO track (Title, Length, Navigation) VALUES('Witchcraft', 253, 'C/Libraries/Music');
INSERT INTO track (Title, Length, Navigation) VALUES('Watercolour', 277, 'C/Libraries/Music');
INSERT INTO track (Title, Navigation) VALUES('The Island', 'C/Libraries/Music');
INSERT INTO track (Title, Navigation) VALUES('Crush', 'C/Libraries/Music');
INSERT INTO track (Title, Length, Navigation) VALUES('Livin'"'"' on a prayer', 252, 'C/Libraries/Music');
INSERT INTO track (Title, Length, Navigation) VALUES('You give love a bad name', 222, 'C/Libraries/Music');
INSERT INTO track (Title, Length, Navigation) VALUES('Social Disease', 258, 'C/Libraries/Music');
INSERT INTO track (Title, Length, Navigation) VALUES('Runaway', 230, 'C/Libraries/Music');
INSERT INTO track (Title, Length, Navigation) VALUES('One Wild Night', 283, 'C/Libraries/Music');
INSERT INTO track (Title, Navigation) VALUES('Radioactive', 'C/Libraries/Music');
INSERT INTO track (Title, Length, Navigation) VALUES('Demons', 177, 'C/Libraries/Music');
INSERT INTO track (Title, Length, Navigation) VALUES('Working Man', 235, 'C/Libraries/Music');
INSERT INTO tracklist VALUES(1, 1, 12);
INSERT INTO tracklist VALUES(1, 2, 16);
INSERT INTO tracklist VALUES(1, 3, 8);
INSERT INTO tracklist VALUES(1, 4, 5);
INSERT INTO tracklist VALUES(2, 5, 3);
INSERT INTO tracklist VALUES(3, 5, 1);
INSERT INTO tracklist VALUES(2, 6, 2);
INSERT INTO tracklist VALUES(3, 6, 7);
INSERT INTO tracklist VALUES(2, 7, 4);
INSERT INTO tracklist VALUES(2, 8, 14);
INSERT INTO tracklist VALUES(4, 8, 9);
INSERT INTO tracklist VALUES(4, 9, 1);
INSERT INTO tracklist VALUES(5, 10, 1);
INSERT INTO tracklist VALUES(5, 11, 4);
INSERT INTO tracklist VALUES(5, 12, 12); |
create table Account_ (
accountId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
parentAccountId int64,
name varchar(75),
legalName varchar(75),
legalId varchar(75),
legalType varchar(75),
sicCode varchar(75),
tickerSymbol varchar(75),
industry varchar(75),
type_ varchar(75),
size_ varchar(75)
);
create table ActivityTracker (
activityTrackerId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
classNameId int64,
classPK int64,
activity varchar(75),
extraData blob,
receiverUserId int64,
receiverUserName varchar(75)
);
create table Address (
addressId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
classNameId int64,
classPK int64,
street1 varchar(75),
street2 varchar(75),
street3 varchar(75),
city varchar(75),
zip varchar(75),
regionId int64,
countryId int64,
typeId integer,
mailing smallint,
primary_ smallint
);
create table BlogsCategory (
categoryId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
parentCategoryId int64,
name varchar(75),
description varchar(4000)
);
create table BlogsEntry (
uuid_ varchar(75),
entryId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
title varchar(150),
urlTitle varchar(150),
content blob,
displayDate timestamp
);
create table BlogsStatsUser (
statsUserId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
entryCount integer,
lastPostDate timestamp,
ratingsTotalEntries integer,
ratingsTotalScore double precision,
ratingsAverageScore double precision
);
create table BookmarksEntry (
uuid_ varchar(75),
entryId int64 not null primary key,
companyId int64,
userId int64,
createDate timestamp,
modifiedDate timestamp,
folderId int64,
name varchar(300),
url varchar(4000),
comments varchar(4000),
visits integer,
priority integer
);
create table BookmarksFolder (
uuid_ varchar(75),
folderId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
createDate timestamp,
modifiedDate timestamp,
parentFolderId int64,
name varchar(75),
description varchar(4000)
);
create table CalEvent (
uuid_ varchar(75),
eventId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
title varchar(75),
description varchar(4000),
startDate timestamp,
endDate timestamp,
durationHour integer,
durationMinute integer,
allDay smallint,
timeZoneSensitive smallint,
type_ varchar(75),
repeating smallint,
recurrence blob,
remindBy varchar(75),
firstReminder integer,
secondReminder integer
);
create table ClassName_ (
classNameId int64 not null primary key,
value varchar(200)
);
create table Company (
companyId int64 not null primary key,
accountId int64,
webId varchar(75),
key_ blob,
virtualHost varchar(75),
mx varchar(75),
logoId int64
);
create table Contact_ (
contactId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
accountId int64,
parentContactId int64,
firstName varchar(75),
middleName varchar(75),
lastName varchar(75),
prefixId integer,
suffixId integer,
male smallint,
birthday timestamp,
smsSn varchar(75),
aimSn varchar(75),
icqSn varchar(75),
jabberSn varchar(75),
msnSn varchar(75),
skypeSn varchar(75),
ymSn varchar(75),
employeeStatusId varchar(75),
employeeNumber varchar(75),
jobTitle varchar(100),
jobClass varchar(75),
hoursOfOperation varchar(75)
);
create table Counter (
name varchar(75) not null primary key,
currentId int64
);
create table Country (
countryId int64 not null primary key,
name varchar(75),
a2 varchar(75),
a3 varchar(75),
number_ varchar(75),
idd_ varchar(75),
active_ smallint
);
create table CyrusUser (
userId varchar(75) not null primary key,
password_ varchar(75) not null
);
create table CyrusVirtual (
emailAddress varchar(75) not null primary key,
userId varchar(75) not null
);
create table DLFileEntry (
uuid_ varchar(75),
fileEntryId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
versionUserId int64,
versionUserName varchar(75),
createDate timestamp,
modifiedDate timestamp,
folderId int64,
name varchar(300),
title varchar(300),
description varchar(4000),
version double precision,
size_ integer,
readCount integer,
extraSettings blob
);
create table DLFileRank (
fileRankId int64 not null primary key,
companyId int64,
userId int64,
createDate timestamp,
folderId int64,
name varchar(300)
);
create table DLFileShortcut (
uuid_ varchar(75),
fileShortcutId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
folderId int64,
toFolderId int64,
toName varchar(300)
);
create table DLFileVersion (
fileVersionId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
folderId int64,
name varchar(300),
version double precision,
size_ integer
);
create table DLFolder (
uuid_ varchar(75),
folderId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
parentFolderId int64,
name varchar(100),
description varchar(4000),
lastPostDate timestamp
);
create table EmailAddress (
emailAddressId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
classNameId int64,
classPK int64,
address varchar(75),
typeId integer,
primary_ smallint
);
create table Group_ (
groupId int64 not null primary key,
companyId int64,
creatorUserId int64,
classNameId int64,
classPK int64,
parentGroupId int64,
liveGroupId int64,
name varchar(75),
description varchar(4000),
type_ integer,
typeSettings varchar(4000),
friendlyURL varchar(100),
active_ smallint
);
create table Groups_Orgs (
groupId int64 not null,
organizationId int64 not null,
primary key (groupId, organizationId)
);
create table Groups_Permissions (
groupId int64 not null,
permissionId int64 not null,
primary key (groupId, permissionId)
);
create table Groups_Roles (
groupId int64 not null,
roleId int64 not null,
primary key (groupId, roleId)
);
create table Groups_UserGroups (
groupId int64 not null,
userGroupId int64 not null,
primary key (groupId, userGroupId)
);
create table IGFolder (
uuid_ varchar(75),
folderId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
createDate timestamp,
modifiedDate timestamp,
parentFolderId int64,
name varchar(75),
description varchar(4000)
);
create table IGImage (
uuid_ varchar(75),
imageId int64 not null primary key,
companyId int64,
userId int64,
createDate timestamp,
modifiedDate timestamp,
folderId int64,
description varchar(4000),
smallImageId int64,
largeImageId int64
);
create table Image (
imageId int64 not null primary key,
modifiedDate timestamp,
text_ blob,
type_ varchar(75),
height integer,
width integer,
size_ integer
);
create table JournalArticle (
uuid_ varchar(75),
id_ int64 not null primary key,
resourcePrimKey int64,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
articleId varchar(75),
version double precision,
title varchar(100),
description varchar(4000),
content blob,
type_ varchar(75),
structureId varchar(75),
templateId varchar(75),
displayDate timestamp,
approved smallint,
approvedByUserId int64,
approvedByUserName varchar(75),
approvedDate timestamp,
expired smallint,
expirationDate timestamp,
reviewDate timestamp,
indexable smallint,
smallImage smallint,
smallImageId int64,
smallImageURL varchar(75)
);
create table JournalArticleImage (
articleImageId int64 not null primary key,
groupId int64,
articleId varchar(75),
version double precision,
elName varchar(75),
languageId varchar(75),
tempImage smallint
);
create table JournalArticleResource (
resourcePrimKey int64 not null primary key,
groupId int64,
articleId varchar(75)
);
create table JournalContentSearch (
contentSearchId int64 not null primary key,
groupId int64,
companyId int64,
privateLayout smallint,
layoutId int64,
portletId varchar(200),
articleId varchar(75)
);
create table JournalFeed (
uuid_ varchar(75),
id_ int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
feedId varchar(75),
name varchar(75),
description varchar(4000),
type_ varchar(75),
structureId varchar(75),
templateId varchar(75),
rendererTemplateId varchar(75),
delta integer,
orderByCol varchar(75),
orderByType varchar(75),
targetLayoutFriendlyUrl varchar(75),
targetPortletId varchar(75),
contentField varchar(75),
feedType varchar(75),
feedVersion double precision
);
create table JournalStructure (
uuid_ varchar(75),
id_ int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
structureId varchar(75),
name varchar(75),
description varchar(4000),
xsd blob
);
create table JournalTemplate (
uuid_ varchar(75),
id_ int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
templateId varchar(75),
structureId varchar(75),
name varchar(75),
description varchar(4000),
xsl blob,
langType varchar(75),
cacheable smallint,
smallImage smallint,
smallImageId int64,
smallImageURL varchar(75)
);
create table Layout (
plid int64 not null primary key,
groupId int64,
companyId int64,
privateLayout smallint,
layoutId int64,
parentLayoutId int64,
name varchar(4000),
title varchar(4000),
description varchar(4000),
type_ varchar(75),
typeSettings blob,
hidden_ smallint,
friendlyURL varchar(100),
iconImage smallint,
iconImageId int64,
themeId varchar(75),
colorSchemeId varchar(75),
wapThemeId varchar(75),
wapColorSchemeId varchar(75),
css varchar(4000),
priority integer,
dlFolderId int64
);
create table LayoutSet (
layoutSetId int64 not null primary key,
groupId int64,
companyId int64,
privateLayout smallint,
logo smallint,
logoId int64,
themeId varchar(75),
colorSchemeId varchar(75),
wapThemeId varchar(75),
wapColorSchemeId varchar(75),
css varchar(75),
pageCount integer,
virtualHost varchar(75)
);
create table ListType (
listTypeId integer not null primary key,
name varchar(75),
type_ varchar(75)
);
create table MBBan (
banId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
banUserId int64
);
create table MBCategory (
uuid_ varchar(75),
categoryId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
parentCategoryId int64,
name varchar(75),
description varchar(4000),
lastPostDate timestamp
);
create table MBDiscussion (
discussionId int64 not null primary key,
classNameId int64,
classPK int64,
threadId int64
);
create table MBMessage (
uuid_ varchar(75),
messageId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
categoryId int64,
threadId int64,
parentMessageId int64,
subject varchar(75),
body blob,
attachments smallint,
anonymous smallint
);
create table MBMessageFlag (
messageFlagId int64 not null primary key,
userId int64,
messageId int64,
flag integer
);
create table MBStatsUser (
statsUserId int64 not null primary key,
groupId int64,
userId int64,
messageCount integer,
lastPostDate timestamp
);
create table MBThread (
threadId int64 not null primary key,
categoryId int64,
rootMessageId int64,
messageCount integer,
viewCount integer,
lastPostByUserId int64,
lastPostDate timestamp,
priority double precision
);
create table MembershipRequest (
membershipRequestId int64 not null primary key,
companyId int64,
userId int64,
createDate timestamp,
groupId int64,
comments varchar(4000),
replyComments varchar(4000),
replyDate timestamp,
replierUserId int64,
statusId integer
);
create table Organization_ (
organizationId int64 not null primary key,
companyId int64,
parentOrganizationId int64,
name varchar(100),
location smallint,
recursable smallint,
regionId int64,
countryId int64,
statusId integer,
comments varchar(4000)
);
create table OrgGroupPermission (
organizationId int64 not null,
groupId int64 not null,
permissionId int64 not null,
primary key (organizationId, groupId, permissionId)
);
create table OrgGroupRole (
organizationId int64 not null,
groupId int64 not null,
roleId int64 not null,
primary key (organizationId, groupId, roleId)
);
create table OrgLabor (
orgLaborId int64 not null primary key,
organizationId int64,
typeId integer,
sunOpen integer,
sunClose integer,
monOpen integer,
monClose integer,
tueOpen integer,
tueClose integer,
wedOpen integer,
wedClose integer,
thuOpen integer,
thuClose integer,
friOpen integer,
friClose integer,
satOpen integer,
satClose integer
);
create table PasswordPolicy (
passwordPolicyId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
defaultPolicy smallint,
name varchar(75),
description varchar(4000),
changeable smallint,
changeRequired smallint,
minAge int64,
checkSyntax smallint,
allowDictionaryWords smallint,
minLength integer,
history smallint,
historyCount integer,
expireable smallint,
maxAge int64,
warningTime int64,
graceLimit integer,
lockout smallint,
maxFailure integer,
lockoutDuration int64,
requireUnlock smallint,
resetFailureCount int64
);
create table PasswordPolicyRel (
passwordPolicyRelId int64 not null primary key,
passwordPolicyId int64,
classNameId int64,
classPK int64
);
create table PasswordTracker (
passwordTrackerId int64 not null primary key,
userId int64,
createDate timestamp,
password_ varchar(75)
);
create table Permission_ (
permissionId int64 not null primary key,
companyId int64,
actionId varchar(75),
resourceId int64
);
create table Phone (
phoneId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
classNameId int64,
classPK int64,
number_ varchar(75),
extension varchar(75),
typeId integer,
primary_ smallint
);
create table PluginSetting (
pluginSettingId int64 not null primary key,
companyId int64,
pluginId varchar(75),
pluginType varchar(75),
roles varchar(4000),
active_ smallint
);
create table PollsChoice (
uuid_ varchar(75),
choiceId int64 not null primary key,
questionId int64,
name varchar(75),
description varchar(1000)
);
create table PollsQuestion (
uuid_ varchar(75),
questionId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
title varchar(500),
description varchar(4000),
expirationDate timestamp,
lastVoteDate timestamp
);
create table PollsVote (
voteId int64 not null primary key,
userId int64,
questionId int64,
choiceId int64,
voteDate timestamp
);
create table Portlet (
id_ int64 not null primary key,
companyId int64,
portletId varchar(200),
roles varchar(4000),
active_ smallint
);
create table PortletPreferences (
portletPreferencesId int64 not null primary key,
ownerId int64,
ownerType integer,
plid int64,
portletId varchar(200),
preferences blob
);
create table RatingsEntry (
entryId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
classNameId int64,
classPK int64,
score double precision
);
create table RatingsStats (
statsId int64 not null primary key,
classNameId int64,
classPK int64,
totalEntries integer,
totalScore double precision,
averageScore double precision
);
create table Region (
regionId int64 not null primary key,
countryId int64,
regionCode varchar(75),
name varchar(75),
active_ smallint
);
create table Release_ (
releaseId int64 not null primary key,
createDate timestamp,
modifiedDate timestamp,
buildNumber integer,
buildDate timestamp,
verified smallint
);
create table Resource_ (
resourceId int64 not null primary key,
codeId int64,
primKey varchar(300)
);
create table ResourceCode (
codeId int64 not null primary key,
companyId int64,
name varchar(300),
scope integer
);
create table Role_ (
roleId int64 not null primary key,
companyId int64,
classNameId int64,
classPK int64,
name varchar(75),
description varchar(4000),
type_ integer
);
create table Roles_Permissions (
roleId int64 not null,
permissionId int64 not null,
primary key (roleId, permissionId)
);
create table SCFrameworkVersi_SCProductVers (
productVersionId int64 not null,
frameworkVersionId int64 not null,
primary key (productVersionId, frameworkVersionId)
);
create table SCFrameworkVersion (
frameworkVersionId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
name varchar(75),
url varchar(4000),
active_ smallint,
priority integer
);
create table SCLicense (
licenseId int64 not null primary key,
name varchar(75),
url varchar(4000),
openSource smallint,
active_ smallint,
recommended smallint
);
create table SCLicenses_SCProductEntries (
productEntryId int64 not null,
licenseId int64 not null,
primary key (productEntryId, licenseId)
);
create table SCProductEntry (
productEntryId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
name varchar(75),
type_ varchar(75),
tags varchar(300),
shortDescription varchar(4000),
longDescription varchar(4000),
pageURL varchar(4000),
author varchar(75),
repoGroupId varchar(75),
repoArtifactId varchar(75)
);
create table SCProductScreenshot (
productScreenshotId int64 not null primary key,
companyId int64,
groupId int64,
productEntryId int64,
thumbnailId int64,
fullImageId int64,
priority integer
);
create table SCProductVersion (
productVersionId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
productEntryId int64,
version varchar(75),
changeLog varchar(4000),
downloadPageURL varchar(4000),
directDownloadURL varchar(2000),
repoStoreArtifact smallint
);
create table ServiceComponent (
serviceComponentId int64 not null primary key,
buildNamespace varchar(75),
buildNumber int64,
buildDate int64,
data_ blob
);
create table ShoppingCart (
cartId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
itemIds varchar(4000),
couponCodes varchar(75),
altShipping integer,
insure smallint
);
create table ShoppingCategory (
categoryId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
parentCategoryId int64,
name varchar(75),
description varchar(4000)
);
create table ShoppingCoupon (
couponId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
code_ varchar(75),
name varchar(75),
description varchar(4000),
startDate timestamp,
endDate timestamp,
active_ smallint,
limitCategories varchar(4000),
limitSkus varchar(4000),
minOrder double precision,
discount double precision,
discountType varchar(75)
);
create table ShoppingItem (
itemId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
categoryId int64,
sku varchar(75),
name varchar(200),
description varchar(4000),
properties varchar(4000),
fields_ smallint,
fieldsQuantities varchar(4000),
minQuantity integer,
maxQuantity integer,
price double precision,
discount double precision,
taxable smallint,
shipping double precision,
useShippingFormula smallint,
requiresShipping smallint,
stockQuantity integer,
featured_ smallint,
sale_ smallint,
smallImage smallint,
smallImageId int64,
smallImageURL varchar(75),
mediumImage smallint,
mediumImageId int64,
mediumImageURL varchar(75),
largeImage smallint,
largeImageId int64,
largeImageURL varchar(75)
);
create table ShoppingItemField (
itemFieldId int64 not null primary key,
itemId int64,
name varchar(75),
values_ varchar(4000),
description varchar(4000)
);
create table ShoppingItemPrice (
itemPriceId int64 not null primary key,
itemId int64,
minQuantity integer,
maxQuantity integer,
price double precision,
discount double precision,
taxable smallint,
shipping double precision,
useShippingFormula smallint,
status integer
);
create table ShoppingOrder (
orderId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
number_ varchar(75),
tax double precision,
shipping double precision,
altShipping varchar(75),
requiresShipping smallint,
insure smallint,
insurance double precision,
couponCodes varchar(75),
couponDiscount double precision,
billingFirstName varchar(75),
billingLastName varchar(75),
billingEmailAddress varchar(75),
billingCompany varchar(75),
billingStreet varchar(75),
billingCity varchar(75),
billingState varchar(75),
billingZip varchar(75),
billingCountry varchar(75),
billingPhone varchar(75),
shipToBilling smallint,
shippingFirstName varchar(75),
shippingLastName varchar(75),
shippingEmailAddress varchar(75),
shippingCompany varchar(75),
shippingStreet varchar(75),
shippingCity varchar(75),
shippingState varchar(75),
shippingZip varchar(75),
shippingCountry varchar(75),
shippingPhone varchar(75),
ccName varchar(75),
ccType varchar(75),
ccNumber varchar(75),
ccExpMonth integer,
ccExpYear integer,
ccVerNumber varchar(75),
comments varchar(4000),
ppTxnId varchar(75),
ppPaymentStatus varchar(75),
ppPaymentGross double precision,
ppReceiverEmail varchar(75),
ppPayerEmail varchar(75),
sendOrderEmail smallint,
sendShippingEmail smallint
);
create table ShoppingOrderItem (
orderItemId int64 not null primary key,
orderId int64,
itemId varchar(75),
sku varchar(75),
name varchar(200),
description varchar(4000),
properties varchar(4000),
price double precision,
quantity integer,
shippedDate timestamp
);
create table Subscription (
subscriptionId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
classNameId int64,
classPK int64,
frequency varchar(75)
);
create table TagsAsset (
assetId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
classNameId int64,
classPK int64,
startDate timestamp,
endDate timestamp,
publishDate timestamp,
expirationDate timestamp,
mimeType varchar(75),
title varchar(300),
description varchar(4000),
summary varchar(4000),
url varchar(4000),
height integer,
width integer,
priority double precision,
viewCount integer
);
create table TagsAssets_TagsEntries (
assetId int64 not null,
entryId int64 not null,
primary key (assetId, entryId)
);
create table TagsEntry (
entryId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
name varchar(75)
);
create table TagsProperty (
propertyId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
entryId int64,
key_ varchar(75),
value varchar(300)
);
create table TagsSource (
sourceId int64 not null primary key,
parentSourceId int64,
name varchar(75),
acronym varchar(75)
);
create table User_ (
uuid_ varchar(75),
userId int64 not null primary key,
companyId int64,
createDate timestamp,
modifiedDate timestamp,
defaultUser smallint,
contactId int64,
password_ varchar(75),
passwordEncrypted smallint,
passwordReset smallint,
passwordModifiedDate timestamp,
graceLoginCount integer,
screenName varchar(75),
emailAddress varchar(75),
portraitId int64,
languageId varchar(75),
timeZoneId varchar(75),
greeting varchar(75),
comments varchar(4000),
loginDate timestamp,
loginIP varchar(75),
lastLoginDate timestamp,
lastLoginIP varchar(75),
lastFailedLoginDate timestamp,
failedLoginAttempts integer,
lockout smallint,
lockoutDate timestamp,
agreedToTermsOfUse smallint,
active_ smallint
);
create table UserGroup (
userGroupId int64 not null primary key,
companyId int64,
parentUserGroupId int64,
name varchar(75),
description varchar(4000)
);
create table UserGroupRole (
userId int64 not null,
groupId int64 not null,
roleId int64 not null,
primary key (userId, groupId, roleId)
);
create table UserIdMapper (
userIdMapperId int64 not null primary key,
userId int64,
type_ varchar(75),
description varchar(75),
externalUserId varchar(75)
);
create table Users_Groups (
userId int64 not null,
groupId int64 not null,
primary key (userId, groupId)
);
create table Users_Orgs (
userId int64 not null,
organizationId int64 not null,
primary key (userId, organizationId)
);
create table Users_Permissions (
userId int64 not null,
permissionId int64 not null,
primary key (userId, permissionId)
);
create table Users_Roles (
userId int64 not null,
roleId int64 not null,
primary key (userId, roleId)
);
create table Users_UserGroups (
userId int64 not null,
userGroupId int64 not null,
primary key (userId, userGroupId)
);
create table UserTracker (
userTrackerId int64 not null primary key,
companyId int64,
userId int64,
modifiedDate timestamp,
sessionId varchar(200),
remoteAddr varchar(75),
remoteHost varchar(75),
userAgent varchar(200)
);
create table UserTrackerPath (
userTrackerPathId int64 not null primary key,
userTrackerId int64,
path_ varchar(4000),
pathDate timestamp
);
create table WebDAVProps (
webDavPropsId int64 not null primary key,
companyId int64,
createDate timestamp,
modifiedDate timestamp,
classNameId int64,
classPK int64,
props blob
);
create table Website (
websiteId int64 not null primary key,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
classNameId int64,
classPK int64,
url varchar(4000),
typeId integer,
primary_ smallint
);
create table WikiNode (
uuid_ varchar(75),
nodeId int64 not null primary key,
groupId int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
modifiedDate timestamp,
name varchar(75),
description varchar(4000),
lastPostDate timestamp
);
create table WikiPage (
uuid_ varchar(75),
pageId int64 not null primary key,
resourcePrimKey int64,
companyId int64,
userId int64,
userName varchar(75),
createDate timestamp,
nodeId int64,
title varchar(75),
version double precision,
content blob,
format varchar(75),
head smallint
);
create table WikiPageResource (
resourcePrimKey int64 not null primary key,
nodeId int64,
title varchar(75)
);
--
-- List types for accounts
--
--
-- List types for contacts
--
--
-- List types for organizations
--
commit;
|
USE employeeDB;
CREATE TABLE department (
name VARCHAR(25) NOT NULL
);
CREATE TABLE role (
title VARCHAR(30) NOT NULL,
salary INTEGER(20) NOT NULL,
department_id INTEGER(5) NOT NULL
);
CREATE TABLE employee(
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
role_id INTEGER(10)
);
INSERT INTO department(name) VALUES ("accouting"), ("sales"), ("engineering"), ("legal");
INSERT INTO role(title, salary, department_id) VALUES ("Accountant", 95000, 1), ("Account Manager", 65000, 1), ("Sales Rep", 75000, 2), ("Sales Lead", 125000, 2), ("Junior Developer", 48000, 3), ("Senior Software Developer", 175000, 3 ), ("Legal Assistant", 35000, 4), ("Lawyer", 175000, 4);
INSERT INTO employee(first_name, last_name, role_id) VALUES ("Martha", "McCartney", 1), ("Elvis", "Lennon", 2), ("Mimi", "Babaghi", 3), ("Sam", "Tich",4)
|
-- MySQL dump 10.13 Distrib 5.7.21, for Win64 (x86_64)
--
-- Host: localhost Database: biblioteca
-- ------------------------------------------------------
-- Server version 5.7.21-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `apartado`
--
DROP TABLE IF EXISTS `apartado`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `apartado` (
`codigo_libro` varchar(20) NOT NULL,
`codigo_usuario` varchar(20) NOT NULL,
`fecha_inicio` date DEFAULT NULL,
`fecha_fin` date DEFAULT NULL,
`prestado` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`codigo_libro`,`codigo_usuario`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `apartado`
--
LOCK TABLES `apartado` WRITE;
/*!40000 ALTER TABLE `apartado` DISABLE KEYS */;
INSERT INTO `apartado` VALUES ('12345','11161024','2018-03-25','2018-03-31',1),('2345','sadsdf','2018-03-25','2018-03-25',1),('codigo3','11161024','2018-03-25',NULL,0),('codigo5','11161024','2018-03-25',NULL,0),('samv','samv','2018-03-25',NULL,0);
/*!40000 ALTER TABLE `apartado` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `editorial`
--
DROP TABLE IF EXISTS `editorial`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `editorial` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`editorial` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `editorial`
--
LOCK TABLES `editorial` WRITE;
/*!40000 ALTER TABLE `editorial` DISABLE KEYS */;
INSERT INTO `editorial` VALUES (6,'preson'),(7,'editorial1'),(8,'editorial2'),(9,'editorial4'),(10,'editorial3');
/*!40000 ALTER TABLE `editorial` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `genero`
--
DROP TABLE IF EXISTS `genero`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `genero` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`genero` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `genero`
--
LOCK TABLES `genero` WRITE;
/*!40000 ALTER TABLE `genero` DISABLE KEYS */;
INSERT INTO `genero` VALUES (6,'suspenso'),(7,'terror'),(8,'acción'),(9,'genero1'),(10,'genero2');
/*!40000 ALTER TABLE `genero` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `libros`
--
DROP TABLE IF EXISTS `libros`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `libros` (
`codigo` varchar(20) NOT NULL,
`nombre` varchar(45) DEFAULT NULL,
`total` int(11) DEFAULT NULL,
`cantidad` int(11) DEFAULT NULL,
`autor` varchar(45) DEFAULT NULL,
`genero` int(11) DEFAULT NULL,
`editorial` int(11) DEFAULT NULL,
PRIMARY KEY (`codigo`),
KEY `editorial_idx` (`editorial`),
KEY `genero_idx` (`genero`),
CONSTRAINT `editorial` FOREIGN KEY (`editorial`) REFERENCES `editorial` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `genero` FOREIGN KEY (`genero`) REFERENCES `genero` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `libros`
--
LOCK TABLES `libros` WRITE;
/*!40000 ALTER TABLE `libros` DISABLE KEYS */;
INSERT INTO `libros` VALUES ('12345','señor de los anillos',10,10,'tolkie',6,6),('codigo1','libro1',10,10,'luis',9,7),('codigo2','libro2',2,2,'santiago',10,8),('codigo3','libro3',1,1,'jeja',10,7),('codigo5','libro de la selva',0,0,'no se',8,10);
/*!40000 ALTER TABLE `libros` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `prestamo`
--
DROP TABLE IF EXISTS `prestamo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `prestamo` (
`codigo_libro` varchar(20) DEFAULT NULL,
`codigo_usuario` varchar(20) DEFAULT NULL,
`fecha_inicio` date DEFAULT NULL,
`fecha_fin` date DEFAULT NULL,
KEY `codigo_libro_idx` (`codigo_libro`),
KEY `codigo_usuario_idx` (`codigo_usuario`),
CONSTRAINT `codigo_libro` FOREIGN KEY (`codigo_libro`) REFERENCES `libros` (`codigo`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `prestamo`
--
LOCK TABLES `prestamo` WRITE;
/*!40000 ALTER TABLE `prestamo` DISABLE KEYS */;
/*!40000 ALTER TABLE `prestamo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `rel_rol_usuario`
--
DROP TABLE IF EXISTS `rel_rol_usuario`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rel_rol_usuario` (
`codigo_usuario` varchar(20) DEFAULT NULL,
`id_rol` int(11) DEFAULT NULL,
KEY `codigo_usuario_idx` (`codigo_usuario`),
KEY `id_rol_idx` (`id_rol`),
CONSTRAINT `codigo_usuario` FOREIGN KEY (`codigo_usuario`) REFERENCES `usuarios` (`codigo`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `id_rol` FOREIGN KEY (`id_rol`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `rel_rol_usuario`
--
LOCK TABLES `rel_rol_usuario` WRITE;
/*!40000 ALTER TABLE `rel_rol_usuario` DISABLE KEYS */;
INSERT INTO `rel_rol_usuario` VALUES ('11161024',1),('1116100045',1),('123456789',5),('11161025',1);
/*!40000 ALTER TABLE `rel_rol_usuario` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `roles`
--
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rol` varchar(45) DEFAULT NULL,
`rango` int(11) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `roles`
--
LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,'Administrador',1),(2,'alumno',2),(5,'maestro',2),(6,'santi',1),(7,'sa',1),(11,'administrador',1);
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usuarios`
--
DROP TABLE IF EXISTS `usuarios`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios` (
`codigo` varchar(20) NOT NULL,
`nombre` varchar(45) DEFAULT NULL,
`apellido_paterno` varchar(45) DEFAULT NULL,
`apellido_materno` varchar(45) DEFAULT NULL,
`fecha_nacimiento` date DEFAULT NULL,
`password` varchar(45) DEFAULT NULL,
PRIMARY KEY (`codigo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `usuarios`
--
LOCK TABLES `usuarios` WRITE;
/*!40000 ALTER TABLE `usuarios` DISABLE KEYS */;
INSERT INTO `usuarios` VALUES ('1116100045','concepcion',NULL,NULL,NULL,'12345'),('11161024','santiago','mariscal','velasquez','1993-07-25','12345'),('11161025','gabriela','vasquez','lopez','2018-03-01','12345'),('111649590','jessica karina','mariscal','velasquez','2005-02-10','234234324'),('123456789','josua','josua','jpsua','2018-03-17','12345'),('324','sammv','mariscal','fsd','1994-04-06',NULL);
/*!40000 ALTER TABLE `usuarios` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-03-26 8:19:15
|
DROP TABLE USER CASCADE
|
create or replace procedure Proc_Check_QY_BHYW_JC(rt out DevelopmentFramework.packageCheck,dtDate varchar2,strInstCode varchar2)
is
tempDate varchar2(50);
V_CURSQL VARCHAR2(4000);
begin
tempDate := dtDate;
IF dtDate='*****' and strInstCode='*****'
THEN
V_CURSQL :='select
autoID
,BHHM
,JRJGDM
,RPTCheckType
,RPTFeedbackType
,RPTSendType
,RPTSubmitStatus
,RPTVerifyType
,SXXYHM
,XXJLCZLX
,XXJLGZBH
,XZXH
,YWFSRQ
,dtDate
,extend1
,extend2
,extend3
,extend4
,extend5
,lastUpdateDate
,instInfo
,operationUser
from QY_BHYW_JC;
ELSE
V_CURSQL :='select
autoID
,BHHM
,JRJGDM
,RPTCheckType
,RPTFeedbackType
,RPTSendType
,RPTSubmitStatus
,RPTVerifyType
,SXXYHM
,XXJLCZLX
,XXJLGZBH
,XZXH
,YWFSRQ
,dtDate
,extend1
,extend2
,extend3
,extend4
,extend5
,lastUpdateDate
,instInfo
,operationUser
from QY_BHYW_JC
where to_Date('''||tempDate||''', ''yyyy-MM-dd'')=dtDate and Instinfo= '''||strInstCode||'''';
END IF;
OPEN rt FOR V_CURSQL;
END;
|
CREATE TABLE stock_live
(
value_date DATE NOT NULL,
value_time TIME NOT NULL,
symbol VARCHAR(255) NOT NULL,
ltp NUMERIC(19, 2) NOT NULL,
ltv NUMERIC(19, 2) NOT NULL,
point_change NUMERIC(19, 2) NOT NULL,
percentage_change NUMERIC(19, 2) NOT NULL,
open NUMERIC(19, 2) NOT NULL,
high NUMERIC(19, 2) NOT NULL,
low NUMERIC(19, 2) NOT NULL,
volume INTEGER NOT NULL,
previous_closing NUMERIC(19, 2) NOT NULL,
CONSTRAINT stock_live_pkey
PRIMARY KEY (value_date, value_time, symbol)
); |
----------------------
-- Other Activities --
----------------------
CREATE TABLE others ( -- No. 1
id SERIAL,
activity text NOT NULL,
year int4 NOT NULL,
uid int4 NOT NULL CONSTRAINT s__ref_uid -- Use it only to know who has
REFERENCES users(id) -- inserted, updated or deleted
ON UPDATE CASCADE -- data into or from this table.
DEFERRABLE,
dbuser text DEFAULT CURRENT_USER,
dbtimestamp timestamp DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE (activity, year)
);
CREATE TABLE researcherothers ( -- No. 2
id SERIAL,
uid int4 NOT NULL CONSTRAINT ro__ref_uid
REFERENCES users(id)
ON UPDATE CASCADE
ON DELETE CASCADE
DEFERRABLE,
othersid int4 NOT NULL CONSTRAINT ro__ref_othersid
REFERENCES others(id)
ON UPDATE CASCADE
DEFERRABLE,
dbuser text DEFAULT CURRENT_USER,
dbtimestamp timestamp DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE (uid, oid)
);
---------------
-- Log table --
---------------
CREATE TABLE others_logs ( -- No. 3
id int4,
activity text NOT NULL,
year int4 NOT NULL,
uid int4 NOT NULL,
dbuser text DEFAULT CURRENT_USER,
dbtimestamp timestamp DEFAULT CURRENT_TIMESTAMP,
dbmodtype char(1)
);
CREATE TABLE researcherothers_logs ( -- No. 4
id int4,
uid int4 NOT NULL,
othersid int4 NOT NULL,
dbuser text DEFAULT CURRENT_USER,
dbtimestamp timestamp DEFAULT CURRENT_TIMESTAMP,
dbmodtype char(1)
);
-----------
-- Rules --
-----------
CREATE RULE others_update AS -- UPDATE rule
ON UPDATE TO others
DO
INSERT INTO others_logs( id, activity, year, uid, dbmodtype )
VALUES( old.id, old.activity, old.year, old.uid, 'U' );
CREATE RULE others_delete AS -- DELETE rule
ON DELETE TO others
DO
INSERT INTO others_logs( id, activity, year, uid, dbmodtype )
VALUES( old.id, old.activity, old.year, old.uid, 'D' );
CREATE RULE researcherothers_update AS -- UPDATE rule
ON UPDATE TO researcherothers
DO
INSERT INTO researcherothers_logs ( id, uid, othersid, dbmodtype )
VALUES ( old.id, old.uid, old.othersid, 'D' );
CREATE RULE researcherothers_delete AS -- DELETE rule
ON DELETE TO researcherothers
DO
INSERT INTO researcherothers_logs ( id, uid, othersid, dbmodtype )
VALUES ( old.id, old.uid, old.othersid, 'D' );
|
SELECT orders.* FROM orders
INNER JOIN (
SELECT user_id FROM users ORDER BY users.created_at DESC LIMIT 1
) as last_user
ON orders.by_user_id = last_user.user_id
WHERE orders.order_status = 'placed'
ORDER BY orders.created_at DESC LIMIT 3; |
create table `websites`(
`id` int(11) not null AUTO_INCREMENT,
`name` char(20) not null default '' comment '站点名称',
`url` varchar(255) not null default '',
`alexa` int(11) not null default '0' comment 'Alexa排名',
`country` char(10) not null default '' comment '国家',
primary key(`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
|
-- we need to create index first
-- create index on sandbox.article(pubdate);
-- create index on sandbox.comment(article_id);
-- create index on sandbox.comment(pubdate);
select
category.name as category,
article.title,
article.pubdate,
jsonb_pretty(article.comments) as comments
from
sandbox.category
left join lateral (
select
article.title,
article.pubdate,
jsonb_agg(comment) as comments
from
sandbox.article
join lateral (
select
id,
content,
pubdate
from
sandbox.comment
where comment.article_id = article.id
order by pubdate desc
limit 3
) as comment
on true -- required by lateral join
where article.category_id = category.id
group by article.id
order by pubdate desc
limit 3
) as article
on true -- required by lateral join
order by
category,
pubdate desc
;
|
■問題文
アクセス記録テーブル(access_log)から日時が2012年06月01日より前か、リンク元のURLが空である情報を削除しましょう。
空欄を埋めて、正しいSQLを完成させてください。
DELETE FROM
[空欄①]
WHERE
[空欄②]
;
■実行文
# アクセス記録テーブルからデータを削除する
DELETE FROM
access_log
# 日時が2012年06月01日より前か、リンク元のURLが空である場合のみ削除する
WHERE
access_date < '2012-06-01'
OR referer IS NULL
;
■返却値
mysql> DELETE FROM
-> access_log
-> WHERE
-> access_date < '2012-06-01'
-> OR referer IS NULL
-> ;
Query OK, 15 rows affected (0.04 sec)
【Before】
mysql> select count(*) from access_log;
+----------+
| count(*) |
+----------+
| 126 |
+----------+
1 row in set (0.01 sec)
mysql> select * from access_log where access_date < '2012-06-01' or referer is NULL;
+--------+---------+---------------------------+-----------------+---------------------+
| log_id | page_id | referer | ip_address | access_date |
+--------+---------+---------------------------+-----------------+---------------------+
| 1 | A0001 | http://wings.msn.to/hamu/ | 192.168.0.253 | 2012-02-01 10:11:12 |
| 2 | A0001 | http://wings.msn.to/hamu/ | 192.168.1.223 | 2012-02-12 07:15:14 |
| 3 | B0001 | http://wings.msn.to/hamu/ | 192.168.21.18 | 2012-02-19 20:11:12 |
| 4 | A0001 | http://wings.msn.to/hamu/ | 192.168.115.25 | 2012-03-01 21:14:18 |
| 5 | A0001 | http://wings.msn.to/hamu/ | 192.168.29.208 | 2012-03-11 21:18:17 |
| 6 | A0001 | http://wings.msn.to/hamu/ | 192.168.3.254 | 2012-03-19 20:10:14 |
| 7 | A0001 | http://wings.msn.to/neko/ | 192.168.42.217 | 2012-03-19 20:11:12 |
| 8 | B0001 | http://wings.msn.to/inu/ | 192.168.81.112 | 2012-04-01 21:14:18 |
| 9 | B0001 | http://wings.msn.to/hamu/ | 192.168.165.27 | 2012-04-10 14:18:19 |
| 10 | B0002 | http://wings.msn.to/neko/ | 192.168.29.207 | 2012-04-11 21:18:17 |
| 11 | B0003 | http://wings.msn.to/neko/ | 192.168.4.257 | 2012-05-10 14:18:19 |
| 12 | A0001 | http://wings.msn.to/hamu/ | 192.168.142.207 | 2012-05-21 21:11:17 |
| 13 | A0001 | http://wings.msn.to/hamu/ | 192.168.41.102 | 2012-05-30 13:17:24 |
| 94 | A0001 | NULL | 192.168.116.14 | 2012-11-15 23:17:48 |
| 112 | A0001 | NULL | 192.168.31.226 | 2012-12-27 23:11:15 |
+--------+---------+---------------------------+-----------------+---------------------+
15 rows in set (0.00 sec)
【After】
mysql> select count(*) from access_log;
+----------+
| count(*) |
+----------+
| 111 |
+----------+
1 row in set (0.00 sec)
mysql> select * from access_log where access_date < '2012-06-01' or referer is NULL;
Empty set (0.00 sec) |
CREATE TABLE agent_config (
id INT NOT NULL AUTO_INCREMENT,
agent_name VARCHAR(128),
syslogd_port INT,
special_poller_thread INT,
poller_thread INT,
trapd_port INT,
receive_event_port INT,
agent_addr VARCHAR(64),
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE spservice (
serviceId INT DEFAULT 0 NOT NULL,
name VARCHAR(128),
serviceType VARCHAR(128),
status VARCHAR(64),
svcLostEventUei VARCHAR(128),
ipAddr VARCHAR(64),
m_interval BIGINT,
ifHalfInterval TINYINT,
svcLostServiceTime TIMESTAMP,
mininterval BIGINT,
PRIMARY KEY (serviceId)
) ENGINE=InnoDB;
CREATE TABLE spservice_param (
parmName VARCHAR(128),
value VARCHAR(128),
serviceId INT
) ENGINE=InnoDB;
CREATE TABLE syslog_parser_config (
id INT NOT NULL AUTO_INCREMENT,
type VARCHAR(128),
src_id varchar(128),
domain_id varchar(128),
ip_addr VARCHAR(128),
uei VARCHAR(128),
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE syslog_parser_type (
id INT NOT NULL AUTO_INCREMENT,
type VARCHAR(128),
class_name VARCHAR(128),
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE syslogrules (
id BIGINT NOT NULL AUTO_INCREMENT,
type VARCHAR(10) DEFAULT '' NOT NULL,
ip VARCHAR(64) DEFAULT '' NOT NULL,
regex VARCHAR(128),
tableName VARCHAR(128),
status VARCHAR(10),
createtime DATETIME,
PRIMARY KEY (id)
) ENGINE=InnoDB;
DROP TABLE IF EXISTS `lm_dlog_syslog_hillstone_firewall`;
CREATE TABLE `lm_dlog_syslog_hillstone_firewall` (
`id` int(11) NOT NULL auto_increment,
`dstip` varchar(255) default NULL,
`dstport` varchar(255) default NULL,
`hostname` varchar(255) default NULL,
`ipaddr` varchar(255) default NULL,
`log_sourcese_quence` varchar(255) default NULL,
`message_type` varchar(255) default NULL,
`msg` varchar(255) default NULL,
`protocol` varchar(255) default NULL,
`srcip` varchar(255) default NULL,
`srcport` varchar(255) default NULL,
`timestamp` datetime default NULL,
`domain` varchar(255) default NULL,
`facility` varchar(255) default NULL,
`severity` varchar(255) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
-- POWERSHELL Check_cluster_votes
-- Get-ClusterNode | ft name, dynamicweight, nodeweight, state -AutoSize
-- To monitor availability database
select * from sys.availability_databases_cluster
select * from sys.dm_hadr_auto_page_repair
select * from sys.dm_hadr_database_replica_states
select * from sys.dm_hadr_database_replica_cluster_states
select * from sys.databases
-- To monitor availability replicas
select * from sys.availability_read_only_routing_lists
SELECT * FROM sys.dm_hadr_cluster_members
select * from sys.availability_replicas
select * from sys.dm_hadr_availability_replica_cluster_nodes
select * from sys.dm_hadr_availability_replica_cluster_states
select * from sys.dm_hadr_availability_replica_states
select * from sys.fn_hadr_backup_is_preferred_replica()
-- To monitor the availability groups
select * from sys.availability_groups_cluster
select * from sys.availability_groups
select * from sys.dm_hadr_availability_group_states
-- To monitor the availability group listeners
select * from sys.availability_group_listener_ip_addresses
select * from sys.availability_group_listeners
select * from sys.dm_tcp_listener_states
-- other queries
select * from sys.availability_databases_cluster
select * from sys.availability_group_listener_ip_addresses
select * from sys.availability_group_listeners
select * from sys.availability_groups
select * from sys.availability_groups_cluster
select * from sys.availability_read_only_routing_lists
select * from sys.availability_replicas
select * from sys.dm_hadr_availability_group_states
select * from sys.dm_hadr_availability_replica_cluster_nodes
select * from sys.dm_hadr_availability_replica_cluster_states
select * from sys.dm_hadr_availability_replica_states
select * from sys.dm_hadr_cluster
select * from sys.dm_hadr_cluster_members
select * from sys.dm_hadr_cluster_networks
select * from sys.dm_hadr_database_replica_cluster_states
select * from sys.dm_io_cluster_shared_drives
select * from sys.dm_io_cluster_valid_path_names
select * from sys.dm_os_cluster_nodes
select * from sys.dm_os_cluster_properties
---
SELECT
ar.replica_server_name,
adc.database_name,
ag.name AS ag_name,
drs.is_local,
drs.is_primary_replica,
drs.synchronization_state_desc,
drs.database_state_desc,
drs.is_commit_participant,
drs.synchronization_health_desc,
drs.recovery_lsn,
drs.truncation_lsn,
drs.last_sent_lsn,
drs.last_sent_time,
drs.last_received_lsn,
drs.last_received_time,
drs.last_hardened_lsn,
drs.last_hardened_time,
drs.last_redone_lsn,
drs.last_redone_time,
drs.log_send_queue_size,
drs.log_send_rate,
drs.redo_queue_size,
drs.redo_rate,
drs.filestream_send_rate,
drs.end_of_log_lsn,
drs.last_commit_lsn,
drs.last_commit_time
FROM sys.dm_hadr_database_replica_states AS drs
INNER JOIN sys.availability_databases_cluster AS adc
ON drs.group_id = adc.group_id AND
drs.group_database_id = adc.group_database_id
INNER JOIN sys.availability_groups AS ag
ON ag.group_id = drs.group_id
INNER JOIN sys.availability_replicas AS ar
ON drs.group_id = ar.group_id AND
drs.replica_id = ar.replica_id
ORDER BY
ag.name,
ar.replica_server_name,
adc.database_name;
select dc.database_name
, d.synchronization_health_desc
, d.synchronization_state_desc
, d.database_state_desc from sys.dm_hadr_database_replica_states d
join sys.availability_databases_cluster dc
on d.group_database_id=dc.group_database_id
WHERE d.is_local=1 |
Create function mERP_fn_GetSchemeOutletDetails (@SchemeID integer)
Returns @Customers Table ( CustomerID nVarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS,SchemeID Int, GroupID Int, QPS Int )
As
Begin
Insert into @Customers
Select Distinct C.CustomerID,S.SchemeID,So.GroupID, So.QPS
From
tbl_mERP_SchemeAbstract S ,tbl_mERP_SchemeOutlet SO , tbl_mERP_SchemeChannel SC ,
tbl_mERP_SchemeOutletClass SOLC, tbl_mERP_SchemeLoyaltyList SLList,tbl_Merp_OlclassMapping OLM,
tbl_merp_Olclass OL,Customer C
Where
S.SCHEMEID = @SchemeID AND
S.Active = 1 And
C.CustomerID = OLM.CustomerID And
-- C.ACTIVE = 1 AND
OLM.OLClassID = OL.ID And
OLM.Active = 1 And
S.SchemeID = SO.SchemeID And
(SO.OutletID = C.CustomerID Or SO.OutletID = N'All')
And S.SchemeID = SC.SchemeID And
SC.GroupID = SO.GroupID And
(SC.Channel = OL.Channel_Type_Desc Or SC.Channel = N'All') And
S.SchemeID = SOLC.SchemeID And
SOLC.GroupID = SO.GroupID And
(SOLC.OutLetClass = OL.Outlet_Type_Desc Or SOLC.OutLetClass = N'All') And
S.SchemeID = SLList.SchemeID And
SLList.GroupID = SO.GroupID And
(SLList.LoyaltyName = OL.SubOutlet_Type_Desc Or SLList.LoyaltyName = N'All')
Group By S.SchemeID,SO.GroupID,C.CustomerID,So.QPS
Return
End
|
ALTER TABLE `crm_module_form` DROP PRIMARY KEY, ADD PRIMARY KEY(`module_id`, `place`);
|
CREATE DATABASE productManagement;
USE productManagement;
CREATE TABLE products(
id INT AUTO_INCREMENT PRIMARY KEY,
productName VARCHAR(220),
price BIGINT,
quantity INT,
color VARCHAR(220),
category VARCHAR(50),
des VARCHAR(220)
);
-- DROP TABLE products;
|
CREATE TABLE PRODUCT(
P_CODE VARCHAR2(20) PRIMARY KEY,
P_COUNT NUMBER,
P_PRICE NUMBER UNIQUE,
P_GPRICE NUMBER UNIQUE,
P_LIMIT NUMBER NOT NULL,
P_NAME VARCHAR2(100) UNIQUE, --제목
P_SELLERNAME VARCHAR2(30) NOT NULL
)
alter table product
add P_COUNT NUMBER
DROP TABLE PRODUCT
SELECT * FROM PRODUCT
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 21, 2020 at 07:27 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.3.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `cms`
--
-- --------------------------------------------------------
--
-- Table structure for table `content`
--
CREATE TABLE `content` (
`id` int(255) NOT NULL,
`content_message` text DEFAULT NULL,
`destination` varchar(50) DEFAULT NULL,
`price` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `content`
--
INSERT INTO `content` (`id`, `content_message`, `destination`, `price`) VALUES
(1, 'The best destination for 2019 year.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec.', 'Abu Dhabi', 565),
(2, 'Every other country which either has or aspires to have a major tourist industry is actively promoting that country as a tourist destination.Nulla consequat massa quis enim.', 'Paris', 540),
(3, 'We are still the sixth most popular tourist destination in the world.Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.', 'Budapest', 400),
(4, 'Europe\'s diversity and richness mean that it is still the world\'s most popular tourist destination.', 'Venezia', 500),
(5, 'What is most important is that we should put the development of tourism in each tourist destination on foundations that will be secure in the long term.', 'Tahiti', 520),
(6, 'This will be opposed by all the forces committed to the country\'s future as a serious tourist destination.', 'Bora Bora', 480),
(12, 'It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Belgrade', 250);
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
CREATE TABLE `groups` (
`id` int(11) NOT NULL,
`name` varchar(20) NOT NULL,
`permissions` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `groups`
--
INSERT INTO `groups` (`id`, `name`, `permissions`) VALUES
(1, 'Standard user', ''),
(2, 'Administrator', '{\"admin\": 1}');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(64) NOT NULL,
`salt` varchar(70) CHARACTER SET latin1 NOT NULL,
`name` varchar(50) NOT NULL,
`joined` date NOT NULL,
`group` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `salt`, `name`, `joined`, `group`) VALUES
(36, 'aleksandar', '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', '', 'Aleks', '2020-01-16', 1),
(40, 'igor', '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', '', 'Igor Kostadinoski', '2020-01-17', 2),
(41, 'qwerty', '65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5', '$salt', 'Jack Wilshare', '2020-01-17', 1),
(44, 'otamendi', '893836eac77d8d00d2570ed0c2032d49976e971278ce67d0dd08b84d255189d8', '$salt', 'otamendi', '2020-01-17', 1);
-- --------------------------------------------------------
--
-- Table structure for table `users_session`
--
CREATE TABLE `users_session` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`hash` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `content`
--
ALTER TABLE `content`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `groups`
--
ALTER TABLE `groups`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users_session`
--
ALTER TABLE `users_session`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `content`
--
ALTER TABLE `content`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `groups`
--
ALTER TABLE `groups`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;
--
-- AUTO_INCREMENT for table `users_session`
--
ALTER TABLE `users_session`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.