text
stringlengths
6
9.38M
-- Database: biometrics -- DROP DATABASE biometrics; /*step 1*/ DROP TABLE IF EXISTS today_Users; DROP TABLE IF EXISTS yesterday_Users; DROP TABLE IF EXISTS new_Users; DROP TABLE IF EXISTS deleted_Users; /*step 2*/ DROP TABLE IF EXISTS modified_Users; DROP TABLE IF EXISTS fixed_user_Data; DROP TABLE IF EXISTS rejected_user_Data; /*step 3*/ DROP TABLE IF EXISTS sent_for_validation_users; DROP TABLE IF EXISTS sent_for_transformation_users; /* step 4 */ DROP TABLE IF EXISTS transformed_users; truncate table users; create table today_Users as select * from users where 1=0; create table yesterday_Users as select * from users where 1=0; create table new_Users as select * from today_Users where 1=0; create table deleted_Users as select * from today_Users where 1=0; create table modified_Users as select * from today_Users where 1=0; create table sent_for_validation_users as select * from today_Users where 1=0; alter table sent_for_validation_users add change_type varchar(50) not null check (change_type in ('New','Deleted','Changed')); create table fixed_user_Data as select * from sent_for_validation_users where 1=0; create table rejected_user_Data as select * from sent_for_validation_users where 1=0; create table sent_for_transformation_users as select * from sent_for_validation_users where 1=0; create table transformed_users( user_id integer not null, user_name VARCHAR(50) not null, birthday date not null, change_type varchar(50) not null ); commit;
create table department( dept_name varchar(20), building varchar(30), budget numeric(15,0), primary key (dept_name)); create table instructor( ID char(5), name varchar(20) not null, dept_name varchar(20), salary numeric(8,2), primary key (ID), foreign key (dept_name) references department(dept_name) on delete set null); create table student( ID varchar(5), name varchar(20) not null, dept_name varchar(20), tot_cred numeric(3,0), primary key (ID), foreign key (dept_name) references department(dept_name) on delete set null); create table section( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(30), room_no int, time_slot_id varchar(10), primary key(course_id, sec_id, semester, year, building)); create table takes( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2), primary key (ID, course_id, sec_id, semester, year), foreign key (ID) references student(ID), foreign key (course_id, sec_id, semester, year) references section(course_id, sec_id, semester, year)); create table course( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0), primary key (course_id), foreign key (dept_name) references department(dept_name)); insert into instructor values('10211', 'Smith', 'Biology', 66000); delete from student where dept_name = 'Biology'; select name from instructor; select distinct dept_name from instructor; select all dept_name from instructor; select * from instructor; select ID, name, salary/12 from instructor; select name from instructor where dept_name = 'Comp. Sci.' and salary > 80000; select * from instructor, teaches; select name, course_id from instructor, teaches where instructor.ID = teaches.ID; select name, course_id from instructor natural join teaches; select section.course_id, semester, year, title from section, course where section.course_id = course.course_id and dept_name = 'Comp. Sci.'; select * from instructor natural join teaches; select name, course_id from instructor, teaches where instructor.ID = teaches.ID; select name, course_id from instructor natural join teaches; select ID, name, salary/12 as monthly_salary from instructor; select distinct T.name from instructor as T, instructor as S where T.salary > S.salary and S.dept_name = 'Comp. Sci.'; select name from instructor where name like '%dar%'; select distinct name from instructor order by dept_name, name; select name from instructor where salary between 90000 and 100000; select name, course_id from instructor, teaches where (instructor.ID, dept_name) = (teaches.ID, 'Biology'); (select course_id from section where semester = 'Fall' and year = 2009) union (select course_id from section where semester = 'Spring' and year = 2010); select course_id from section where (semester = 'Fall' and year = 2009) and course_id in (select course_id from section where (semester = 'Spring' and year = 2010)); select course_id from section where (semester = 'Fall' and year = 2009) and course_id not in (select course_id from section where (semester = 'Spring' and year = 2010)); select name from instructor where salary is null; select avg(salary) from instructor where dept_name= 'Comp. Sci.'; select count(distinct ID) from teaches where semester = 'Spring' and year = 2010; select count(*) from course; select dept_name, avg (salary) as avg_salary from instructor group by dept_name; select dept_name, ID, avg(salary) from instructor group by dept_name; select dept_name, avg(salary) from instructor group by dept_name having avg(salary) > 42000; select sum(salary) from instructor; select distinct course_id from section where (semester = 'Fall' and year = 2009) and course_id in (select course_id from section where semester = 'Spring' and year = 2010); select distinct course_id from section where (semester = 'Fall' and year = 2009) and course_id not in (select course_id from section where semester = 'Spring' and year = 2010); select count(distinct ID) from takes where (course_id, sec_id, semester, year) in (select course_id, sec_id, semester, year from teaches where teaches.ID = 10101); select distinct T.name from instructor as T, instructor as S where T.salary > S.salary and S.dept_name = 'Biology'; select name from instructor where salary > some(select salary from instructor where dept_name = 'Biology'); select name from instructor where salary > all(select salary from instructor where dept_name = 'Biology'); select course_id from section as S where semester = 'Fall' and year = 2009 and exists(select * from section as T where semester = 'Spring' and year = '2010' and S.course_id = T.course_id); select distinct S.ID, S.name from student as S where not exists (select course_id from course where dept_name = 'Biology' and course_id not in (select T.course_id from takes as T where S.ID = T.ID)); select T.course_id from course as T where (select count(*) from (select distinct R.course_id from section as R where (T.course_id = R.course_id) and (R.year = 2009)) as dist) = (select count(*) from (select U.course_id from section as U where (T.course_id = U.course_id) and (U.year = 2009)) as form); select T.course_id from (select R.course_id from section as R where R.year = 2009) as T group by T.course_id having count(*) = 1; /* get not duplicated rows. mysql = sucks.. select T.course_id, count(*) from (select R.course_id from section as R where R.year = 2009) as T group by T.course_id having count(*) = 1; */ /* get not unique columns.. SELECT my_column, COUNT(*) as count FROM my_table GROUP BY my_column HAVING COUNT(*) > 1 */ select T.dept_name, T.avg_sal as avg_salary from (select S.dept_name, avg(S.salary) as avg_sal from instructor as S group by S.dept_name) as T where T.avg_sal > 42000; select T.dept_name, T.avg_salary from (select S.dept_name, avg(salary) as avg_salary from instructor as S group by S.dept_name) as T where T.avg_salary > 42000; select dept_name, max(budget) from department group by dept_name; select dept_name, sum(salary) from instructor group by dept_name having sum(salary) >= some (select avg(salary) from instructor); select dept_name, (select count(*) from instructor where department.dept_name = instructor.dept_name) as num_instructors from department; delete from instructor; delete from instructor where dept_name='Finance'; delete from instructor where dept_name in (select dept_name from department where building = 'Watson'); delete from instructor where salary < (select * from (select avg(salary) from instructor as S) as T); insert into course values('CS-437', 'Database Systems', 'Comp. Sci.', 4); insert into course(course_id, title, dept_name, credits) values('CS-437', 'Database Systems', 'Comp. Sci.', 4); insert into student values('3003', 'Green', 'Finance', null); insert into student select ID, name, dept_name, 0 from instructor; update instructor set salary = salary * 1.03 where salary > 100000; update instructor set salary = salary * 1.05 where salary <= 100000; update instructor set salary = case when salary <= 100000 then salary * 1.05 else salary * 1.03 end; update student S set tot_cred = (select sum(credits) from takes natural join course where S.ID = takes.ID and takes.grade <> 'F' and takes.grade is not null); update student S set tot_cred = (select (case when sum(credits) is not null then sum(credits) else 0 end) from takes natural join course where S.ID = takes.ID and takes.grade <> 'F' and takes.grade is not null); select * from takes natural join course order by course_id;
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 16-01-2019 a las 17:12:41 -- Versión del servidor: 10.1.29-MariaDB -- Versión de PHP: 7.2.0 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 */; -- -- Base de datos: `automatizacion` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `alumnos` -- CREATE TABLE `alumnos` ( `Nombre_Alumno` varchar(80) NOT NULL, `Matricula` varchar(15) NOT NULL, `Grupo` varchar(10) NOT NULL, `Carrera` varchar(80) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `asesorias` -- CREATE TABLE `asesorias` ( `Nombre_Tutor` varchar(80) NOT NULL, `Motivo_Asesoria` varchar(5) NOT NULL, `Genero` varchar(10) NOT NULL, `Grupo` varchar(10) NOT NULL, `Calificacion` varchar(5) NOT NULL, `Descripcion_Motivo` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `carrera` -- CREATE TABLE `carrera` ( `Nombre de Carrera` varchar(60) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `encuesta_satisfaccion` -- CREATE TABLE `encuesta_satisfaccion` ( `Nombre_Tutor` varchar(80) NOT NULL, `Nombre_Maestro` varchar(80) NOT NULL, `Pregunta_1` int(5) NOT NULL, `Pregunta_2` int(5) NOT NULL, `Pregunta_3` int(5) NOT NULL, `Pregunta_4` int(5) NOT NULL, `Nombre_Alumno` varchar(80) NOT NULL, `Promedio` int(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `profesores` -- CREATE TABLE `profesores` ( `Nombre_Profesor` varchar(80) NOT NULL, `Matricula` varchar(15) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tutores` -- CREATE TABLE `tutores` ( `Nombre_Tutor` varchar(80) NOT NULL, `Matricula` varchar(60) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tutoria_grupal` -- CREATE TABLE `tutoria_grupal` ( `Nombre_Tutor` varchar(80) NOT NULL, `Motivo_Grupo` varchar(5) NOT NULL, `Grupo` varchar(10) NOT NULL, `Descripcion` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tutoria_indivudual` -- CREATE TABLE `tutoria_indivudual` ( `Nombre_Tutor` varchar(80) NOT NULL, `Nombre_Maestro` varchar(80) NOT NULL, `Nombre_Alumno` varchar(80) NOT NULL, `Motivo` varchar(5) NOT NULL, `Grupo` varchar(10) NOT NULL, `Genero` varchar(10) NOT NULL, `Descripcion_Motivo` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `alumnos` -- ALTER TABLE `alumnos` ADD PRIMARY KEY (`Nombre_Alumno`), ADD KEY `Grupo` (`Grupo`), ADD KEY `Carrera` (`Carrera`); -- -- Indices de la tabla `asesorias` -- ALTER TABLE `asesorias` ADD PRIMARY KEY (`Nombre_Tutor`), ADD KEY `Grupo` (`Grupo`); -- -- Indices de la tabla `carrera` -- ALTER TABLE `carrera` ADD PRIMARY KEY (`Nombre de Carrera`); -- -- Indices de la tabla `encuesta_satisfaccion` -- ALTER TABLE `encuesta_satisfaccion` ADD PRIMARY KEY (`Nombre_Tutor`), ADD KEY `Nombre_Maestro` (`Nombre_Maestro`), ADD KEY `Nombre_Alumno` (`Nombre_Alumno`); -- -- Indices de la tabla `profesores` -- ALTER TABLE `profesores` ADD PRIMARY KEY (`Nombre_Profesor`); -- -- Indices de la tabla `tutores` -- ALTER TABLE `tutores` ADD PRIMARY KEY (`Nombre_Tutor`); -- -- Indices de la tabla `tutoria_grupal` -- ALTER TABLE `tutoria_grupal` ADD PRIMARY KEY (`Nombre_Tutor`), ADD KEY `Grupo` (`Grupo`); -- -- Indices de la tabla `tutoria_indivudual` -- ALTER TABLE `tutoria_indivudual` ADD PRIMARY KEY (`Nombre_Tutor`), ADD KEY `Nombre_Maestro` (`Nombre_Maestro`), ADD KEY `Nombre_Alumno` (`Nombre_Alumno`), ADD KEY `Grupo` (`Grupo`); -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `alumnos` -- ALTER TABLE `alumnos` ADD CONSTRAINT `alumnos_ibfk_1` FOREIGN KEY (`Carrera`) REFERENCES `carrera` (`Nombre de Carrera`) ON DELETE CASCADE; -- -- Filtros para la tabla `asesorias` -- ALTER TABLE `asesorias` ADD CONSTRAINT `asesorias_ibfk_1` FOREIGN KEY (`Nombre_Tutor`) REFERENCES `tutores` (`Nombre_Tutor`) ON DELETE CASCADE, ADD CONSTRAINT `asesorias_ibfk_2` FOREIGN KEY (`Grupo`) REFERENCES `alumnos` (`Grupo`) ON DELETE CASCADE; -- -- Filtros para la tabla `encuesta_satisfaccion` -- ALTER TABLE `encuesta_satisfaccion` ADD CONSTRAINT `encuesta_satisfaccion_ibfk_1` FOREIGN KEY (`Nombre_Maestro`) REFERENCES `profesores` (`Nombre_Profesor`) ON DELETE CASCADE, ADD CONSTRAINT `encuesta_satisfaccion_ibfk_2` FOREIGN KEY (`Nombre_Tutor`) REFERENCES `tutores` (`Nombre_Tutor`) ON DELETE CASCADE, ADD CONSTRAINT `encuesta_satisfaccion_ibfk_3` FOREIGN KEY (`Nombre_Alumno`) REFERENCES `alumnos` (`Nombre_Alumno`) ON DELETE CASCADE; -- -- Filtros para la tabla `tutoria_grupal` -- ALTER TABLE `tutoria_grupal` ADD CONSTRAINT `tutoria_grupal_ibfk_1` FOREIGN KEY (`Nombre_Tutor`) REFERENCES `tutores` (`Nombre_Tutor`) ON DELETE CASCADE, ADD CONSTRAINT `tutoria_grupal_ibfk_2` FOREIGN KEY (`Grupo`) REFERENCES `alumnos` (`Grupo`) ON DELETE CASCADE; -- -- Filtros para la tabla `tutoria_indivudual` -- ALTER TABLE `tutoria_indivudual` ADD CONSTRAINT `tutoria_indivudual_ibfk_1` FOREIGN KEY (`Nombre_Alumno`) REFERENCES `alumnos` (`Nombre_Alumno`) ON DELETE CASCADE, ADD CONSTRAINT `tutoria_indivudual_ibfk_2` FOREIGN KEY (`Nombre_Tutor`) REFERENCES `tutores` (`Nombre_Tutor`) ON DELETE CASCADE, ADD CONSTRAINT `tutoria_indivudual_ibfk_3` FOREIGN KEY (`Nombre_Maestro`) REFERENCES `profesores` (`Nombre_Profesor`) ON DELETE CASCADE, ADD CONSTRAINT `tutoria_indivudual_ibfk_4` FOREIGN KEY (`Grupo`) REFERENCES `alumnos` (`Grupo`) ON DELETE 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 */;
-- nls_date_format.sql -- set the default date format -- can be run interactively or run from the command line -- e.g. '@nls_date_format 1' will set the format to MM/DD/YYYY HH24:MI:SS -- -- jkstill 10/27/99 - use DBMS_SQL rather than spooled script @clears select sysdate from dual; prompt Which Date Format Should I Use? prompt 1. 2012-02-27 14:25:52 prompt prompt 2. 2012-02-27 prompt prompt 3. 20-MAR-98 prompt prompt 4. 20-MAR-1998 prompt set term off feed off col cdateformat noprint new_value udateformat select '&1' cdateformat from dual; -- uncomment to see dbms_output output set feed on term on declare d_sql_cursor integer; v_sqlcmd varchar2(2000); retval integer; begin select 'alter session set nls_date_format = ' || '''' || decode('&&udateformat', '1', 'yyyy-mm-dd hh24:mi:ss', '2', 'yyyy-mm-dd', '3', 'DD-MON-YY', '4', 'DD-MON-YYYY' ) || '''' into v_sqlcmd from dual; dbms_output.put_line('SQLCMD: ' || v_sqlcmd); d_sql_cursor := dbms_sql.open_cursor; begin dbms_sql.parse(d_sql_cursor,v_sqlcmd, dbms_sql.native); retval := dbms_sql.execute(d_sql_cursor); exception when others then raise_application_error(-20999,'Error parsing NLS_DATE format'); end; dbms_sql.close_cursor(d_sql_cursor); end; / set pages 24 term on select sysdate from dual; set feed on prompt undef 1
SELECT title FROM stars JOIN movies ON movies.id = stars.movie_id JOIN ratings ON ratings.movie_id = stars.movie_id JOIN people ON people.id = stars.person_id WHERE name = "Chadwick Boseman" ORDER BY rating DESC LIMIT 5
INSERT INTO alarmas (descripcion,codigo_producto,tendencia_id,tipo,prioridad,reconocida,usuario,detalle,created_at,updated_at) VALUES ('El limite de especificacion fue superado','6127341',2,1,1,false,NULL,NULL,NULL,NULL) ,('El limite de especificacion fue superado','6127341',1,1,1,false,NULL,NULL,NULL,NULL) ;
DROP VIEW IF EXISTS afp_case_based_calc; CREATE OR REPLACE VIEW afp_case_based_calc AS WITH calc AS ( SELECT "EpidNumber" as epid_number, "Province" as province, "DateNotified" as date_notified, "DateCaseinvestigated" as date_case_investigated, "FinalCellCultureResult" as final_cell_culture_result, "StoolCondition" as stool_condition, "DateStoolSentolab" as date_stool_sent_to_lab, "DateLabSentRestodistrict" as date_lab_sent_rest_to_district, "DateSpecRecbyNatLab" as date_spec_rec_by_natlab, "DateOfOnset" as date_of_onset, "DateFollowupExamine" as date_followup_examine, ( ("DateCaseinvestigated"::date - "DateNotified"::date) * 24 ) as hrs_of_notification, ( ("DateLabSentRestodistrict"::date - "DateStoolSentolab"::date) + 1 ) as lab_result_feedback, ( (("DateSpecRecbyNatLab"::date - "DateStoolSentolab"::date) + 1) * 24 ) as specimen_arrival FROM afp_case_based WHERE "DateReceived" != 'DateReceived' ) SELECT epid_number, province, date_notified::date, date_case_investigated::date, final_cell_culture_result, stool_condition, date_stool_sent_to_lab::date, date_lab_sent_rest_to_district::date, date_spec_rec_by_natlab::date, date_of_onset::date, date_followup_examine::date, hrs_of_notification, lab_result_feedback, specimen_arrival, ( CASE WHEN hrs_of_notification < 48 THEN 'Within 48 hours' ELSE 'Later than 48 hours' END ) as investigation_by_dsno, ( CASE WHEN lab_result_feedback <= 14 THEN 'Lab result is timely' ELSE 'Lab result is untimely' END ) as timeliness_of_feedback, ( CASE stool_condition WHEN '1' THEN 'Speciment in good condition' ELSE 'Speciment not in good condition' END ) as specimen_condition, ( CASE WHEN specimen_arrival <= 72 THEN 'Specimen arrived with 72 hours' ELSE 'Speciment arrived later than 72 hours' END ) as specimen_arrival_timeliness, ( (date_followup_examine::date - date_of_onset::date) + 1 ) as days_of_followup FROM calc;
/* Создание таблицы подтуров */ CREATE TABLE /*PREFIX*/SUBROUNDS ( SUBROUND_ID VARCHAR(32) NOT NULL, TIRAGE_ID VARCHAR(32) NOT NULL, ROUND_NUM INTEGER NOT NULL, NAME VARCHAR(100) NOT NULL, PERCENT NUMERIC(4,2) NOT NULL, PRIORITY INTEGER NOT NULL, PRIMARY KEY (SUBROUND_ID), FOREIGN KEY (TIRAGE_ID) REFERENCES /*PREFIX*/TIRAGES (TIRAGE_ID) ) -- /* Создание просмотра таблицы подтуров */ CREATE VIEW /*PREFIX*/S_SUBROUNDS ( SUBROUND_ID, TIRAGE_ID, ROUND_NUM, NAME, PERCENT, PRIORITY, TIRAGE_NUM ) AS SELECT P.*, T.NUM AS TIRAGE_NUM FROM /*PREFIX*/SUBROUNDS P JOIN /*PREFIX*/TIRAGES T ON T.TIRAGE_ID=P.TIRAGE_ID -- /* Создание процедуры добавления подтура */ CREATE PROCEDURE /*PREFIX*/I_SUBROUND ( SUBROUND_ID VARCHAR(32), TIRAGE_ID VARCHAR(32), ROUND_NUM INTEGER, NAME VARCHAR(100), PERCENT NUMERIC(4,2), PRIORITY INTEGER ) AS BEGIN INSERT INTO /*PREFIX*/SUBROUNDS (SUBROUND_ID,TIRAGE_ID,ROUND_NUM,NAME,PERCENT,PRIORITY) VALUES (:SUBROUND_ID,:TIRAGE_ID,:ROUND_NUM,:NAME,:PERCENT,:PRIORITY); END; -- /* Создание процедуры изменения подтура */ CREATE PROCEDURE /*PREFIX*/U_SUBROUND ( SUBROUND_ID VARCHAR(32), TIRAGE_ID VARCHAR(32), ROUND_NUM INTEGER, NAME VARCHAR(100), PERCENT NUMERIC(4,2), PRIORITY INTEGER, OLD_SUBROUND_ID VARCHAR(32) ) AS BEGIN UPDATE /*PREFIX*/SUBROUNDS SET SUBROUND_ID=:SUBROUND_ID, TIRAGE_ID=:TIRAGE_ID, ROUND_NUM=:ROUND_NUM, NAME=:NAME, PERCENT=:PERCENT, PRIORITY=:PRIORITY WHERE SUBROUND_ID=:OLD_SUBROUND_ID; END; -- /* Создание процедуры удаления подтура */ CREATE PROCEDURE /*PREFIX*/D_SUBROUND ( OLD_SUBROUND_ID VARCHAR(32) ) AS BEGIN DELETE FROM /*PREFIX*/SUBROUNDS WHERE SUBROUND_ID=:OLD_SUBROUND_ID; END; -- /* Фиксация изменений */ COMMIT
--Problem 03 GROUP BY SELECT DepositGroup ,MAX(MagicWandSize) AS LongestMagicWand FROM WizzardDeposits GROUP BY DepositGroup
SELECT id, username, nombre, celular, email FROM persona WHERE id = :id;
CREATE TABLE todo (id INTEGER PRIMARY KEY AUTOINCREMENT, title, content, created_at, updated_at, status, progress, marked, tags ); CREATE TABLE tags ( title, created_at, updated_at, color );
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: נובמבר 06, 2019 בזמן 10:56 PM -- גרסת שרת: 10.3.16-MariaDB -- PHP Version: 7.3.7 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: `bloger` -- -- -------------------------------------------------------- -- -- מבנה טבלה עבור טבלה `posts` -- CREATE TABLE `posts` ( `id` int(11) NOT NULL, `userid` int(11) NOT NULL, `title` text CHARACTER SET utf8mb4 NOT NULL, `post` text CHARACTER SET utf8mb4 NOT NULL, `create_at` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- הוצאת מידע עבור טבלה `posts` -- INSERT INTO `posts` (`id`, `userid`, `title`, `post`, `create_at`) VALUES (16, 57, 'Homemade Pizza Recipe', 'Pizza Dough: Makes enough dough for two 10-12 inch pizzas\r\n\r\n1 1/2 cups (355 ml) warm water (105°F-115°F)\r\n1 package (2 1/4 teaspoons) of active dry yeast\r\n3 3/4 cups (490 g) bread flour\r\n2 tablespoons extra virgin olive oil (omit if cooking pizza in a wood-fired pizza oven)\r\n2 teaspoons salt\r\n1 teaspoon sugar\r\nPizza Ingredients\r\n\r\nExtra virgin olive oil\r\nCornmeal (to help slide the pizza onto the pizza stone)\r\nTomato sauce (smooth, or puréed)\r\nFirm mozzarella cheese, grated\r\nFresh soft mozzarella cheese, separated into small clumps\r\nFontina cheese, grated\r\nParmesan cheese, grated\r\nFeta cheese, crumbled\r\nMushrooms, very thinly sliced if raw, otherwise first sautéed\r\nBell peppers, stems and seeds removed, very thinly sliced\r\nItalian pepperoncini, thinly sliced\r\nItalian sausage, cooked ahead and crumbled\r\nChopped fresh basil', '2019-11-03'), (17, 57, 'HOMEMADE TOMATO BASIL SOUP RECIPe', 'Roma tomatoes\r\nGarlic\r\nOlive oil\r\nSalt + Pepper\r\nButter (or more olive oil)\r\nYellow onions\r\nCanned tomatoes\r\nFresh basil\r\nVegetable Broth\r\nSugar (optional)\r\nCrushed Red Chili Flakes (optional)', '2019-11-04'), (28, 57, 'recipe to brownies', 'I threw in over 1 cup of chocolate chunks IN AND ON these (I used 45% cocoa chocolate), but you can also add:\r\n\r\ncrushed nuts (peanuts, walnuts, pecans, almonds, etc)\r\ndried fruits (dates, blueberries, cranberries, raisins)\r\nshredded coconut\r\ncaramel pieces\r\ndiced marshmallows\r\npeanut butter chips', '2019-11-04'), (29, 51, 'מתכון לעוגת שוקולד', '2 ביצים גדולות (או 3 ביצים M)\r\n\r\nכוס ושליש (265 ג&#39;) סוכר (*ראו הערה בתחתית המתכון לגבי כמות הסוכר)\r\n\r\n1 כוס (200 ג&#39;) שמן\r\n\r\n1 כוס (240 מ&#34;ל) מים פושרים\r\n\r\n¾ כוס (180 מ&#34;ל) מים רותחים (*כמות המים הופחתה מהמתכון המקורי)\r\n\r\nמערבבים בקערה (קערת הקמחים):\r\n\r\n2 כוסות (280 ג&#39;) קמח\r\n\r\n1 שקית (10 ג&#39;) אבקת אפיה\r\n\r\n1 כפית (3 ג&#39;) שטוחה אבקת סודה לשתייה\r\n\r\n4 כפות (40 ג&#39;) קקאו\r\n\r\n*יש להשתמש בכוס זכוכית רגילה עם ידית', '2019-11-04'); -- -------------------------------------------------------- -- -- מבנה טבלה עבור טבלה `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `name` char(50) NOT NULL, `email` char(50) NOT NULL, `pwd` varchar(250) NOT NULL, `role` int(11) NOT NULL, `update_at` datetime NOT NULL DEFAULT current_timestamp(), `avatar` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- הוצאת מידע עבור טבלה `users` -- INSERT INTO `users` (`id`, `name`, `email`, `pwd`, `role`, `update_at`, `avatar`) VALUES (50, 'omer', 'avharomer@gmail.com', '$2y$10$7ssnhiD7xUGcnc3lXOXfeu/HOgv3HSZMDzpQ2dBPJEyq/b/07nn72', 6, '2019-10-29 18:20:26', ''), (51, 'admin', 'admin@gmail.com', '$2y$10$QcGcGyfM4kgVuJUeLAWqDucUgcMncqQ5PxU995f1CJW90a1IVRG9m', 6, '2019-10-29 18:21:46', ''), (57, 'dvora', 'shalom@gmail789', '$2y$10$DeS9AcQ8g6xZOUgP70A55.jaHEOSCkCS71RCSpAG5NsoDaZTRudOm', 6, '2019-11-03 16:18:09', ''), (62, 'dvora', 'shalom@gmail78910', '$2y$10$IC0cJPcG475KJ3Y1pq2PBu78XBecBG3bHHbsoix.XMj3BHDDmMvxW', 6, '2019-11-04 19:34:58', ''); -- -- Indexes for dumped tables -- -- -- אינדקסים לטבלה `posts` -- ALTER TABLE `posts` ADD PRIMARY KEY (`id`); -- -- אינדקסים לטבלה `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `posts` -- ALTER TABLE `posts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=63; 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 IF NOT EXISTS users ( user_id INTEGER auto_increment PRIMARY KEY, username VARCHAR(50) NOT NULL, name VARCHAR(100) NOT NULL, password VARCHAR(50) NOT NULL, role_id INTEGER, email VARCHAR(50), create_user VARCHAR(100), create_date TIMESTAMP, update_user VARCHAR(100), update_date TIMESTAMP ); CREATE TABLE IF NOT EXISTS role ( role_id INTEGER auto_increment PRIMARY KEY, rolename VARCHAR(50), role_desc VARCHAR(100), create_user VARCHAR(100), create_date TIMESTAMP, update_user VARCHAR(100), update_date TIMESTAMP ); CREATE TABLE IF NOT EXISTS url ( url_id INTEGER auto_increment PRIMARY KEY, name VARCHAR(100), description VARCHAR(1000), url VARCHAR(1000), username VARCHAR(50), password VARCHAR(50), module_id INTEGER, env_id INTEGER, role_id INTEGER, -- This field indicates the username/password would be visible to only this role. If blank then it would be visible to all if visible is marked as TRUE visible BOOLEAN, -- This field indicates if the details is visible to all email VARCHAR(50), create_user VARCHAR(100), create_date TIMESTAMP, update_user VARCHAR(100), update_date TIMESTAMP ); CREATE TABLE IF NOT EXISTS user_url_dtl ( -- This table holds additional URL description id INTEGER auto_increment PRIMARY KEY, user_id INTEGER, url_id INTEGER, username VARCHAR(200), password VARCHAR(200), description VARCHAR(200), create_user VARCHAR(100), create_date TIMESTAMP, update_user VARCHAR(100), update_date TIMESTAMP ); CREATE TABLE IF NOT EXISTS module ( module_id INTEGER auto_increment PRIMARY KEY, module_name VARCHAR(100), description VARCHAR(200), --env_id INTEGER, create_user VARCHAR(100), create_date TIMESTAMP, update_user VARCHAR(100), update_date TIMESTAMP ); CREATE TABLE IF NOT EXISTS environment_master ( env_id INTEGER auto_increment PRIMARY KEY, env_name VARCHAR(200), env_desc VARCHAR(200), create_user VARCHAR(100), create_date TIMESTAMP, update_user VARCHAR(100), update_date TIMESTAMP ); CREATE TABLE IF NOT EXISTS module_env ( module_env_id INTEGER auto_increment, module_id INTEGER, env_id INTEGER, create_user VARCHAR(100), create_date TIMESTAMP, update_user VARCHAR(100), update_date TIMESTAMP ); ALTER TABLE users ADD FOREIGN KEY ( role_id ) REFERENCES role( role_id ); ALTER TABLE users ADD CONSTRAINT users_unique UNIQUE(username); ALTER TABLE url ADD FOREIGN KEY ( role_id ) REFERENCES role( role_id ); ALTER TABLE role ADD CONSTRAINT role_unique UNIQUE(rolename); ALTER TABLE url ADD FOREIGN KEY ( module_id1 ) REFERENCES module ( module_id ); ALTER TABLE url ADD FOREIGN KEY ( env_id1 ) REFERENCES module ( env_id ); ALTER TABLE user_url_dtl ADD FOREIGN KEY ( user_id ) REFERENCES users ( user_id ); ALTER TABLE user_url_dtl ADD FOREIGN KEY ( url_id ) REFERENCES url ( url_id ); ALTER TABLE module ADD FOREIGN KEY ( env_id ) REFERENCES environment_master( env_id ); ALTER TABLE module_env ADD FOREIGN KEY ( module_id ) REFERENCES module ( module_id ); ALTER TABLE module_env ADD FOREIGN KEY ( env_id ) REFERENCES environment_master( env_id ); ALTER TABLE module_env ADD PRIMARY KEY(module_id, env_id)); INSERT INTO role (role_id, rolename,role_desc) VALUES (1, 'ADMIN', 'Administrator Role'); INSERT INTO role (role_id, rolename,role_desc) VALUES (2, 'GENERAL', 'General Loggedin User'); INSERT INTO users (username,name,password,role_id) VALUES ('ashish', 'Ashish Mondal', 'YXNoaXNo',1);
DROP TABLE exercise_db; CREATE TABLE exercise_db( exid INTEGER PRIMARY KEY, name TEXT, bpart TEXT ); INSERT INTO exercise_db(name, bpart) VALUES('Assisted Dips', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Assisted Dips-Axiom', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Assisted Dips-FFA', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Assisted Pull Up', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Assisted Pullups-Axiom', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Assisted Pullups-FFA', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Barbell Bicep Curl', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('Barbell Row', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Bench Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Cable Crossovers', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Cable Curls-FFA', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('Cable Flyes-FFA', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Cable Kickbacks', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Cable Lateral Raise', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Cable Row', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Calf Raises', 'calf'); INSERT INTO exercise_db(name, bpart) VALUES('Close Grip Bench Press', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Concentration Curl', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('DB Kickback', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('DB Rear Delt', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('DB Skullcrusher', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('DB Squat', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Dorsiflexor Machine Wide', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Dumbbell Bicep Curl', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('Dumbbell Flyes', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Dumbbell Lateral Raises', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Dumbbell Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Dumbbell Row', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('EZ Bar Curls', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('Face Pulls', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Face Pulls-FFA', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Flex Leverage Plate Loaded Chest Press-Axiom', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Front Squat', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Hack Squat', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Hammer Curl', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('Hammer Strength Iso-Lateral Flat Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Hammer Strength Leverage Machine High Row', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Hammer Strength Plate Loaded Iso-Lateral Incline Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Hyperextensions', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Incline Bench Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Incline Dumbbell Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Incline Hammer Curls', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('Incline Machine Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Inverted Row', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Iso-Lateral Low Row Machine', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Isolateral Row', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Leg Extensions', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Leg Extensions-FFA', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Leg Press', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Leg Press-FFA', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Leverage Machine High Row One-Arm', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('LF Chest Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Lunges', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Lying Leg Curls', 'ham'); INSERT INTO exercise_db(name, bpart) VALUES('Machine Bench Press', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Machine Lateral Raise', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Machine Shoulder Press', 'fdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Machine Shoulder Press-Axiom', 'fdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Machine Shoulder Press-FFA', 'fdelt'); INSERT INTO exercise_db(name, bpart) VALUES('One-Arm Dumbbell Preacher Curl', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('One-Arm Hammer Rows', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('One Arm Dumbbell Lateral Raise', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('One Arm Dumbbell Shoulder Press', 'fdelt'); INSERT INTO exercise_db(name, bpart) VALUES('One Arm Dumbbell Upright Row', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Overhead Tricep Extension', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Pec Deck-Axiom', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Preacher Curl Machine', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('Preacher Curls', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('Pull Up', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Pulldowns', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Pushdowns', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Reverse Pec Deck', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Romanian Deadlift', 'ham'); INSERT INTO exercise_db(name, bpart) VALUES('Seated Cable Row Wide', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Seated Calf Press-FFA', 'calf'); INSERT INTO exercise_db(name, bpart) VALUES('Seated Calf Raises', 'calf'); INSERT INTO exercise_db(name, bpart) VALUES('Seated Dip', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Seated Leg Curl', 'ham'); INSERT INTO exercise_db(name, bpart) VALUES('Seated Leg Curl-FFA', 'ham'); INSERT INTO exercise_db(name, bpart) VALUES('Seated Row Closegrip', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Shoulder Dumbbell Press', 'fdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Single Arm Dumbbel Preacher Curl', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Single Arm Machine Lateral Raise-FFA', 'rsdelt'); INSERT INTO exercise_db(name, bpart) VALUES('Single arm Overhead Tricep Extension', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Single Cable Tricep Pushdown', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Skullcrusher EZ', 'tricep'); INSERT INTO exercise_db(name, bpart) VALUES('Smith Bench', 'chest'); INSERT INTO exercise_db(name, bpart) VALUES('Smith Calf Raise', 'calf'); INSERT INTO exercise_db(name, bpart) VALUES('Smith Squat ATG', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Smith Squat ATG slow eccentric-FFA', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Split Squats', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Squat', 'quad'); INSERT INTO exercise_db(name, bpart) VALUES('Standing Calf Raise', 'calf'); INSERT INTO exercise_db(name, bpart) VALUES('Standing Calf Raise Machine-Axiom', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Stiff Legged Deadlifts', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Straight Bar Curls', 'bicep'); INSERT INTO exercise_db(name, bpart) VALUES('T-bar Row', 'back'); INSERT INTO exercise_db(name, bpart) VALUES('Upright Rows', 'fdelt');
DROP TABLE guestbook;
create or replace TRIGGER PREPARATION_COMGLOB INSTEAD OF UPDATE ON VIEW_COMMANDEGLOBALE REFERENCING OLD AS A NEW AS N FOR EACH ROW BEGIN if :n.comglobetat = 'en cours de préparation' then ETAT_PREPARATION(:n.comglobnum); end if; END;
create table orders ( id varchar(255) not null, operation int not null default 0, cost int not null default 0, userId int null, characterId int null, estateId int null, approvalState int not null default 0, adminNote varchar(1000) null, dateCreated datetime default now(), dateReviewed datetime null, primary key (id), foreign key (userId) references konta (id) on delete set null, foreign key (characterId) references postacie (id) on delete set null, foreign key (estateId) references nieruchomosci (id) on delete set null ); create table premium_files ( id varchar(255) NOT NULL, path varchar(255) NOT NULL, dateCreated datetime NOT NULL, orderId varchar(255) not null, userId int not null, fileType int not null default 0, inUse bit not null defaul 0, skinId int null, primary key (id), foreign key (orderId) references orders (id) on delete cascade ); show create table orders; show create table order_files;
Create Procedure mERP_sp_InsertRecdLPAbstract(@DocNumber nVarchar(30), @DocDate DateTime, @CompanyFrom nVarchar(30), @DocType nVarchar(30)) As Begin Insert into LP_RecdDocAbstract(CompanyID, DocumentID, DocumentDate, DocType) Values (@CompanyFrom, Cast(@DocNumber as int), @DocDate , @DocType) Select @@Identity End
-- +goose Up -- SQL in section 'Up' is executed when this migration is applied CREATE TABLE `gateway_device_status` ( `id` int(11) UNSIGNED NOT NULL COMMENT '管理用', `gateway_device_id` int(11) UNSIGNED NOT NULL COMMENT '機器管理のID', `battery` smallint(1) UNSIGNED DEFAULT NULL COMMENT 'バッテリー残量', `status` smallint(1) UNSIGNED NOT NULL COMMENT '機器の状態', `datetime` datetime NOT NULL COMMENT '観測日時', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '管理用', `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '管理用' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='機器の状態を管理するテーブル'; ALTER TABLE `gateway_device_status` ADD PRIMARY KEY (`id`), ADD KEY `network_device_id` (`gateway_device_id`), MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '管理用'; -- +goose Down -- SQL section 'Down' is executed when this migration is rolled back DROP TABLE gateway_device_status;
/* Name: Home Hero Impressions test Data source: 4 Created By: Admin Last Update At: 2016-04-08T17:28:53.593819+00:00 */ SELECT nvl(H_Lis.marketingGroup_name,"--") AS Marketing_Group, nvl(H_Lis.marketingGroup_id,"--") AS Marketing_Group_id, nvl(H_Lis.brokerage_name,"--") AS Brokerage, nvl(H_Lis.brokerage_id,"--") AS Brokerage_id, nvl(H_Lis.branch_name,"--") AS Branch, nvl(H_Lis.branch_id,"--") AS Branch_id, nvl(H_Lis.agent_name,"--") AS Agent, nvl(H_Lis.agent_id,"--") AS Agent_id, nvl(H_Lis.Listing_id,"--") as Listing_id, nvl(H_Lis.listing_address,H_Lis_address.street_address) AS Listing_address,v.post_prop1 as post_prop1, count(*) AS Impressions FROM (SELECT post_prop34,post_prop1, FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal, " month(TIMESTAMP(CONCAT(REPLACE(table_id,"_","-"),"-01"))) >= month(DATE('{{startdate}}')) and month(TIMESTAMP(CONCAT(REPLACE(table_id,"_","-"),"-01"))) <= month(DATE('{{enddate}}')) ")) WHERE DATE(date_time) >= DATE('{{startdate}}') AND DATE(date_time) <= DATE('{{enddate}}') AND date(date_time) > date('2016-02-02') AND post_prop33 = 'MG_HomeHero_Impressions') v LEFT OUTER JOIN [djomniture:devspark.MG_Hierarchy_Listing] AS H_Lis ON H_Lis.listing_id = v.post_prop34 LEFT OUTER JOIN [djomniture:devspark.MG_Listing_Address] AS H_Lis_address ON H_Lis.listing_id = H_Lis_address.id GROUP BY Marketing_Group, Marketing_Group_id, Brokerage, Brokerage_id, Branch, Branch_id, Agent, agent_id,Listing_id,Listing_address,post_prop1 ORDER BY Impressions DESC
-- query 15 INSERT INTO links_prematch.freq_firstname_sex_tmp( name_str , sex ) SELECT firstname2 , sex FROM links_cleaned.person_c WHERE firstname2 IS NOT NULL AND firstname2 <> 'null' AND firstname2 <> '' ;
CREATE TABLE FoodDataset( ID INTEGER NOT NULL PRIMARY KEY ,Name VARCHAR(174) NOT NULL ,Food_Group VARCHAR(23) ,Calories NUMERIC(6,3) NOT NULL ,Fat_g NUMERIC(6,3) NOT NULL ,Protein_g NUMERIC(5,2) NOT NULL ,Carbohydrate_g NUMERIC(5,2) NOT NULL ,Sugars_g NUMERIC(5,2) ,Fiber_g NUMERIC(4,1) ,Cholesterol_mg INTEGER ,Saturated_Fats_g NUMERIC(6,3) ,Calcium_mg INTEGER ,Iron_Fe_mg NUMERIC(5,2) ,Potassium_K_mg INTEGER ,Magnesium_mg INTEGER ,Vitamin_A_IU_IU INTEGER ,Vitamin_A_RAE_mcg INTEGER ,Vitamin_C_mg NUMERIC(6,1) ,Vitamin_B12_mcg NUMERIC(5,2) ,Vitamin_D_mcg NUMERIC(4,1) ,Vitamin_E_AlphaTocopherol_mg NUMERIC(5,2) ,Added_Sugar_g VARCHAR(4) ,NetCarbs_g NUMERIC(5,2) NOT NULL ,Water_g NUMERIC(5,2) NOT NULL ,Omega_3s_mg INTEGER ,Omega_6s_mg INTEGER ,PRAL_score NUMERIC(8,3) ,Trans_Fatty_Acids_g NUMERIC(6,3) ,Soluble_Fiber_g VARCHAR(4) ,Insoluble_Fiber_g VARCHAR(4) ,Sucrose_g NUMERIC(5,2) ,Glucose_Dextrose_g NUMERIC(5,2) ,Fructose_g NUMERIC(5,2) ,Lactose_g NUMERIC(5,2) ,Maltose_g NUMERIC(5,2) ,Galactose_g NUMERIC(4,2) ,Starch_g NUMERIC(5,2) ,Total_sugar_alcohols_g VARCHAR(4) ,Phosphorus_P_mg INTEGER ,Sodium_mg INTEGER ,Zinc_Zn_mg NUMERIC(5,2) ,Copper_Cu_mg NUMERIC(6,3) ,Manganese_mg NUMERIC(6,3) ,Selenium_Se_mcg NUMERIC(5,1) ,Fluoride_F_mcg NUMERIC(5,1) ,Molybdenum_mcg VARCHAR(4) ,Chlorine_mg VARCHAR(4) ,Thiamin_B1_mg NUMERIC(6,3) ,Riboflavin_B2_mg NUMERIC(5,3) ,Niacin_B3_mg NUMERIC(6,3) ,Pantothenic_acid_B5_mg NUMERIC(6,3) ,Vitamin_B6_mg NUMERIC(5,3) ,Biotin_B7_mcg VARCHAR(4) ,Folate_B9_mcg INTEGER ,Folic_acid_mcg INTEGER ,Food_Folate_mcg INTEGER ,Folate_DFE_mcg INTEGER ,Choline_mg NUMERIC(6,1) ,Betaine_mg NUMERIC(5,1) ,Retinol_mcg INTEGER ,Carotene_beta_mcg INTEGER ,Carotene_alpha_mcg INTEGER ,Lycopene_mcg INTEGER ,Lutein_Zeaxanthin_mcg INTEGER ,Vitamin_D2_ergocalciferol_mcg NUMERIC(4,1) ,Vitamin_D3_cholecalciferol_mcg NUMERIC(4,1) ,Vitamin_D_IU_IU INTEGER ,Vitamin_K_mcg NUMERIC(6,1) ,Dihydrophylloquinone_mcg NUMERIC(5,1) ,Menaquinone4_mcg NUMERIC(4,1) ,Fatty_acids_total_monounsaturated_mg INTEGER ,Fatty_acids_total_polyunsaturated_mg INTEGER ,183_n3_ccc_ALA_mg INTEGER ,205_n3_EPA_mg INTEGER ,225_n3_DPA_mg INTEGER ,226_n3_DHA_mg INTEGER ,Tryptophan_mg INTEGER ,Threonine_mg INTEGER ,Isoleucine_mg INTEGER ,Leucine_mg INTEGER ,Lysine_mg INTEGER ,Methionine_mg INTEGER ,Cystine_mg INTEGER ,Phenylalanine_mg INTEGER ,Tyrosine_mg INTEGER ,Valine_mg INTEGER ,Arginine_mg INTEGER ,Histidine_mg INTEGER ,Alanine_mg INTEGER ,Aspartic_acid_mg INTEGER ,Glutamic_acid_mg INTEGER ,Glycine_mg INTEGER ,Proline_mg INTEGER ,Serine_mg INTEGER ,Hydroxyproline_mg INTEGER ,Alcohol_g NUMERIC(4,1) ,Caffeine_mg INTEGER ,Theobromine_mg INTEGER ,Serving_Weight_1_g NUMERIC(5,1) ,Serving_Description_1_g VARCHAR(98) ,Serving_Weight_2_g NUMERIC(5,1) ,Serving_Description_2_g VARCHAR(114) ,Serving_Weight_3_g NUMERIC(5,1) ,Serving_Description_3_g VARCHAR(98) ,Serving_Weight_4_g NUMERIC(5,1) ,Serving_Description_4_g VARCHAR(74) ,Serving_Weight_5_g NUMERIC(5,1) ,Serving_Description_5_g VARCHAR(88) ,Serving_Weight_6_g NUMERIC(5,1) ,Serving_Description_6_g VARCHAR(87) ,Serving_Weight_7_g NUMERIC(5,1) ,Serving_Description_7_g VARCHAR(79) ,Serving_Weight_8_g NUMERIC(5,1) ,Serving_Description_8_g VARCHAR(71) ,Serving_Weight_9_g NUMERIC(6,2) ,Serving_Description_9_g VARCHAR(88) ,200_Calorie_Weight_g NUMERIC(8,3) );
INSERT INTO task (priority, notice, finished) VALUES ('VAZNO', 'podici pasos u petak', 0), ('VAZNO', 'zvati advokata u ponedeljak', 1), ('NAPOMENA', 'kontaktirati adama u vezi posla', 0), ('PODSETNIK', 'registracija u sredu', 0), ('NAPOMENA', 'zubar, sto pre', 0), ('PODSETNIK', 'kupovina u subotu', 1), ('VAZNO', 'otici do banke po karticu', 0);
DROP TABLE IF EXISTS sh_admin; CREATE table sh_admin ( id int IDENTITY(1,1) PRIMARY KEY, first_name varchar(20) NOT NULL, last_name varchar(30) , pwd varchar(30) NOT NULL )
INSERT INTO `super_rent`.`user` VALUES ('clerk', 'clerk', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('clerk2', 'clerk2', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('clerk3', 'clerk3', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('clerk4', 'clerk4', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('clerk5', 'clerk5', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('clerk6', 'clerk6', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('clerk7', 'clerk7', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('clerk8', 'clerk8', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('clubmember', 'clubmember', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember10', 'clubmember10', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember11', 'clubmember11', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember12', 'clubmember12', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember13', 'clubmember13', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember14', 'clubmember14', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember15', 'clubmember15', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember16', 'clubmember16', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember2', 'clubmember2', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember3', 'clubmember3', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember4', 'clubmember4', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember5', 'clubmember5', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember6', 'clubmember6', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember7', 'clubmember7', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember8', 'clubmember8', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('clubmember9', 'clubmember9', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('customer', 'customer', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('customer2', 'customer2', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('customer3', 'customer3', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('customer4', 'customer4', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('customer5', 'customer5', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('customer6', 'customer6', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('jakezhang', 'jakezhang', 'CUSTOMER'); INSERT INTO `super_rent`.`user` VALUES ('manager', 'manager', 'STAFF'); INSERT INTO `super_rent`.`user` VALUES ('manager2', 'manager2', 'STAFF');
CREATE TABLE [Portfolio].[PortfolioDetails] ( [PortfolioID] INT NOT NULL IDENTITY, [UserID] UNIQUEIDENTIFIER NOT NULL, [PortfolioName] NVARCHAR(50) NOT NULL, [PortfolioCurrencyID] INT NOT NULL, [IsMarginLoan] BIT NOT NULL DEFAULT 0, [MarginLoanLimit] MONEY NULL, [MarginLoanInterestRate] DECIMAL NULL, [StopLossPercentage] DECIMAL NULL, [LVRLimit] DECIMAL NULL, CONSTRAINT [FK_PortfolioDetails_User] FOREIGN KEY ([UserID]) REFERENCES [Control].[Users]([UserID]), CONSTRAINT [PK_PortfolioDetails] PRIMARY KEY ([PortfolioID]) );
/* 6. ¿Qué consulta harías para obtener todos los actores que se unieron en el film_id = 369? Su consulta debe devolver film_id, title, actor_id y actor_name. */ SELECT film.film_id, film.title, actor.actor_id, actor.first_name, actor.last_name FROM film JOIN film_actor ON film.film_id = film_actor.film_id JOIN actor ON film_actor.actor_id = actor.actor_id WHERE film.film_id = 369
-- al detectar que se tiene al menos 3 idiomas, agregar un aumento de sueldo CREATE OR REPLACE TRIGGER t_idioma_incremento_sueldo BEFORE INSERT ON guia_idioma FOR EACH ROW DECLARE idioma_count NUMBER ; BEGIN SELECT count(*) INTO idioma_count FROM guia g JOIN guia_idioma gi ON g.persona_id = gi.guia_id WHERE persona_id = :new.guia_id; IF idioma_count = 2 THEN UPDATE guia SET aumento_porcentaje = aumento_porcentaje + 0.1 WHERE persona_id = :new.guia_id; END IF; END; /
-- Assignment 7: SELECT SQL Statements -- Benjamin Rubin 2406404158 -- ID: benjamfr -- DVD -- 4 SELECT dvd_titles.title, dvd_titles.award, genres.genre, labels.label, ratings.rating FROM dvd_titles JOIN genres ON dvd_titles.genre_id = genres.genre_id JOIN labels ON dvd_titles.label_id = labels.label_id JOIN ratings ON dvd_titles.rating_id = ratings.rating_id WHERE dvd_titles.award IS NOT NULL AND dvd_titles.genre_id = 9 ORDER BY dvd_titles.award; -- 5 SELECT dvd_titles.title, sounds.sound, labels.label, genres.genre, ratings.rating FROM dvd_titles JOIN sounds ON dvd_titles.sound_id = sounds.sound_id JOIN labels ON dvd_titles.label_id = labels.label_id JOIN genres ON dvd_titles.genre_id = genres.genre_id JOIN ratings ON dvd_titles.rating_id = ratings.rating_id WHERE labels.label = 'Universal' AND sounds.sound = 'DTS' ORDER BY dvd_titles.title; -- 6 SELECT dvd_titles.title, dvd_titles.release_date, ratings.rating, genres.genre, sounds.sound, labels.label FROM dvd_titles JOIN ratings ON dvd_titles.rating_id = ratings.rating_id JOIN sounds ON dvd_titles.sound_id = sounds.sound_id JOIN labels ON dvd_titles.label_id = labels.label_id JOIN genres ON dvd_titles.genre_id = genres.genre_id WHERE genres.genre = 'Sci-Fi' AND ratings.rating = 'R' ORDER BY dvd_titles.release_date DESC;
-- -- PostgreSQL database dump -- -- Dumped from database version 9.6.3 -- Dumped by pg_dump version 9.6.3 -- -- Name: course; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE course ( id integer NOT NULL, credits numeric(4,1) NOT NULL, hours integer NOT NULL, hours_per_credit integer NOT NULL, semester integer NOT NULL, course_name_id integer, kc_id integer ); -- -- Name: course_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE course_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: course_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE course_id_seq OWNED BY course.id; -- -- Name: course_name; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE course_name ( id integer NOT NULL, name character varying(100) NOT NULL, name_eng character varying(100), abbreviation character varying(15) ); -- -- Name: course_name_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE course_name_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: course_name_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE course_name_id_seq OWNED BY course_name.id; -- -- Name: courses_for_groups; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE courses_for_groups ( id integer NOT NULL, exam_date date, course_id integer NOT NULL, student_group_id integer NOT NULL, teacher_id integer ); -- -- Name: courses_for_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE courses_for_groups_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: courses_for_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE courses_for_groups_id_seq OWNED BY courses_for_groups.id; -- -- Name: current_year; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE current_year ( id integer NOT NULL, curr_year integer ); -- -- Name: current_year_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE current_year_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: current_year_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE current_year_id_seq OWNED BY current_year.id; -- -- Name: degree; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE degree ( id integer NOT NULL, name character varying(100) NOT NULL, name_eng character varying(100), admission_requirements character varying(255), admission_requirements_eng character varying(255), further_study_access character varying(255), further_study_access_eng character varying(255), professional_status character varying(255), professional_status_eng character varying(255), qualification_level_descr character varying(255), qualification_level_descr_eng character varying(255) ); -- -- Name: degree_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE degree_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: degree_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE degree_id_seq OWNED BY degree.id; -- -- Name: department; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE department ( id integer NOT NULL, name character varying(100) NOT NULL, active boolean NOT NULL, abbr character varying(20) NOT NULL, faculty_id integer NOT NULL ); -- -- Name: department_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE department_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: department_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE department_id_seq OWNED BY department.id; -- -- Name: faculty; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE faculty ( id integer NOT NULL, name character varying(100) NOT NULL, name_eng character varying(100), active boolean NOT NULL, abbr character varying(20) NOT NULL, dean character varying(70) ); -- -- Name: faculty_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE faculty_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: faculty_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE faculty_id_seq OWNED BY faculty.id; -- -- Name: grade; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE grade ( id integer NOT NULL, ects character varying(2), grade integer, points integer, course_id integer NOT NULL, student_degree_id integer NOT NULL ); -- -- Name: grade_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE grade_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: grade_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE grade_id_seq OWNED BY grade.id; -- -- Name: knowledge_control; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE knowledge_control ( id integer NOT NULL, name character varying(100) NOT NULL, name_eng character varying(100), graded boolean NOT NULL ); -- -- Name: knowledge_control_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE knowledge_control_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: knowledge_control_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE knowledge_control_id_seq OWNED BY knowledge_control.id; -- -- Name: order_reason; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE order_reason ( id integer NOT NULL, name character varying(100) NOT NULL, active boolean NOT NULL, kind character varying(25) NOT NULL ); -- -- Name: order_reason_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE order_reason_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: order_reason_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE order_reason_id_seq OWNED BY order_reason.id; -- -- Name: position; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE "position" ( id integer NOT NULL, name character varying(100) NOT NULL ); -- -- Name: position_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE position_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: position_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE position_id_seq OWNED BY "position".id; -- -- Name: privilege; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE privilege ( id integer NOT NULL, name character varying(100) NOT NULL, active boolean NOT NULL ); -- -- Name: privilege_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE privilege_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: privilege_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE privilege_id_seq OWNED BY privilege.id; -- -- Name: renewed_academic_vacation_student; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE renewed_academic_vacation_student ( id integer NOT NULL, application_date date NOT NULL, payment character varying(8) DEFAULT 'BUDGET'::character varying NOT NULL, renew_date date, study_year integer NOT NULL, student_academic_vacation_id integer NOT NULL, student_group_id integer NOT NULL ); -- -- Name: renewed_academic_vacation_student_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE renewed_academic_vacation_student_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: renewed_academic_vacation_student_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE renewed_academic_vacation_student_id_seq OWNED BY renewed_academic_vacation_student.id; -- -- Name: renewed_expelled_student; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE renewed_expelled_student ( id integer NOT NULL, academic_certificate_date date NOT NULL, academic_certificate_issued_by character varying(255) NOT NULL, academic_certificate_number character varying(255) NOT NULL, application_date date NOT NULL, payment character varying(8) DEFAULT 'BUDGET'::character varying NOT NULL, renew_date date, study_year integer NOT NULL, student_expel_id integer NOT NULL, student_group_id integer NOT NULL ); -- -- Name: renewed_expelled_student_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE renewed_expelled_student_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: renewed_expelled_student_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE renewed_expelled_student_id_seq OWNED BY renewed_expelled_student.id; -- -- Name: speciality; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE speciality ( id integer NOT NULL, name character varying(100) NOT NULL, name_eng character varying(100), active boolean NOT NULL, code character varying(20) NOT NULL, field_of_study character varying(150), field_of_study_eng character varying(150) ); -- -- Name: speciality_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE speciality_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: speciality_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE speciality_id_seq OWNED BY speciality.id; -- -- Name: specialization; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE specialization ( id integer NOT NULL, name character varying(100) NOT NULL, name_eng character varying(100), active boolean NOT NULL, applying_knowledge_and_understanding_outcomes character varying(1200), applying_knowledge_and_understanding_outcomes_eng character varying(1200), program_head_info character varying(255) NOT NULL, program_head_info_eng character varying(255) NOT NULL, program_head_name character varying(255) NOT NULL, program_head_name_eng character varying(255) NOT NULL, knowledge_and_understanding_outcomes character varying(1200), knowledge_and_understanding_outcomes_eng character varying(1200), making_judgements_outcomes character varying(1200), making_judgements_outcomes_eng character varying(1200), payment_extramural numeric(15,2), payment_fulltime numeric(15,2), qualification character varying(100), qualification_eng character varying(100), degree_id integer NOT NULL, department_id integer, faculty_id integer NOT NULL, speciality_id integer NOT NULL ); -- -- Name: specialization_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE specialization_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: specialization_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE specialization_id_seq OWNED BY specialization.id; -- -- Name: student; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE student ( id integer NOT NULL, name character varying(20) NOT NULL, patronimic character varying(20), sex character varying(6) DEFAULT 'MALE'::character varying NOT NULL, surname character varying(20) NOT NULL, actual_address character varying(100), birth_date date, email character varying(30), father_info character varying(70), father_name character varying(40), father_phone character varying(20), mother_info character varying(70), mother_name character varying(40), mother_phone character varying(20), name_eng character varying(20), notes character varying(150), patronimic_eng character varying(20), photo bytea, registration_address character varying(100), school character varying(100), surname_eng character varying(20), telephone character varying(30), privilege_id integer ); -- -- Name: student_academic_vacation; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE student_academic_vacation ( id integer NOT NULL, application_date date NOT NULL, extra_information character varying(255), order_date date NOT NULL, order_number character varying(15) NOT NULL, study_year integer NOT NULL, vacation_end_date date NOT NULL, vacation_start_date date NOT NULL, order_reason_id integer NOT NULL, student_degree_id integer NOT NULL, student_group_id integer NOT NULL ); -- -- Name: student_academic_vacation_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE student_academic_vacation_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: student_academic_vacation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE student_academic_vacation_id_seq OWNED BY student_academic_vacation.id; -- -- Name: student_degree; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE student_degree ( id integer NOT NULL, active boolean NOT NULL, admission_order_date date, admission_order_number character varying(15), contract_date date, contract_number character varying(15), diploma_date date, diploma_number character varying(15), payment character varying(8) DEFAULT 'BUDGET'::character varying NOT NULL, previous_diploma_date date, previous_diploma_number character varying(15), previous_diploma_type character varying(30) DEFAULT 'SECONDARY_SCHOOL_CERTIFICATE'::character varying NOT NULL, protocol_date date, protocol_number character varying(10), record_book_number character varying(15), student_card_number character varying(15), supplement_date date, supplement_number character varying(15), thesis_name character varying(150), thesis_name_eng character varying(150), degree_id integer NOT NULL, specialization_id integer NOT NULL, student_id integer NOT NULL, student_group_id integer ); -- -- Name: student_degree_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE student_degree_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: student_degree_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE student_degree_id_seq OWNED BY student_degree.id; -- -- Name: student_expel; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE student_expel ( id integer NOT NULL, application_date date NOT NULL, expel_date date NOT NULL, order_date date NOT NULL, order_number character varying(15) NOT NULL, payment character varying(8) DEFAULT 'BUDGET'::character varying NOT NULL, study_year integer NOT NULL, order_reason_id integer NOT NULL, student_degree_id integer NOT NULL, student_group_id integer NOT NULL ); -- -- Name: student_expel_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE student_expel_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: student_expel_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE student_expel_id_seq OWNED BY student_expel.id; -- -- Name: student_group; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE student_group ( id integer NOT NULL, name character varying(100) NOT NULL, active boolean NOT NULL, begin_years integer NOT NULL, creation_year integer NOT NULL, study_semesters integer NOT NULL, study_years numeric(19,2) NOT NULL, tuition_form character varying(10) DEFAULT 'FULL_TIME'::character varying NOT NULL, tuition_term character varying(10) DEFAULT 'REGULAR'::character varying NOT NULL, specialization_id integer NOT NULL ); -- -- Name: student_group_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE student_group_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: student_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE student_group_id_seq OWNED BY student_group.id; -- -- Name: student_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE student_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: student_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE student_id_seq OWNED BY student.id; -- -- Name: teacher; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE teacher ( id integer NOT NULL, name character varying(20) NOT NULL, patronimic character varying(20), sex character varying(6) DEFAULT 'MALE'::character varying NOT NULL, surname character varying(20) NOT NULL, active boolean NOT NULL, scientific_degree character varying(255), department_id integer NOT NULL, position_id integer NOT NULL ); -- -- Name: teacher_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE teacher_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: teacher_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE teacher_id_seq OWNED BY teacher.id; -- -- Name: course id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY course ALTER COLUMN id SET DEFAULT nextval('course_id_seq'::regclass); -- -- Name: course_name id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY course_name ALTER COLUMN id SET DEFAULT nextval('course_name_id_seq'::regclass); -- -- Name: courses_for_groups id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY courses_for_groups ALTER COLUMN id SET DEFAULT nextval('courses_for_groups_id_seq'::regclass); -- -- Name: current_year id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY current_year ALTER COLUMN id SET DEFAULT nextval('current_year_id_seq'::regclass); -- -- Name: degree id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY degree ALTER COLUMN id SET DEFAULT nextval('degree_id_seq'::regclass); -- -- Name: department id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY department ALTER COLUMN id SET DEFAULT nextval('department_id_seq'::regclass); -- -- Name: faculty id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY faculty ALTER COLUMN id SET DEFAULT nextval('faculty_id_seq'::regclass); -- -- Name: grade id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY grade ALTER COLUMN id SET DEFAULT nextval('grade_id_seq'::regclass); -- -- Name: knowledge_control id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY knowledge_control ALTER COLUMN id SET DEFAULT nextval('knowledge_control_id_seq'::regclass); -- -- Name: order_reason id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY order_reason ALTER COLUMN id SET DEFAULT nextval('order_reason_id_seq'::regclass); -- -- Name: position id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY "position" ALTER COLUMN id SET DEFAULT nextval('position_id_seq'::regclass); -- -- Name: privilege id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY privilege ALTER COLUMN id SET DEFAULT nextval('privilege_id_seq'::regclass); -- -- Name: renewed_academic_vacation_student id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY renewed_academic_vacation_student ALTER COLUMN id SET DEFAULT nextval('renewed_academic_vacation_student_id_seq'::regclass); -- -- Name: renewed_expelled_student id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY renewed_expelled_student ALTER COLUMN id SET DEFAULT nextval('renewed_expelled_student_id_seq'::regclass); -- -- Name: speciality id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY speciality ALTER COLUMN id SET DEFAULT nextval('speciality_id_seq'::regclass); -- -- Name: specialization id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY specialization ALTER COLUMN id SET DEFAULT nextval('specialization_id_seq'::regclass); -- -- Name: student id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student ALTER COLUMN id SET DEFAULT nextval('student_id_seq'::regclass); -- -- Name: student_academic_vacation id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_academic_vacation ALTER COLUMN id SET DEFAULT nextval('student_academic_vacation_id_seq'::regclass); -- -- Name: student_degree id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_degree ALTER COLUMN id SET DEFAULT nextval('student_degree_id_seq'::regclass); -- -- Name: student_expel id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_expel ALTER COLUMN id SET DEFAULT nextval('student_expel_id_seq'::regclass); -- -- Name: student_group id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_group ALTER COLUMN id SET DEFAULT nextval('student_group_id_seq'::regclass); -- -- Name: teacher id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY teacher ALTER COLUMN id SET DEFAULT nextval('teacher_id_seq'::regclass); -- -- Name: course_name course_name_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY course_name ADD CONSTRAINT course_name_pkey PRIMARY KEY (id); -- -- Name: course course_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY course ADD CONSTRAINT course_pkey PRIMARY KEY (id); -- -- Name: courses_for_groups courses_for_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY courses_for_groups ADD CONSTRAINT courses_for_groups_pkey PRIMARY KEY (id); -- -- Name: current_year current_year_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY current_year ADD CONSTRAINT current_year_pkey PRIMARY KEY (id); -- -- Name: degree degree_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY degree ADD CONSTRAINT degree_pkey PRIMARY KEY (id); -- -- Name: department department_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY department ADD CONSTRAINT department_pkey PRIMARY KEY (id); -- -- Name: faculty faculty_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY faculty ADD CONSTRAINT faculty_pkey PRIMARY KEY (id); -- -- Name: grade grade_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY grade ADD CONSTRAINT grade_pkey PRIMARY KEY (id); -- -- Name: knowledge_control knowledge_control_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY knowledge_control ADD CONSTRAINT knowledge_control_pkey PRIMARY KEY (id); -- -- Name: order_reason order_reason_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY order_reason ADD CONSTRAINT order_reason_pkey PRIMARY KEY (id); -- -- Name: position position_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY "position" ADD CONSTRAINT position_pkey PRIMARY KEY (id); -- -- Name: privilege privilege_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY privilege ADD CONSTRAINT privilege_pkey PRIMARY KEY (id); -- -- Name: renewed_academic_vacation_student renewed_academic_vacation_student_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY renewed_academic_vacation_student ADD CONSTRAINT renewed_academic_vacation_student_pkey PRIMARY KEY (id); -- -- Name: renewed_expelled_student renewed_expelled_student_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY renewed_expelled_student ADD CONSTRAINT renewed_expelled_student_pkey PRIMARY KEY (id); -- -- Name: speciality speciality_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY speciality ADD CONSTRAINT speciality_pkey PRIMARY KEY (id); -- -- Name: specialization specialization_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY specialization ADD CONSTRAINT specialization_pkey PRIMARY KEY (id); -- -- Name: student_academic_vacation student_academic_vacation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_academic_vacation ADD CONSTRAINT student_academic_vacation_pkey PRIMARY KEY (id); -- -- Name: student_degree student_degree_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_degree ADD CONSTRAINT student_degree_pkey PRIMARY KEY (id); -- -- Name: student_expel student_expel_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_expel ADD CONSTRAINT student_expel_pkey PRIMARY KEY (id); -- -- Name: student_group student_group_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_group ADD CONSTRAINT student_group_pkey PRIMARY KEY (id); -- -- Name: student student_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student ADD CONSTRAINT student_pkey PRIMARY KEY (id); -- -- Name: teacher teacher_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY teacher ADD CONSTRAINT teacher_pkey PRIMARY KEY (id); -- -- Name: courses_for_groups uk19sieop4l7esqbqmc6ictdvph; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY courses_for_groups ADD CONSTRAINT uk19sieop4l7esqbqmc6ictdvph UNIQUE (course_id, student_group_id); -- -- Name: order_reason uk1otnvcettwbi4id43dh8d5sis; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY order_reason ADD CONSTRAINT uk1otnvcettwbi4id43dh8d5sis UNIQUE (name); -- -- Name: faculty uk7vcysepqmv2k09mdfa18gj8qw; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY faculty ADD CONSTRAINT uk7vcysepqmv2k09mdfa18gj8qw UNIQUE (name); -- -- Name: faculty uk_757mlj4kyjn7mpb0fb67owj00; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY faculty ADD CONSTRAINT uk_757mlj4kyjn7mpb0fb67owj00 UNIQUE (abbr); -- -- Name: speciality uk_f7cgfesjcj3ygekov90nlvnaa; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY speciality ADD CONSTRAINT uk_f7cgfesjcj3ygekov90nlvnaa UNIQUE (code); -- -- Name: department ukbiw7tevwc07g3iutlbmkes0cm; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY department ADD CONSTRAINT ukbiw7tevwc07g3iutlbmkes0cm UNIQUE (name); -- -- Name: degree ukby27bbt64p1ria17hy3khpyft; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY degree ADD CONSTRAINT ukby27bbt64p1ria17hy3khpyft UNIQUE (name); -- -- Name: position ukhct1althd622w7vj7630fvoh3; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY "position" ADD CONSTRAINT ukhct1althd622w7vj7630fvoh3 UNIQUE (name); -- -- Name: course_name ukmcev2xfgvg6v572t3h91d7gap; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY course_name ADD CONSTRAINT ukmcev2xfgvg6v572t3h91d7gap UNIQUE (name); -- -- Name: knowledge_control uksvc0hwsgvfil1om8pvh41ay2c; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY knowledge_control ADD CONSTRAINT uksvc0hwsgvfil1om8pvh41ay2c UNIQUE (name); -- -- Name: grade ukt7cwyqn470e4ll4g11g1dib1p; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY grade ADD CONSTRAINT ukt7cwyqn470e4ll4g11g1dib1p UNIQUE (course_id, student_degree_id); -- -- Name: privilege uktcjtkyhbxekm2p1hsv6ju9bju; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY privilege ADD CONSTRAINT uktcjtkyhbxekm2p1hsv6ju9bju UNIQUE (name); -- -- Name: student_academic_vacation fk1aj9uc687ivslkx3tspud1n9y; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_academic_vacation ADD CONSTRAINT fk1aj9uc687ivslkx3tspud1n9y FOREIGN KEY (order_reason_id) REFERENCES order_reason(id); -- -- Name: courses_for_groups fk1t8vjy9y1j7cf7s5dorx1t1it; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY courses_for_groups ADD CONSTRAINT fk1t8vjy9y1j7cf7s5dorx1t1it FOREIGN KEY (teacher_id) REFERENCES teacher(id); -- -- Name: course fk2wuyv2xldcdi3x9srcaicq89g; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY course ADD CONSTRAINT fk2wuyv2xldcdi3x9srcaicq89g FOREIGN KEY (kc_id) REFERENCES knowledge_control(id); -- -- Name: teacher fk3ebf13bw5jxpbch977xtuxrax; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY teacher ADD CONSTRAINT fk3ebf13bw5jxpbch977xtuxrax FOREIGN KEY (position_id) REFERENCES "position"(id); -- -- Name: courses_for_groups fk3icq8kpwq3vo1hko4sntb0hin; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY courses_for_groups ADD CONSTRAINT fk3icq8kpwq3vo1hko4sntb0hin FOREIGN KEY (course_id) REFERENCES course(id); -- -- Name: department fk41ox44lg0tyunaxq4y8oyuq8m; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY department ADD CONSTRAINT fk41ox44lg0tyunaxq4y8oyuq8m FOREIGN KEY (faculty_id) REFERENCES faculty(id); -- -- Name: student_expel fk538kl40vl5ec58jmf1txkmity; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_expel ADD CONSTRAINT fk538kl40vl5ec58jmf1txkmity FOREIGN KEY (student_degree_id) REFERENCES student_degree(id); -- -- Name: grade fk5s1gpik3vodxr5cyqkyn6mkek; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY grade ADD CONSTRAINT fk5s1gpik3vodxr5cyqkyn6mkek FOREIGN KEY (student_degree_id) REFERENCES student_degree(id); -- -- Name: grade fk7e8ca7hfmrpruicqhocskjlf2; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY grade ADD CONSTRAINT fk7e8ca7hfmrpruicqhocskjlf2 FOREIGN KEY (course_id) REFERENCES course(id); -- -- Name: renewed_expelled_student fk8i4ftbqmtllto4rwrehaltsdx; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY renewed_expelled_student ADD CONSTRAINT fk8i4ftbqmtllto4rwrehaltsdx FOREIGN KEY (student_group_id) REFERENCES student_group(id); -- -- Name: student_degree fk9st6a1j5cw6s3xkakvnavyi99; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_degree ADD CONSTRAINT fk9st6a1j5cw6s3xkakvnavyi99 FOREIGN KEY (degree_id) REFERENCES degree(id); -- -- Name: course fkcurovqow7p3irfphx9ucpx5lr; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY course ADD CONSTRAINT fkcurovqow7p3irfphx9ucpx5lr FOREIGN KEY (course_name_id) REFERENCES course_name(id); -- -- Name: student_academic_vacation fke3qe359u8kbkfaim28vw97758; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_academic_vacation ADD CONSTRAINT fke3qe359u8kbkfaim28vw97758 FOREIGN KEY (student_degree_id) REFERENCES student_degree(id); -- -- Name: student_academic_vacation fke6j5q4pv8onchxlkq2m7282ey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_academic_vacation ADD CONSTRAINT fke6j5q4pv8onchxlkq2m7282ey FOREIGN KEY (student_group_id) REFERENCES student_group(id); -- -- Name: student_expel fkfkdbusap38npuwhdye6pg99hy; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_expel ADD CONSTRAINT fkfkdbusap38npuwhdye6pg99hy FOREIGN KEY (student_group_id) REFERENCES student_group(id); -- -- Name: student_degree fkgy7f1su2qykfrx8b3snqlssek; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_degree ADD CONSTRAINT fkgy7f1su2qykfrx8b3snqlssek FOREIGN KEY (student_group_id) REFERENCES student_group(id); -- -- Name: student_degree fkj1llwoe8g31ishojdh9xv44t8; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_degree ADD CONSTRAINT fkj1llwoe8g31ishojdh9xv44t8 FOREIGN KEY (specialization_id) REFERENCES specialization(id); -- -- Name: specialization fkjbku080fy3i9fbr82lccuit2h; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY specialization ADD CONSTRAINT fkjbku080fy3i9fbr82lccuit2h FOREIGN KEY (speciality_id) REFERENCES speciality(id); -- -- Name: teacher fkjdcmjbru2mdniqr8rk6phwx6e; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY teacher ADD CONSTRAINT fkjdcmjbru2mdniqr8rk6phwx6e FOREIGN KEY (department_id) REFERENCES department(id); -- -- Name: specialization fkjk07jlkbyg2dnhqlhd6udqyld; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY specialization ADD CONSTRAINT fkjk07jlkbyg2dnhqlhd6udqyld FOREIGN KEY (faculty_id) REFERENCES faculty(id); -- -- Name: student_expel fkjn4uf1ps2my5e9poueo8rvook; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_expel ADD CONSTRAINT fkjn4uf1ps2my5e9poueo8rvook FOREIGN KEY (order_reason_id) REFERENCES order_reason(id); -- -- Name: specialization fkjnv6iiajjgw8x2e55shgj5y8h; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY specialization ADD CONSTRAINT fkjnv6iiajjgw8x2e55shgj5y8h FOREIGN KEY (degree_id) REFERENCES degree(id); -- -- Name: student_degree fkl2otuowdej7vkvfxbi2tq5jgd; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_degree ADD CONSTRAINT fkl2otuowdej7vkvfxbi2tq5jgd FOREIGN KEY (student_id) REFERENCES student(id); -- -- Name: student fkndn9m434jroav4tpm0tvo0vkk; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student ADD CONSTRAINT fkndn9m434jroav4tpm0tvo0vkk FOREIGN KEY (privilege_id) REFERENCES privilege(id); -- -- Name: renewed_academic_vacation_student fknld8adwhu2yp51sdf3tk8j92f; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY renewed_academic_vacation_student ADD CONSTRAINT fknld8adwhu2yp51sdf3tk8j92f FOREIGN KEY (student_group_id) REFERENCES student_group(id); -- -- Name: specialization fkq2c76cyld8gltdkxod8fosvub; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY specialization ADD CONSTRAINT fkq2c76cyld8gltdkxod8fosvub FOREIGN KEY (department_id) REFERENCES department(id); -- -- Name: renewed_academic_vacation_student fkq630ubwk4twmf2y6rh0kui1n8; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY renewed_academic_vacation_student ADD CONSTRAINT fkq630ubwk4twmf2y6rh0kui1n8 FOREIGN KEY (student_academic_vacation_id) REFERENCES student_academic_vacation(id); -- -- Name: student_group fkro5caukwd9ufot4qqkdqcbhx6; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY student_group ADD CONSTRAINT fkro5caukwd9ufot4qqkdqcbhx6 FOREIGN KEY (specialization_id) REFERENCES specialization(id); -- -- Name: courses_for_groups fkrwsolvxclmfpwhunt70mrlq7s; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY courses_for_groups ADD CONSTRAINT fkrwsolvxclmfpwhunt70mrlq7s FOREIGN KEY (student_group_id) REFERENCES student_group(id); -- -- Name: renewed_expelled_student fksc5pauvj5kxci1w5o4ymvpsa5; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY renewed_expelled_student ADD CONSTRAINT fksc5pauvj5kxci1w5o4ymvpsa5 FOREIGN KEY (student_expel_id) REFERENCES student_expel(id); -- -- PostgreSQL database dump complete --
create database if not exists library; use library; create table if not exists book( id int not null auto_increment primary key, title varchar(120) not null, description text, publication_date date not null default '2018-01-01', category varchar(30) not null, isbn varchar(20) not null unique, qty_pages smallint unsigned not null, author_name varchar(45) not null, author_surname varchar(45) not null, author_email varchar(50) not null unique, author_age tinyint unsigned not null, author_birthdate date not null, author_awards varchar(120) ); insert into book (title, description, publication_date, category, isbn, qty_pages, author_name, author_surname, author_email, author_age, author_birthdate, author_awards) values ('In Search of Lost Time', 'Swanns Way, the first part of A la recherche de temps perdu, Marcel Prousts seven-part cycle. In it, Proust introduces the themes that run through the entire work. The narrator recalls his childhood, aided by the famous madeleine; and describes M. Swanns passion for Odette. The work is incomparable. Edmund Wilson said: Proust has supplied for the first time in literature an equivalent in the full scale for the new theory of modern physics.', '1913-05-12', 'novel', '0812969642', 4211, 'Marcel', 'Proust', 'prust@gmail.com', 51, '1871-07-10', null), ('Pride and Prejudice', 'It is a truth universally acknowledged that when most people think of Jane Austen they think of this charming and humorous story of love, difficult families and the tricky task of finding a handsome husband with a good fortune.', '1813-09-10', 'love story', '9780141439518', 480, 'Jane', 'Austen', 'austen@gmail.com', 41, '1775-12-16', null), ('One Hundred Years of Solitude', 'The multi-generational story of the Buendía family, whose patriarch, José Arcadio Buendía, founded the (fictitious) town of Macondo. The novel is often cited as one of the supreme achievements in literature.', '1967-02-02', 'opus', '0060883286', 417, 'Gabriel', 'García Márquez', 'marquez@gmail.com', 87, '1927-03-06', '1980 - Mexican Cinema Journalists; 1982 - Nobel Prize'), ('Crime and Punishment', 'This novel is a masterful and completely captivating depiction of a man experiencing a profound mental unravelling. No amount of ethical bargaining on Raskolnikov’s part can free him from the parasitic guilt nested in his soul. A brilliant read if you loved Breaking Bad.', '1866-07-01', 'novel', '9781784871970', 560, 'Fyodor', 'Dostoevsky', 'dostoevsky@gmail.com', 59, '1881-02-09', null), ('Ulysses', 'James Joyces masterpiece, Ulysses, tells of the diverse events which befall Leopold Bloom and Stephen Dedalus in Dublin on one day in June 1904. It is considered to be one of the most important works of modernist literature and was hailed as a work of genius by W. B. Yeats, T. S. Eliot and Ernest Hemingway. Scandalously frank, wittily erudite, mercurially eloquent, resourcefully comic and generously humane, Ulysses offers the reader a life-changing experience.', '1904-06-16', 'novel', '9781857151008', 1144, 'James', 'Joyce', 'joyce@gmail.com', 58, '1882-02-02', '1989 - USC Scripter Award'), ('The Lion, the Witch and the Wardrobe', 'Most of the novel is set in Narnia, a land of talking animals and mythical creatures that is ruled by the evil White Witch. In the frame story, four English children are relocated to a large, old country house following a wartime evacuation. The youngest, Lucy, visits Narnia three times via the magic of a wardrobe in a spare room. Lucys three siblings are with her on her third visit to Narnia. In Narnia, the siblings seem fit to fulfill an old prophecy and find themselves adventuring to save Narnia and their own lives. The lion Aslan gives his life to save one of the children; he later rises from the dead, vanquishes the White Witch, and crowns the children Kings and Queens of Narnia.', '1950-12-18', 'fantasy', '9780064404990', 208, 'Clive Staples', 'Lewis', 'lewis@gmail.com', 64, '1898-11-29', '2006 - Hugo Awards'), ('The Master and Margarita', 'This ribald, carnivalesque satire - featuring the Devil, true love and a gun-toting cat - was written in the darkest days of the Soviet Union and became an underground sensation.', '1966-03-08', 'novel', '9780241259320', 528, 'Mikhail', 'Bulgakov', 'bulgakov@gmail.com', 48, '1891-05-15', null), ('The Grapes of Wrath', 'Set during the Great Depression, the novel focuses on the Joads, a poor family of tenant farmers driven from their Oklahoma home by drought, economic hardship, agricultural industry changes, and bank foreclosures forcing tenant farmers out of work. Due to their nearly hopeless situation, and in part because they are trapped in the Dust Bowl, the Joads set out for California along with thousands of other "Okies" seeking jobs, land, dignity, and a future.', '1939-04-14', 'novel', '9780241980347', 544, 'John', 'Steinbeck', 'steinback@gmail.com', 66, '1902-02-27', '1945 - Academy Awards, USA; 1962 - Nobel Prize'), ('The Adventures of Huckleberry Finn', 'Meander down the Mississippi River with Huck Finn and Tom Sawyer; on the surface, it’s a simple adventure but dig a little deeper into Mark Twains novel and discover undercurrents of slavery, abuse and corruption.', '1884-10-15', 'adventure', '9780141199009', 336, 'Mark', 'Twain', 'twain@gmail.com', 74, '1835-11-30', null), ('One Flew Over the Cuckoos Nest', 'A psychiatric ward in Oregon is ruled by a tyrannical head nurse, but when a rebellious patient arrives her regime is thrown into disarray. A story of the imprisoned battling the establishment.', '1962-01-21', 'psychology thriller', '0451163966', 272, 'Ken', 'Kesey', 'kesey@gmail.com', 66, '1935-09-17', null); select * from book; select * from book where id = 5 or id = 10 or id = 13; select * from book where qty_pages > 150; select * from book where author_age > 30; select * from book where author_awards is null; select * from book where author_email = 'kesey@gmail.com'; select * from book where isbn = '9780064404990'; select * from book where category = 'novel'; select * from book where qty_pages > 200 and author_age > 25; select * from book where category = 'adventure' or category = 'fantasy'; select * from book order by title; select * from book order by author_email; select * from book order by qty_pages desc; select distinct category from book; select distinct author_name from book; select * from book where publication_date > '2000-01-01'; select * from book where publication_date < '2010-01-01';
INSERT INTO series (title, author_id, subgenre_id) VALUES ("Harry Potter", 1, 1), ("Lord of the Rings", 2, 1); INSERT INTO books (title, year, series_id) VALUES ("White Teeth", 2005, 1), ("White Teeth", 2005, 1), ("White Teeth", 2005, 1), ("White Teeth", 2005, 1), ("White Teeth", 2005, 1), ("White Teeth", 2005, 1); INSERT INTO characters (name, species, motto, series_id, author_id) VALUES ("name", "species", "motto", 1, 3), ("name", "species", "motto", 1, 3), ("name", "species", "motto", 1, 3), ("name", "species", "motto", 1, 3), ("name", "species", "motto", 1, 3), ("name", "species", "motto", 1, 3), ("name", "species", "motto", 1, 3), ("name", "species", "motto", 1, 3); INSERT INTO subgenres (name) VALUES ("hopeful dystopian"), ("disdainful romance"); INSERT INTO authors (name) VALUES ("Hart McFart"), ("Kerin Feral"); INSERT INTO character_books (book_id, character_id) VALUES (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10), (5, 10);
select * from perusers where username = $1
SET SQLBLANKLINES ON SET DEFINE OFF CREATE OR REPLACE VIEW RV_UNPROCESSED ( AD_CLIENT_ID, AD_ORG_ID, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISACTIVE, DOCUMENTNO, DATEDOC, DATEACCT, AD_TABLE_ID, RECORD_ID, ISSOTRX, POSTED, PROCESSING, PROCESSED, DOCSTATUS ) AS SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, DateDoc, DateAcct, 224 AS AD_Table_ID, GL_Journal_ID AS Record_ID, 'N' AS IsSOTrx, posted, processing, processed, docstatus FROM GL_JOURNAL WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION /*SELECT pi.AD_Client_ID, pi.AD_Org_ID, pi.Created, pi.CreatedBy, pi.Updated, pi.UpdatedBy, pi.IsActive, p.NAME || '_' || pi.Line, pi.MovementDate, pi.MovementDate, 623, pi.C_ProjectIssue_ID, 'N', posted, pi.processing, pi.processed, 'CO' AS DocStatus FROM C_PROJECTISSUE pi INNER JOIN C_PROJECT p ON (pi.C_Project_ID = p.C_Project_ID) WHERE Posted <> 'Y' --AND DocStatus<>'VO' UNION*/ SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, DateInvoiced, DateAcct, 318, C_Invoice_ID, IsSOTrx, posted, processing, processed, docstatus FROM C_INVOICE WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, MovementDate, DateAcct, 319, M_InOut_ID, IsSOTrx, posted, processing, processed, docstatus FROM M_INOUT WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, MovementDate, MovementDate, 321, M_Inventory_ID, 'N', posted, processing, processed, docstatus FROM M_INVENTORY WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, MovementDate, MovementDate, 323, M_Movement_ID, 'N', posted, processing, processed, docstatus FROM M_MOVEMENT WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION /*SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, NAME, MovementDate, MovementDate, 325, M_Production_ID, 'N', posted, processing, processed, 'CO' AS docstatus FROM M_PRODUCTION WHERE Posted <> 'Y' -- AND DocStatus<>'VO' UNION*/ SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, NAME, StatementDate, DateAcct, 407, C_Cash_ID, 'N', posted, processing, processed, docstatus FROM C_CASH WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, DateTrx, DateTrx, 335, C_Payment_ID, 'N', posted, processing, processed, docstatus FROM C_PAYMENT WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, DateTrx, DateTrx, 735, C_AllocationHdr_ID, 'N', posted, processing, processed, docstatus FROM C_ALLOCATIONHDR WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, NAME, StatementDate, StatementDate, 392, C_BankStatement_ID, 'N', posted, processing, processed, docstatus FROM C_BANKSTATEMENT WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION /*SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, DateTrx, DateTrx, 472, M_MatchInv_ID, 'N', posted, processing, processed, 'CO' AS docstatus FROM M_MATCHINV WHERE Posted <> 'Y' --AND DocStatus<>'VO' UNION*/ /*SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, DateTrx, DateTrx, 473, M_MatchPO_ID, 'N', posted, processing, processed, 'CO' AS docstatus FROM M_MATCHPO WHERE Posted <> 'Y' --AND DocStatus<>'VO' UNION*/ SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, DateOrdered, DateAcct, 259, C_Order_ID, IsSOTrx, posted, processing, processed, docstatus FROM C_ORDER WHERE DocStatus NOT IN ('CO','CL','VO','RE') UNION SELECT AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, IsActive, DocumentNo, DateRequired, DateRequired, 702, M_Requisition_ID, 'N', posted, processing, processed, docstatus FROM M_REQUISITION WHERE DocStatus NOT IN ('CO','CL','VO','RE'); -- Jul 24, 2009 12:44:54 PM COT -- 2815134-Window My Unprocessed Documents INSERT INTO AD_Window (AD_Client_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,IsBetaFunctionality,IsDefault,IsSOTrx,Name,Processing,Updated,UpdatedBy,WindowType) VALUES (0,0,53086,TO_DATE('2009-07-24 12:44:53','YYYY-MM-DD HH24:MI:SS'),100,'My UnProcessed Documents','D','View my unprocessed documents','Y','N','N','Y','My UnProcessed Documents','N',TO_DATE('2009-07-24 12:44:53','YYYY-MM-DD HH24:MI:SS'),100,'Q') ; INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Window_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=53086 AND EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Window_ID!=t.AD_Window_ID) ; INSERT INTO AD_Table (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsChangeLog,IsDeleteable,IsHighVolume,IsSecurityEnabled,IsView,Name,ReplicationType,TableName,Updated,UpdatedBy) VALUES ('3',0,0,53221,53086,TO_DATE('2009-07-24 12:44:54','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','N','Y','Not Processed','L','RV_Unprocessed',TO_DATE('2009-07-24 12:44:54','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=53221 AND EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Table_ID!=t.AD_Table_ID) ; INSERT INTO AD_Sequence (AD_Client_ID,AD_Org_ID,AD_Sequence_ID,Created,CreatedBy,CurrentNext,CurrentNextSys,Description,IncrementNo,IsActive,IsAudited,IsAutoSequence,IsTableID,Name,StartNewYear,StartNo,Updated,UpdatedBy) VALUES (0,0,53329,TO_DATE('2009-07-24 12:44:55','YYYY-MM-DD HH24:MI:SS'),100,1000000,50000,'Table RV_Unprocessed',1,'Y','N','Y','Y','RV_Unprocessed','N',1000000,TO_DATE('2009-07-24 12:44:55','YYYY-MM-DD HH24:MI:SS'),100) ; UPDATE AD_Element SET ColumnName='AD_Client_ID', Description='Client/Tenant for this installation.', EntityType='D', Help='A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.', IsActive='Y', Name='Client', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Client',Updated=TO_DATE('2009-07-24 12:44:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=102 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=102 ; UPDATE AD_Reference SET Description='Direct Table Access', EntityType='D', Help=NULL, IsActive='Y', Name='Table Direct', ValidationType='D',Updated=TO_DATE('2009-07-24 12:44:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=19 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=19 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57923,102,0,19,53221,'AD_Client_ID',TO_DATE('2009-07-24 12:44:57','YYYY-MM-DD HH24:MI:SS'),100,'Client/Tenant for this installation.','D',10,'A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','N','N','N','N','N','N','N','Y','N','N','Client',TO_DATE('2009-07-24 12:44:57','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57923 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='UpdatedBy', Description='User who updated this records', EntityType='D', Help='The Updated By field indicates the user who updated this record.', IsActive='Y', Name='Updated By', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Updated By',Updated=TO_DATE('2009-07-24 12:44:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=608 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=608 ; UPDATE AD_Reference SET Description='Table List', EntityType='D', Help=NULL, IsActive='Y', Name='Table', ValidationType='D',Updated=TO_DATE('2009-07-24 12:44:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=18 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=18 ; UPDATE AD_Reference SET Description='User selection', EntityType='D', Help=NULL, IsActive='Y', Name='AD_User', ValidationType='T',Updated=TO_DATE('2009-07-24 12:44:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=110 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=110 ; UPDATE AD_Ref_Table SET AD_Table_ID = 114, AD_Display = 213, AD_Key = 212, isValueDisplayed = 'N', OrderByClause = 'AD_User.Name', EntityType ='D', WhereClause = '' WHERE AD_Reference_ID = 110 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57924,608,0,18,110,53221,'UpdatedBy',TO_DATE('2009-07-24 12:44:59','YYYY-MM-DD HH24:MI:SS'),100,'User who updated this records','D',10,'The Updated By field indicates the user who updated this record.','Y','N','N','N','N','N','N','N','Y','N','N','Updated By',TO_DATE('2009-07-24 12:44:59','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57924 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='AD_Table_ID', Description='Database Table information', EntityType='D', Help='The Database Table provides the information of the table definition', IsActive='Y', Name='Table', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Table',Updated=TO_DATE('2009-07-24 12:45:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=126 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=126 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57925,126,0,19,53221,'AD_Table_ID',TO_DATE('2009-07-24 12:45:00','YYYY-MM-DD HH24:MI:SS'),100,'Database Table information','D',22,'The Database Table provides the information of the table definition','Y','N','N','N','N','N','N','N','Y','N','N','Table',TO_DATE('2009-07-24 12:45:00','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57925 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='Created', Description='Date this record was created', EntityType='D', Help='The Created field indicates the date that this record was created.', IsActive='Y', Name='Created', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Created',Updated=TO_DATE('2009-07-24 12:45:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=245 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=245 ; UPDATE AD_Reference SET Description='Date with time', EntityType='D', Help=NULL, IsActive='Y', Name='Date+Time', ValidationType='D',Updated=TO_DATE('2009-07-24 12:45:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=16 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=16 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57926,245,0,16,53221,'Created',TO_DATE('2009-07-24 12:45:01','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was created','D',7,'The Created field indicates the date that this record was created.','Y','N','N','N','N','N','N','N','Y','N','N','Created',TO_DATE('2009-07-24 12:45:01','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57926 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='CreatedBy', Description='User who created this records', EntityType='D', Help='The Created By field indicates the user who created this record.', IsActive='Y', Name='Created By', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Created By',Updated=TO_DATE('2009-07-24 12:45:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=246 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=246 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57927,246,0,18,110,53221,'CreatedBy',TO_DATE('2009-07-24 12:45:02','YYYY-MM-DD HH24:MI:SS'),100,'User who created this records','D',10,'The Created By field indicates the user who created this record.','Y','N','N','N','N','N','N','N','Y','N','N','Created By',TO_DATE('2009-07-24 12:45:02','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57927 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='DateAcct', Description='Accounting Date', EntityType='D', Help='The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.', IsActive='Y', Name='Account Date', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Acct Date',Updated=TO_DATE('2009-07-24 12:45:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=263 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=263 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57928,263,0,16,53221,'DateAcct',TO_DATE('2009-07-24 12:45:03','YYYY-MM-DD HH24:MI:SS'),100,'Accounting Date','D',7,'The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.','Y','N','N','N','N','N','N','N','Y','N','N','Account Date',TO_DATE('2009-07-24 12:45:03','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57928 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='DateDoc', Description='Date of the Document', EntityType='D', Help='The Document Date indicates the date the document was generated. It may or may not be the same as the accounting date.', IsActive='Y', Name='Document Date', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Doc date',Updated=TO_DATE('2009-07-24 12:45:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=265 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=265 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57929,265,0,16,53221,'DateDoc',TO_DATE('2009-07-24 12:45:05','YYYY-MM-DD HH24:MI:SS'),100,'Date of the Document','D',7,'The Document Date indicates the date the document was generated. It may or may not be the same as the accounting date.','Y','N','N','N','N','N','N','N','Y','N','N','Document Date',TO_DATE('2009-07-24 12:45:05','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57929 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='DocStatus', Description='The current status of the document', EntityType='D', Help='The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field', IsActive='Y', Name='Document Status', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Doc Status',Updated=TO_DATE('2009-07-24 12:45:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=289 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=289 ; UPDATE AD_Reference SET Description='Reference List', EntityType='D', Help=NULL, IsActive='Y', Name='List', ValidationType='D',Updated=TO_DATE('2009-07-24 12:45:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=17 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=17 ; UPDATE AD_Reference SET Description='Document Status list', EntityType='D', Help=NULL, IsActive='Y', Name='_Document Status', ValidationType='L',Updated=TO_DATE('2009-07-24 12:45:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=131 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=131 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Unknown', Value='??',Updated=TO_DATE('2009-07-24 12:45:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=190 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=190 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Approved', Value='AP',Updated=TO_DATE('2009-07-24 12:45:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=166 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=166 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Closed', Value='CL',Updated=TO_DATE('2009-07-24 12:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=177 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=177 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Completed', Value='CO',Updated=TO_DATE('2009-07-24 12:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=165 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=165 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Drafted', Value='DR',Updated=TO_DATE('2009-07-24 12:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=164 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=164 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Invalid', Value='IN',Updated=TO_DATE('2009-07-24 12:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=173 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=173 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='In Progress', Value='IP',Updated=TO_DATE('2009-07-24 12:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=341 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=341 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Not Approved', Value='NA',Updated=TO_DATE('2009-07-24 12:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=168 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=168 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Reversed', Value='RE',Updated=TO_DATE('2009-07-24 12:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=176 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=176 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Voided', Value='VO',Updated=TO_DATE('2009-07-24 12:45:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=172 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=172 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Waiting Confirmation', Value='WC',Updated=TO_DATE('2009-07-24 12:45:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=670 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=670 ; UPDATE AD_Ref_List SET AD_Reference_ID=131, Description=NULL, EntityType='D', IsActive='Y', Name='Waiting Payment', Value='WP',Updated=TO_DATE('2009-07-24 12:45:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=346 ; UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=346 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57930,289,0,17,131,53221,'DocStatus',TO_DATE('2009-07-24 12:45:08','YYYY-MM-DD HH24:MI:SS'),100,'The current status of the document','D',2,'The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','Y','N','N','N','N','N','N','Y','Y','N','N','Document Status',TO_DATE('2009-07-24 12:45:08','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57930 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='DocumentNo', Description='Document sequence number of the document', EntityType='D', Help='The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>". If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).', IsActive='Y', Name='Document No', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Document No',Updated=TO_DATE('2009-07-24 12:45:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=290 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=290 ; UPDATE AD_Reference SET Description='Character String', EntityType='D', Help=NULL, IsActive='Y', Name='String', ValidationType='D',Updated=TO_DATE('2009-07-24 12:45:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=10 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=10 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57931,290,0,10,53221,'DocumentNo',TO_DATE('2009-07-24 12:45:10','YYYY-MM-DD HH24:MI:SS'),100,'Document sequence number of the document','D',60,'The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>". If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).','Y','N','N','N','N','N','N','N','Y','N','N','Document No',TO_DATE('2009-07-24 12:45:10','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57931 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='IsActive', Description='The record is active in the system', EntityType='D', Help='There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. There are two reasons for de-activating and not deleting records: (1) The system requires the record for audit purposes. (2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.', IsActive='Y', Name='Active', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Active',Updated=TO_DATE('2009-07-24 12:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=348 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=348 ; UPDATE AD_Reference SET Description='CheckBox', EntityType='D', Help=NULL, IsActive='Y', Name='Yes-No', ValidationType='D',Updated=TO_DATE('2009-07-24 12:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=20 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=20 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57932,348,0,20,53221,'IsActive',TO_DATE('2009-07-24 12:45:11','YYYY-MM-DD HH24:MI:SS'),100,'The record is active in the system','D',1,'There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. There are two reasons for de-activating and not deleting records: (1) The system requires the record for audit purposes. (2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','N','N','N','N','N','N','N','Y','N','N','Active',TO_DATE('2009-07-24 12:45:11','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57932 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='IsSOTrx', Description='This is a Sales Transaction', EntityType='D', Help='The Sales Transaction checkbox indicates if this item is a Sales Transaction.', IsActive='Y', Name='Sales Transaction', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Sales Transaction',Updated=TO_DATE('2009-07-24 12:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=1106 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=1106 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57933,1106,0,20,53221,'IsSOTrx',TO_DATE('2009-07-24 12:45:12','YYYY-MM-DD HH24:MI:SS'),100,'This is a Sales Transaction','D',1,'The Sales Transaction checkbox indicates if this item is a Sales Transaction.','Y','N','N','N','N','N','N','N','Y','N','N','Sales Transaction',TO_DATE('2009-07-24 12:45:12','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57933 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='Posted', Description='Posting status', EntityType='D', Help='The Posted field indicates the status of the Generation of General Ledger Accounting Lines ', IsActive='Y', Name='Posted', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Posted',Updated=TO_DATE('2009-07-24 12:45:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=1308 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=1308 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57934,1308,0,20,53221,'Posted',TO_DATE('2009-07-24 12:45:13','YYYY-MM-DD HH24:MI:SS'),100,'Posting status','D',1,'The Posted field indicates the status of the Generation of General Ledger Accounting Lines ','Y','N','N','N','N','N','N','N','Y','N','N','Posted',TO_DATE('2009-07-24 12:45:13','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57934 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='Processed', Description='The document has been processed', EntityType='D', Help='The Processed checkbox indicates that a document has been processed.', IsActive='Y', Name='Processed', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Processed',Updated=TO_DATE('2009-07-24 12:45:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=1047 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=1047 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57935,1047,0,20,53221,'Processed',TO_DATE('2009-07-24 12:45:13','YYYY-MM-DD HH24:MI:SS'),100,'The document has been processed','D',1,'The Processed checkbox indicates that a document has been processed.','Y','N','N','N','N','N','N','N','Y','N','N','Processed',TO_DATE('2009-07-24 12:45:13','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57935 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='Processing', Description=NULL, EntityType='D', Help=NULL, IsActive='Y', Name='Process Now', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Process Now',Updated=TO_DATE('2009-07-24 12:45:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=524 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=524 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57936,524,0,20,53221,'Processing',TO_DATE('2009-07-24 12:45:14','YYYY-MM-DD HH24:MI:SS'),100,'D',1,'Y','N','N','N','N','N','N','N','Y','N','N','Process Now',TO_DATE('2009-07-24 12:45:14','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57936 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='Record_ID', Description='Direct internal record ID', EntityType='D', Help='The Record ID is the internal unique identifier of a record. Please note that zooming to the record may not be successful for Orders, Invoices and Shipment/Receipts as sometimes the Sales Order type is not known.', IsActive='Y', Name='Record ID', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Record ID',Updated=TO_DATE('2009-07-24 12:45:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=538 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=538 ; UPDATE AD_Reference SET Description='Command Button - starts a process', EntityType='D', Help=NULL, IsActive='Y', Name='Button', ValidationType='D',Updated=TO_DATE('2009-07-24 12:45:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=28 ; UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=28 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57937,538,0,28,53221,'Record_ID',TO_DATE('2009-07-24 12:45:15','YYYY-MM-DD HH24:MI:SS'),100,'Direct internal record ID','D',10,'The Record ID is the internal unique identifier of a record. Please note that zooming to the record may not be successful for Orders, Invoices and Shipment/Receipts as sometimes the Sales Order type is not known.','Y','N','N','N','N','N','N','N','Y','N','N','Record ID',TO_DATE('2009-07-24 12:45:15','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57937 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='Updated', Description='Date this record was updated', EntityType='D', Help='The Updated field indicates the date that this record was updated.', IsActive='Y', Name='Updated', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Updated',Updated=TO_DATE('2009-07-24 12:45:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=607 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=607 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57938,607,0,16,53221,'Updated',TO_DATE('2009-07-24 12:45:16','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was updated','D',7,'The Updated field indicates the date that this record was updated.','Y','N','N','N','N','N','N','N','Y','N','N','Updated',TO_DATE('2009-07-24 12:45:16','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57938 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; UPDATE AD_Element SET ColumnName='AD_Org_ID', Description='Organizational entity within client', EntityType='D', Help='An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.', IsActive='Y', Name='Organization', PO_Description=NULL, PO_Help=NULL, PO_Name=NULL, PO_PrintName=NULL, PrintName='Organization',Updated=TO_DATE('2009-07-24 12:45:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=113 ; UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=113 ; INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,57939,113,0,19,53221,'AD_Org_ID',TO_DATE('2009-07-24 12:45:17','YYYY-MM-DD HH24:MI:SS'),100,'Organizational entity within client','D',10,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','N','N','N','N','N','N','Y','N','N','Organization',TO_DATE('2009-07-24 12:45:17','YYYY-MM-DD HH24:MI:SS'),100,0) ; INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57939 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; INSERT INTO AD_Tab (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_Table_ID,AD_Window_ID,CommitWarning,Created,CreatedBy,EntityType,HasTree,IsActive,IsAdvancedTab,IsInfoTab,IsInsertRecord,IsReadOnly,IsSingleRow,IsSortTab,IsTranslationTab,Name,OrderByClause,Processing,SeqNo,TabLevel,Updated,UpdatedBy,WhereClause) VALUES (0,0,53238,53221,53086,NULL,TO_DATE('2009-07-24 12:45:18','YYYY-MM-DD HH24:MI:SS'),100,'D','N','Y','N','N','Y','N','N','N','N','Unprocessed Documents','DateDoc ASC','N',10,0,TO_DATE('2009-07-24 12:45:18','YYYY-MM-DD HH24:MI:SS'),100,'CreatedBy=@#AD_User_ID@') ; INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, CommitWarning,Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.CommitWarning,t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=53238 AND EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Tab_ID!=t.AD_Tab_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57934,57345,0,53238,TO_DATE('2009-07-24 12:45:19','YYYY-MM-DD HH24:MI:SS'),100,'Posting status',1,'D','The Posted field indicates the status of the Generation of General Ledger Accounting Lines ','Y','Y','N','N','N','N','N','Posted',0,0,TO_DATE('2009-07-24 12:45:19','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57345 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57923,57346,0,53238,TO_DATE('2009-07-24 12:45:19','YYYY-MM-DD HH24:MI:SS'),100,'Client/Tenant for this installation.',10,'D','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','Y','Y','N','N','N','N','Client',10,0,TO_DATE('2009-07-24 12:45:19','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57346 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57939,57347,0,53238,TO_DATE('2009-07-24 12:45:20','YYYY-MM-DD HH24:MI:SS'),100,'Organizational entity within client',10,'D','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','Y','Y','N','N','N','Y','Organization',20,0,TO_DATE('2009-07-24 12:45:20','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57347 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57925,57348,0,53238,TO_DATE('2009-07-24 12:45:21','YYYY-MM-DD HH24:MI:SS'),100,'Database Table information',22,'D','The Database Table provides the information of the table definition','Y','Y','Y','N','N','N','N','Table',30,0,TO_DATE('2009-07-24 12:45:21','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57348 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57937,57349,0,53238,TO_DATE('2009-07-24 12:45:21','YYYY-MM-DD HH24:MI:SS'),100,'Direct internal record ID',10,'D','The Record ID is the internal unique identifier of a record. Please note that zooming to the record may not be successful for Orders, Invoices and Shipment/Receipts as sometimes the Sales Order type is not known.','Y','Y','Y','N','N','N','Y','Record ID',40,0,TO_DATE('2009-07-24 12:45:21','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57349 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57931,57350,0,53238,TO_DATE('2009-07-24 12:45:22','YYYY-MM-DD HH24:MI:SS'),100,'Document sequence number of the document',60,'D','The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>". If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).','Y','Y','Y','N','N','N','N','Document No',50,0,TO_DATE('2009-07-24 12:45:22','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57350 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57929,57351,0,53238,TO_DATE('2009-07-24 12:45:22','YYYY-MM-DD HH24:MI:SS'),100,'Date of the Document',7,'D','The Document Date indicates the date the document was generated. It may or may not be the same as the accounting date.','Y','Y','Y','N','N','N','N','Document Date',60,0,TO_DATE('2009-07-24 12:45:22','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57351 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57928,57352,0,53238,TO_DATE('2009-07-24 12:45:23','YYYY-MM-DD HH24:MI:SS'),100,'Accounting Date',7,'D','The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.','Y','Y','Y','N','N','N','Y','Account Date',70,0,TO_DATE('2009-07-24 12:45:23','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57352 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57930,57353,0,53238,TO_DATE('2009-07-24 12:45:24','YYYY-MM-DD HH24:MI:SS'),100,'The current status of the document',2,'D','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','Y','Y','Y','N','N','N','N','Document Status',80,0,TO_DATE('2009-07-24 12:45:24','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57353 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57935,57354,0,53238,TO_DATE('2009-07-24 12:45:24','YYYY-MM-DD HH24:MI:SS'),100,'The document has been processed',1,'D','The Processed checkbox indicates that a document has been processed.','Y','Y','Y','N','N','N','N','Processed',90,0,TO_DATE('2009-07-24 12:45:24','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57354 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57936,57355,0,53238,TO_DATE('2009-07-24 12:45:25','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','Y','Process Now',100,0,TO_DATE('2009-07-24 12:45:25','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57355 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57933,57356,0,53238,TO_DATE('2009-07-24 12:45:25','YYYY-MM-DD HH24:MI:SS'),100,'This is a Sales Transaction',1,'D','The Sales Transaction checkbox indicates if this item is a Sales Transaction.','Y','Y','Y','N','N','N','N','Sales Transaction',110,0,TO_DATE('2009-07-24 12:45:25','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57356 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57932,57357,0,53238,TO_DATE('2009-07-24 12:45:26','YYYY-MM-DD HH24:MI:SS'),100,'The record is active in the system',1,'D','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. There are two reasons for de-activating and not deleting records: (1) The system requires the record for audit purposes. (2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','Y','Y','N','N','N','Y','Active',120,0,TO_DATE('2009-07-24 12:45:26','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57357 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('W',0,53225,0,53086,TO_DATE('2009-07-24 12:49:37','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','My UnProcessed Documents',TO_DATE('2009-07-24 12:49:37','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=53225 AND EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Menu_ID!=t.AD_Menu_ID) ; INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', SysDate, 0, SysDate, 0,t.AD_Tree_ID, 53225, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=53225) ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=218 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=153 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=263 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=166 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=203 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=236 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=183 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=160 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=278 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=345 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53014 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53108 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=114 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=108 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=115 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53225 ; INSERT INTO AD_Window (AD_Client_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,IsBetaFunctionality,IsDefault,IsSOTrx,Name,Processing,Updated,UpdatedBy,WindowType) VALUES (0,0,53087,TO_DATE('2009-07-24 13:07:40','YYYY-MM-DD HH24:MI:SS'),100,'Unprocessed Documents (All)','D','View all unprocessed documents','Y','N','N','Y','Unprocessed Documents (All)','N',TO_DATE('2009-07-24 13:07:40','YYYY-MM-DD HH24:MI:SS'),100,'Q') ; INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Window_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=53087 AND EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Window_ID!=t.AD_Window_ID) ; UPDATE AD_Window SET Description='My Unprocessed Documents', Name='My Unprocessed Documents',Updated=TO_DATE('2009-07-24 13:07:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=53086 ; UPDATE AD_Window_Trl SET IsTranslated='N' WHERE AD_Window_ID=53086 ; UPDATE AD_Menu SET Description='My Unprocessed Documents', IsActive='Y', Name='My Unprocessed Documents',Updated=TO_DATE('2009-07-24 13:07:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53225 ; UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53225 ; INSERT INTO AD_Tab (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_Table_ID,AD_Window_ID,Created,CreatedBy,EntityType,HasTree,IsActive,IsAdvancedTab,IsInfoTab,IsInsertRecord,IsReadOnly,IsSingleRow,IsSortTab,IsTranslationTab,Name,OrderByClause,Processing,SeqNo,TabLevel,Updated,UpdatedBy,WhereClause) VALUES (0,0,53239,53221,53087,TO_DATE('2009-07-24 13:07:55','YYYY-MM-DD HH24:MI:SS'),100,'D','N','Y','N','N','Y','N','N','N','N','Unprocessed Documents','DateDoc ASC','N',10,0,TO_DATE('2009-07-24 13:07:55','YYYY-MM-DD HH24:MI:SS'),100,'CreatedBy=@#AD_User_ID@') ; INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, CommitWarning,Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.CommitWarning,t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=53239 AND EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Tab_ID!=t.AD_Tab_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57934,57358,0,53239,TO_DATE('2009-07-24 13:07:56','YYYY-MM-DD HH24:MI:SS'),100,'Posting status',1,'D','The Posted field indicates the status of the Generation of General Ledger Accounting Lines ','Y','Y','N','N','N','N','N','N','Posted',0,0,TO_DATE('2009-07-24 13:07:56','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57358 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57923,57359,0,53239,TO_DATE('2009-07-24 13:07:57','YYYY-MM-DD HH24:MI:SS'),100,'Client/Tenant for this installation.',10,'D','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','Y','Y','N','N','N','N','N','Client',10,0,TO_DATE('2009-07-24 13:07:57','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57359 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57939,57360,0,53239,TO_DATE('2009-07-24 13:07:58','YYYY-MM-DD HH24:MI:SS'),100,'Organizational entity within client',10,'D','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','Y','Y','N','N','N','N','Y','Organization',20,0,TO_DATE('2009-07-24 13:07:58','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57360 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57925,57361,0,53239,TO_DATE('2009-07-24 13:07:58','YYYY-MM-DD HH24:MI:SS'),100,'Database Table information',22,'D','The Database Table provides the information of the table definition','Y','Y','Y','N','N','N','N','N','Table',30,0,TO_DATE('2009-07-24 13:07:58','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57361 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57937,57362,0,53239,TO_DATE('2009-07-24 13:07:59','YYYY-MM-DD HH24:MI:SS'),100,'Direct internal record ID',10,'D','The Record ID is the internal unique identifier of a record. Please note that zooming to the record may not be successful for Orders, Invoices and Shipment/Receipts as sometimes the Sales Order type is not known.','Y','Y','Y','N','N','N','N','Y','Record ID',40,0,TO_DATE('2009-07-24 13:07:59','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57362 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57931,57363,0,53239,TO_DATE('2009-07-24 13:08:00','YYYY-MM-DD HH24:MI:SS'),100,'Document sequence number of the document',60,'D','The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>". If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).','Y','Y','Y','N','N','N','N','N','Document No',50,0,TO_DATE('2009-07-24 13:08:00','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57363 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57929,57364,0,53239,TO_DATE('2009-07-24 13:08:00','YYYY-MM-DD HH24:MI:SS'),100,'Date of the Document',7,'D','The Document Date indicates the date the document was generated. It may or may not be the same as the accounting date.','Y','Y','Y','N','N','N','N','N','Document Date',60,0,TO_DATE('2009-07-24 13:08:00','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57364 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57928,57365,0,53239,TO_DATE('2009-07-24 13:08:01','YYYY-MM-DD HH24:MI:SS'),100,'Accounting Date',7,'D','The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.','Y','Y','Y','N','N','N','N','Y','Account Date',70,0,TO_DATE('2009-07-24 13:08:01','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57365 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57930,57366,0,53239,TO_DATE('2009-07-24 13:08:02','YYYY-MM-DD HH24:MI:SS'),100,'The current status of the document',2,'D','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','Y','Y','Y','N','N','N','N','N','Document Status',80,0,TO_DATE('2009-07-24 13:08:02','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57366 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57935,57367,0,53239,TO_DATE('2009-07-24 13:08:02','YYYY-MM-DD HH24:MI:SS'),100,'The document has been processed',1,'D','The Processed checkbox indicates that a document has been processed.','Y','Y','Y','N','N','N','N','N','Processed',90,0,TO_DATE('2009-07-24 13:08:02','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57367 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57936,57368,0,53239,TO_DATE('2009-07-24 13:08:03','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','Y','Process Now',100,0,TO_DATE('2009-07-24 13:08:03','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57368 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57933,57369,0,53239,TO_DATE('2009-07-24 13:08:03','YYYY-MM-DD HH24:MI:SS'),100,'This is a Sales Transaction',1,'D','The Sales Transaction checkbox indicates if this item is a Sales Transaction.','Y','Y','Y','N','N','N','N','N','Sales Transaction',110,0,TO_DATE('2009-07-24 13:08:03','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57369 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57932,57370,0,53239,TO_DATE('2009-07-24 13:08:04','YYYY-MM-DD HH24:MI:SS'),100,'The record is active in the system',1,'D','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. There are two reasons for de-activating and not deleting records: (1) The system requires the record for audit purposes. (2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','Y','Y','N','N','N','N','Y','Active',120,0,TO_DATE('2009-07-24 13:08:04','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57370 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; UPDATE AD_Tab SET WhereClause=NULL,Updated=TO_DATE('2009-07-24 13:08:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53239 ; INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,Description,EntityType,IsActive,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('W',0,53226,0,53087,TO_DATE('2009-07-24 13:09:26','YYYY-MM-DD HH24:MI:SS'),100,'Unprocessed Documents (All)','D','Y','N','N','N','Unprocessed Documents (All)',TO_DATE('2009-07-24 13:09:26','YYYY-MM-DD HH24:MI:SS'),100) ; INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=53226 AND EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Menu_ID!=t.AD_Menu_ID) ; INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', SysDate, 0, SysDate, 0,t.AD_Tree_ID, 53226, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=53226) ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=218 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=153 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=263 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=166 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=203 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=236 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=183 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=160 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=278 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=345 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53014 ; UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53108 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=114 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=108 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=115 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53225 ; UPDATE AD_TreeNodeMM SET Parent_ID=159, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53226 ;
DROP TABLE IF EXISTS ER_waits; CREATE TABLE ER_waits (PRIMARY KEY (id)) SELECT DISTINCT a.provider_id AS id, a.hospital_name, b.HospitalName AS display_name, a.address, a.city, a.state, a.zip_code, a.county_name, MAX(CASE WHEN a.measure_id = 'EDV' THEN a.score END) AS er_volume, MAX(CASE WHEN a.measure_id = 'ED_1b' THEN a.score END) AS er_inpatient_1, MAX(CASE WHEN a.measure_id = 'ED_2b' THEN a.score END) AS er_inpatient_2, MAX(CASE WHEN a.measure_id = 'OP_18b' THEN a.score END) AS er_total_time_avg, MAX(CASE WHEN a.measure_id = 'OP_20' THEN a.score END) AS er_time_to_eval, MAX(CASE WHEN a.measure_id = 'OP_21' THEN a.score END) AS er_time_to_painmed, MAX(CASE WHEN a.measure_id = 'OP_22' THEN a.score END) AS er_left_pct, MAX(CASE WHEN a.measure_id = 'OP_23' THEN a.score END) AS er_ctresults_pct FROM hospital_compare.HQI_HOSP_TimelyEffectiveCare a JOIN hospital_names b ON a.provider_ID = b.ProviderNumber WHERE condition_name = "Emergency Department" AND STATE = "GA" GROUP BY a.provider_id;
use webInfo --创建信息表 create table infoTab ( 文章标题 nvarchar(255) not null primary key, 文章作者 nvarchar(50), 发布时间 char(20), 内容摘要 nvarchar(max), 评论量 char(10), 浏览量 char(10) ) alter table infoTab alter column 评论量 char(9) insert into infoTab values('你是猪吗3','你才是猪','对','你是猪','00000','11111') insert into infoTab values('机器学习实战之第一章 机器学习基础','nm-xy','2017-09-01 11:59','ApacheCN——专注于优秀开源项目维护的组织,不止于权威的文档视频技术支持 ...','1','291') select * from infoTab --alter table infoTab --删除表表中数据 delete from infoTab drop table infoTab /*==============================================================*/ --创建文章内容表 create table detailInfo ( 文章标题 nvarchar(255) not null primary key, 文章内容 text ) --插入数据 insert into detailInfo values('机器学习实战之第一章 机器学习基础','曾经有一份真挚的爱情放在我的面前我没有珍惜,知道后悔了才感觉追悔莫及') select 文章内容 from detailInfo --删除表表中数据 delete from detailInfo select * from infoTab,detailInfo where infoTab.文章标题=detailInfo.文章标题 select * from detailInfo where 文章标题='你是猪吗3' alter table detailInfo add constraint PK primary key(文章标题) alter table detailInfo alter column 文章内容 nvarchar(max) not null drop table detailInfo delete from infoTab delete from detailInfo select * from infoTab select * from detailInfo
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 27, 2021 at 06:26 AM -- Server version: 10.4.18-MariaDB -- PHP Version: 8.0.3 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: `flight_management` -- DELIMITER $$ -- -- Procedures -- CREATE DEFINER=`root`@`localhost` PROCEDURE `ageup` (IN `adhaar` INT(12)) UPDATE passenger_info SET P_age = year(CURRENT_DATE())-year(P_DOB) where Aadhar_No=adhaar$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `airline_info` (IN `frm` VARCHAR(30), IN `t` VARCHAR(30), IN `dte` DATE, IN `seat` INT(3), IN `cl` VARCHAR(10)) BEGIN case cl when 1 then Select * from airline_info_view where departure_Destination=frm and arrival_Destination=t and dept_date= dte and vacant_seats>= seat order by economy_Fare; when 2 then Select * from airline_info_view where departure_Destination=frm and arrival_Destination=t and dept_date=dte and vacant_seats>= seat order by buisness_fare; end case; end$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `all_flights` () SELECT * from airline$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `cancelticket` (IN `adhaar` INT) BEGIN DELETE FROM passenger_info WHERE Aadhar_No=adhaar; end$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `enquiry_answer` () BEGIN SELECT * FROM enquiry WHERE enquiry_answer IS NOT NULL; End$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `enquiry_user` (IN `user` VARCHAR(20)) SELECT * FROM enquiry_user_view WHERE login_username=user$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `inserenq` (IN `title` VARCHAR(10), IN `type` VARCHAR(40), IN `descrip` VARCHAR(200), IN `username` VARCHAR(20)) INSERT INTO enquiry ( Enquiry_title, Enquiry_type,Enquiry_Description,login_username) VALUES (title,type,descrip,username)$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `inserpass` (IN `adhaar` INT(12), IN `dob` INT(40), IN `email` INT(40), IN `name` INT(30), IN `gender` INT(7), IN `phone ` INT(13), IN `state` INT(10), IN `city` INT(10), IN `postal` INT(10)) INSERT INTO passenger_info ( Aadhar_No, P_DOB,P_email,P_Name,P_gender,p_phone_no,state,city,pincode) VALUES (adhaar,dob,email,name,gender,phone,state,city,postal)$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `logincommon` (IN `username` VARCHAR(20), IN `pass` VARCHAR(20)) SELECT login_username,Password FROM login where login_username=username and password=pass$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `passenger_user` (IN `user` VARCHAR(20)) Select * from passenger_info where P_email =(Select email from customer where login_username=user)$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `pend_queries` () SELECT * FROM enquiry WHERE enquiry_answer IS NULL$$ -- -- Functions -- CREATE DEFINER=`root`@`localhost` FUNCTION `empl_answered` (`user` VARCHAR(45)) RETURNS INT(11) BEGIN return(Select count(*) from answers where login_username=user); End$$ CREATE DEFINER=`root`@`localhost` FUNCTION `find_employee_type` (`user` VARCHAR(20)) RETURNS INT(11) BEGIN return(Select count(*) from airline_coordinator where login_username=(Select login_username from login where login_username=user)); end$$ CREATE DEFINER=`root`@`localhost` FUNCTION `manage_flight` (`user` VARCHAR(20)) RETURNS INT(11) BEGIN return(Select count(*) from manages where login_username= user); END$$ CREATE DEFINER=`root`@`localhost` FUNCTION `passadhar` (`adhaar` INT(12)) RETURNS INT(13) BEGIN RETURN (SELECT COUNT(Aadhar_No) FROM passenger_info WHERE Aadhar_No = adhaar); end$$ CREATE DEFINER=`root`@`localhost` FUNCTION `passenger_count` (`email` VARCHAR(45)) RETURNS INT(11) BEGIN return(Select count(*) from passenger_info where P_email= email); end$$ CREATE DEFINER=`root`@`localhost` FUNCTION `passenger_enq` (`user` VARCHAR(20)) RETURNS INT(11) BEGIN return(Select count(*) from enquiry where login_username=user); end$$ CREATE DEFINER=`root`@`localhost` FUNCTION `passenger_enq_answered` (`user` VARCHAR(20)) RETURNS INT(11) BEGIN return(Select count(*) from enquiry where login_username=user && enquiry_answer is null); end$$ CREATE DEFINER=`root`@`localhost` FUNCTION `pending_answer_all` () RETURNS INT(11) begin return(Select count(*) from enquiry where enquiry_answer is null); end$$ CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_count` (`email` VARCHAR(45)) RETURNS INT(11) BEGIN return(Select count(*) from ticket where aadhar_no in (Select Aadhar_no from passenger_info where P_email= email)); end$$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `airline` -- CREATE TABLE `airline` ( `Flight_ID` int(4) NOT NULL, `Reference_no` varchar(6) DEFAULT NULL, `economy_Fare` double(7,2) DEFAULT NULL, `buisness_fare` double(8,2) DEFAULT NULL, `vacant_seats` int(3) DEFAULT 100, `dept_Time` time DEFAULT NULL, `dept_date` date DEFAULT NULL, `departure_Destination` varchar(30) DEFAULT NULL, `arrival_time` time DEFAULT NULL, `arrival_date` date DEFAULT NULL, `arrival_destination` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `airline` -- INSERT INTO `airline` (`Flight_ID`, `Reference_no`, `economy_Fare`, `buisness_fare`, `vacant_seats`, `dept_Time`, `dept_date`, `departure_Destination`, `arrival_time`, `arrival_date`, `arrival_destination`) VALUES (1114, 'WY233', 3400.00, 12999.00, 220, '22:00:00', '2021-05-02', 'Chennai', '00:00:23', '2021-05-02', 'Mumbai'), (1220, 'WY133', 4200.00, 7999.00, 318, '23:30:00', '2021-05-03', 'Lucknow', '01:00:00', '2021-05-04', 'Chennai'), (1234, 'WY233', 3200.00, 9999.00, 220, '22:00:00', '2021-05-01', 'Mumbai', '23:45:00', '2021-05-01', 'Chennai'), (1235, 'WY222', 3900.00, 8900.00, 300, '14:00:00', '2021-04-28', 'Bengaluru', '16:15:00', '2021-04-28', 'Chennai'), (1444, 'AI234', 1400.00, 7899.00, 200, '12:00:00', '2021-05-02', 'Mumbai', '00:00:23', '2021-05-02', 'Chennai'), (3114, 'MS234', 1400.00, 7899.00, 200, '12:00:00', '2021-05-01', 'Chennai', '00:00:23', '2021-05-01', 'Mumbai'), (3234, 'WY203', 2200.00, 7999.00, 210, '14:00:00', '2021-05-01', 'Mumbai', '00:00:16', '2021-05-01', 'Chennai'), (3333, 'WY449', 2120.00, 12120.00, 100, '04:29:00', '2021-04-29', 'Surat', '06:29:00', '2021-04-30', ' Delhi'), (4114, 'MS234', 1400.00, 7899.00, 200, '12:00:00', '2021-05-01', 'Lucknow', '00:00:23', '2021-05-01', 'Mumbai'), (4414, 'AI234', 1400.00, 7899.00, 200, '12:00:00', '2021-05-01', 'Lucknow', '00:00:23', '2021-05-01', 'Chennai'), (4444, 'AI234', 1400.00, 7899.00, 198, '12:00:00', '2021-05-01', 'Mumbai', '00:00:23', '2021-05-01', 'Chennai'), (8898, 'WY990', 2120.00, 12120.00, 200, '00:07:00', '2021-04-15', 'Thiruvananthapuram', '02:07:00', '2021-04-24', ' Kolkata'), (9999, 'AI234', 2120.00, 12120.00, 100, '03:13:00', '2021-05-08', 'Jaipur', '07:13:00', '2021-05-08', ' Mumbai'); -- -------------------------------------------------------- -- -- Table structure for table `airline_coordinator` -- CREATE TABLE `airline_coordinator` ( `Emp_name` varchar(20) DEFAULT NULL, `salary` double(7,2) DEFAULT NULL, `gender` varchar(7) DEFAULT NULL, `phone_no` varchar(13) DEFAULT NULL, `email` varchar(40) DEFAULT NULL, `Date_of_join` date DEFAULT NULL, `Role` varchar(20) DEFAULT NULL, `Login_username` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `airline_coordinator` -- INSERT INTO `airline_coordinator` (`Emp_name`, `salary`, `gender`, `phone_no`, `email`, `Date_of_join`, `Role`, `Login_username`) VALUES ('Krithikha', 99999.99, 'Female', '8656765432', 'krithikha23@gmail.com', '2021-04-23', 'Admin', 'admin1'), ('Ritz', 4499.99, 'Female', '8656765432', 'rithikha23@gmail.com', '2021-04-23', 'Admin', 'admin2'); -- -------------------------------------------------------- -- -- Stand-in structure for view `airline_info_view` -- (See below for the actual view) -- CREATE TABLE `airline_info_view` ( `Flight_ID` int(4) ,`Reference_no` varchar(6) ,`economy_Fare` double(7,2) ,`buisness_fare` double(8,2) ,`vacant_seats` int(3) ,`dept_Time` time ,`dept_date` date ,`departure_Destination` varchar(30) ,`arrival_time` time ,`arrival_date` date ,`arrival_destination` varchar(30) ,`Airline_name` varchar(30) ); -- -------------------------------------------------------- -- -- Table structure for table `answers` -- CREATE TABLE `answers` ( `Login_username` varchar(20) NOT NULL, `enquiry_id` int(8) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `answers` -- INSERT INTO `answers` (`Login_username`, `enquiry_id`) VALUES ('care1', 7), ('care1', 22), ('care2', 12), ('care2', 28), ('care2', 29); -- -------------------------------------------------------- -- -- Table structure for table `booking` -- CREATE TABLE `booking` ( `login_username` varchar(20) NOT NULL, `Flight_ID` int(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `booking` -- INSERT INTO `booking` (`login_username`, `Flight_ID`) VALUES ('aish17', 3234), ('aish17', 4444), ('deepa k', 1220); -- -------------------------------------------------------- -- -- Table structure for table `customer` -- CREATE TABLE `customer` ( `Cust_name` varchar(25) DEFAULT NULL, `gender` varchar(7) DEFAULT NULL, `email` varchar(40) NOT NULL, `phone_number` varchar(12) DEFAULT NULL, `login_username` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`Cust_name`, `gender`, `email`, `phone_number`, `login_username`) VALUES ('Aishwarya', 'female', 'aishwarya@gmail', '123456', 'aish17'), ('Ashwin', 'male', 'ashwin@gmail.com', '23232323', 'Ashwin'), ('Deepa', 'female', 'deepak@gmail.com', '1212344442', 'deepa k'), ('mahi', 'female', 'snitr2002@yahoo.com', '8610284988', 'mah'), ('mahitha', 'female', 'mahi@gmail.com', '12323232', 'mahi'), ('Ram Kumar', 'male', 'ramkumar@gmail.com', '1232432231', 'Ram'), ('hh', 'male', 'qwefge@gmil.com', '123', 'sanki'); -- -- Triggers `customer` -- DELIMITER $$ CREATE TRIGGER `delete_cust` AFTER DELETE ON `customer` FOR EACH ROW BEGIN Delete from enquiry where login_username=OLD.login_username; Delete from login where Login_username=OLD.login_username; Delete from booking where login_username=OLD.login_username; Delete from passenger_info where P_email in (Select email from customer where login_username=OLD.login_username); Delete from ticket where aadhar_no in (Select Aadhar_No from passenger_info where P_email =(Select email from customer where login_username=OLD.login_username)); End $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `customer_care_agent` -- CREATE TABLE `customer_care_agent` ( `Emp_name` varchar(20) DEFAULT NULL, `salary` double(7,2) DEFAULT NULL, `gender` varchar(7) DEFAULT NULL, `phone_no` varchar(13) DEFAULT NULL, `email` varchar(40) DEFAULT NULL, `Date_of_join` date DEFAULT NULL, `login_username` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `customer_care_agent` -- INSERT INTO `customer_care_agent` (`Emp_name`, `salary`, `gender`, `phone_no`, `email`, `Date_of_join`, `login_username`) VALUES ('Sankirtana', 2000.00, 'Female', '999123234', 'sanki@gmail.com', '2021-04-24', 'care2'); -- -------------------------------------------------------- -- -- Table structure for table `enquiry` -- CREATE TABLE `enquiry` ( `Enquiry_ID` int(8) NOT NULL, `Enquiry_type` varchar(10) DEFAULT NULL, `Enquiry_title` varchar(40) NOT NULL, `Enquiry_Description` varchar(200) NOT NULL, `enquiry_answer` varchar(200) DEFAULT NULL, `login_username` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `enquiry` -- INSERT INTO `enquiry` (`Enquiry_ID`, `Enquiry_type`, `Enquiry_title`, `Enquiry_Description`, `enquiry_answer`, `login_username`) VALUES (7, 'Complaint ', 'Feedback', 'dieeeeeee', 'Ok sir!', 'aish17'), (8, 'Complaint ', 'Feedback', 'dieeeeeee', 'die', 'aish17'), (9, 'Complaint ', 'Feedback', 'dieeeeeee', 'hi', 'aish17'), (10, 'Complaint ', 'Feedback', 'dieeeeeee', 'ok bye', 'aish17'), (11, 'Complaint ', 'Feedback', 'dieeeeeee', NULL, 'aish17'), (12, 'Complaint ', 'Feedback', 'dieeeeeee', 'ok', 'aish17'), (13, 'krith', 'Feedback', 'qqqqqqqqqqqqq', NULL, 'aish17'), (14, 'krith', 'Feedback', 'qqqqqqqqqqqqq', NULL, 'aish17'), (21, 'Complaint ', 'complaint', 'what to asl', NULL, 'deepa k'), (22, 'qw', 'Question', 'what to ask', 'Anything sir!!!', 'deepa k'), (23, 'qw', 'Question', 'what to ask', NULL, 'deepa k'), (24, 'qw', 'Question', 'what to ask', NULL, 'deepa k'), (28, 'Question', 'hello', 'when will flight come', 'Tommorow', 'deepa k'), (29, 'Question', 'hello', 'when will flight come', 'Tommorowwwww', 'deepa k'), (32, 'complaint', 'nice quest', 'nice', NULL, 'aish17'), (37, 'Feedback', 'nice quest', 'hello', NULL, 'aish17'); -- -------------------------------------------------------- -- -- Stand-in structure for view `enquiry_user_view` -- (See below for the actual view) -- CREATE TABLE `enquiry_user_view` ( `enquiry_title` varchar(40) ,`Enquiry_type` varchar(10) ,`Enquiry_Description` varchar(200) ,`enquiry_answer` varchar(200) ,`login_username` varchar(20) ); -- -------------------------------------------------------- -- -- Table structure for table `login` -- CREATE TABLE `login` ( `Login_username` varchar(20) NOT NULL, `Password` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Contains all login data of customers and employees'; -- -- Dumping data for table `login` -- INSERT INTO `login` (`Login_username`, `Password`) VALUES ('admin1', 'Admin1'), ('admin2', 'Admin2'), ('aish17', 'aish'), ('Ashwin', 'Ashwin24'), ('care1', 'Care1'), ('care2', 'Care2'), ('deepa k', 'deepa'), ('mah', 'mah'), ('mahi', 'mahi1'), ('Ram', 'cust'), ('sanki', '68'); -- -------------------------------------------------------- -- -- Table structure for table `manages` -- CREATE TABLE `manages` ( `Login_username` varchar(20) NOT NULL, `Flight_ID` int(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `manages` -- INSERT INTO `manages` (`Login_username`, `Flight_ID`) VALUES ('admin1', 0), ('admin1', 1234), ('admin1', 3232), ('admin1', 3333), ('admin1', 8898), ('admin1', 9898), ('admin1', 9999); -- -------------------------------------------------------- -- -- Table structure for table `passenger_info` -- CREATE TABLE `passenger_info` ( `Aadhar_No` int(12) NOT NULL, `P_DOB` date DEFAULT NULL, `P_email` varchar(40) NOT NULL, `P_Name` varchar(30) NOT NULL, `P_gender` varchar(7) DEFAULT NULL, `P_age` int(3) DEFAULT NULL, `p_phone_no` varchar(13) DEFAULT NULL, `state` varchar(10) DEFAULT NULL, `city` varchar(10) DEFAULT NULL, `pincode` varchar(10) DEFAULT NULL ) ; -- -- Dumping data for table `passenger_info` -- INSERT INTO `passenger_info` (`Aadhar_No`, `P_DOB`, `P_email`, `P_Name`, `P_gender`, `P_age`, `p_phone_no`, `state`, `city`, `pincode`) VALUES (2345, '2021-04-06', 'aishwarya@gmail', 'byg', 'Female', 0, '123456', 'Tamil Nadu', 'Chennai', '600102'), (121212, '2021-04-06', 'aishwarya@gmail', 'Ram', 'Female', 20, '123456', 'Tamil Nadu', 'Chennai', '600102'), (555555, '2021-05-28', 'aishwarya@gmail', 'Mahitha', 'Female', 0, '123456', 'Tamil Nadu', 'Chennai', '600102'), (1234567, '2016-11-18', 'aishwarya@gmail', 'xyz', 'Female', 5, '123456', 'Tamil Nadu', 'Chennai', '600102'), (4444444, '2021-04-14', 'aishwarya@gmail', 'saas', 'Female', 0, '123456', 'Tamil Nadu', 'Chennai', '600102'), (12131329, '2021-04-15', 'aishwarya@gmail', 'NITHISH KUMAR S', 'Male', 0, '123456', 'Haryana', 'Thanjavur', '613005'), (999999999, '2021-04-06', 'deepak@gmail.com', 'deepan ', 'Male', 20, '1212344442', 'Tamil Nadu', 'Chennai', '600102'), (2147483647, '2021-04-16', 'aishwarya@gmail', 'Krithikha Bala', 'Female', 0, '123456', 'Tamil Nadu', 'Chennai', '600102'); -- -- Triggers `passenger_info` -- DELIMITER $$ CREATE TRIGGER `delete_passenger` AFTER DELETE ON `passenger_info` FOR EACH ROW BEGIN Delete from ticket where Aadhar_No=old.Aadhar_no; end $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `reference_flight_no` -- CREATE TABLE `reference_flight_no` ( `Reference_no` varchar(6) NOT NULL, `Flight_Type` varchar(20) DEFAULT NULL, `Airline_name` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `reference_flight_no` -- INSERT INTO `reference_flight_no` (`Reference_no`, `Flight_Type`, `Airline_name`) VALUES ('AI234', 'Boeing 747-8', 'Indian Airlines'), ('MS234', 'Boeing 747-8', 'Mirchi Airlines'), ('WY133', 'Boeing 737', 'Indigo'), ('WY203', 'Airbus A350', 'Mirchi Airlines'), ('WY222', 'Airbus A380', 'Indian Airways'), ('WY223', 'International', 'Indian Airways'), ('WY233', 'Airbus A350', 'Indian Airways'), ('WY443', 'Domestic', 'Indian Airways'), ('WY449', 'Domestic', 'Indian Airways'), ('WY990', 'Airbus A320', 'Bharat Airlines'); -- -------------------------------------------------------- -- -- Table structure for table `ticket` -- CREATE TABLE `ticket` ( `Class` varchar(20) DEFAULT NULL, `Booking_Ref` varchar(8) DEFAULT NULL, `Seat_No` int(3) DEFAULT NULL, `payment_Type` varchar(15) DEFAULT NULL, `booking_time` time DEFAULT NULL, `booking_date` date DEFAULT NULL, `account_No` varchar(10) DEFAULT NULL, `Bank_name` varchar(30) DEFAULT NULL, `flight_ID` int(4) NOT NULL, `aadhar_no` int(12) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `ticket` -- INSERT INTO `ticket` (`Class`, `Booking_Ref`, `Seat_No`, `payment_Type`, `booking_time`, `booking_date`, `account_No`, `Bank_name`, `flight_ID`, `aadhar_no`) VALUES ('Economy', '1220#999', NULL, 'UPI', '11:57:46', '2021-04-25', '1232323', 'hdfc', 1220, 999999999), ('Economy', '3234#234', NULL, 'UPI', '13:32:53', '2021-04-26', '23344455', 'axis', 3234, 2345), ('Economy', '3234#123', NULL, 'UPI', '13:32:53', '2021-04-26', '23344455', 'axis', 3234, 1234567), ('Economy', '3234#121', NULL, 'UPI', '08:03:55', '2021-04-27', NULL, NULL, 3234, 12131329), ('Economy', '3234#111', NULL, 'UPI', '08:03:55', '2021-04-27', NULL, NULL, 3234, 2147483647), ('Economy', '4444#234', NULL, 'UPI', '23:53:18', '2021-04-26', NULL, NULL, 4444, 2345), ('Economy', '4444#121', NULL, 'UPI', '23:53:18', '2021-04-26', NULL, NULL, 4444, 121212), ('Economy', '4444#232', NULL, 'UPI', '13:27:18', '2021-04-26', '1232323', 'hdfc', 4444, 232323), ('Economy', '4444#555', NULL, 'UPI', '13:27:17', '2021-04-26', '1232323', 'hdfc', 4444, 555555); -- -------------------------------------------------------- -- -- Structure for view `airline_info_view` -- DROP TABLE IF EXISTS `airline_info_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `airline_info_view` AS SELECT `airline`.`Flight_ID` AS `Flight_ID`, `airline`.`Reference_no` AS `Reference_no`, `airline`.`economy_Fare` AS `economy_Fare`, `airline`.`buisness_fare` AS `buisness_fare`, `airline`.`vacant_seats` AS `vacant_seats`, `airline`.`dept_Time` AS `dept_Time`, `airline`.`dept_date` AS `dept_date`, `airline`.`departure_Destination` AS `departure_Destination`, `airline`.`arrival_time` AS `arrival_time`, `airline`.`arrival_date` AS `arrival_date`, `airline`.`arrival_destination` AS `arrival_destination`, `reference_flight_no`.`Airline_name` AS `Airline_name` FROM (`airline` join `reference_flight_no` on(`airline`.`Reference_no` = `reference_flight_no`.`Reference_no`)) ; -- -------------------------------------------------------- -- -- Structure for view `enquiry_user_view` -- DROP TABLE IF EXISTS `enquiry_user_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `enquiry_user_view` AS SELECT `enquiry`.`Enquiry_title` AS `enquiry_title`, `enquiry`.`Enquiry_type` AS `Enquiry_type`, `enquiry`.`Enquiry_Description` AS `Enquiry_Description`, `enquiry`.`enquiry_answer` AS `enquiry_answer`, `enquiry`.`login_username` AS `login_username` FROM `enquiry` ; -- -- Indexes for dumped tables -- -- -- Indexes for table `airline` -- ALTER TABLE `airline` ADD PRIMARY KEY (`Flight_ID`), ADD KEY `Reference_no` (`Reference_no`); -- -- Indexes for table `airline_coordinator` -- ALTER TABLE `airline_coordinator` ADD PRIMARY KEY (`Login_username`), ADD UNIQUE KEY `email` (`email`); -- -- Indexes for table `answers` -- ALTER TABLE `answers` ADD PRIMARY KEY (`Login_username`,`enquiry_id`), ADD KEY `enquiry_id` (`enquiry_id`); -- -- Indexes for table `booking` -- ALTER TABLE `booking` ADD PRIMARY KEY (`login_username`,`Flight_ID`); -- -- Indexes for table `customer` -- ALTER TABLE `customer` ADD PRIMARY KEY (`login_username`), ADD UNIQUE KEY `email` (`email`) USING BTREE; -- -- Indexes for table `customer_care_agent` -- ALTER TABLE `customer_care_agent` ADD PRIMARY KEY (`login_username`), ADD UNIQUE KEY `email` (`email`); -- -- Indexes for table `enquiry` -- ALTER TABLE `enquiry` ADD PRIMARY KEY (`Enquiry_ID`), ADD KEY `login_username` (`login_username`); -- -- Indexes for table `login` -- ALTER TABLE `login` ADD PRIMARY KEY (`Login_username`); -- -- Indexes for table `manages` -- ALTER TABLE `manages` ADD PRIMARY KEY (`Flight_ID`,`Login_username`); -- -- Indexes for table `passenger_info` -- ALTER TABLE `passenger_info` ADD PRIMARY KEY (`Aadhar_No`); -- -- Indexes for table `reference_flight_no` -- ALTER TABLE `reference_flight_no` ADD PRIMARY KEY (`Reference_no`); -- -- Indexes for table `ticket` -- ALTER TABLE `ticket` ADD PRIMARY KEY (`flight_ID`,`aadhar_no`), ADD KEY `aadhar_no` (`aadhar_no`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `enquiry` -- ALTER TABLE `enquiry` MODIFY `Enquiry_ID` int(8) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38; -- -- Constraints for dumped tables -- -- -- Constraints for table `airline` -- ALTER TABLE `airline` ADD CONSTRAINT `airline_ibfk_1` FOREIGN KEY (`Reference_no`) REFERENCES `reference_flight_no` (`Reference_no`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `airline_coordinator` -- ALTER TABLE `airline_coordinator` ADD CONSTRAINT `airline_coordinator_ibfk_1` FOREIGN KEY (`Login_username`) REFERENCES `login` (`Login_username`); -- -- Constraints for table `answers` -- ALTER TABLE `answers` ADD CONSTRAINT `answers_ibfk_1` FOREIGN KEY (`enquiry_id`) REFERENCES `enquiry` (`Enquiry_ID`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `answers_ibfk_2` FOREIGN KEY (`Login_username`) REFERENCES `login` (`Login_username`); -- -- Constraints for table `booking` -- ALTER TABLE `booking` ADD CONSTRAINT `booking_ibfk_1` FOREIGN KEY (`login_username`) REFERENCES `login` (`Login_username`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `customer` -- ALTER TABLE `customer` ADD CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`login_username`) REFERENCES `login` (`Login_username`); -- -- Constraints for table `customer_care_agent` -- ALTER TABLE `customer_care_agent` ADD CONSTRAINT `customer_care_agent_ibfk_1` FOREIGN KEY (`login_username`) REFERENCES `login` (`Login_username`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `enquiry` -- ALTER TABLE `enquiry` ADD CONSTRAINT `enquiry_ibfk_1` FOREIGN KEY (`login_username`) REFERENCES `login` (`Login_username`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `ticket` -- ALTER TABLE `ticket` ADD CONSTRAINT `ticket_ibfk_2` FOREIGN KEY (`flight_ID`) REFERENCES `airline` (`Flight_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 */;
INSERT INTO assunto (id,nome) VALUES (1,'Educação'); INSERT INTO assunto (id,nome) VALUES (2,'Computação'); INSERT INTO assunto (id,nome) VALUES (3,'Biologia'); INSERT INTO assunto (id,nome) VALUES (4,'Física'); INSERT INTO assunto (id,nome) VALUES (5,'História'); INSERT INTO assunto (id,nome) VALUES (6,'Romance'); INSERT INTO assunto (id,nome) VALUES (7,'Policial'); INSERT INTO assunto (id,nome) VALUES (8,'Saúde'); INSERT INTO assunto (id,nome) VALUES (9,'Marketing'); INSERT INTO assunto (id,nome) VALUES (10,'Administração'); INSERT INTO categoria (id,nome) VALUES (1,'Estudante'); INSERT INTO categoria (id,nome) VALUES (2,'Professor'); INSERT INTO categoria (id,nome) VALUES (3,'Funcionário'); INSERT INTO classificacao (id,nome) VALUES (1,'Ciências naturais'); INSERT INTO classificacao (id,nome) VALUES (2,'Ciências exatas'); INSERT INTO classificacao (id,nome) VALUES (3,'Ciências sociais'); INSERT INTO classificacao (id,nome) VALUES (4,'Ciências aplicadas'); INSERT INTO classificacao (id,nome) VALUES (5,'Artes'); INSERT INTO colecao (id,nome) VALUES (1,'Livros'); INSERT INTO colecao (id,nome) VALUES (2,'Periódicos'); INSERT INTO colecao (id,nome) VALUES (3,'DVD'); INSERT INTO colecao (id,nome) VALUES (4,'CD'); INSERT INTO configuracao (id,chave,valor) VALUES (1,'multa','2'); INSERT INTO configuracao (id,chave,valor) VALUES (2,'dias_emprestimo','7'); INSERT INTO estado (id,nome) VALUES (11,'Rondônia'); INSERT INTO estado (id,nome) VALUES (12,'Acre'); INSERT INTO estado (id,nome) VALUES (13,'Amazonas'); INSERT INTO estado (id,nome) VALUES (14,'Roraima'); INSERT INTO estado (id,nome) VALUES (15,'Pará'); INSERT INTO estado (id,nome) VALUES (16,'Amapá'); INSERT INTO estado (id,nome) VALUES (17,'Tocantins'); INSERT INTO estado (id,nome) VALUES (21,'Maranhão'); INSERT INTO estado (id,nome) VALUES (22,'Piauí'); INSERT INTO estado (id,nome) VALUES (23,'Ceará'); INSERT INTO estado (id,nome) VALUES (24,'Rio Grande do Norte'); INSERT INTO estado (id,nome) VALUES (25,'Paraíba'); INSERT INTO estado (id,nome) VALUES (26,'Pernambuco'); INSERT INTO estado (id,nome) VALUES (27,'Alagoas'); INSERT INTO estado (id,nome) VALUES (28,'Sergipe'); INSERT INTO estado (id,nome) VALUES (29,'Bahia'); INSERT INTO estado (id,nome) VALUES (31,'Minas Gerais'); INSERT INTO estado (id,nome) VALUES (32,'Espírito Santo'); INSERT INTO estado (id,nome) VALUES (33,'Rio de Janeiro'); INSERT INTO estado (id,nome) VALUES (35,'São Paulo'); INSERT INTO estado (id,nome) VALUES (41,'Paraná'); INSERT INTO estado (id,nome) VALUES (42,'Santa Catarina'); INSERT INTO estado (id,nome) VALUES (43,'Rio Grande do Sul'); INSERT INTO estado (id,nome) VALUES (50,'Mato Grosso do Sul'); INSERT INTO estado (id,nome) VALUES (51,'Mato Grosso'); INSERT INTO estado (id,nome) VALUES (52,'Goiás'); INSERT INTO estado (id,nome) VALUES (53,'Distrito Federal'); INSERT INTO status (id,nome) VALUES (1,'Disponível'); INSERT INTO status (id,nome) VALUES (2,'Emprestado'); INSERT INTO status (id,nome) VALUES (3,'Perdido');
--修改日期:20120920 --修改人:高枫 --修改内容:XD-JD03-027 系统功能-贷款还款 --修改内容:系统菜单 增加 贷款台账还款 --参数设置: INSERT INTO BT_SYS_RES (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, REVERSE7, REVERSE8, REVERSE9, REVERSE10, RES_LEVEL, RES_ROLE) SELECT (SELECT MAX(T1.RES_CODE) + 1 FROM BT_SYS_RES T1), '贷款还款台账', 'cms', RES_CODE, '/cms/cmsLoanRepay.do?method=initQuery', '0', '1', '0', '0', (SELECT MAX(T2.RES_ORDER)+1 FROM BT_SYS_RES T2 WHERE T2.FATHER_CODE = T3.RES_CODE AND T2.SYS_CODE = 'cms'), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2, '' FROM BT_SYS_RES T3 WHERE T3.RES_NAME = '贷款管理' AND T3.SYS_CODE = 'cms'; COMMIT; CREATE OR REPLACE VIEW V_CMS_REPAY_VIEW AS SELECT CRL.CRL_ID, --还款单号 CLB.CLB_NO, --贷款单号 CLB.CLB_ID, --台账id CLB.CLB_LOAN_CORP_ID AS BL_CORP_ID, BL.CORP_NAME AS BL_CORP_NAME, CLB.CLB_BORROW_CORP_ID AS BB_CORP_ID, BB.CORP_NAME AS BB_CORP_NAME, ROUND(NVL(CRL.CRL_MONEY,0), 2) AS CRL_MONEY, --本金 ROUND(NVL(CRL.CRL_FIXED_MONEY, 0), 2) AS CRL_FIXED_MONEY, --固定占用费 ROUND(NVL(CRL.CRL_AGREEMENT_MONEY,0), 2) AS CRL_AGREEMENT_MONEY, -- 协定占用费 ROUND(NVL(CLB.CLB_LOAN_MONEY,0), 2) AS CLB_LOAN_MONEY, --贷款本金 ROUND(NVL(CLB.CLB_BALANCE,0), 2) AS CLB_BALANCE, --当前余额 ROUND(NVL(CRL.CRL_MONEY,0)+NVL(CRL.CRL_FIXED_MONEY, 0)+NVL(CRL.CRL_AGREEMENT_MONEY,0), 2) REPAYMONEY, CRL.CRL_DATE, CRL.CRL_DESC, CRL.CRL_STATUS, CRL.CRL_NO, CRL.USER_ID, CRL.NEXTCHECKER FROM CMS_REPAY_LOAN CRL INNER JOIN CMS_LOAN_BILL CLB ON CLB.CLB_ID = CRL.CLB_ID INNER JOIN BT_CORP BL ON CLB.CLB_LOAN_CORP_ID = BL.ID INNER JOIN BT_CORP BB ON CLB.CLB_BORROW_CORP_ID = BB.ID GROUP BY CRL.CRL_ID, CLB.CLB_NO, CLB.CLB_ID, CLB.CLB_LOAN_CORP_ID, BL.CORP_NAME, CLB.CLB_BORROW_CORP_ID, BB.CORP_NAME, CRL.CRL_MONEY, CRL.CRL_FIXED_MONEY, CRL.CRL_AGREEMENT_MONEY, CLB.CLB_LOAN_MONEY, CLB.CLB_BALANCE, CRL.CRL_DATE, CRL.CRL_DESC, CRL.CRL_STATUS, CRL.CRL_NO, CRL.USER_ID, CRL.NEXTCHECKER;
USE psdb; SELECT first_name,last_name FROM psdb.employees WHERE psdb.employees.emp_no=14037;
-- LABORATORY WORK 4 -- BY Kharytonchyk_Oleksandr -- При изменении имени человека удалять все написанные ним песни. set serveroutput on CREATE OR REPLACE TRIGGER deleting_of_written_songs BEFORE UPDATE OF human_name ON Human for EACH ROW DECLARE id_to_delete human.human_identific_number%type; BEGIN SELECT human_identific_number into id_to_delete FROM Human WHERE human_name = :old.human_name; DELETE FROM human_writes_song WHERE human_writes_song.human_identific_number = id_to_delete; END; -- Не дает изменить название альбома, если он не пустой (в нем есть песни). CREATE OR REPLACE TRIGGER rename_of_album before UPDATE OF song_album ON Song for each row DECLARE count_song number; not_empty_album exception; BEGIN SELECT COUNT(song_title) into count_song FROM SONG WHERE song_album = :old.song_album; IF count_song > 0 THEN raise not_empty_album; END IF; exception when not_empty_album then raise_application_error('-20787', 'Can not rename album name, because it is not empty'); END; -- Параметром курсора является имя человека. Курсор выводит в консоль -- все написанные ним песни, которые он пел. DECLARE CURSOR human_cur(v_human_name human.human_name%type) IS SELECT human_writes_song.song_title FROM Human JOIN human_writes_song ON Human.human_identific_number = human_writes_song.human_identific_number JOIN human_sings_song ON human_writes_song.human_identific_number = human_sings_song.human_identific_number WHERE (Human.human_name = v_human_name) AND (human_writes_song.song_title = human_sings_song.song_title); human_rec human_cur%ROWTYPE; v_name human.human_name%type; BEGIN v_name := 'Malcolm'; OPEN human_cur(v_name); LOOP FETCH human_cur INTO human_rec; EXIT WHEN human_cur%NOTFOUND; DBMS_OUTPUT.PUT_LINE(human_rec.song_title); END LOOP; CLOSE human_cur; END;
-- phpMyAdmin SQL Dump -- version 4.0.10deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 03, 2014 at 04:39 PM -- Server version: 5.5.40-0ubuntu0.14.04.1 -- PHP Version: 5.5.9-1ubuntu4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 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 utf8 */; -- -- Database: `vislab` -- -- -------------------------------------------------------- -- -- Table structure for table `category` -- CREATE TABLE IF NOT EXISTS `category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `product` -- CREATE TABLE IF NOT EXISTS `product` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sku` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `price` decimal(10,0) NOT NULL, `category_id` int(11) DEFAULT NULL, `color` varchar(50) NOT NULL, `weight` decimal(10,0) NOT NULL, `quantity` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `category_id` (`category_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `firstname` varchar(255) NOT NULL, `lastname` varchar(255) NOT NULL, `is_admin` tinyint(1) NOT NULL DEFAULT '0', `password` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `username`, `firstname`, `lastname`, `is_admin`, `password`) VALUES (1, 'admin', 'Max', 'Mustermann', 1, '40bd001563085fc35165329ea1ff5c5ecbdbbeef'), (2, 'Customer1', 'Moritz', 'Lutz', 0, '40bd001563085fc35165329ea1ff5c5ecbdbbeef'), (3, 'das', 'ads', 'asd', 0, 'das'); -- -- Constraints for dumped tables -- -- -- Constraints for table `product` -- ALTER TABLE `product` ADD CONSTRAINT `fk_product_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`) ON DELETE SET NULL; /*!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 trades_with_quotes ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, hash BLOB UNIQUE NOT NULL, preimage BLOB UNIQUE, destinationAmountAsset VARCHAR(5) NOT NULL REFERENCES assets(symbol), destinationAmountUnit VARCHAR(20) NOT NULL REFERENCES units(unit), destinationAmountValue INTEGER NOT NULL, sourceAmountAsset VARCHAR(5) NOT NULL REFERENCES assets(symbol), sourceAmountUnit VARCHAR(20) NOT NULL REFERENCES units(unit), sourceAmountValue INTEGER NOT NULL, expiration DATETIME NOT NULL, startTime DATETIME DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), endTime DATETIME, failureCode INTEGER ); INSERT INTO trades_with_quotes ( id, hash, preimage, destinationAmountAsset, destinationAmountUnit, destinationAmountValue, sourceAmountAsset, sourceAmountUnit, sourceAmountValue, expiration, startTime, endTime, failureCode ) SELECT id, hash, preimage, destinationAmountAsset, destinationAmountUnit, destinationAmountValue, sourceAmountAsset, sourceAmountUnit, sourceAmountValue, -- while we don't have an exact expiration for legacy trades, we can -- estimate it as 5 seconds from the start time of the trade. strftime('%Y-%m-%dT%H:%M:%fZ', startTime, '+5 seconds') AS expiration, strftime('%Y-%m-%dT%H:%M:%fZ', startTime) AS startTime, strftime('%Y-%m-%dT%H:%M:%fZ', endTime) AS endTime, failureCode FROM trades; DROP TABLE trades; ALTER TABLE trades_with_quotes RENAME TO trades;
--Creating tables CREATE TABLE IF NOT EXISTS students( username VARCHAR(256) NOT NULL PRIMARY KEY, password VARCHAR(256) NOT NULL, sessionn VARCHAR(256) ); CREATE TABLE IF NOT EXISTS instructors( username VARCHAR(256) NOT NULL PRIMARY KEY, password VARCHAR(256) NOT NULL, sessionn VARCHAR(256) ); CREATE TABLE IF NOT EXISTS feedback( username VARCHAR(256) NOT NULL, question VARCHAR(256) NOT NULL, comment VARCHAR(256), FOREIGN KEY(username) REFERENCES instructors(username) ); CREATE TABLE IF NOT EXISTS marks( username VARCHAR(256) NOT NULL, mark_id VARCHAR(256) NOT NULL, mark INTEGER NOT NULL, FOREIGN KEY(username) REFERENCES students(username), CHECK (mark_id IN ('Q1', 'Q2', 'Q3', 'Q4', 'A1', 'A2', 'A3', 'Final')), CHECK (mark > -1 and mark <101) ); CREATE TABLE IF NOT EXISTS remark_requests( username VARCHAR(256) NOT NULL, mark_id VARCHAR(256) NOT NULL, comment VARCHAR(256), status VARCHAR(256), CHECK (status in ('in progress', 'addressed')), FOREIGN KEY(username) REFERENCES students(username) ); --Inserting values INSERT INTO students VALUES('student1', 'student1', 'LEC01'); INSERT INTO students VALUES('student2', 'student2', 'LEC02'); INSERT INTO students VALUES('student3', 'student3', 'LEC01'); INSERT INTO students VALUES('a', 'a', 'LEC02'); INSERT INTO instructors VALUES('instructor1', 'instructor1', 'LEC01'); INSERT INTO instructors VALUES('instructor2', 'instructor2', 'LEC02'); INSERT INTO instructors VALUES('instructor3', 'instructor3', 'LEC01'); INSERT INTO instructors VALUES('a', 'a', 'LEC02'); INSERT INTO feedback VALUES('instructor1', 'What do you like about the instructor teaching?', 'Nothing'); INSERT INTO feedback VALUES('instructor1', 'What do you recommend the instructor to do to improve their teaching?', 'I do not know'); INSERT INTO feedback VALUES('instructor1', 'What do you like about the labs?', 'Not sure, have not been'); INSERT INTO feedback VALUES('instructor1', 'What do you recommend the lab instructors to do to improve their lab teaching?', 'Give me a reason to attend'); INSERT INTO feedback VALUES('instructor1', 'What do you like about the instructor teaching?', 'Everything'); INSERT INTO feedback VALUES('instructor1', 'What do you like about the labs?', 'Love the labs'); INSERT INTO marks VALUES('a', 'Q1', 52); INSERT INTO marks VALUES('a', 'Q2', 94); INSERT INTO marks VALUES('a', 'Q3', 76); INSERT INTO marks VALUES('a', 'Q4', 83); INSERT INTO marks VALUES('a', 'A1', 62); INSERT INTO marks VALUES('a', 'A2', 43); INSERT INTO marks VALUES('a', 'A3', 94); INSERT INTO marks VALUES('a', 'Final', 85); INSERT INTO marks VALUES('student1', 'Q1', 100); INSERT INTO marks VALUES('student1', 'Q2', 0); INSERT INTO marks VALUES('student1', 'Q3', 75); INSERT INTO marks VALUES('student1', 'Q4', 63); INSERT INTO marks VALUES('student1', 'A1', 69); INSERT INTO marks VALUES('student1', 'A2', 64); INSERT INTO marks VALUES('student1', 'A3', 79); INSERT INTO marks VALUES('student1', 'Final', 84); INSERT INTO marks VALUES('student2', 'Q1', 10); INSERT INTO marks VALUES('student2', 'Q2', 68); INSERT INTO marks VALUES('student2', 'Q3', 74); INSERT INTO marks VALUES('student2', 'Q4', 30); INSERT INTO marks VALUES('student2', 'A1', 58); INSERT INTO marks VALUES('student2', 'A2', 99); INSERT INTO remark_requests VALUES('student2', 'A2', 'my last answer was graded wrong', 'in progress'); INSERT INTO remark_requests VALUES('student1', 'Q2', 'my first answer was graded wrong', 'in progress'); INSERT INTO remark_requests VALUES('a', 'Final', 'question 4 was graded wrong because ...', 'in progress');
START TRANSACTION SELECT @id := MAX(id)+1 FROM ORDERS; INSERT INTO ORDERS (@id,user_id) VALUES (); INSERT INTO ORDER_DETAILS (id,@id,product_id) VALUES (); COMMIT;
/** * Execute like this: * mysql -u 'root' -p < createDB.sql */ /* drop database if exists `tdb`; create database `tdb`; create user tu@localhost identified by 'secretpass'; grant create, drop, select, update, insert on table `tdb`.* to `tu`; */ /** * Execute like this: * mysql -u 'tu' -p < createDB.sql */ use tdb; /*DROP TABLE IF EXISTS `users`;*/ CREATE TABLE users ( tumblr_uname VARCHAR(100) NOT NULL, access_token_key VARCHAR(100) NOT NULL, access_token_secret VARCHAR(100) NOT NULL, ); /* DROP TABLE IF EXISTS `posts`; CREATE TABLE `posts` ( `type` VARCHAR(100) NOT NULL, `access_token_key` VARCHAR(100) NOT NULL, `access_token_secret` VARCHAR(100) NOT NULL, );*/ /*drop database if exists `TestDB`; create database `TestDB`; use TestDB; create user 'testU' identified by 'testU'; grant create, drop, select, update, insert on table `testDB`.* to `testU`; */
INSERT INTO image_categories(id, name) VALUES (1, 'profile_image'), (2, 'featured');
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: sql102.byethost33.com -- Generation Time: May 07, 2021 at 01:40 AM -- Server version: 5.6.48-88.0 -- PHP Version: 7.2.22 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: `b33_28547139_milk` -- -- -------------------------------------------------------- -- -- Table structure for table `milk` -- CREATE TABLE `milk` ( `month` varchar(7) NOT NULL DEFAULT '', `num_day` int(2) DEFAULT NULL, `1` float DEFAULT NULL, `2` float DEFAULT NULL, `3` float DEFAULT NULL, `4` float DEFAULT NULL, `5` float DEFAULT NULL, `6` float DEFAULT NULL, `7` float DEFAULT NULL, `8` float DEFAULT NULL, `9` float DEFAULT NULL, `10` float DEFAULT NULL, `11` float DEFAULT NULL, `12` float DEFAULT NULL, `13` float DEFAULT NULL, `14` float DEFAULT NULL, `15` float DEFAULT NULL, `16` float DEFAULT NULL, `17` float DEFAULT NULL, `18` float DEFAULT NULL, `19` float DEFAULT NULL, `20` float DEFAULT NULL, `21` float DEFAULT NULL, `22` float DEFAULT NULL, `23` float DEFAULT NULL, `24` float DEFAULT NULL, `25` float DEFAULT NULL, `26` float DEFAULT NULL, `27` float DEFAULT NULL, `28` float DEFAULT NULL, `29` float DEFAULT NULL, `30` float DEFAULT NULL, `31` float DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `milk` -- INSERT INTO `milk` (`month`, `num_day`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15`, `16`, `17`, `18`, `19`, `20`, `21`, `22`, `23`, `24`, `25`, `26`, `27`, `28`, `29`, `30`, `31`) VALUES ('2021-1', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-10', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-11', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-12', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-2', 28, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-3', 31, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-4', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-6', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-7', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-8', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-9', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-1', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-10', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-11', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-12', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-2', 28, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-3', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-4', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-5', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-6', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-7', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-8', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2022-9', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-1', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-10', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-11', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-12', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-2', 28, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-3', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-4', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-5', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-6', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-7', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-8', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2023-9', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-1', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-10', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-11', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-12', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-2', 29, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-3', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-4', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-5', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-6', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-7', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-8', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2024-9', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-1', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-10', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-11', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-12', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-2', 28, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-3', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-4', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-5', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-6', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-7', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-8', 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2025-9', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), ('2021-5', 31, 0.5, 0.5, 0, 1, 0, 0.5, 0.5, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `milk` -- ALTER TABLE `milk` ADD PRIMARY KEY (`month`), ADD KEY `month` (`month`); 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 */;
-- MySQL Administrator dump 1.4 -- -- ------------------------------------------------------ -- Server version 5.1.62-0ubuntu0.11.10.1 /*!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 */; /*!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' */; -- -- Create schema SPITTER -- CREATE DATABASE IF NOT EXISTS SPITTER; USE SPITTER; -- -- Definition of table `SPITTER`.`FOLLOWING_RELATION` -- DROP TABLE IF EXISTS `SPITTER`.`FOLLOWING_RELATION`; CREATE TABLE `SPITTER`.`FOLLOWING_RELATION` ( `FOLLOWER_ID` bigint(20) unsigned NOT NULL, `FOLLOWED_ID` bigint(20) unsigned NOT NULL, UNIQUE KEY `FOLLOWER_ID` (`FOLLOWER_ID`,`FOLLOWED_ID`), KEY `followed_id_fk` (`FOLLOWED_ID`), CONSTRAINT `followed_id_fk` FOREIGN KEY (`FOLLOWED_ID`) REFERENCES `USER` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `follower_id_fk` FOREIGN KEY (`FOLLOWER_ID`) REFERENCES `USER` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SPITTER`.`FOLLOWING_RELATION` -- /*!40000 ALTER TABLE `FOLLOWING_RELATION` DISABLE KEYS */; LOCK TABLES `FOLLOWING_RELATION` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `FOLLOWING_RELATION` ENABLE KEYS */; -- -- Definition of table `SPITTER`.`TWEET` -- DROP TABLE IF EXISTS `SPITTER`.`TWEET`; CREATE TABLE `SPITTER`.`TWEET` ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `USER_ID` bigint(20) unsigned NOT NULL, `TWEET_DATE` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `TEXT` varchar(140) NOT NULL, PRIMARY KEY (`ID`), KEY `fk_user` (`USER_ID`), CONSTRAINT `fk_user` FOREIGN KEY (`USER_ID`) REFERENCES `USER` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=latin1; -- -- Dumping data for table `SPITTER`.`TWEET` -- /*!40000 ALTER TABLE `TWEET` DISABLE KEYS */; LOCK TABLES `TWEET` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `TWEET` ENABLE KEYS */; -- -- Definition of table `SPITTER`.`USER` -- DROP TABLE IF EXISTS `SPITTER`.`USER`; CREATE TABLE `SPITTER`.`USER` ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `NICKNAME` varchar(100) NOT NULL, `FIRSTNAME` varchar(100) DEFAULT NULL, `LASTNAME` varchar(100) DEFAULT NULL, `PASSWORD` varchar(100) NOT NULL, `EMAIL` varchar(100) NOT NULL, `UPDATE_BY_EMAIL` tinyint(1) NOT NULL, `USER_PIC` varchar(100) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `unique_nickname` (`NICKNAME`) ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1; -- -- Dumping data for table `SPITTER`.`USER` -- /*!40000 ALTER TABLE `USER` DISABLE KEYS */; LOCK TABLES `USER` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `USER` ENABLE KEYS */; -- -- Definition of table `SPITTER`.`USER_ROLES` -- DROP TABLE IF EXISTS `SPITTER`.`USER_ROLES`; CREATE TABLE `SPITTER`.`USER_ROLES` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` bigint(20) unsigned NOT NULL, `authority` varchar(100) NOT NULL, PRIMARY KEY (`id`), KEY `fk_user_constraint` (`user_id`), CONSTRAINT `fk_user_constraint` FOREIGN KEY (`user_id`) REFERENCES `USER` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1; -- -- Dumping data for table `SPITTER`.`USER_ROLES` -- /*!40000 ALTER TABLE `USER_ROLES` DISABLE KEYS */; LOCK TABLES `USER_ROLES` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `USER_ROLES` ENABLE KEYS */; /*!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 */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50714 Source Host : localhost:3306 Source Database : parper Target Server Type : MYSQL Target Server Version : 50714 File Encoding : 65001 Date: 2019-09-27 17:47:22 */ SET FOREIGN_KEY_CHECKS=0;
-- https://www.urionlinejudge.com.br/judge/en/problems/view/2604 select id, name from products where price < 10 or price > 100
DROP DATABASE IF EXISTS PontoAcesso; CREATE DATABASE PontoAcesso; USE PontoAcesso; CREATE TABLE Setor( idSetor INT NOT NULL auto_increment, nome VARCHAR(45) NOT NULL, CONSTRAINT pk_setor PRIMARY KEY (idSetor) ); CREATE TABLE Funcao( idFuncao INT NOT NULL auto_increment, idSetor INT NOT NULL, nome VARCHAR(45) NOT NULL, CONSTRAINT pk_funcao PRIMARY KEY (idFuncao), CONSTRAINT fk_funcao_setor FOREIGN KEY (idSetor) REFERENCES Setor(idSetor) ); CREATE TABLE Horario ( idHorario INT NOT NULL auto_increment, nome VARCHAR(45) NOT NULL, inicio TIME NOT NULL, termino TIME NOT NULL, almocoInicio TIME NOT NULL, almocoTermino TIME NOT NULL, segunda BOOLEAN NOT NULL, terca BOOLEAN NOT NULL, quarta BOOLEAN NOT NULL, quinta BOOLEAN NOT NULL, sexta BOOLEAN NOT NULL, sabado BOOLEAN NOT NULL, domingo BOOLEAN NOT NULL, CONSTRAINT pk_horario PRIMARY KEY (idHorario) ); CREATE TABLE usuario( idUsuario INT NOT NULL auto_increment, nome VARCHAR(20) NOT NULL, senha VARCHAR(60) NOT NULL, CONSTRAINT pk_usuario PRIMARY KEY (idUsuario) ); CREATE TABLE Funcionario( idFuncionario INT NOT NULL auto_increment, nome VARCHAR(45) NOT NULL, sobrenome VARCHAR(45) NOT NULL, rg VARCHAR(12) NOT NULL, cpf VARCHAR(14) NOT NULL, ctps VARCHAR(45) NOT NULL, telefone VARCHAR(15) NOT NULL, rua VARCHAR(45) NOT NULL, numero INT NOT NULL, bairro VARCHAR(45) NOT NULL, cidade VARCHAR(45) NOT NULL, estado VARCHAR(45) NOT NULL, salarioHoras DOUBLE NOT NULL, suspensao BOOLEAN NOT NULL, idFuncao INT NOT NULL, admissao DATE NOT NULL, demissao DATE, CONSTRAINT fk_funcao FOREIGN KEY (idFuncao) REFERENCES Funcao(idFuncao), CONSTRAINT pk_funcionario PRIMARY KEY (idFuncionario) ); CREATE TABLE HorarioFuncionario ( idHorarioFuncionario INT NOT NULL auto_increment, idHorario INT NOT NULL, idFuncionario INT NOT NULL, CONSTRAINT pk_horario_funcionario PRIMARY KEY (idHorarioFuncionario), CONSTRAINT fk_horario FOREIGN KEY (idHorario) REFERENCES Horario(idHorario), CONSTRAINT fk_funcionario FOREIGN KEY (idFuncionario) REFERENCES Funcionario(idFuncionario) ); CREATE TABLE Empresa( idEmpresa INT NOT NULL auto_increment, nome VARCHAR(45) NOT NULL, razaoSocial VARCHAR(60) NOT NULL, cnpj VARCHAR(18) NOT NULL, rua VARCHAR(45) NOT NULL, numero INT NOT NULL, bairro VARCHAR(45) NOT NULL, cidade VARCHAR(45) NOT NULL, estado VARCHAR(45) NOT NULL, CONSTRAINT pk_empresa PRIMARY KEY (idEmpresa) ); CREATE TABLE Ferias( idFerias INT NOT NULL auto_increment, nome VARCHAR(45) NOT NULL, inicio DATE NOT NULL, termino DATE NOT NULL, CONSTRAINT pk_ferias PRIMARY KEY (idFerias) ); CREATE TABLE FuncionarioFerias( idFeriasfuncionario INT NOT NULL auto_increment, idFuncionario INT NOT NULL, idFerias INT NOT NULL, CONSTRAINT pk_funcionario_ferias PRIMARY KEY (idFeriasfuncionario), CONSTRAINT fk_funcionario_ferias FOREIGN KEY (idFuncionario) REFERENCES Funcionario(idFuncionario), CONSTRAINT fk_ferias FOREIGN KEY (idFerias) REFERENCES Ferias(idFerias) ); CREATE TABLE Abono( idAbono INT NOT NULL auto_increment, dataFalta DATE NOT NULL, descricao VARCHAR(60) NOT NULL, idFuncionario INT NOT NULL, CONSTRAINT pk_abono PRIMARY KEY (idAbono), CONSTRAINT fk_funcionario_abono FOREIGN KEY (idFuncionario) REFERENCES Funcionario(idFuncionario) ); CREATE TABLE Bonificacao ( idBonificacao INT NOT NULL auto_increment, nome VARCHAR(45) NOT NULL, valor FLOAT NOT NULL, CONSTRAINT pk_bonificacao PRIMARY KEY (idBonificacao) ); CREATE TABLE BonificacaoFuncionario ( idBonificacao INT NOT NULL, idFuncionario INT NOT NULL, CONSTRAINT fk_bonificacaofuncionario_bonificacao FOREIGN KEY (idBonificacao) REFERENCES Bonificacao(idBonificacao), CONSTRAINT fk_bonificacaofuncionario_funcionario FOREIGN KEY (idFuncionario) REFERENCES Funcionario(idFuncionario), CONSTRAINT pk_bonificacaofuncionario PRIMARY KEY (idBonificacao, idFuncionario) ); CREATE TABLE FuncionarioTag( idFuncionarioTag INT NOT NULL auto_increment, codigo VARCHAR(20) NOT NULL, ativo BOOLEAN NOT NULL, idFuncionario INT NOT NULL, CONSTRAINT pk_funcionario_tag PRIMARY KEY (idFuncionarioTag), CONSTRAINT fk_funcionario_funcionario_tag FOREIGN KEY (idFuncionario) REFERENCES Funcionario(idFuncionario) ); CREATE TABLE Ponto( idPonto INT NOT NULL auto_increment, horario DATETIME NOT NULL, idFuncionario INT NOT NULL, idFuncionarioTag INT NOT NULL, CONSTRAINT pk_ponto PRIMARY KEY (idPonto), CONSTRAINT fk_funcionario_ponto FOREIGN KEY (idFuncionario) REFERENCES Funcionario(idFuncionario), CONSTRAINT fk_ponto_tag FOREIGN KEY (idFuncionarioTag) REFERENCES FuncionarioTag(idFuncionarioTag) ); CREATE TABLE Imposto ( idImposto INT NOT NULL auto_increment, nome VARCHAR(45) NOT NULL, valor DOUBLE NOT NULL, CONSTRAINT pk_imposto PRIMARY KEY (idImposto) ); CREATE TABLE Logs ( idLog INT NOT NULL auto_increment, idUsuario INT NOT NULL, objeto VARCHAR(30) NOT NULL, objetoId INT NOT NULL, acao VARCHAR(60) NOT NULL, data DATETIME NOT NULL DEFAULT NOW(), CONSTRAINT pk_logs PRIMARY KEY (idLog), CONSTRAINT fk_log_usuario FOREIGN KEY (idUsuario) REFERENCES Usuario(idUsuario) ); CREATE TABLE Acesso( idAcesso INT NOT NULL auto_increment, horario DATETIME NOT NULL, idFuncionario INT NOT NULL, idFuncionarioTag INT NOT NULL, CONSTRAINT pk_acesso PRIMARY KEY (idAcesso), CONSTRAINT fk_funcionario_acesso FOREIGN KEY (idFuncionario) REFERENCES Funcionario(idFuncionario), CONSTRAINT fk_acesso_tag FOREIGN KEY (idFuncionarioTag) REFERENCES FuncionarioTag(idFuncionarioTag) ); CREATE TABLE Config ( idConfig INT NOT NULL auto_increment, com VARCHAR(5) NOT NULL, ponto BOOLEAN NOT NULL, CONSTRAINT pk_config PRIMARY KEY (idConfig) ); INSERT INTO Config (com, ponto) VALUES ("COM1", true); CREATE VIEW ShowTags as SELECT ft.idFuncionarioTag, concat(f.nome, ' ', f.sobrenome) as nome, f.cpf, ft.codigo, ft.ativo FROM Funcionario as f NATURAL JOIN FuncionarioTag as ft; CREATE VIEW FuncionarioTodasFerias as SELECT ff.idFeriasfuncionario, ff.idFerias, f.nome, f.inicio, f.termino, ff.idFuncionario FROM FuncionarioFerias as ff NATURAL JOIN Ferias as f; CREATE VIEW FuncionarioBonificacao as SELECT b.idBonificacao, b.nome, b.valor, bf.idFuncionario FROM Bonificacao as b NATURAL JOIN BonificacaoFuncionario as bf; CREATE VIEW AcessoRelatorio as SELECT COUNT(idAcesso) as numAcesso, DATE(horario) as dia, CONCAT(HOUR(horario),':00:00') as hora FROM Acesso GROUP BY DATE(horario), HOUR(horario);
SELECT --SUBSCRIBER_ID, -- NO ISSUE --SUBSCRIBER_CODE, -- NO ISSUE --LINE_TENURE, -- VALUES SHOULDN'T EXCEED # OF DAYS SERVICE WAS ACTIVE; CALCULATED AS CURRENT_DATE - CAST(STG_BSCS_V.T_CONTRACT_ALL.CO_ACTIVATED AS DATE); CHECK FOR END DATE? --DEALER_AT_ACT_CHANNEL_DESC, -- MOSTLY NULL; USING INNER JOIN ON STG_HANA_V.T_SPSALL.SALES_CODE = STG_BSCS_V.T_CONTRACT_REASON_HISTORY.DEALER_CODE_ENTRY; DEALER_CODE_ENTRY HAS VALUES LIKE 9254953|8499, WHILE MANY SALES_CODE VALUES OMIT THE SECOND PIECE (DEALER CODE?) (E.G., 3033614) --NUMBER_OF_PHONES, -- NO ISSUE --SUB_POS_SO_WITH_ACT_IND, -- STU UNSURE OF WHAT INFO FIELD IS SHOWING (I.E., EVALUATING IF EQUIPMENT PURCHASED AT TIME OF ACTIVATION BASED ON DATE MATCH BETWEEN CONTRACT ACTIVATION DATE AND EQUIPMENT PURCHASE); IN V7 OF THE SSA, THIS FIELD IS LISTED UNDER THE SUBSCRIBER 'CATEGORY' + DEFINED AS 'SUBSCRIBER SALES ORDER W/ POS W/ ACTIVATION INDICATOR'; SERIES OF INNER JOINS: STG_BSCS_V.T_HARDWARE_ASSET TO STG_BSCS_V.T_CONTRACT_ALL ON CO_ID, THEN TO STG_BSCS_V.L_MPDNPTAB (?) ON NPCODE (?) --IMEI, -- NO ISSUE --LAST_UPDATE_DATETIME, -- NO ISSUE --CHANNEL, -- NO ISSUE --PASS_NAME, -- NO ISSUE --PASS_ID, -- NO ISSUE --PASS_TYPE, -- NO ISSUE --CHANGE_IMSI, -- STU UNSURE OF INFO FROM FIELD; V7 OF SSA DEFINES IT AS 'SUBSCRIBER' CATEGORY + 'FLAG TO INDICATE THE IMSI WAS CHANGED' --SUBSCRIBER_STATUS_DATETIME, -- CONVERT FROM DATETIME TO DATE (CAST INSTEAD?) --SUBSCRIBER_MBB_INITIA_PASS_ACT_DATETIME,-- CONVERT FROM DATETIME TO DATE (CAST INSTEAD?) --PASS_UOM_CD, -- NO ISSUE --ACTIVATING_DEALER_CODE, -- MOSTLY NULLS; IS THERE A DIFFERENCE BETWEEN THIS AND DEALER_AT_ACT_CHANNEL_DESC (VALUES LOOK SIMILAR AND IT IS MATCHING DEALER_CODE_ENTRY FROM CONTRACT_ALL) --ACTIVATION_DATETIME, -- CONVERT FROM DATETIME TO DATE (CAST INSTEAD?) --DEACTIVATION_DATETIME, -- CONVERT FROM DATETIME TO DATE (CAST INSTEAD?) --REACTIVATION_DATETIME, -- CONVERT FROM DATETIME TO DATE (CAST INSTEAD?) --DEALER_CODE, -- LOGIC FOR FIELD PARSES DEALER_CODE_ENTRY FROM STG_BSCS_V.T_CONTRACT_HISTORY FOR '|' TO PULL OUT DEALER_CODE; HOWEVER; VALUES ARE MISSING FOR SOME RECORDS WHERE CHANNEL = 'RETAIL', WHICH SHOULD HAVE VALUES (I.E., STORE_ID HAS VALUES, WHICH COME FROM SAME FIELD); LOGIC MAY BE PLACED WHERE IT'S MUTUALLY EXCLUSIVE W/ DEALER_ID (SEE LINES 78-87 FROM VIEW DEFINITION) --FINAL_CANCEL_REASON, -- NO COMMENT; NO ISSUE ASSUMED --SUBSCRIBER_STATUS_ACTIVITY_CODE, -- SOURCED FROM IDW_TD_STG_TRANSIENT_V.NK_BUSINESS_STATUS -> DUPLICATE --SUBSCRIBER_STATUS_REASON_CODE, -- STU WOULD LIKE TO PULL IN RS_DESC FROM SAME TABLE (T_REASONSTATUS_ALL) --SUBSCRIBER_STATUS_ACTIVITY_DESCRIPTION, -- SOURCED FROM IDW_TD_STG_TRANSIENT_V.NK_BUSINESS_STATUS -> DUPLICATE --SUBSCRIBER_STATUS_DESCRIPTION, -- SOURCED FROM IDW_TD_STG_TRANSIENT_V.NK_BUSINESS_STATUS -> DUPLICATE --REASON_TYPE, -- NO ISSUE --STORE_ID, -- NO ISSUE --FORTEEN_DAY_DEACTIVATION_FLAG, -- RETURNS 'Y' WHEN T_CONTRACT_ALL.CH_STATUS = 'D' AND (CH_STATUS_VALID_FROM - CO_SIGNED) <= 14; FIELD IS NOT IN V7 OF SSA --MSISDN, -- NO ISSUE WIN_BACK_MSISDN, -- UNTESTED DUE TO NO NON-NULL VALUES; LOGIC IS COMPLICATED, WIN_BACK_MSISDN COMES FROM STG_BSCS_V.T_DIRECTORY_NUMBER WHERE THE NUMBER MEETS SEVERAL CRITERIA (PORTED IN, MAYBE CONFLICTING STATUSES FROM PORTING_REQUEST_HISTORY [ACTION_ID = 1 AND/OR 2) --SIM_VALID_FROM, -- POSSIBLY BROKEN; NO NON-NULL VALUES; LOGIC SEEMS OVERLY COMPLICATED + PULLS FROM T_CUSTOMER_ALL, T_CUSTOMER_CHARACTERISTICS, AND T_HARDWARE_ASSET --SIM_TYPE, -- POSSIBLY BROKEN; NO NON-NULL VALUES; SAME ISSUE AS SIM_VALID_FROM MASTER_DEALER_CODE, -- MOSTLY NULL VALUES (ONLY 143 NON-NULL); LOTS OF ISSUES IN FIELDS WHICH RELY ON DEALER_CODE_ENTRY; SEE LINES 233-249 FROM VIEW DEFINITION. DEALER_NAME, -- MOSTLY NULL VALUES (ONLY 143 NON-NULL); LOTS OF ISSUES IN FIELDS WHICH RELY ON DEALER_CODE_ENTRY; SEE LINES 233-249 FROM VIEW DEFINITION. CHANNEL_DESCRIPTION, -- MOSTLY NULL VALUES (ONLY 143 NON-NULL); LOTS OF ISSUES IN FIELDS WHICH RELY ON DEALER_CODE_ENTRY; SEE LINES 233-249 FROM VIEW DEFINITION. DEALER_MASTER_LOCATION, -- MOSTLY NULL VALUES (ONLY 143 NON-NULL); LOTS OF ISSUES IN FIELDS WHICH RELY ON DEALER_CODE_ENTRY; SEE LINES 233-249 FROM VIEW DEFINITION. --LINE_OF_BUSINESS -------------------------- /* Formatted on 11/1/2017 10:33:35 AM (QP5 v5.114.809.3010) */ SELECT CA.CO_ID SUBSCRIBER_ID, CO_CODE SUBSCRIBER_CODE, CASE WHEN CA.CH_STATUS != 'd' THEN TO_CHAR (TRUNC (SYSDATE) - TRUNC (CO_ACTIVATED)) WHEN CA.CH_STATUS = 'd' THEN TO_CHAR ( (TRUNC (CO_MODDATE) - TRUNC (CO_ACTIVATED))) END AS "LINE_TENURE", CHANNEL_CODE_ENTRY DEALER_AT_ACT_CHANNEL_DESC, REVERSE(SUBSTR (REVERSE (DEALER_CODE_ENTRY), INSTR (REVERSE (DEALER_CODE_ENTRY), '|') + 1)) ACTIVATING_DEALER_CODE, CO_ACTIVATED ACTIVATION_DATETIME, COUNT_PHONE, CASE WHEN (TRUNC (CO_ACTIVATED) = TRUNC (H1.VALID_FROM) AND CA.CHANNEL_CODE_ENTRY ='RETAIL' AND CA.ORDER_ID_ENTRY = H1.ORDER_ID_ENTRY ) THEN 'Y' -- ADD SAME ORDER ELSE 'N' END AS "SUB_POS_SO_WITH_ACT_IND", HA_CODE IMEI, CO_MODDATE LAST_UPDATE_DATETIME, CA.CHANNEL_CODE_ENTRY CHANNEL, OFFER_NAME PASS_NAME, OFFER_ID PASS_ID, OFFER_TYPE PASS_TYPE, CASE WHEN CD_STATUS = 'R' THEN CD_ACTIV_DATE ELSE NULL END AS "CHANGE_IMSI_DT"--THEN 'Y' ELSE 'N' END AS "CHANGE_IMSI", --INCLUDE IMSI CHANEGE DATETIME INSTEAD OF Y/N DURATION || ' ' || DURATION_UOM PASS_UOM_CD, CASE WHEN CUST_EXT.STRING10 = 'X' THEN 'SOFT SIM' ELSE 'PHYSICAL SIM' END "SIM_TYPE", H1.VALID_FROM SIM_VALID_FROM, RS_DESC SUBSCRIBER_STATUS_REASON_CODE, SUB_STATUS.BUSINESS_STATUS SUBSCRIBER_STATUS_DESCRIPTION, CA.CH_STATUS SUB_STATUS_ACTIVITY_CODE, CA.CH_STATUS REASON_TYPE, MBB_ACT_DATE SUB_MBB_INIT_PASS_ACT_DATETIME, CA.CO_MODDATE SUBSCRIBER_STATUS_DATETIME, CASE WHEN BUSINESS_STATUS IN ('CANCELLED', 'CLOSED') THEN RS_DESC ELSE 'N/A' END AS "FINAL_CANCEL_REASON", CASE WHEN BUSINESS_STATUS = 'CLOSED' THEN TRUNC (CH_VALIDFROM) END AS "DEACTIVATION_DATETIME", CASE WHEN (CA.CH_STATUS = 'd' AND TRUNC (CA.CO_MODDATE) - TRUNC(CO_ACTIVATED) = 14) THEN 'Y' ELSE 'N' END AS "FORTEEN_DAY_DEACTIVATION_FLAG", MSISDN.DN_NUM MSISDN, CASE WHEN TRUNC (CO_ACTIVATED) != TRUNC (REACT_DATE) THEN TRUNC (REACT_DATE) END "REACTIVATION_DATETIME", BU.DESCRIPTION LINE_OF_BUSINESS FROM CONTRACT_ALL CA, BUSINESS_UNIT BU, ( SELECT HA.CO_ID, COUNT ( * ) COUNT_PHONE FROM HARDWARE_ASSET HA, MPDNPTAB M WHERE HA.NPCODE = M.NPCODE AND M.SHDES = 'IMEI' --AND (VALID_TO IS NULL OR VALID_TO > SYSDATE) -- Removing 'Active Only' from phone count GROUP BY CO_ID) H, (SELECT HA.CO_ID, VALID_FROM, HA_CODE, HA.NPCODE, HA.SEQNO, HA.ORDER_ID_ENTRY, HA.CUSTOMER_ID FROM HARDWARE_ASSET HA, MPDNPTAB M WHERE HA.NPCODE = M.NPCODE AND M.SHDES = 'IMEI' --AND (VALID_TO IS NULL OR VALID_TO > SYSDATE) ) H1, (SELECT CO_ID, OFFER_NAME, OFFER_ID, OFFER_TYPE, DURATION, DURATION_UOM FROM NK_SESSION_PASS_HISTORY NK WHERE SESSION_PASS_HIST_ID = (SELECT MAX (SESSION_PASS_HIST_ID) FROM NK_SESSION_PASS_HISTORY B WHERE NK.SESSION_PASS_ID = B.SESSION_PASS_ID)) SPH, ( SELECT MIN (START_DATE) MBB_ACT_DATE, CO_ID FROM NK_SESSION_PASS_HISTORY NK WHERE SESSION_PASS_HIST_ID = (SELECT MAX (SESSION_PASS_HIST_ID) FROM NK_SESSION_PASS_HISTORY B WHERE NK.SESSION_PASS_ID = B.SESSION_PASS_ID) AND OFFER_CATEGORY = 'DATA' GROUP BY CO_ID) MBB, (SELECT CD.CO_ID, CD_STATUS, CD_ACTIVE_DATE FROM CONTR_DEVICES CD WHERE CD.CD_ACTIV_DATE IN (SELECT MAX (Z.CD_ACTIV_DATE) FROM CONTR_DEVICES Z WHERE Z.CO_ID = CD.CO_ID)) CDEV, (SELECT EXT_ID, STRING10, CUSTOMER_ID FROM CUSTOMER_CHARACTERISTICS CC, CHARACTERISTICS_DEF CD WHERE CC.CHAR_ID = CD.CHAR_ID AND CD.CHAR_SHDES = 'HWASTEXT') CUST_EXT, (SELECT RS.RS_DESC, CO_ID, NK.BUSINESS_STATUS, CH.CH_STATUS, CH_VALIDFROM FROM CONTRACT_HISTORY CH, REASONSTATUS_ALL RS, NK_BUSINESS_STATUS NK WHERE CH.CH_REASON = RS.RS_ID AND CH.CH_REASON = NK.RS_ID) SUB_STATUS, ( SELECT MAX (CH.CH_VALIDFROM) REACT_DATE, CH.CO_ID FROM CONTRACT_HISTORY CH WHERE CH.CH_STATUS = 'a' AND CH_PENDING IS NULL AND CH_REASON !=156 -- REMOVE RATE PLAN CHANGES GROUP BY CH.CO_ID HAVING COUNT ( * ) > 1) REACT, (SELECT DN.DN_NUM, CS.CO_ID FROM CONTR_SERVICES_CAP CS, DIRECTORY_NUMBER DN WHERE CS.DN_ID = DN.DN_ID AND CS.CS_ACTIV_DATE IN (SELECT MAX (CS_ACTIV_DATE) FROM CONTR_SERVICES_CAP CS1 WHERE CS1.CO_ID = CS.CO_ID)) MSISDN WHERE CO_ACTIVATED IS NOT NULL AND CA.CO_ID = H.CO_ID AND CA.CO_ID = H1.CO_ID AND CA.CO_ID = SPH.CO_ID AND CA.CO_ID = CDEV.CO_ID AND H1.CUSTOMER_ID = CUST_EXT.CUSTOMER_ID(+) AND H1.HA_CODE || '|' || H1.NPCODE || '|' || H1.SEQNO =CUST_EXT.EXT_ID(+) AND CA.CO_ID = SUB_STATUS.CO_ID AND CA.CH_STATUS = SUB_STATUS.CH_STATUS AND CA.CO_ID = MBB.CO_ID AND CA.CO_ID = MSISDN.CO_ID AND CA.CO_ID = REACT.CO_ID AND CA.BUSINESS_UNIT_ID = BU.BUSINESS_UNIT_ID --AND CO_ID = 17070 ORDER BY CA.CO_ID DESC SELECT TRUNC(SYSDATE) - TRUNC(CO_ACTIVATED) FROM CONTRACT_ALL WHERE CH_STATUS='d' AND CO_ID = 17070 SELECT CD.CO_ID, CD_STATUS FROM CONTR_DEVICES CD WHERE CD.CD_ACTIV_DATE IN ( SELECT MAX(Z.CD_ACTIV_DATE) FROM CONTR_DEVICES Z WHERE Z.CO_ID = CD.CO_ID) AND CD.CD_STATUS = 'R' SELECT DECODE (NK.BUSINESS_STATUS, 'CLOSED', TRUNC(CH.CH_VALIDFROM), 'HH') "DEACTIVATION_DATETIME", RS.RS_DESC, CO_ID, NK.BUSINESS_STATUS FROM CONTRACT_HISTORY CH, REASONSTATUS_ALL RS, NK_BUSINESS_STATUS NK WHERE CH.CH_REASON = RS.RS_ID AND CH.CH_REASON = NK.RS_ID SELECT * FROM CUSTOMER_CHARACTERISTICS WHERE CHAR_ID = 27 SELECT HA.VALID_FROM, A.STRING10 FROM CUSTOMER_CHARACTERISTICS A, CHARACTERISTICS_DEF B, HARDWARE_ASSET HA, CONTRACT_ALL D WHERE A.CHAR_ID = B.CHAR_ID AND B.CHAR_DES = 'HardwareAssetExtension' AND HA.HA_CODE||'|'||HA.NPCODE||'|'||HA.SEQNO = A.EXT_ID (+) AND HA.CO_ID = D.CO_ID AND A.CUSTOMER_ID(+) = HA.CUSTOMER_ID AND STRING10 IS NOT NULL SELECT * FROM CHARACTERISTICS_DEF SELECT DISTINCT OFFER_CATEGORY FROM NK_SESSION_PASS_HISTORY SELECT DISTINCT OFFER_TYPE FROM NK_SESSION_PASS_HISTORY SELECT * FROM HARDWARE_ASSET WHERE CO_ID =19064 SELECT * FROM BUSINESS_UNIT SELECT business_unit_id FROM CONTRACT_ALL WHERE CH_STATUS='d' ORDER BY CO_MODDATE DESC SELECT SUBSTR(DEALER_CODE_ENTRY,INSTR(DEALER_CODE_ENTRY,'|')+1) STORE_CODE, DEALER_CODE_ENTRY DEALER_CODE, REVERSE(SUBSTR(REVERSE(DEALER_CODE_ENTRY), INSTR(REVERSE(DEALER_CODE_ENTRY),'|')+1)) FROM CONTRACT_ALL WHERE DEALER_CODE_ENTRY IS NOT NULL SELECT * FROM NK_BUSINESS_STATUS SELECT * FROM CONTRACT_HISTORY WHERE CO_ID = 19064 SELECT CA.CO_ID, CO_ACTIVATED, CO_MODDATE, CH.CH_VALIDFROM, CH.CH_STATUS, CH.CH_REASON FROM CONTRACT_ALL CA, CONTRACT_HISTORY CH WHERE CA.CH_STATUS = CH.CH_STATUS AND CA.CO_ID = CH.CO_ID AND CA.CH_STATUS = 'd' --AND CH_PENDING IS NOT NULL AND CO_MODDATE!= CH.CH_VALIDFROM SELECT DISTINCT DN.DN_NUM, COUNT(*) FROM SYSADM.PORTING_REQUEST_HISTORY PRH, SYSADM.DIRECTORY_NUMBER DN WHERE (PRH.ACTION_ID = '1' AND PRH.ACTION_ID = '2') /*MEANING PORT-IN */ --DETAILS IN PORTING_ACTION TABLE AND PRH.DN_ID = DN.DN_ID AND PRH.SEQNO = ( SELECT MAX( Z.SEQNO ) FROM SYSADM.PORTING_REQUEST_HISTORY Z WHERE Z.REQUEST_ID=PRH.REQUEST_ID ) AND PRH.STATUS = 's' --AND DN.DN_NUM = <<MSISDN>> -- FILTER WITH MSISDN GROUP BY DN_NUM --HAVING COUNT(*) > 0 SELECT * FROM PORTING_REQUEST_HISTORY SELECT * FROM PORTING_ACTION SELECT MAX(B.CH_VALIDFROM), A.CO_ID FROM CONTRACT_ALL A, CONTRACT_HISTORY B WHERE A.CO_ID = B.CO_ID AND B.CH_STATUS='a' --AND A.CO_CODE = <<CO_CODE>> -- SAMPLE CO_CODE '800010000771' AND A.CO_ID= 16780 AND CH_PENDING IS NULL GROUP BY A.CO_ID HAVING COUNT(*) > 1 SELECT * FROM CONTRACT_REASON_HISTORY WHERE CO_ID = 1769 SELECT * FROM CONTRACT_HISTORY WHERE CO_ID = 16780 SELECT * FROM REASONSTATUS_ALL WHERE RS_ID = 156 SELECT MAX (CH.CH_VALIDFROM) REACT_DATE, CH.CO_ID FROM CONTRACT_HISTORY CH WHERE CH.CH_STATUS = 'a' AND CH_PENDING IS NULL --AND CH_REASON !=156 AND CO_ID = 19064 GROUP BY CH.CO_ID HAVING COUNT ( * ) > 1 SELECT * FROM CONTRACT_ALL WHERE CO_ID = 19064 SELECT * FROM CONTR_dEVICES WHERE CD_STATUS='R'
CREATE DATABASE hero_squad; \c hero_squad; CREATE TABLE hero (name TEXT,id SERIAL PRIMARY KEY, age INTEGER, powers TEXT,weakness TEXT); CREATE TABLE squad (maxSize INTEGER,name TEXT,cause TEXT,id INTEGER); CREATE DATABASE hero_squad_test WITH TEMPLATE hero_squad;
-- Include table data insertion, updation, deletion and select scripts -- ------------------------------------------------------------------- -- Adding Movie Items in MovieCruiser Table -- ------------------------------------------------------------------- INSERT INTO movie_item VALUES (1, 'Avatar', 2787965087, 'Yes', '2017-03-15','Science Fiction', 'Yes'), (2, 'The Avengers', 1518812988, 'Yes', '2017-12-23', 'Superhero', 'No'), (3, 'Titanic', 2187463944, 'Yes','2017-08-21', 'Romance', 'No'), (4, 'Jurassic World', 1671713208, 'No','2017-07-02','Science Fiction', 'Yes'), (5, 'Avengers: End Game', 2750760348, 'Yes', '2022-11-02','Superhero', 'Yes'); -- --------------------------------------------------------- -- Displaying Movie Items -- -- ----------------------------------------------------------------- select movie_title as Title, movie_gross as Gross, movie_active as Active, movie_date_of_launch as Date_of_Launch, movie_genre as Genre, movie_has_teaser as Has_Teaser from movie_item; -- ------------------------------------------------------------------- -- Edit Movie Items in Movie Cruiser Table -- ------------------------------------------------------------------- update movie_item set movie_title='The Gentlemen',movie_gross=2589631478,movie_genre='Action Crime' where movie_id=1; -- ------------------------------------------------------------------- -- Displaying Updated movies in Movie Cruiser Table -- ------------------------------------------------------------------- select movie_title as Title, movie_gross as Gross, movie_active as Active, movie_date_of_launch as Date_of_Launch, movie_genre as Genre, movie_has_teaser as Has_Teaser from movie_item; -- ------------------------------------------------------------------- -- Displaying Customer Movie List in MovieItem Table -- ------------------------------------------------------------------- select movie_title as Title, movie_gross as Gross, movie_genre as Genre, movie_has_teaser as Has_Teaser from movie_item where movie_active='Yes' and movie_date_of_launch <= current_date(); -- ------------------------------------------------------------------- -- setting User Name and Id -- ------------------------------------------------------------------- INSERT INTO user VALUES (1,'Vinayak'), (2,'Asha'); -- --------------------------------------------------------- -- Displaying User Selected Items -- ----------------------------------------------------------------- select us_id as User_Id, us_title as User_Title from user; -- ------------------------------------------------------------------- -- Add to Favorites Table -- ------------------------------------------------------------------- insert into favorites(ft_us_id,ft_pr_id) values(2,1),(2,2),(2,5),(2,1),(1,1),(1,4); -- ------------------------------------------------------------------- -- ViewFavorites Movie Items -- ------------------------------------------------------------------- select ft_id as Id, ft_us_id as User_Id, ft_pr_id as Movie_Id from favorites; -- ------------------------------------------------------------------- -- Show Favorites Movie Items -- ------------------------------------------------------------------- SELECT movie_title as Title, movie_gross as Gross, movie_genre as Genre FROM movie_item INNER JOIN favorites ON ft_pr_id=movie_id WHERE ft_us_id=2; -- ----------------------------------------------------------------- -- Displaying User Movie Items -- ----------------------------------------------------------------- select ft_id as Title, ft_us_id as Gross, ft_pr_id as Genre from favorites; -- ------------------------------------------------------------------- -- Total Price of Favorites Movie Items -- ------------------------------------------------------------------- select count(movie_title) as no_of_favorites from movie_item inner join favorites on ft_pr_id=movie_id where ft_us_id=2; -- ----------------------------------------------------- -- Delete Favorite Items from Favorites Table -- ----------------------------------------------------- delete from favorites where ft_us_id=2 and ft_pr_id=1 limit 1; -- ------------------------------------------------------------------- -- View Remove Favorites -- ------------------------------------------------------------------- SELECT movie_title as Title, movie_gross as Gross, movie_genre as Genre FROM movie_item INNER JOIN favorites ON ft_pr_id=movie_id WHERE ft_us_id=2; -- ------------------------------------------------------------------- -- Show Total Number of Favorites Items -- ------------------------------------------------------------------- select count(movie_title) as no_of_favorites from movie_item inner join favorites on ft_pr_id=movie_id where ft_us_id=2;
/* Warnings: - You are about to drop the column `duration` on the `assessment` table. All the data in the column will be lost. - You are about to drop the column `schedule` on the `assessment` table. All the data in the column will be lost. - Added the required column `endTime` to the `assessment` table without a default value. This is not possible if the table is not empty. - Added the required column `startTime` to the `assessment` table without a default value. This is not possible if the table is not empty. */ -- AlterTable ALTER TABLE "assessment" DROP COLUMN "duration", DROP COLUMN "schedule", ADD COLUMN "endTime" TIMESTAMP(3) NOT NULL, ADD COLUMN "startTime" TIMESTAMP(3) NOT NULL;
insert into usuario values('admin@saude.com','$2a$10$Uxig9f1xNu3enQkxBA1tbutS1WYTADWweDLFvyrKzpDZ.Qjzo0/hu',3);
INSERT INTO `muse_dev`.`elementcode`(`elementId`,`code`,`locationId`) VALUES(32,4786,null); INSERT INTO `muse_dev`.`elementcode`(`elementId`,`code`,`locationId`) VALUES(33,1334,null); INSERT INTO `muse_dev`.`elementcode`(`elementId`,`code`,`locationId`) VALUES(34,2526,null); INSERT INTO `muse_dev`.`elementcode`(`elementId`,`code`,`locationId`) VALUES(35,8345,null);
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 15, 2020 at 01:28 PM -- Server version: 10.1.30-MariaDB -- PHP Version: 5.6.33 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: `venuefinder` -- -- -------------------------------------------------------- -- -- Table structure for table `book_venue` -- CREATE TABLE `book_venue` ( `book_id` varchar(20) NOT NULL, `venue_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `event_name` varchar(100) NOT NULL, `booking_date` varchar(255) NOT NULL, `session` varchar(30) NOT NULL, `advance_payment` int(10) NOT NULL, `remain_payment` int(10) NOT NULL, `total` int(10) NOT NULL, `transaction_id` varchar(100) NOT NULL, `event_status` varchar(20) NOT NULL DEFAULT 'Reserved', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `reason` varchar(500) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `book_venue` -- INSERT INTO `book_venue` (`book_id`, `venue_id`, `user_id`, `event_name`, `booking_date`, `session`, `advance_payment`, `remain_payment`, `total`, `transaction_id`, `event_status`, `created_at`, `reason`) VALUES ('BID13848', 5, 2, 'Birthday Party', '12-05-2020', 'evening', 1000, 5000, 0, '20200509111212800110168237001521056', 'Confirmed', '2020-05-09 14:30:37', ''), ('BID17277', 2, 3, 'Wedding Ceremony', '12-04-2020', 'fullday', 8000, 72000, 0, '20200312111212800110168332201517089', 'Completed', '2020-03-12 00:41:01', ''), ('BID17477', 2, 1, 'Engagement Ceremony', '30-01-2020', 'morning', 3500, 31500, 0, '20200110111212800110168114801509060', 'Completed', '2020-01-10 06:32:57', ''), ('BID17657', 9, 6, 'Wedding', '28-05-2020', 'fullday', 6000, 54000, 0, '20200430111212800110168510501729639', 'Confirmed', '2020-04-30 00:20:08', ''), ('BID18467', 2, 6, 'Wedding Ceremony', '09-04-2020', 'fullday', 8000, 72000, 0, '20200313111212800110168514901730842', 'Completed', '2020-03-13 02:21:25', ''), ('BID19911', 2, 7, 'Wedding Ceremony', '22-05-2020', 'fullday', 8000, 72000, 0, '20200425111212800110168169801537375', 'Canceled', '2020-04-25 08:01:56', 'Postpone date'), ('BID22581', 4, 5, 'Wedding', '02-05-2020', 'fullday', 6000, 0, 0, '6764', 'Reserved', '2020-04-08 01:41:47', ''), ('BID2353', 5, 5, 'Wedding', '10-06-2020', 'fullday', 6500, 54000, 0, '20200509111212800110168803001523564', 'Canceled', '2020-05-09 08:42:56', 'Family Problem'), ('BID23710', 4, 5, 'Wedding', '02-05-2020', 'fullday', 6000, 0, 0, '15065', 'Reserved', '2020-04-08 01:41:47', ''), ('BID26649', 10, 7, 'Wedding', '25-06-2020', 'fullday', 6000, 54000, 0, '20200520111212800110168509401510555', 'Confirmed', '2020-05-19 23:55:52', ''), ('BID26669', 7, 4, 'Wedding', '16-04-2020', 'fullday', 5000, 45000, 0, '20200310111212800110168888601519942', 'Completed', '2020-03-10 06:35:23', ''), ('BID26811', 4, 5, 'Wedding', '02-05-2020', 'fullday', 6000, 54000, 0, '20200408111212800110168299301529126', 'Completed', '2020-04-08 01:41:47', ''), ('BID26896', 2, 4, 'Wedding', '17-05-2020', 'fullday', 8000, 72000, 0, '20200417111212800110168765801521666', 'Confirmed', '2020-04-17 01:35:23', ''), ('BID27043', 7, 1, 'Engagement', '13-06-2020', 'morning', 5000, 5000, 0, '20200505111212800110168316701543918', 'Confirmed', '2020-05-04 21:56:21', ''), ('BID29317', 2, 5, 'Wedding Ceremony', '29-05-2020', 'fullday', 28000, 52000, 0, '20200507111212800110168557101508340', 'Confirmed', '2020-05-07 16:28:08', ''), ('BID31299', 5, 1, 'Wedding', '05-03-2020', 'fullday', 6500, 0, 0, '25586', 'Reserved', '2020-02-01 01:39:00', ''), ('BID31757', 4, 3, 'Wedding', '27-03-2020', 'fullday', 6000, 0, 0, '1700', 'Reserved', '2020-02-26 02:26:14', ''), ('BID5919', 3, 2, 'Engagement', '30-04-2020', 'morning', 1000, 8000, 0, '20200410111212800110168013901516264', 'Completed', '2020-04-10 00:04:56', ''), ('BID6013', 2, 2, 'Wedding Ceremony', '25-03-2020', 'fullday', 8000, 72000, 0, '20200210111212800110168371201545169', 'Completed', '2020-02-10 08:56:36', ''), ('BID6103', 2, 8, 'Engagement Ceremony', '16-06-2020', 'morning', 3500, 31500, 0, '20200508111212800110168677301514717', 'Confirmed', '2020-05-08 07:27:44', ''), ('BID6264', 2, 9, 'Reception ', '16-06-2020', 'evening', 2500, 22500, 0, '20200508111212800110168157501527014', 'Confirmed', '2020-05-08 07:22:07', ''), ('BID6808', 8, 3, 'Wedding', '27-05-2020', 'fullday', 7000, 63000, 0, '20200430111212800110168999201517144', 'Confirmed', '2020-04-30 03:58:41', ''), ('BID7210', 2, 2, 'Birthday Party', '19-03-2020', 'evening', 2000, 18000, 0, '20200305111212800110168470001514787', 'Completed', '2020-03-05 14:40:19', ''), ('BID7849', 4, 3, 'Wedding', '20-03-2020', 'fullday', 6000, 54000, 0, '20200226111212800110168159101525297', 'Completed', '2020-02-26 02:26:14', ''), ('BID8353', 5, 1, 'Wedding', '05-03-2020', 'fullday', 6500, 58500, 0, '20200201111212800110168261501519457', 'Canceled', '2020-02-01 01:39:00', ''); -- -------------------------------------------------------- -- -- Table structure for table `contact` -- CREATE TABLE `contact` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `phone` varchar(10) NOT NULL, `message` varchar(500) NOT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `contact` -- INSERT INTO `contact` (`id`, `name`, `email`, `phone`, `message`, `date`) VALUES (1, 'Aishwarya Shamrao Bhise', 'aishwarya1995@gmail.com', '9820700935', 'Thank you!! You provides nice platform to users who wants to search a hall. But i request you to add more browsing cities.', '2020-03-03 10:52:47'), (2, 'Anuradha Patil', 'anuradha19@gmail.com', '8380905672', 'Nice!! ', '2020-03-12 10:58:15'), (3, 'Renuka Bhosale', 'renuka123@gmail.com', '8934567845', 'Your website is outstanding.', '2020-04-13 11:01:09'), (4, 'Vikas Kate', 'vikas12@gmail.com', '8989562310', 'Thanks to provide the vendor facility on website.', '2020-04-25 11:03:51'), (5, 'Ankita Nevase', 'ankita15@gmail.com', '8805006732', 'Nice website.please pagination adds to show venues.', '2020-04-27 11:10:00'), (6, 'Shruti Pawar', 'shrutip26@gmail.com', '9034567278', 'Nice!!', '2020-05-01 11:11:06'), (7, 'Amar Pawar', 'amar1995pawar@gmail.com', '8149534439', 'I like your website. Thank u !! I have booked venue from these website .', '2020-05-01 11:13:43'), (8, 'Mansi Kumbhar', 'mansik34@gmail.com', '9870433433', 'No any question ! i like your website. Nice!!', '2020-05-02 11:18:20'), (9, 'Ajay Nikam', 'ajay1995@gmail.com', '8585903456', 'Outstanding platform.....', '2020-06-03 11:21:02'), (10, 'Vedika Ajit Mane', 'veduamane@gmail.com', '8380905672', 'You provides up-to date details of venue. Thank u!!', '2020-07-03 11:22:47'); -- -------------------------------------------------------- -- -- Table structure for table `event_master` -- CREATE TABLE `event_master` ( `id` bigint(20) UNSIGNED NOT NULL, `venue_id` int(4) NOT NULL, `event_name` varchar(30) NOT NULL, `price` int(7) NOT NULL, `advance` int(5) NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updated` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `event_master` -- INSERT INTO `event_master` (`id`, `venue_id`, `event_name`, `price`, `advance`, `created`, `updated`) VALUES (1, 2, 'Corporate Event', 25000, 10, '2020-05-07 08:41:05', '2020-05-07'), (2, 2, 'Birthday Party', 20000, 10, '2020-05-07 08:41:20', '2020-05-07'), (3, 2, 'Reception ', 25000, 10, '2020-05-07 08:52:54', '2020-05-07'), (4, 2, 'Engagement Ceremony', 35000, 10, '2020-05-07 08:50:22', '2020-05-07'), (5, 2, 'Wedding Ceremony', 80000, 10, '2020-05-07 08:40:06', '2020-05-07'); -- -------------------------------------------------------- -- -- Table structure for table `images` -- CREATE TABLE `images` ( `image_id` bigint(20) UNSIGNED NOT NULL, `holder_id` int(11) NOT NULL, `album_name` varchar(100) NOT NULL, `image_name` varchar(255) NOT NULL, `location` varchar(255) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `views` int(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `images` -- INSERT INTO `images` (`image_id`, `holder_id`, `album_name`, `image_name`, `location`, `created_at`, `views`) VALUES (1, 2, 'Visiting Card', 'banner_logo.jpg', 'http://localhost/venuefinder/controller/uploads/album/banner_logo.jpg', '2020-03-25 07:14:49', 20), (2, 2, 'Visiting Card', 'card.jpg', 'http://localhost/venuefinder/controller/uploads/album/card.jpg', '2020-03-25 07:14:49', 20), (3, 2, 'Decoration', 'dec.jpg', 'http://localhost/venuefinder/controller/uploads/album/dec.jpg', '2020-03-30 07:17:48', 20), (4, 2, 'Decoration', 'deco1.jpg', 'http://localhost/venuefinder/controller/uploads/album/deco1.jpg', '2020-03-30 07:17:48', 20), (5, 2, 'Decoration', 'download.jpg', 'http://localhost/venuefinder/controller/uploads/album/download.jpg', '2020-03-30 07:17:48', 20), (6, 2, 'Decoration', 'images.jpg', 'http://localhost/venuefinder/controller/uploads/album/images.jpg', '2020-03-30 07:17:48', 20), (7, 2, 'Catering', 'catering.jpg', 'http://localhost/venuefinder/controller/uploads/album/catering.jpg', '2020-04-01 07:18:14', 20), (8, 2, 'Catering', 'catering2.jpg', 'http://localhost/venuefinder/controller/uploads/album/catering2.jpg', '2020-04-01 07:18:14', 20), (9, 2, 'Catering', 'catering3.jpg', 'http://localhost/venuefinder/controller/uploads/album/catering3.jpg', '2020-04-01 07:18:14', 20), (10, 2, 'Conference', 'conf.jpg', 'http://localhost/venuefinder/controller/uploads/album/conf.jpg', '2020-04-01 07:18:14', 20), (11, 2, 'Conference', 'room.jpg', 'http://localhost/venuefinder/controller/uploads/album/room.jpg', '2020-04-01 07:18:14', 20), (12, 2, 'Night View', 'night4.jpg', 'http://localhost/venuefinder/controller/uploads/album/night4.jpg', '2020-04-03 07:19:22', 20), (13, 2, 'Parking', 'parking.jpg', 'http://localhost/venuefinder/controller/uploads/album/parking.jpg', '2020-04-03 07:19:22', 20), (14, 2, 'Wedding Photos', 'm1.jpg', 'http://localhost/venuefinder/controller/uploads/album/m1.jpg', '2020-05-07 07:20:37', 20), (15, 2, 'Wedding Photos', 'm2.jpg', 'http://localhost/venuefinder/controller/uploads/album/m2.jpg', '2020-05-07 07:20:37', 20), (16, 2, 'Wedding Photos', 'm3.jpg', 'http://localhost/venuefinder/controller/uploads/album/m3.jpg', '2020-05-07 07:20:37', 20), (17, 2, 'Wedding Photos', 'm4.jpg', 'http://localhost/venuefinder/controller/uploads/album/m4.jpg', '2020-05-07 07:20:37', 20), (18, 2, 'Wedding Photos', 'm5.jpg', 'http://localhost/venuefinder/controller/uploads/album/m5.jpg', '2020-05-07 07:20:37', 20), (19, 2, 'Wedding Photos', 'm6.jpg', 'http://localhost/venuefinder/controller/uploads/album/m6.jpg', '2020-05-07 07:20:37', 20), (20, 2, 'Wedding Photos', 'rupali and sushant.jpg', 'http://localhost/venuefinder/controller/uploads/album/rupali and sushant.jpg', '2020-05-07 07:20:37', 20), (21, 2, 'Wedding Photos', 'shree vs deepa.jpg', 'http://localhost/venuefinder/controller/uploads/album/shree vs deepa.jpg', '2020-05-07 07:20:37', 20), (22, 2, 'Seating System', 'cate.jpg', 'http://localhost/venuefinder/controller/uploads/album/cate.jpg', '2020-05-07 07:21:51', 20), (23, 2, 'Seating System', 'deco1.jpg', 'http://localhost/venuefinder/controller/uploads/album/deco1.jpg', '2020-05-07 07:21:51', 20), (24, 2, 'Seating System', 'seating.jpg', 'http://localhost/venuefinder/controller/uploads/album/seating.jpg', '2020-05-07 07:21:51', 20), (25, 2, 'Seating System', 'seating1.jpg', 'http://localhost/venuefinder/controller/uploads/album/seating1.jpg', '2020-05-07 07:21:51', 20), (26, 2, 'Night View', 'night1.jpg', 'http://localhost/venuefinder/controller/uploads/album/night1.jpg', '2020-04-03 07:19:22', 20), (27, 2, 'Night View', 'night2.jpg', 'http://localhost/venuefinder/controller/uploads/album/night2.jpg', '2020-04-03 07:19:22', 20); -- -------------------------------------------------------- -- -- Table structure for table `notification` -- CREATE TABLE `notification` ( `notification_id` int(10) NOT NULL, `id` varchar(10) NOT NULL, `notification` varchar(100) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `notification` -- INSERT INTO `notification` (`notification_id`, `id`, `notification`, `created_at`) VALUES (1, '3', 'User', '2020-05-05 14:02:36'), (2, '4', 'User', '2020-05-05 14:02:41'), (3, '3', 'Venue', '2020-05-05 14:02:46'), (4, '4', 'Venue', '2020-05-05 14:02:50'), (5, '1', 'User', '2020-05-05 14:02:54'), (6, '2', 'User', '2020-05-05 14:03:04'), (7, '5', 'Venue', '2020-05-05 14:03:10'), (8, '6', 'Venue', '2020-05-05 14:03:19'), (9, '7', 'Venue', '2020-05-02 14:03:25'), (10, '8', 'Venue', '2020-05-02 14:03:30'), (11, '9', 'Venue', '2020-05-05 14:03:40'), (12, '5', 'User', '2020-05-05 11:28:15'), (13, '6', 'User', '2020-03-26 09:59:11'), (14, '10', 'Venue', '2020-05-06 08:06:11'), (15, '7', 'User', '2020-03-05 09:59:11'), (16, '8', 'User', '2020-04-15 09:59:11'), (17, '9', 'User', '2020-05-05 09:59:11'), (18, 'BID29317', 'Book', '2020-05-07 16:55:16'), (19, 'BID17477', 'Book', '2020-05-08 12:16:42'), (20, 'BID13848', 'Book', '2020-05-09 14:30:37'), (21, 'BID17277', 'Book', '2020-03-12 00:41:01'), (22, 'BID17477', 'Book', '2020-01-10 06:32:57'), (23, 'BID17657', 'Book', '2020-04-30 00:20:08'), (24, 'BID18467', 'Book', '2020-03-13 02:21:25'), (25, 'BID19911', 'Book', '2020-04-25 08:01:56'), (26, 'BID2353', 'Book', '2020-05-09 08:42:56'), (27, 'BID26649', 'Book', '2020-05-19 23:55:52'), (28, 'BID26669', 'Book', '2020-03-10 06:35:23'), (29, 'BID26811', 'Book', '2020-04-08 01:41:47'), (30, 'BID26896', 'Book', '2020-04-17 01:35:23'), (31, 'BID27043', 'Book', '2020-05-04 21:56:21'), (32, 'BID29317', 'Book', '2020-05-07 16:28:08'), (33, 'BID5919', 'Book', '2020-04-10 00:04:56'), (34, 'BID6013', 'Book', '2020-02-10 08:56:36'), (35, 'BID6103', 'Book', '2020-05-08 07:27:44'), (36, 'BID6264', 'Book', '2020-05-08 07:22:07'), (37, 'BID6808', 'Book', '2020-04-30 03:58:41'), (38, 'BID7210', 'Book', '2020-03-05 14:40:19'), (39, 'BID7849', 'Book', '2020-02-26 02:26:14'), (40, 'BID8353', 'Book', '2020-02-01 01:39:00'); -- -------------------------------------------------------- -- -- Table structure for table `payment` -- CREATE TABLE `payment` ( `id` int(11) NOT NULL, `bookid` varchar(10) NOT NULL, `payment_status` varchar(255) NOT NULL, `payment_amount` int(10) NOT NULL, `payment_currency` varchar(255) NOT NULL, `txn_id` varchar(255) NOT NULL, `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `payment_mode` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `payment` -- INSERT INTO `payment` (`id`, `bookid`, `payment_status`, `payment_amount`, `payment_currency`, `txn_id`, `create_at`, `payment_mode`) VALUES (1, 'BID29317', 'TXN_SUCCESS', 8000, 'INR', '20200507111212800110168557101508340', '2020-05-07 16:57:20', 'PPI'), (2, 'BID17477', 'TXN_SUCCESS', 3500, 'INR', '20200110111212800110168114801509060', '2020-01-10 06:32:57', 'PPI'), (3, 'BID31299', 'TXN_FAILURE', 6500, 'INR', '20200102111212800110168739601532487', '2020-02-01 01:39:00', ''), (4, 'BID8353', 'TXN_SUCCESS', 6500, 'INR', '20200201111212800110168261501519457', '2020-02-01 01:39:00', 'PPI'), (5, 'BID27043', 'TXN_SUCCESS', 5000, 'INR', '20200505111212800110168316701543918', '2020-05-05 05:52:38', 'PPI'), (6, 'BID6013', 'TXN_SUCCESS', 8000, 'INR', '20200210111212800110168371201545169', '2020-02-10 08:56:36', 'PPI'), (7, 'BID5919', 'TXN_SUCCESS', 1000, 'INR', '20200410111212800110168013901516264', '2020-04-10 00:04:56', 'PPI'), (8, 'BID17277', 'TXN_SUCCESS', 8000, 'INR', '20200312111212800110168332201517089', '2020-03-12 00:41:01', 'PPI'), (9, 'BID6808', 'TXN_SUCCESS', 6000, 'INR', '20200430111212800110168999201517144', '2020-05-09 16:55:05', 'PPI'), (10, 'BID31757', 'TXN_FAILURE', 6000, 'INR', '20200509111212800110168944401514685', '2020-02-26 02:26:14', ''), (11, 'BID7849', 'TXN_SUCCESS', 6000, 'INR', '20200226111212800110168159101525297', '2020-02-26 02:26:14', 'PPI'), (12, 'BID26896', 'TXN_SUCCESS', 7500, 'INR', '20200417111212800110168765801521666', '2020-04-17 01:35:23', 'PPI'), (13, 'BID26669', 'TXN_SUCCESS', 5000, 'INR', '20200310111212800110168888601519942', '2020-03-10 06:35:23', 'PPI'), (14, 'BID6264', 'TXN_SUCCESS', 2500, 'INR', '20200508111212800110168157501527014', '2020-05-08 07:23:33', 'PPI'), (15, 'BID6103', 'TXN_SUCCESS', 3500, 'INR', '20200508111212800110168677301514717', '2020-05-08 07:37:05', 'PPI'), (16, 'BID19911', 'TXN_SUCCESS', 8000, 'INR', '20200425111212800110168169801537375', '2020-04-25 07:53:29', 'PPI'), (17, 'BID26649', 'TXN_SUCCESS', 6000, 'INR', '20200520111212800110168509401510555', '2020-05-19 23:55:52', 'PPI'), (18, 'BID17657', 'TXN_SUCCESS', 6000, 'INR', '20200430111212800110168510501729639', '2020-04-30 00:20:08', 'PPI'), (19, 'BID18467', 'TXN_SUCCESS', 8000, 'INR', '20200313111212800110168514901730842', '2020-03-13 02:21:25', 'PPI'), (20, 'BID23710', 'TXN_FAILURE', 6000, 'INR', '20200509111212800110168644201532228', '2020-05-09 08:51:09', ''), (21, 'BID23710', 'TXN_FAILURE', 6000, 'INR', '', '2020-05-09 08:51:21', ''), (22, 'BID26811', 'TXN_SUCCESS', 6000, 'INR', '20200408111212800110168299301529126', '2020-04-08 01:41:47', 'PPI'), (23, 'BID2353', 'TXN_SUCCESS', 6500, 'INR', '20200509111212800110168803001523564', '2020-05-09 08:50:27', 'PPI'), (24, 'BID13848', 'TXN_SUCCESS', 1000, 'INR', '20200509111212800110168237001521056', '2020-05-09 14:39:01', 'PPI'), (25, 'BID7210', 'TXN_SUCCESS', 2000, 'INR', '20200305111212800110168470001514787', '2020-05-09 16:46:57', 'PPI'); -- -------------------------------------------------------- -- -- Table structure for table `rating` -- CREATE TABLE `rating` ( `id` int(11) NOT NULL, `venue_id` int(11) NOT NULL, `quality` int(10) NOT NULL, `response` int(10) NOT NULL, `value` int(10) NOT NULL, `recommend` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `description` varchar(500) COLLATE utf8_unicode_ci NOT NULL, `amount` int(10) NOT NULL, `photo` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `likes` int(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `rating` -- INSERT INTO `rating` (`id`, `venue_id`, `quality`, `response`, `value`, `recommend`, `title`, `description`, `amount`, `photo`, `name`, `created_at`, `likes`) VALUES (1, 2, 4, 4, 5, '1', 'Amazing venue!', 'I truly loved the venue.It was a very nice experience with this venue and it was worth hosting the functions here. The food, decor and arrangements, all was pretty amazing.', 80, 'image6.jpeg', 'Sonam Bhosale', '2020-01-24 14:10:14', 5), (2, 2, 5, 5, 5, '1', 'Outstanding Venue !', 'It was a very nice experience with this venue and it was worth hosting the functions here. The food, decor and arrangements, all was pretty amazing.\r\n\r\n', 0, 'm3.jpg', 'Nilam More', '2020-03-05 14:29:23', 3), (3, 2, 4, 3, 3, '1', 'Stunning and Flawless Venue!', 'I truly loved the venue. The staffs were so good, they were best at hospitality and services. The venue was very beautiful, the decor was superbly done. Food could not have been better. In all praises for them. Loved the experience!', 60, 'm5.jpg', 'Tejas Pawar', '2020-03-31 14:35:30', 3), (4, 3, 4, 4, 5, '1', 'Amazing venue!', 'I truly loved the venue.It was a very nice experience with this venue and it was worth hosting the functions here. The food, decor and arrangements, all was pretty amazing.', 80, 'image6.jpeg', 'Sonam Bhosale', '2020-05-03 08:40:14', 5), (5, 4, 5, 5, 5, '1', 'Outstanding Venue !', 'It was a very nice experience with this venue and it was worth hosting the functions here. The food, decor and arrangements, all was pretty amazing.\r\n\r\n', 0, 'image11.jpg', 'Nilam More', '2020-05-03 08:59:23', 1), (6, 5, 4, 3, 3, '1', 'Stunning and Flawless Venue!', 'I truly loved the venue. The staffs were so good, they were best at hospitality and services. The venue was very beautiful, the decor was superbly done. Food could not have been better. In all praises for them. Loved the experience!', 60, 'll.jpg', 'Tejas Pawar', '2020-05-03 09:05:30', 3), (7, 5, 5, 5, 5, '1', 'Outstanding Venue !', 'It was a very nice experience with this venue and it was worth hosting the functions here. The food, decor and arrangements, all was pretty amazing.\r\n\r\n', 0, 'image11.jpg', 'Nilam More', '2020-05-03 08:59:23', 1), (8, 8, 4, 3, 3, '1', 'Stunning and Flawless Venue!', 'I truly loved the venue. The staffs were so good, they were best at hospitality and services. The venue was very beautiful, the decor was superbly done. Food could not have been better. In all praises for them. Loved the experience!', 60, 'll.jpg', 'Tejas Pawar', '2020-05-03 09:05:30', 3), (9, 2, 5, 5, 5, '1', 'Good management and staff. Well experience', 'It’s a nice place for a comfortable stay. Having a beautiful view of mountain. Fresh air. N nice quality food and clean. Luxury rooms', 90, 'sharad_mane.jpg', 'Sharad Mane', '2020-04-08 14:07:40', 0), (10, 2, 4, 4, 3, '1', 'Very good location wedding party', 'Good experience overall.Location is beautiful. View is awesome.\r\nRestaurant and lawn food very good and service excellent..', 0, 'login.jpeg', 'Dhiraj Manthalakar', '2020-04-20 14:09:32', 0), (11, 2, 4, 5, 4, '1', 'Marriage party and Dinner', 'Lovely place in mid of nature. Great location, great service and wonderful food. Staff and managemwnt is very cooperative.', 0, 'm2.jpg', 'Rohit Bhosale', '2020-04-20 14:11:58', 1), (12, 2, 3, 3, 4, '1', 'Testy food mind blowing location', 'Delicious food with good quality and such a nice mountain view good supportive staff and great venue for destinations weeding... I loved it', 0, 'deco1.jpg', 'Vijay Chavan', '2020-04-27 14:13:23', 2), (13, 2, 3, 3, 3, '1', 'Best location celebrate a event party etc', 'Location is awesome and the food was so tasty.\r\nThe staff was courteous and very humble.', 0, 'deco.jpg', 'Sneha Raut', '2020-04-30 14:14:24', 2), (14, 2, 3, 3, 3, '1', 'Nice experience', 'Nice experience, quality food , helpful staff, they cares for you.', 0, 'm1.jpg', 'Sameer Shelake', '2020-05-01 14:16:46', 2), (15, 2, 5, 4, 4, '1', 'Perfect location for wedding memories😍', 'Professional and supportive staff. Food is tasty serving with love.... Will recommend Swaraj Bhavan to my family and friends. 😊☺️', 0, 'm4.jpg', 'Rekha Tate', '2020-05-05 14:19:37', 5), (16, 2, 4, 4, 4, '1', 'Nice Place', 'I like all arrangements. supportive staff. ', 0, 'm2.jpg', 'Shrutika Gaikwad', '2020-05-10 01:12:16', 1), (17, 2, 3, 3, 3, '1', 'Amazing Venue', 'I like place,food,decoration.helping staff. nice to meet you again', 0, 'image6.jpeg', 'Vrushali Shinde', '2020-05-10 01:20:18', 4); -- -------------------------------------------------------- -- -- Table structure for table `register_user` -- CREATE TABLE `register_user` ( `user_id` int(20) UNSIGNED NOT NULL, `name` varchar(50) NOT NULL, `user_name` varchar(50) NOT NULL, `mobile` varchar(10) NOT NULL, `address` varchar(100) NOT NULL, `password` varchar(50) NOT NULL, `email` varchar(30) NOT NULL, `ip` varchar(50) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `register_user` -- INSERT INTO `register_user` (`user_id`, `name`, `user_name`, `mobile`, `address`, `password`, `email`, `ip`, `created_at`, `updated_at`) VALUES (1, 'Varsha Pawar', 'Varsha25', '8380905673', 'Opp.to D.P.Bhosale College, Near Parvati Niwas,Koregaon,415501', '2252c0811be2ea4e8fe02b2d25d80236', 'varsha9635@gmail.com', '::1', '2020-01-08 09:59:11', '0000-00-00'), (2, 'Bhagyashsree Shinde', 'Bhagi1812', '8805006723', 'Limb,Satara-415001', 'c077b156eaf6d625a979cf742f5e6b28', 'bhagi18shinde@gmail.com', '::1', '2020-01-30 10:01:35', '0000-00-00'), (3, 'Poonam Kate', 'Poonam0110', '9594957760', 'A/P Kanherkhed,Koregoan,Satara-415501', 'df96d71fa56d4a29fbf4e069877cfb10', 'poonamkate@gmail.com', '::1', '2020-02-05 10:06:42', '0000-00-00'), (4, 'Vijay Patil', 'VijayP12', '9870433433', 'A/P Kanherkhed,Koregoan,Satara-415501', '53e5e577c8feeefa611f37c28feca612', 'vijaykate@gmail.com', '::1', '2020-02-10 10:08:00', '0000-00-00'), (5, 'Sona Bhosale', 'Sona25', '8380905672', 'Near to New Stand,Koregaon', '4104f939fdc98f9823a53edee1355caa', 'sonambhosale9635@gmail.com', '::1', '2020-03-03 11:28:15', '2020-05-01'), (6, 'Gauri Jadhav', 'GauriJ62', '8108355936', 'Sangam Nagar ,Satara', 'de44704d6efbe5a79b627c305e50d5c8', 'gaurij63@gmail.com', '::1', '2020-03-03 14:10:11', '0000-00-00'), (7, 'Ashwini Shinde', 'Ashu89', '8678896745', 'Near to Arjun hospital,Wai.', 'b78070c17a3f1d7bd4265f2e2d466eaf', 'ashwini35shinde@gmail.com', '::1', '2020-04-11 14:47:19', '0000-00-00'), (8, 'Prajkta Bobade', 'Pranj12', '8678896746', 'A/P Ekambe, Koregoan', 'e680d3a4a88747619acb04704bf7ed96', 'p12bobade@gmail.com', '::1', '2020-04-15 15:52:34', '0000-00-00'), (9, 'Nitish Kadam', 'NitishK', '8888567324', 'At -Velang Post- Kanherkhed ,Koregoan', '971b0426a5f66d959515eb6440d89d96', 'kadamnitish@gmail.com', '::1', '2020-05-05 15:56:06', '0000-00-00'); -- -------------------------------------------------------- -- -- Table structure for table `register_venue` -- CREATE TABLE `register_venue` ( `user_id` bigint(20) UNSIGNED NOT NULL, `user_name` varchar(50) NOT NULL, `venue_name` varchar(100) NOT NULL, `city` varchar(30) NOT NULL DEFAULT 'Satara', `landline` varchar(12) DEFAULT NULL, `mobile` varchar(10) NOT NULL, `booking_amt` int(10) NOT NULL, `email` varchar(30) NOT NULL, `address` varchar(100) NOT NULL, `pincode` int(6) NOT NULL, `password` varchar(50) NOT NULL, `ac_type` varchar(20) NOT NULL DEFAULT 'Owner', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NULL DEFAULT NULL, `status` varchar(20) NOT NULL DEFAULT 'Deactive', `logo` varchar(255) NOT NULL, `banner_image` varchar(255) NOT NULL, `views` int(10) NOT NULL, `ip` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `register_venue` -- INSERT INTO `register_venue` (`user_id`, `user_name`, `venue_name`, `city`, `landline`, `mobile`, `booking_amt`, `email`, `address`, `pincode`, `password`, `ac_type`, `created_at`, `updated_at`, `status`, `logo`, `banner_image`, `views`, `ip`) VALUES (1, 'Admin', 'Venufinder', 'Satara', NULL, '9820700675', 0, 'sonambhosale@gmail.com', '', 0, 'e10adc3949ba59abbe56e057f20f883e', 'Admin', '2019-12-31 05:25:30', '2020-05-10 05:38:53', 'Active', '', '', 0, ''), (2, 'Pravin Pawar', 'Swaraj Sanskrutik Bhavan', 'Satara', '2162244648', '8380905672', 80000, 'swarajbhavan@outlook.com', '44B, Sahakarnagar, Koregaon Road,Satara', 415001, '80c437aee2e961144b1929ed1b788468', 'Owner', '2020-01-01 15:08:17', '2020-05-05 04:55:07', 'Active', 'Swaraj-logo.jpg', 'yash_banner.jpg', 65, '::1'), (3, 'Nariman Pawar', 'Nariman Hall', 'Satara', '216123088', '9820700953', 75000, 'sonambhosale9635@gmail.com', 'Plot No 505, Sadar Bazar,Satara', 415001, 'b52bdfc97da1440f6b8a6a7b121f2940', 'Owner', '2020-01-09 08:32:59', NULL, 'Active', 'nir_logo.png', 'nir_banner.jpg', 52, '::1'), (4, 'Devyani Shinde', 'Devayani Multipurpose Hall', 'Satara', '216223087', '8805006723', 60000, 'devyani123@gmail.com', 'Survey No.165-166, Kondawa-Satara Medha Road, Molyacha Oodha,Satara', 415001, '91d542da7964da3a0f1dda58c1ce565b', 'Owner', '2020-01-15 09:07:54', NULL, 'Active', 'dev_logo.png', 'dev_banner.jpg', 21, '::1'), (5, 'Nitin Ghadge', 'Kanishk Multipurpose Hall', 'Satara', NULL, '9594957760', 65000, 'kanishk@gmail.com', '449/D, In front of Sumitraraje Bhosale Garden, Sadar Bazar, Satara', 415002, '826f630d0842802133f3f3594f4e19ca', 'Owner', '2020-02-01 13:38:28', '2020-05-03 03:50:05', 'Active', 'kanishk_logo.jpg', 'kanishk_banner.jpg', 37, '::1'), (7, 'Yash Mohite', 'Yashraj Multipurpose Hall', 'Satara', NULL, '9552549034', 50000, 'yashraj@gmail.com', 'Daulatnagar near k s d shanbhag school ,behind bhu Vikas bank ,Satara', 415002, '860597464b31f718bc28e3994d28d0f0', 'Owner', '2020-03-01 13:49:06', '2020-05-03 03:54:33', 'Active', 'yash_logo.jpg', 'yash_banner.jpg', 8, '::1'), (8, 'Vedant Patil', 'Vedbhavan Mangal Karyalaya ', 'Satara', NULL, '9870500853', 70000, 'vedhabhavn@co.in', 'Shrinagar Colony, Satara Koregoan Road, Sangamnagar Satara', 415003, '860597464b31f718bc28e3994d28d0f0', 'Owner', '2020-04-01 13:54:36', '2020-05-03 05:27:37', 'Active', 'ved_logo.jpg', 'ved_banner.jpg', 35, '::1'), (9, 'Samrat Shinde', 'Sai Samrat Mangal Karyalay ', 'Satara', '0', '8149953899', 60000, 'sai@gmail.com', 'Sai Samrat, Satara Rahmatpur Road, Satara MIDC, Kodoli, Satara ', 415004, '873441d4ff7411690a531bbe2896e21f', 'Owner', '2020-04-22 14:18:54', '2020-05-03 05:28:27', 'Active', 'sai_logo.jpg', 'sai_banner.jpg', 12, '::1'), (10, 'Pushkar More', 'Pushkar Mangal Karyalay', 'Satara', '02162234296', '8950895090', 60000, 'pushkar@123gmail.com', 'Satara Koregon Road, Near Bombay Restaurant, Satara', 415002, '28e194c453600d099b3c9de42d5c60dd', 'Owner', '2020-05-05 08:06:11', NULL, 'Active', 'pushkar_logo.jpg', 'pushkar_banner.jpg', 0, '::1'); -- -------------------------------------------------------- -- -- Table structure for table `subscription_plan` -- CREATE TABLE `subscription_plan` ( `plan_id` bigint(20) UNSIGNED NOT NULL, `plan_name` varchar(30) NOT NULL, `monthly` int(10) NOT NULL, `yearly` int(10) NOT NULL, `images` varchar(10) NOT NULL DEFAULT 'No', `video` varchar(10) NOT NULL DEFAULT 'No', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `subscription_plan` -- INSERT INTO `subscription_plan` (`plan_id`, `plan_name`, `monthly`, `yearly`, `images`, `video`, `created_at`, `updated_at`) VALUES (1, 'Premium', 300, 1200, 'Yes', 'No', '2020-04-15 12:23:03', '0000-00-00 00:00:00'), (2, 'Top', 400, 1500, 'Yes', 'Yes', '2020-04-15 12:23:49', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_about` -- CREATE TABLE `tbl_about` ( `id` int(4) NOT NULL, `venue_id` int(4) NOT NULL, `website` varchar(50) NOT NULL, `opening_date` date NOT NULL, `events` varchar(300) NOT NULL, `helpers` int(4) NOT NULL, `info` varchar(500) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_about` -- INSERT INTO `tbl_about` (`id`, `venue_id`, `website`, `opening_date`, `events`, `helpers`, `info`, `created_at`) VALUES (1, 2, 'www.swarajbhavan.com', '2006-12-05', 'weddings, receptions and all kinds of cultural events.conferences, meetings and corporate events.', 11, 'Swaraj Sanskrutik Bhavan was established in December 2006 to provide Satara and nearby districts with a quality venue for weddings, receptions and all kinds of cultural events. The Marriage hall is among the best available halls and with 7500 sq.ft of space. It has four rooms adjacent to the hall for any pre-event arrangements. \r\nAdditional Available Facilities:PA system,TV,LCD projector on hire,White board and Markers\r\n,parking is available.,Generator Backup / DG backup.\r\n,Solar water heating s', '2020-05-05 08:48:58'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_faq` -- CREATE TABLE `tbl_faq` ( `id` bigint(20) UNSIGNED NOT NULL, `venue_id` int(4) NOT NULL, `f1` varchar(100) NOT NULL, `f2` varchar(100) NOT NULL, `f3` varchar(100) NOT NULL, `f4` varchar(10) NOT NULL, `f5` varchar(100) NOT NULL, `f6` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_faq` -- INSERT INTO `tbl_faq` (`id`, `venue_id`, `f1`, `f2`, `f3`, `f4`, `f5`, `f6`) VALUES (1, 2, 'Yes, We can have more than one event-space at time. We can arrange 2 events at time.', '800', '1000', '10', 'Yes, We have paid advance amount.', 'Yes'); -- -------------------------------------------------------- -- -- Table structure for table `venue_details` -- CREATE TABLE `venue_details` ( `venue_id` int(10) NOT NULL, `venue_info` varchar(1000) NOT NULL, `chair` int(10) NOT NULL, `seating_capacity` int(10) NOT NULL, `room` int(10) NOT NULL, `parking` varchar(10) NOT NULL, `drink_water` varchar(10) NOT NULL, `catering` varchar(10) NOT NULL, `decoration` varchar(10) NOT NULL, `sound_system` varchar(10) NOT NULL, `ac_fan` varchar(10) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `venue_details` -- INSERT INTO `venue_details` (`venue_id`, `venue_info`, `chair`, `seating_capacity`, `room`, `parking`, `drink_water`, `catering`, `decoration`, `sound_system`, `ac_fan`, `created_at`, `updated_at`) VALUES (2, 'Swaraj Sanskrutik Bhavan was established in December 2006 to provide Satara and nearby districts with a quality venue for weddings, receptions and all kinds of cultural events. This is also an equally suitable place for organising conferences, meetings and corporate events.Swaraj is well designed to suit large events and provide good infrastructure along with good and timely service. Located just on the outskirts of Satara, the surroundings are peaceful and ideal for events. It has an easy access from the city convenient access for people coming from Pune, Kolhapur and Mahabaleshwar. We are proud to be considered as one of the premium wedding halls and an ultimate venue for events and occasions in Satara.The Marriage hall is among the best available halls and with 7500 sq.ft of space. It has four rooms adjacent to the hall for any pre-event arrangements. ', 400, 500, 11, 'Yes', 'Yes', 'No', 'No', 'Yes', 'Yes', '2020-05-02 15:22:35', '2020-05-02 05:44:52'); -- -------------------------------------------------------- -- -- Table structure for table `venue_enquires` -- CREATE TABLE `venue_enquires` ( `id` bigint(20) UNSIGNED NOT NULL, `user_id` int(11) NOT NULL, `venue_id` int(11) NOT NULL, `event_name` varchar(100) NOT NULL, `booking_date` varchar(11) NOT NULL, `requirement` varchar(500) NOT NULL, `token` varchar(10) NOT NULL, `quotation_rate` int(11) NOT NULL, `reply` varchar(300) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `venue_enquires` -- INSERT INTO `venue_enquires` (`id`, `user_id`, `venue_id`, `event_name`, `booking_date`, `requirement`, `token`, `quotation_rate`, `reply`, `created_at`, `updated_at`) VALUES (1, 1, 2, 'Wedding', '2020-02-14', 'I want half and full day your venue.Please as soon as possible sent pricing details. Also provide better service.', 'pD0l9dNqfB', 95000, '', '2020-01-15 13:23:14', '2020-01-16'), (2, 3, 2, 'Birthday Party', '2020-03-05', 'I want to book venue for birthday party with 200 guest.', 'u8pc6HFPPw', 21000, '', '2020-02-28 13:29:32', '2020-02-28'), (3, 4, 2, 'Sangeet Function', '2020-04-12', 'Please well decoration provide. I send you the decoration photos. As soon as possible send the pricing for these function.', 'F9ikKCAlKd', 20000, '', '2020-03-11 13:33:03', '2020-03-15'), (4, 6, 2, 'Conference', '2020-03-30', 'Need a peaceful rooms with proper arrangement of projector.', '9bafbOgWb6', 10000, '', '2020-03-03 14:50:10', '2020-03-08'), (5, 5, 2, 'Wedding Event', '2020-04-25', 'I see your booking amount.but I want to add LED,projector system with beautiful decoration.Drinking water and i can take other drinks other than water.', 'Zv9UVUoDkv', 80000, 'No extra amount to pay. Yes, You allowed to take any drink.', '2020-04-01 11:16:23', '2020-04-02'); -- -------------------------------------------------------- -- -- Table structure for table `venue_plan` -- CREATE TABLE `venue_plan` ( `id` varchar(20) NOT NULL, `venue_id` int(11) NOT NULL, `plan_id` int(11) NOT NULL, `price` int(11) NOT NULL, `status` varchar(10) NOT NULL, `start_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `expire_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `payment_status` varchar(20) NOT NULL, `payment_mode` varchar(100) NOT NULL, `trans_id` varchar(100) NOT NULL, `create_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `venue_plan` -- INSERT INTO `venue_plan` (`id`, `venue_id`, `plan_id`, `price`, `status`, `start_date`, `expire_date`, `payment_status`, `payment_mode`, `trans_id`, `create_at`) VALUES ('PID14247', 3, 1, 300, 'Deactive', '2020-01-07 08:00:00', '2020-02-06 18:30:00', 'TXN_SUCCESS', 'PPI', '20200107111212400110168875501507451', '2020-01-07 08:00:00'), ('PID14858', 4, 1, 300, 'Deactive', '2020-01-23 00:05:16', '2020-02-22 18:30:00', 'TXN_SUCCESS', 'PPI', '20191231111212400110168875501507430', '2020-01-23 00:05:16'), ('PID16837', 5, 1, 300, 'Active', '2020-05-06 09:07:20', '2020-06-05 18:30:00', 'TXN_SUCCESS', 'PPI', '20200506111212400110168875501507443', '2020-05-06 09:03:10'), ('PID23729', 2, 2, 400, 'Deactive', '2020-03-25 06:54:57', '2020-04-24 18:30:00', 'TXN_SUCCESS', 'PPI', '20200325111212400110168875501507445', '2020-03-25 06:54:57'), ('PID24161', 4, 2, 400, 'Active', '2020-04-16 02:46:13', '2020-05-15 18:30:00', 'TXN_SUCCESS', 'PPI', '20200416111212800120168875501507433', '2020-04-16 02:46:13'), ('PID26763', 3, 2, 1500, 'Active', '2020-02-19 05:50:45', '2021-02-18 18:30:00', 'TXN_SUCCESS', 'PPI', '20200219111212800120168875501507439', '2020-02-19 05:50:45'), ('PID27661', 10, 2, 1500, 'Deactive', '2020-05-09 13:29:56', '2021-05-06 18:30:00', 'TXN_SUCCESS', 'PPI', '20200416111212800110168875501507432', '2020-05-07 01:52:55'), ('PID4489', 9, 2, 400, 'Deactive', '2020-04-25 07:44:50', '2020-05-24 18:30:00', 'TXN_SUCCESS', 'PPI', '20200318111212800110168875501507435', '2020-04-25 07:44:50'), ('PID7913', 8, 1, 300, 'Active', '2020-04-18 05:19:43', '2020-05-17 18:30:00', 'TXN_SUCCESS', 'PPI', '20200102111212800110168875501507436', '2020-04-18 05:19:43'), ('PID8051', 2, 1, 300, 'Active', '2020-05-06 01:34:49', '2020-06-05 18:30:00', 'TXN_SUCCESS', 'PPI', '20200506111212800110168875501507431', '2020-05-06 01:34:49'); -- -------------------------------------------------------- -- -- Table structure for table `videos` -- CREATE TABLE `videos` ( `video_id` int(11) NOT NULL, `holder_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `description` varchar(255) NOT NULL, `extension` varchar(5) NOT NULL, `location` varchar(500) NOT NULL, `likes` int(4) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `videos` -- INSERT INTO `videos` (`video_id`, `holder_id`, `name`, `description`, `extension`, `location`, `likes`, `created_at`) VALUES (1, 4, 'devyani_hall.mp4', 'Amazing Hall View', 'mp4', 'http://localhost/venuefinder/videos/devyani_hall.mp4', 0, '2020-04-20 04:22:04'), (2, 4, 'pre_shoot.mp4', 'Pre-Shoot Video', 'mp4', 'http://localhost/venuefinder/videos/pre_shoot.mp4', 0, '2020-04-27 04:24:45'), (3, 4, 'Wedding.mp4', 'Wedding Video', 'mp4', 'http://localhost/venuefinder/videos/Wedding.mp4', 0, '2020-05-05 04:26:52'), (4, 2, 'devyani_hall.mp4', 'Amazing Hall View', 'mp4', 'http://localhost/venuefinder/videos/devyani_hall.mp4', 0, '2020-03-26 04:22:04'), (5, 2, 'pre_shoot.mp4', 'Pre-Shoot Video', 'mp4', 'http://localhost/venuefinder/videos/pre_shoot.mp4', 0, '2020-04-07 04:24:45'), (6, 2, 'Wedding_ceremony.mp4', 'Wedding Ceremony Video', 'mp4', 'http://localhost/venuefinder/videos/Wedding_ceremony.mp4', 0, '2020-04-08 04:24:45'), (7, 2, 'Mehandi.mp4', 'Mehandi Ceremony Video', 'mp4', 'http://localhost/venuefinder/videos/Mehandi.mp4', 0, '2020-04-08 04:24:45'); -- -------------------------------------------------------- -- -- Table structure for table `wishlist` -- CREATE TABLE `wishlist` ( `id` bigint(20) UNSIGNED NOT NULL, `userid` int(4) NOT NULL, `venue_id` int(4) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `removed_at` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `wishlist` -- INSERT INTO `wishlist` (`id`, `userid`, `venue_id`, `created_at`, `removed_at`) VALUES (1, 5, 7, '2020-05-07 12:36:47', '0000-00-00'), (2, 5, 4, '2020-05-07 12:37:06', '0000-00-00'), (3, 5, 2, '2020-03-31 12:37:16', '0000-00-00'), (4, 5, 3, '2020-05-07 12:38:09', '0000-00-00'), (6, 1, 2, '2020-01-10 12:37:16', '0000-00-00'), (7, 2, 2, '2020-02-01 12:37:16', '0000-00-00'), (8, 3, 2, '2020-02-13 12:37:16', '0000-00-00'), (9, 4, 2, '2020-02-15 12:37:16', '0000-00-00'), (10, 6, 2, '2020-03-05 12:37:16', '0000-00-00'), (11, 7, 2, '2020-04-15 05:37:16', '0000-00-00'), (12, 8, 2, '2020-05-02 12:37:16', '0000-00-00'), (13, 1, 7, '2020-05-09 05:50:36', '0000-00-00'); -- -- Indexes for dumped tables -- -- -- Indexes for table `book_venue` -- ALTER TABLE `book_venue` ADD UNIQUE KEY `id` (`book_id`); -- -- Indexes for table `contact` -- ALTER TABLE `contact` ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `event_master` -- ALTER TABLE `event_master` ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `images` -- ALTER TABLE `images` ADD UNIQUE KEY `image_id` (`image_id`); -- -- Indexes for table `notification` -- ALTER TABLE `notification` ADD PRIMARY KEY (`notification_id`); -- -- Indexes for table `payment` -- ALTER TABLE `payment` ADD PRIMARY KEY (`id`); -- -- Indexes for table `rating` -- ALTER TABLE `rating` ADD PRIMARY KEY (`id`); -- -- Indexes for table `register_user` -- ALTER TABLE `register_user` ADD PRIMARY KEY (`user_id`), ADD UNIQUE KEY `mobile` (`mobile`); -- -- Indexes for table `register_venue` -- ALTER TABLE `register_venue` ADD UNIQUE KEY `user_id` (`user_id`), ADD UNIQUE KEY `mobile` (`mobile`), ADD UNIQUE KEY `email` (`email`); -- -- Indexes for table `subscription_plan` -- ALTER TABLE `subscription_plan` ADD UNIQUE KEY `plan_id` (`plan_id`); -- -- Indexes for table `tbl_about` -- ALTER TABLE `tbl_about` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_faq` -- ALTER TABLE `tbl_faq` ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `venue_details` -- ALTER TABLE `venue_details` ADD UNIQUE KEY `venue_id` (`venue_id`); -- -- Indexes for table `venue_enquires` -- ALTER TABLE `venue_enquires` ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `venue_plan` -- ALTER TABLE `venue_plan` ADD UNIQUE KEY `book_id` (`id`); -- -- Indexes for table `videos` -- ALTER TABLE `videos` ADD PRIMARY KEY (`video_id`); -- -- Indexes for table `wishlist` -- ALTER TABLE `wishlist` ADD UNIQUE KEY `id` (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `contact` -- ALTER TABLE `contact` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `event_master` -- ALTER TABLE `event_master` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `images` -- ALTER TABLE `images` MODIFY `image_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; -- -- AUTO_INCREMENT for table `payment` -- ALTER TABLE `payment` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT for table `rating` -- ALTER TABLE `rating` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT for table `register_user` -- ALTER TABLE `register_user` MODIFY `user_id` int(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `register_venue` -- ALTER TABLE `register_venue` MODIFY `user_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `subscription_plan` -- ALTER TABLE `subscription_plan` MODIFY `plan_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tbl_about` -- ALTER TABLE `tbl_about` MODIFY `id` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tbl_faq` -- ALTER TABLE `tbl_faq` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `venue_enquires` -- ALTER TABLE `venue_enquires` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `videos` -- ALTER TABLE `videos` MODIFY `video_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `wishlist` -- ALTER TABLE `wishlist` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; 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 */;
col MEMBER for a45; select * from v$logfile order by 1,2; col MEMBER clear;
CREATE procedure spr_list_NonMovable_Items(@ShowItems nvarchar(255), @FromDate datetime, @ToDate datetime) as if @ShowItems = 'Items With Stock' begin select Items.Product_Code, "Item Code" = Items.Product_Code, "Item Name" = Items.ProductName, "Description" = Items.Description, "Category" = ItemCategories.Category_Name, "Last Sale Date" = (select Max(InvoiceAbstract.InvoiceDate) from InvoiceAbstract, InvoiceDetail where InvoiceAbstract.InvoiceDate < @FromDate and InvoiceAbstract.Status & 128 = 0 and InvoiceAbstract.InvoiceType in (1,2,3) and InvoiceAbstract.InvoiceID = InvoiceDetail.InvoiceID AND InvoiceDetail.Product_Code = Items.Product_Code), "Saleable Stock" = ISNULL((select Sum(Case When IsNull(Free, 0) = 0 And IsNull(Damage, 0) = 0 Then Quantity Else 0 End) from Batch_products where Batch_Products.Product_Code = Items.Product_Code), 0), "Damaged Stock" = ISNULL((select Sum(Case When IsNull(Damage, 0) > 0 Then Quantity Else 0 End) from Batch_products where Batch_Products.Product_Code = Items.Product_Code), 0), "Free Stock" = ISNULL((select Sum(Case When IsNull(Free, 0) = 1 And IsNull(Damage, 0) = 0 Then Quantity Else 0 End) from Batch_products where Batch_Products.Product_Code = Items.Product_Code), 0), "Maximum Stock" = ISNULL((select MAX (ISNULL(Opening_Quantity, 0) - IsNull(Damage_Opening_Quantity, 0)) from openingdetails where openingdetails.product_code = Items.Product_Code and opening_date between @FromDate and @ToDate), 0), "Total Stock" = ISNULL((select Sum(Quantity) from Batch_products where Batch_Products.Product_Code = Items.Product_Code), 0), "Total Value" = Cast(ISNULL((Select Sum(Quantity * PurchasePrice) from Batch_Products where Batch_Products.Product_Code = Items.Product_Code), 0) as Decimal(18,6)) From Items, ItemCategories, Batch_Products where Items.Product_Code not in (select distinct(InvoiceDetail.Product_Code ) from InvoiceDetail, InvoiceAbstract where InvoiceAbstract.InvoiceID = InvoiceDetail.InvoiceID and InvoiceAbstract.InvoiceDate between @FromDate and @ToDate and InvoiceAbstract.Status & 128 = 0 and InvoiceAbstract.InvoiceType in (1,2,3)) And Items.CategoryID = ItemCategories.CategoryID And Batch_Products.Product_Code = Items.Product_Code group by Items.Product_Code, Items.ProductName, Items.Description, ItemCategories.Category_Name having sum(Batch_Products.Quantity) > 0 end else begin select Items.Product_Code, "Item Code" = Items.Product_Code, "Item Name" = Items.ProductName, "Description" = Items.Description, "Category" = ItemCategories.Category_Name, "Last Sale Date" = (select Max(InvoiceAbstract.InvoiceDate) from InvoiceAbstract, InvoiceDetail where InvoiceAbstract.InvoiceDate < @FromDate and InvoiceAbstract.Status & 128 = 0 and InvoiceAbstract.InvoiceType in (1,2,3) and InvoiceAbstract.InvoiceID = InvoiceDetail.InvoiceID AND InvoiceDetail.Product_Code = Items.Product_Code), "Saleable Stock" = ISNULL((select Sum(Case When IsNull(Free, 0) = 0 And IsNull(Damage, 0) = 0 Then Quantity Else 0 End) from Batch_products where Batch_Products.Product_Code = Items.Product_Code), 0), "Damaged Stock" = ISNULL((select Sum(Case When IsNull(Damage, 0) > 0 Then Quantity Else 0 End) from Batch_products where Batch_Products.Product_Code = Items.Product_Code), 0), "Free Stock" = ISNULL((select Sum(Case When IsNull(Free, 0) = 1 And IsNull(Damage, 0) = 0 Then Quantity Else 0 End) from Batch_products where Batch_Products.Product_Code = Items.Product_Code), 0), "Maximum Stock" = ISNULL((select MAX (ISNULL(Opening_Quantity, 0) - IsNull(Damage_Opening_Quantity, 0)) from openingdetails where openingdetails.product_code = Items.Product_Code and opening_date between @FromDate and @ToDate), 0), "Total Stock" = ISNULL((select Sum(Quantity) from Batch_products where Batch_Products.Product_Code = Items.Product_Code), 0), "Total Value" = Cast(ISNULL((Select Sum(Quantity * PurchasePrice) from Batch_Products where Batch_Products.Product_Code = Items.Product_Code), 0) as Decimal(18,6)) From Items, ItemCategories where Items.Product_Code not in (select distinct(InvoiceDetail.Product_Code ) from InvoiceDetail, InvoiceAbstract where InvoiceAbstract.InvoiceID = InvoiceDetail.InvoiceID and InvoiceAbstract.InvoiceDate between @FromDate and @ToDate and InvoiceAbstract.Status & 128 = 0 and InvoiceAbstract.InvoiceType in (1,2,3)) and Items.CategoryID = ItemCategories.CategoryID end
-- phpMyAdmin SQL Dump -- version 4.0.4.1 -- http://www.phpmyadmin.net -- -- Machine: 127.0.0.1 -- Genereertijd: 30 okt 2015 om 20:31 -- Serverversie: 5.6.11 -- PHP-versie: 5.5.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 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 utf8 */; -- -- Databank: `bowling` -- CREATE DATABASE IF NOT EXISTS `bowling` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `bowling`; -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `game` -- DROP TABLE IF EXISTS `game`; CREATE TABLE IF NOT EXISTS `game` ( `Game_ID` int(11) NOT NULL AUTO_INCREMENT, `Tournament_ID` int(11) NOT NULL, `Game_Name` text NOT NULL, `Date` date NOT NULL, `Time` time NOT NULL, `Location` text, PRIMARY KEY (`Game_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Gegevens worden uitgevoerd voor tabel `game` -- INSERT INTO `game` (`Game_ID`, `Tournament_ID`, `Game_Name`, `Date`, `Time`, `Location`) VALUES (1, 0, 'Game1', '2015-10-10', '10:10:00', 'HASSELT'), (2, 0, 'Game2', '2015-10-10', '10:10:00', 'HASSELT'), (3, 0, 'Game3', '2015-10-10', '10:10:00', 'HASSELT'), (4, 0, 'Game4', '2015-10-10', '10:10:00', 'HASSELT'); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `participants` -- DROP TABLE IF EXISTS `participants`; CREATE TABLE IF NOT EXISTS `participants` ( `Game_ID` int(11) NOT NULL, `Google_ID` varchar(25) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Gegevens worden uitgevoerd voor tabel `participants` -- INSERT INTO `participants` (`Game_ID`, `Google_ID`) VALUES (1, '4'), (2, '1'), (2, '2'), (2, '3'), (2, '4'), (3, '1'), (3, '2'), (3, '3'), (3, '4'), (4, '1'), (4, '2'), (4, '3'), (4, '4'), (5, '1'), (5, '2'), (5, '3'), (5, '4'), (1, '1'), (1, '2'), (1, '3'), (6, '1'), (6, '2'), (6, '3'), (6, '4'), (7, '1'), (7, '2'), (7, '3'), (7, '4'); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `participants_tournament` -- DROP TABLE IF EXISTS `participants_tournament`; CREATE TABLE IF NOT EXISTS `participants_tournament` ( `Google_ID` varchar(25) NOT NULL, `Tournament_ID` int(11) NOT NULL, `Status` tinyint(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Gegevens worden uitgevoerd voor tabel `participants_tournament` -- INSERT INTO `participants_tournament` (`Google_ID`, `Tournament_ID`, `Status`) VALUES ('1', 1, 1), ('1', 1, 1), ('1', 2, 0), ('1', 3, 0), ('1', 5, 0), ('1', 6, 0), ('1', 7, 0), ('2', 1, 0), ('2', 2, 0), ('2', 3, 0), ('2', 5, 0), ('2', 6, 0), ('2', 7, 0), ('3', 1, 0), ('3', 2, 0), ('3', 3, 0), ('3', 5, 0), ('3', 6, 0), ('3', 7, 0), ('4', 1, 0), ('4', 2, 0), ('4', 3, 0), ('4', 5, 0), ('4', 6, 0), ('4', 7, 0); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `person` -- DROP TABLE IF EXISTS `person`; CREATE TABLE IF NOT EXISTS `person` ( `Google_ID` varchar(25) NOT NULL, `Last_Name` text NOT NULL, `Nickname` text, `First_Name` text NOT NULL, `Email` text, `GSM` text, PRIMARY KEY (`Google_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Gegevens worden uitgevoerd voor tabel `person` -- INSERT INTO `person` (`Google_ID`, `Last_Name`, `Nickname`, `First_Name`, `Email`, `GSM`) VALUES ('1', 'AchternaamTest', NULL, 'Voornaam', NULL, NULL), ('2', 'Boelen', 'Bilbo', 'Tom', 'BoelenTom@gmail.com', '0497495050'), ('3', 'Trekels', '', 'Vincent', 'trekelsVincent@gmail.com', '123456789'), ('4', 'Carremans', '', 'Glenn', 'CarremansGlenn@gmail.com', '123456789'), ('5', 'Cardinaals', 'stukske', 'Leandro', 'CardinaalsLeandro@gmail.com', '123456789'); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `score` -- DROP TABLE IF EXISTS `score`; CREATE TABLE IF NOT EXISTS `score` ( `Score_ID` int(11) NOT NULL AUTO_INCREMENT, `Game_ID` int(11) NOT NULL, `Google_ID` varchar(25) NOT NULL, `Total` int(11) NOT NULL, `Strikes` int(11) NOT NULL, `Spares` int(11) NOT NULL, PRIMARY KEY (`Score_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ; -- -- Gegevens worden uitgevoerd voor tabel `score` -- INSERT INTO `score` (`Score_ID`, `Game_ID`, `Google_ID`, `Total`, `Strikes`, `Spares`) VALUES (3, 1, '1', 101, 1, 2), (4, 2, '1', 102, 1, 2), (5, 3, '1', 103, 1, 2), (6, 4, '1', 101, 1, 2), (7, 1, '2', 201, 1, 2), (8, 2, '2', 202, 1, 2), (9, 3, '2', 203, 1, 2), (10, 4, '2', 201, 1, 2), (11, 1, '3', 121, 1, 2), (12, 2, '3', 122, 1, 2), (13, 3, '3', 123, 1, 2), (14, 4, '3', 121, 1, 2), (15, 1, '4', 124, 1, 2), (16, 2, '4', 125, 1, 2), (17, 3, '4', 126, 1, 2), (18, 4, '4', 127, 1, 2); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `tournament` -- DROP TABLE IF EXISTS `tournament`; CREATE TABLE IF NOT EXISTS `tournament` ( `Tournament_ID` int(11) NOT NULL AUTO_INCREMENT, `Google_ID` varchar(25) NOT NULL, `Start_Date` date NOT NULL, `End_Date` date NOT NULL, `Tournament_Name` text, PRIMARY KEY (`Tournament_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Gegevens worden uitgevoerd voor tabel `tournament` -- INSERT INTO `tournament` (`Tournament_ID`, `Google_ID`, `Start_Date`, `End_Date`, `Tournament_Name`) VALUES (1, '1', '2021-12-12', '2012-12-12', 'TEST TOURNOOI 1'), (2, '1', '2021-12-12', '2012-12-12', 'TEST TOURNOOI 2'), (3, '1', '2021-12-12', '2012-12-12', 'TEST TOURNOOI 3'), (4, '1', '2021-12-12', '2012-12-12', 'TEST TOURNOOI 4'); /*!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 keyspace if not exists apache_log WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; //----------------------------------------------------------- use apache_log; drop table if exists apache_log.fact_access_log; CREATE TABLE if not exists apache_log.fact_access_log( client_ip_address varchar, request_id Int, referrer_id Int, agent_id Int, agent_device_id Int, request_date timestamp, client_id int, remote_user varchar, request text, http_status_code int, bytes_sent int, referrer text, user_agent text, PRIMARY KEY (request_date, client_ip_address, request) ) WITH bloom_filter_fp_chance = 0.01 AND read_repair_chance = 0.3; //----------------------------------------------------------- drop table if exists apache_log.dim_client; CREATE TABLE if not exists apache_log.dim_client( client_ip_address varchar, client_country_code varchar, client_country_name varchar, client_region varchar, client_city varchar, client_latitude float, client_longitude float, client_timezone varchar, client_postal_code varchar, client_dma_code int, client_area_code int, client_metro_code int, client_region_name varchar, PRIMARY KEY (client_ip_address) ) WITH bloom_filter_fp_chance = 0.01 AND read_repair_chance = 0.3 AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'ALL' } AND compaction = { 'class' : 'SizeTieredCompactionStrategy' }; //----------------------------------------------------------- drop table if exists apache_log.dim_request; CREATE TABLE if not exists apache_log.dim_request( request_id Int, request_protocol varchar, request_version varchar, request_method varchar, request_path varchar, request_file varchar, request_extension varchar, request_parameters varchar, request_anchor varchar, PRIMARY KEY (request_id) ) WITH bloom_filter_fp_chance = 0.01 AND read_repair_chance = 0.3 AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'ALL' } AND compaction = { 'class' : 'SizeTieredCompactionStrategy' }; //----------------------------------------------------------- drop table if exists apache_log.dim_referrer; CREATE TABLE if not exists apache_log.dim_referrer( referrer_id Int, referrer_medium varchar, referrer_source varchar, referrer_terms set<varchar>, PRIMARY KEY (referrer_id) ) WITH bloom_filter_fp_chance = 0.01 AND read_repair_chance = 0.3 AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'ALL' } AND compaction = { 'class' : 'SizeTieredCompactionStrategy' }; //----------------------------------------------------------- drop table if exists apache_log.dim_agent; CREATE TABLE if not exists apache_log.dim_agent( agent_id Int, agent_type varchar, agent_producer varchar, agent_family varchar, agent varchar, agent_version varchar, PRIMARY KEY (agent_id) ) WITH bloom_filter_fp_chance = 0.01 AND read_repair_chance = 0.3 AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'ALL' } AND compaction = { 'class' : 'SizeTieredCompactionStrategy' }; //----------------------------------------------------------- drop table if exists apache_log.dim_agent_device; CREATE TABLE if not exists apache_log.dim_agent_device( agent_device_id Int, agent_device_category varchar, agent_os_producer varchar, agent_os_family varchar, agent_os varchar, agent_os_version varchar, PRIMARY KEY (agent_device_id) ) WITH bloom_filter_fp_chance = 0.01 AND read_repair_chance = 0.3 AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'ALL' } AND compaction = { 'class' : 'SizeTieredCompactionStrategy' }; //----------------------------------------------------------- drop table if exists apache_log.dim_http_status_code; CREATE TABLE apache_log.dim_http_status_code ( http_status_code int, code_description text, code_group text, PRIMARY KEY (http_status_code) ) WITH bloom_filter_fp_chance = 0.01; insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(100,'Continue','Informational'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(101,'Switching Protocols','Informational'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(102,'Processing (WebDAV; RFC 2518)','Informational'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(200,'OK','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(201,'Created','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(202,'Accepted','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(203,'Non-Authoritative Information (since HTTP/1.1)','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(204,'No Content','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(205,'Reset Content','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(206,'Partial Content (RFC 7233)','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(207,'Multi-Status (WebDAV; RFC 4918)','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(208,'Already Reported (WebDAV; RFC 5842)','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(226,'IM Used (RFC 3229)','Success'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(300,'Multiple Choices','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(301,'Moved Permanently','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(302,'Found','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(303,'See Other (since HTTP/1.1)','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(304,'Not Modified (RFC 7232)','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(305,'Use Proxy (since HTTP/1.1)','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(306,'Switch Proxy','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(307,'Temporary Redirect (since HTTP/1.1)','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(308,'Permanent Redirect (RFC 7538)','Redirection'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(404,'error on German Wikipedia','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(400,'Bad Request','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(401,'Unauthorized (RFC 7235)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(402,'Payment Required','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(403,'Forbidden','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(404,'Not Found','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(405,'Method Not Allowed','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(406,'Not Acceptable','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(407,'Proxy Authentication Required (RFC 7235)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(408,'Request Timeout','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(409,'Conflict','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(410,'Gone','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(411,'Length Required','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(412,'Precondition Failed (RFC 7232)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(413,'Request Entity Too Large','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(414,'Request-URI Too Long','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(415,'Unsupported Media Type','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(416,'Requested Range Not Satisfiable (RFC 7233)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(417,'Expectation Failed','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(418,'I''m a teapot (RFC 2324)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(419,'Authentication Timeout (not in RFC 2616)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(420,'Method Failure (Spring Framework)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(420,'Enhance Your Calm (Twitter)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(421,'Misdirected Request (HTTP/2)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(422,'Unprocessable Entity (WebDAV; RFC 4918)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(423,'Locked (WebDAV; RFC 4918)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(424,'Failed Dependency (WebDAV; RFC 4918)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(426,'Upgrade Required','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(428,'Precondition Required (RFC 6585)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(429,'Too Many Requests (RFC 6585)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(431,'Request Header Fields Too Large (RFC 6585)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(440,'Login Timeout (Microsoft)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(444,'No Response (Nginx)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(449,'Retry With (Microsoft)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(450,'Blocked by Windows Parental Controls (Microsoft)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(451,'Unavailable For Legal Reasons (Internet draft)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(451,'Redirect (Microsoft)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(494,'Request Header Too Large (Nginx)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(495,'Cert Error (Nginx)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(496,'No Cert (Nginx)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(497,'HTTP to HTTPS (Nginx)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(498,'Token expired/invalid (Esri)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(499,'Client Closed Request (Nginx)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(499,'Token required (Esri)','Client Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(500,'Internal Server Error','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(501,'Not Implemented','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(502,'Bad Gateway','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(503,'Service Unavailable','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(504,'Gateway Timeout','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(505,'HTTP Version Not Supported','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(506,'Variant Also Negotiates (RFC 2295)','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(507,'Insufficient Storage (WebDAV; RFC 4918)','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(508,'Loop Detected (WebDAV; RFC 5842)','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(509,'Bandwidth Limit Exceeded (Apache bw/limited extension)[30]','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(510,'Not Extended (RFC 2774)','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(511,'Network Authentication Required (RFC 6585)','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(598,'Network read timeout error (Unknown)','Server Error'); insert into apache_log.dim_http_status_code(http_status_code,code_description,code_group) values(599,'Network connect timeout error (Unknown)','Server Error'); //-----------------------------------------------------------
Submitted By Nivetha.Seenivasan Movie ( mID, title, year, director ) create table Movie(mId Number Constraint pk_key PRIMARY KEY,title text,year Number(4),director text); Reviewer ( rID, name ) create table Reviewer(rId Number Constraint pk_key PRIMARY KEY,name text); Rating ( rID, mID, stars, ratingDate ) create table Rating(rId Number references from Reviewer(rId),mId Number references from Movie(mId),stars int,ratingDate Date); 1.Find the titles of all movies directed by Steven Spielberg. (1 point possible) select title,year from Movie where director='Steven Spielberg'; E.T.|1982 Raiders of the Lost Ark|1981 2.Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order. (1 point possible) select distinct year from Movie m inner join Rating r on m.mId=r.mId where stars=4 or stars=5 order by year; 1937 1939 1981 2009 3.Find the titles of all movies that have no ratings. (1 point possible) select title from Movie where mId not in (select distinct mId Rating r); Star Wars Titanic 4.Some reviewers didn't provide a date with their rating. Find the names of all reviewers who have ratings with a NULL value for the date. select rev.rId,name from Reviewer as rev inner join Rating as rate on rev.rId=rate.rId and ratingDate is NULL; 202|Daniel Lewis 205|Chris Jackson 5.Write a query to return the ratings data in a more readable format: reviewer name, movie title, stars, and ratingDate. Also, sort the data, first by reviewer name, then by movie title, and lastly by number of stars. select name,title,stars,ratingDate from Reviewer as rev inner join Rating as rate on rev.rId=rate.rId inner join Movie as mov on rate.mId=mov.mId order by name,title,stars; Ashley White|E.T.|3|2011-01-02 Brittany Harris|Raiders of the Lost Ark|2|2011-01-30 Brittany Harris|Raiders of the Lost Ark|4|2011-01-12 Brittany Harris|The Sound of Music|2|2011-01-20 Chris Jackson|E.T.|2|2011-01-22 Chris Jackson|Raiders of the Lost Ark|4| Chris Jackson|The Sound of Music|3|2011-01-27 Daniel Lewis|Snow White|4| Elizabeth Thomas|Avatar|3|2011-01-15 Elizabeth Thomas|Snow White|5|2011-01-19 James Cameron|Avatar|5|2011-01-20 Mike Anderson|Gone with the Wind|3|2011-01-09 Sarah Martinez|Gone with the Wind|2|2011-01-22 Sarah Martinez|Gone with the Wind|4|2011-01-27 6.For all cases where the same reviewer rated the same movie twice and gave it a higher rating the second time, return the reviewer's name and the title of the movie. 7.For each movie that has at least one rating, find the highest number of stars that movie received. Return the movie title and number of stars. Sort by movie title. select title,stars from Movie as mov inner join Rating as rate on mov.mId=rate.mId group by rate.mId having max(stars) order by title; Avatar|5 E.T.|3 Gone with the Wind|4 Raiders of the Lost Ark|4 Snow White|5 The Sound of Music|3 8.For each movie, return the title and the 'rating spread', that is, the difference between highest and lowest ratings given to that movie. Sort by rating spread from highest to lowest, then by movie title. select title,max(stars)-min(stars) as ratingSpread from Movie as mov inner join Rating as rate on mov.mId=rate.mId group by rate.mId order by ratingSpread desc; select title,max(stars)-min(stars) as ratingSpread from Movie as mov inner join Rating as rate on mov.mId=rate.mId group by rate.mId order by ratingSpread desc; Gone with the Wind|2 Avatar|2 Raiders of the Lost Ark|2 The Sound of Music|1 E.T.|1 Snow White|1 9.Find the difference between the average rating of movies released before 1980 and the average rating of movies released after 1980. (Make sure to calculate the average rating for each movie, then the average of those averages for movies before 1980 and movies after. Don't just calculate the overall average rating before and after 1980.) 10.Find the names of all reviewers who rated Gone with the Wind. select distinct name from Reviewer as rev inner join Rating as rate on rev.rId=rate.rId inner join Movie as mov on rate.mId=mov.mId and title='Gone with the Wind'; Sarah Martinez Mike Anderson 11.For any rating where the reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars. select name,title,stars from Reviewer as rev inner join Rating as rate on rev.rId=rate.rId inner join Movie as mov on rate.mId=mov.mId and director=name; James Cameron|Avatar|5 12.Return all reviewer names and movie names together in a single list, alphabetized. (Sorting by the first name of the reviewer and first word in the title is fine; no need for special processing on last names or removing "The".) select distinct name,title from Reviewer as rev inner join Rating as rate on rev.rId=rate.rId inner join Movie as mov on rate.mId=mov.mId order by name,title; Ashley White|E.T. Brittany Harris|Raiders of the Lost Ark Brittany Harris|The Sound of Music Chris Jackson|E.T. Chris Jackson|Raiders of the Lost Ark Chris Jackson|The Sound of Music Daniel Lewis|Snow White Elizabeth Thomas|Avatar Elizabeth Thomas|Snow White James Cameron|Avatar Mike Anderson|Gone with the Wind Sarah Martinez|Gone with the Wind 13.Find the titles of all movies not reviewed by Chris Jackson. select title from Movie as mov where mov.mId not in ( select mId from Rating as rate inner join Reviewer as rev on name='Chris Jackson') Star Wars Titanic 14.For all pairs of reviewers such that both reviewers gave a rating to the same movie, return the names of both reviewers. Eliminate duplicates, don't pair reviewers with themselves, and include each pair only once.For each pair, return the names in the pair in alphabetical order. 15.For each rating that is the lowest (fewest stars) currently in the database, return the reviewer name, movie title, and number of stars. select name,title,stars from Reviewer as rev inner join Rating as rate on rev.rId=rate.rId inner join Movie as mov on mov.mId=rate.mId where stars=(select min(stars) from Rating); Sarah Martinez|Gone with the Wind|2 Brittany Harris|The Sound of Music|2 Brittany Harris|Raiders of the Lost Ark|2 Chris Jackson|E.T.|2 16.List movie titles and average ratings, from highest-rated to lowest-rated. If two or more movies have the same average rating, list them in alphabetical order. select title,avg(stars) as star from Movie as mov inner join Rating as rate on mov.mId=rate.mId group by mov.mId order by star desc,title; Snow White|4.5 Avatar|4.0 Raiders of the Lost Ark|3.33333333333333 Gone with the Wind|3.0 E.T.|2.5 The Sound of Music|2.5 17.Find the names of all reviewers who have contributed three or more ratings. (As an extra challenge, try writing the query without HAVING or without COUNT.) select rate.rId,name,count(rate.rId) as count from Rating as rate inner join Reviewer as rev on rate.rId=rev.rId group by rate.rId having count>=3; 203|Brittany Harris|3 205|Chris Jackson|3 18.Some directors directed more than one movie. For all such directors, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title. (As an extra challenge, try writing the query both with and without COUNT.) select title,director from Movie where director is not null and director in (select director from Movie group by director having count(director)>1) order by director,title; Avatar|James Cameron Titanic|James Cameron E.T.|Steven Spielberg Raiders of the Lost Ark|Steven Spielberg 19.Find the movie(s) with the highest average rating. Return the movie title(s) and average rating. (Hint: This query is more difficult to write in SQLite than other systems; you might think of it as finding the highest average rating and then choosing the movie(s) with that average rating.) select MID,title,max(star) from(select title,rate.mId as MID,avg(stars) as star from Movie mov inner join Rating rate on mov.mId=rate.mId group by rate.mId); 106|Snow White|4.5 20.Find the movie(s) with the lowest average rating. Return the movie title(s) and average rating. (Hint: This query may be more difficult to write in SQLite than other systems; you might think of it as finding the lowest average rating and then choosing the movie(s) with that average rating.) select MID,title,min(star) from(select title,rate.mId as MID,avg(stars) as star from Movie mov inner join Rating rate on mov.mId=rate.mId group by rate.mId); 103|The Sound of Music|2.5 21.For each director, return the director's name together with the title(s) of the movie(s) they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL. (1 point possible) select director,title,max(stars) from Movie m inner join Rating r on m.mId=r.mId and director is NOT NULL group by r.mId; Victor Fleming|Gone with the Wind|4 Robert Wise|The Sound of Music|3 Steven Spielberg|E.T.|3 James Cameron|Avatar|5 Steven Spielberg|Raiders of the Lost Ark|4
CREATE TABLE payment.pendingPayments ( pendingPaymentId SERIAL NOT NULL, userId INT NOT NULL, paymentId INT NOT NULL, CONSTRAINT pending_payments_pkey PRIMARY KEY (pendingPaymentId), CONSTRAINT fk_pending_payments_users FOREIGN KEY (userId) REFERENCES main.users (id) MATCH SIMPLE, CONSTRAINT fk_pending_payments_payments FOREIGN KEY (paymentId) REFERENCES payment.payments (paymentId) MATCH SIMPLE ) WITH (OIDS =FALSE);
select Launch_Site from SPACEXTBL group by Launch_Site; select DISTINCT Launch_Site from SPACEXTBL where Launch_Site like 'CCA%' ; select SUM(PAYLOAD_MASS__KG_) as total_payload from SPACEXTBL where CUSTOMER like 'NASA%'; select AVG(PAYLOAD_MASS__KG_) as AVG_PAYLOAD from SPACEXTBL where BOOSTER_VERSION like 'F9 v1.1%'; select min(date) AS DATE, LANDING__OUTCOME FROM SPACEXTBL GROUP BY LANDING__OUTCOME; select BOOSTER_VERSION, PAYLOAD_MASS__KG_, LANDING__OUTCOME from SPACEXTBL Where PAYLOAD_MASS__KG_ > 4000 and PAYLOAD_MASS__KG_ <6000 and LANDING__OUTCOME = 'Success (drone ship)'; select distinct(mission_outcome), count(*) from SPACEXTBL group by MISSION_OUTCOME; Select BOOSTER_VERSION, PAYLOAD_MASS__KG_ from SPACEXTBL WHERE PAYLOAD_MASS__KG_ = (SELECT MAX(PAYLOAD_MASS__KG_) from SPACEXTBL); select MONTHNAME(DATE) AS MONTH, BOOSTER_VERSION, LAUNCH_SITE, LANDING__OUTCOME from SPACEXTBL WHERE LANDING__OUTCOME like 'Failure (drone ship)' and YEAR(DATE)=2015; select BOOSTER_VERSION, LANDING__OUTCOME, Date, ROW_NUMBER() OVER(ORDER BY LANDING__OUTCOME DESC) FROM SPACEXTBL WHERE LANDING__OUTCOME like 'Success%' and date between '2010-06-04' and '2017-03-20';
-- Create the synonym create or replace synonym XTMESSAGE for YZYTHLOG.XTMESSAGE;
-- MySQL Script generated by MySQL Workbench -- Sat Sep 19 18:15:07 2020 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; -- ----------------------------------------------------- -- Schema university -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema university -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `university` DEFAULT CHARACTER SET utf8 ; USE `university` ; -- ----------------------------------------------------- -- Table `university`.`subjects` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `university`.`subjects` ( `id` INT NOT NULL AUTO_INCREMENT, `name` NVARCHAR(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC) VISIBLE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `university`.`faculties` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `university`.`faculties` ( `id` INT NOT NULL AUTO_INCREMENT, `name` NVARCHAR(150) NOT NULL, `budget_places_qty` INT NOT NULL, `total_places_qty` INT NOT NULL, `first_subj_id` INT NOT NULL, `second_subj_id` INT NOT NULL, `third_subj_id` INT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC) VISIBLE, INDEX `fk_faculties_subjects1_idx` (`first_subj_id` ASC) VISIBLE, INDEX `fk_faculties_subjects2_idx` (`second_subj_id` ASC) VISIBLE, INDEX `fk_faculties_subjects3_idx` (`third_subj_id` ASC) VISIBLE, CONSTRAINT `fk_faculties_subjects1` FOREIGN KEY (`first_subj_id`) REFERENCES `university`.`subjects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_faculties_subjects2` FOREIGN KEY (`second_subj_id`) REFERENCES `university`.`subjects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_faculties_subjects3` FOREIGN KEY (`third_subj_id`) REFERENCES `university`.`subjects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `university`.`user_roles` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `university`.`user_roles` ( `id` INT NOT NULL AUTO_INCREMENT, `name` NVARCHAR(45) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `university`.`user_logins` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `university`.`user_logins` ( `id` INT NOT NULL AUTO_INCREMENT, `email` NVARCHAR(45) NOT NULL, `password` NVARCHAR(200) NOT NULL, `user_roles_id` INT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `email_UNIQUE` (`email` ASC) VISIBLE, INDEX `fk_user_logins_user_roles_idx` (`user_roles_id` ASC) VISIBLE, CONSTRAINT `fk_user_logins_user_roles` FOREIGN KEY (`user_roles_id`) REFERENCES `university`.`user_roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `university`.`states` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `university`.`states` ( `id` INT NOT NULL AUTO_INCREMENT, `name` NVARCHAR(45) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `university`.`enrollees` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `university`.`enrollees` ( `user_logins_id` INT NOT NULL, `first_name` NVARCHAR(45) NOT NULL, `father_name` NVARCHAR(45) NOT NULL, `second_name` NVARCHAR(45) NOT NULL, `city` NVARCHAR(45) NOT NULL, `states_id` INT NOT NULL, `school_name` NVARCHAR(150) NOT NULL, `school_certificate` BLOB NOT NULL, `is_blocked` INT NOT NULL, PRIMARY KEY (`user_logins_id`), INDEX `fk_enrollees_states1_idx` (`states_id` ASC) VISIBLE, CONSTRAINT `fk_enrollees_user_logins1` FOREIGN KEY (`user_logins_id`) REFERENCES `university`.`user_logins` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_enrollees_states1` FOREIGN KEY (`states_id`) REFERENCES `university`.`states` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `university`.`statement` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `university`.`statement` ( `user_logins_id` INT NOT NULL, `faculties_id` INT NOT NULL, `grade_1` INT NOT NULL, `grade_2` INT NOT NULL, `grade_3` INT NOT NULL, `priority` INT NOT NULL, `is_approved` INT NOT NULL, PRIMARY KEY (`user_logins_id`, `faculties_id`), INDEX `fk_statement_faculties1_idx` (`faculties_id` ASC) VISIBLE, INDEX `fk_statement_user_logins1_idx` (`user_logins_id` ASC) VISIBLE, CONSTRAINT `fk_statement_faculties1` FOREIGN KEY (`faculties_id`) REFERENCES `university`.`faculties` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_statement_user_logins1` FOREIGN KEY (`user_logins_id`) REFERENCES `university`.`user_logins` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; INSERT INTO `university`.`user_roles` (`name`) VALUES ('admin'), ('user'); INSERT INTO `university`.`subjects` (`name`) VALUES ('Maths'), ('English'), ('Ukrainian language'), ('History'), ('Physics'); INSERT INTO `university`.`faculties` (`name`, `budget_places_qty`, `total_places_qty`, `first_subj_id`, `second_subj_id`, `third_subj_id`) VALUES ('Cybersecurity, Computer and Software Engineering', 5, 10, 1, 2, 3), ('Air Navigation', 3, 6, 1, 4, 5), ('International Relations', 2, 5, 2, 3, 4); INSERT INTO `university`.`user_logins` (`email`, `password`, `user_roles_id`) VALUES ('admin@gmail.com', '123123', 1), ('petrov@gmail.com', '123456', 2), ('ivanov@gmail.com', '456789', 2); INSERT INTO `university`.`states`(`name`) VALUES ('Cherkasy'), ('Chernihiv'), ('Chernivtsi'), ('Dnipropetrovsk'), ('Donetsk'), ('Ivano-Frankivsk'), ('Kharkiv'), ('Kherson'), ('Khmelnytskyi'), ('Kiev'), ('Kirovohrad'), ('Luhansk'), ('Lviv'), ('Mykolaiv'), ('Odessa'), ('Poltava'), ('Rivne'), ('Sumy'), ('Ternopil'), ('Vinnytsia'), ('Volyn'), ('Zakarpattia'), ('Zaporizhia'), ('Zhytomyr'); INSERT INTO `university`.`enrollees` (`user_logins_id`, `first_name`, `father_name`, `second_name`, `city`, `states_id`, `school_name`, `school_certificate`, `is_blocked`) VALUES (2, 'Petr','Petrovich','Petrov','Kyiv', 1,'Gimnazium No34', 0, 1), (3, 'Ivan','Ivanovich','Ivanov','Dnipro', 2,'Gimnazium No15', 0, 0); INSERT INTO `university`.`statement` (`user_logins_id`, `faculties_id`, `grade_1`, `grade_2`, `grade_3`, `priority`, `is_approved`) VALUES (2, 1, 190, 180, 185, 1, 0), (2, 2, 190, 180, 185, 2, 0), (2, 3, 190, 180, 185, 3, 0), (3, 2, 195, 188, 184, 1, 0), (3, 3, 197, 177, 199, 2, 0); SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
DROP DATABASE if EXISTS classbashdb; CREATE DATABASE classbashdb; USE classbashdb; DROP TABLE if EXISTS Users; CREATE TABLE Users ( userId int(11) NOT NULL AUTO_INCREMENT, userName varchar (255) UNIQUE NOT NULL COLLATE utf8_unicode_ci, password varchar(255) NOT NULL COLLATE utf8_unicode_ci, dateCreated TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (userId) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE if EXISTS Assignments; CREATE TABLE Assignments ( assignmentId int(11) NOT NULL AUTO_INCREMENT, assignmentOwnerId int(11) NOT NULL, assignmentDescription varchar (4096) COLLATE utf8_unicode_ci, assignmentTitle varchar (255) COLLATE utf8_unicode_ci, dateCreated TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (assignmentId), FOREIGN KEY (assignmentOwnerId) REFERENCES Users(userId) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE if EXISTS Submissions; CREATE TABLE Submissions ( submissionId int(11) NOT NULL AUTO_INCREMENT, submitterId int(11) NOT NULL, assignmentId int(11) NOT NULL, submissionFile varchar (255) UNIQUE NOT NULL COLLATE utf8_unicode_ci, dateCreated TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (submissionId), FOREIGN KEY (submitterId) REFERENCES Users(userId), FOREIGN KEY (assignmentId) REFERENCES Assignments(assignmentId), CONSTRAINT sid_anum UNIQUE (submitterId, assignmentId) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE if EXISTS Reviews; CREATE TABLE Reviews ( reviewId int(11) NOT NULL AUTO_INCREMENT, submissionId int(11) NOT NULL, reviewerId int(11) NOT NULL, score int NOT NULL COLLATE utf8_unicode_ci, review varchar (4096) NOT NULL COLLATE utf8_unicode_ci, dateCreated TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (reviewId), FOREIGN KEY (submissionId) REFERENCES Submissions(submissionId), FOREIGN KEY (reviewerId) REFERENCES Users(userId), CONSTRAINT rid_subid UNIQUE (reviewerId, submissionId) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO Users (userId, userName, password) VALUES (1, 'Kay', 'xxx'); INSERT INTO Users (userId, userName, password) VALUES (2, 'John', 'yyy'); INSERT INTO Users (userId, userName, password) VALUES (3, 'Alice', 'xxx'); INSERT INTO Users (userId, userName, password) VALUES (4, 'George', 'yyy'); INSERT INTO Assignments (assignmentId, assignmentOwnerId, assignmentDescription, assignmentTitle) VALUES (1, 1, 'This is an assignment', 'Assignment 1'); INSERT INTO Assignments (assignmentId, assignmentOwnerId, assignmentDescription, assignmentTitle) VALUES (2, 1, 'This is another assignment', 'Assignment 2'); INSERT INTO Assignments (assignmentId, assignmentOwnerId, assignmentDescription, assignmentTitle) VALUES (3, 1, 'This is a third assignment', 'Assignment 3'); INSERT INTO Assignments (assignmentId, assignmentOwnerId, assignmentDescription, assignmentTitle) VALUES (4, 1, 'This is a fourth assignment', 'Assignment 4'); INSERT INTO Submissions (submissionId, submitterId, assignmentId, submissionFile) VALUES (1, 1, 1, 'Kay1.txt'); INSERT INTO Submissions (submissionId, submitterId, assignmentId, submissionFile) VALUES (2, 1, 2, 'Kay2.txt'); INSERT INTO Submissions (submissionId, submitterId, assignmentId, submissionFile) VALUES (3, 2, 1, 'John1.txt'); INSERT INTO Reviews (reviewId, submissionId, reviewerId, score, review) VALUES (1, 1, 2, 4, 'This is a review by John of Kay1.txt'); INSERT INTO Reviews (reviewId, submissionId, reviewerId, score, review) VALUES (2, 1, 3, 2, 'This is a review by Alice of Kay1.txt'); INSERT INTO Reviews (reviewId, submissionId, reviewerId, score, review) VALUES (3, 1, 4, 4, 'This is a review by George of Kay1.txt'); INSERT INTO Reviews (reviewId, submissionId, reviewerId, score, review) VALUES (4, 2, 2, 4, 'This is a review of John of Kay2.txt'); INSERT INTO Reviews (reviewId, submissionId, reviewerId, score, review) VALUES (5, 2, 3, 4, 'This is a review by Alice of Kay2.txt'); INSERT INTO Reviews (reviewId, submissionId, reviewerId, score, review) VALUES (6, 3, 3, 4, 'This is a review by Alice of John1.txt'); INSERT INTO Reviews (reviewId, submissionId, reviewerId, score, review) VALUES (7, 2, 1, 4, 'This is a review of Kay of Kay2.txt'); INSERT INTO Reviews (reviewId, submissionId, reviewerId, score, review) VALUES (8, 3, 1, 4, 'This is a review of Kay of John1.txt');
--修改日期:2012.11.14 --修改人:周兵 --修改内容:资金头寸预警(曲线) --修改原因:资金头寸预警(曲线) DECLARE VN_COUNT NUMBER; BEGIN SELECT COUNT(*) INTO VN_COUNT FROM bt_sys_res WHERE res_name = '资金头寸预警(曲线)' and sys_code = 'fqs' and res_level = 2; IF VN_COUNT = 0 THEN insert into bt_sys_res (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, REVERSE7, REVERSE8, REVERSE9, REVERSE10, RES_LEVEL, RES_ROLE) values (( select max(res_code)+1 from bt_sys_res ) , '资金头寸预警(曲线)', 'fqs', ( select min(res_code) from bt_sys_res r where r.res_name = '资金预测' and r.sys_code = 'fqs' ), '/allocation/fundAllocation.do?method=toQueryReport', '0', '1', '0', '0', 1, ' ', '', '', '', '', '', null, null, null, null, null, 2, ''); END IF; END; / commit;
CREATE TABLE Reader( username char(20) not null primary key, password char(20), fullname char(50) );
-- BANK DETAILS -- -- TABLE CREATION -- CREATE TABLE bank_customer( accno INT PRIMARY KEY, cust_name VARCHAR(20), place VARCHAR(20) ); -- TABLE CREATED -- --- SCHEMA DIAGRAM --- -- +-----------+-------------+------+-----+---------+-------+ -- | Field | Type | Null | Key | Default | Extra | -- +-----------+-------------+------+-----+---------+-------+ -- | accno | int(11) | NO | PRI | NULL | | -- | cust_name | varchar(20) | YES | | NULL | | -- | place | varchar(20) | YES | | NULL | | -- +-----------+-------------+------+-----+---------+-------+ INSERT INTO bank_customer VALUES ( 1001, 'Appu', 'kannur' ), ( 1002, 'Manu', 'Calicut' ), ( 1003, 'Achu', 'Cochin' ), ( 1004, 'Anu', 'Mahi' ); -- TABLE CREATION -- CREATE TABLE deposite( accno INT, deposite INT, amount INT, FOREIGN KEY(accno) REFERENCES bank_customer(accno) ); --- SCHEMA DIAGRAM --- -- +----------+---------+------+-----+---------+-------+ -- | Field | Type | Null | Key | Default | Extra | -- +----------+---------+------+-----+---------+-------+ -- | accno | int(11) | YES | MUL | NULL | | -- | deposite | int(11) | YES | | NULL | | -- | amount | int(11) | YES | | NULL | | -- +----------+---------+------+-----+---------+-------+ INSERT INTO deposite VALUES(1003, 514, 1500),(1005,614,10000); SELECT * FROM deposite; -- TABLE CREATION -- CREATE TABLE loan( accno INT, loanno INT, lamount INT, FOREIGN KEY(accno) REFERENCES bank_customer(accno) ); -- TABLE CREATED -- --- SCHEMA DIAGRAM --- -- +---------+---------+------+-----+---------+-------+ -- | Field | Type | Null | Key | Default | Extra | -- +---------+---------+------+-----+---------+-------+ -- | accno | int(11) | YES | MUL | NULL | | -- | loanno | int(11) | YES | | NULL | | -- | lamount | int(11) | YES | | NULL | | -- +---------+---------+------+-----+---------+-------+ INSERT INTO loan VALUES ( 1001,114,25000 ), ( 1002, 214, 20000 ), ( 1005, 314, 50000 ); SELECT * from loan; -- A) -- SELECT * FROM bank_customer; -- B) -- SELECT B.accno, B.cust_name, B.place, D.amount, from bank_customer B, deposite D WHERE B.accno = L.accno; -- C) -- SELECT B.accn, B.cust_name, B.place, L.amount, FROM bank_customer B, loan L WHERE B.accno = L.accno; -- D) -- SELECT C.cust_name FOM bank_customer C WHERE C.accno IN(SELECT D.accno FROM deposite D.loan WHERE D.accno = loan.accno) -- E) -- SELECT C.cust_name FROM bank_customer C WHERE C.accno NOT IN(SELECT accno FROM deposite UNION SELECT accno FROM loan);
drop table product CASCADE CONSTRAINTS; --1. index.jsp���� ���� �մϴ�. --2. ������ ���� admin, ��� 1234�� ����ϴ�. --3. ����� ������ 3�� ����ϴ�. create table product ( num number , code number primary key, productname varchar2(50) not null, description varchar2(50) not null, perpoint number not null, quantity number(2) not null, img varchar2(40) not null ); create sequence product_seq --위에 테이블, 시퀀스까지 생성해주세요 drop sequence event_seq --insert into product values(1,1001,'브라질 세하도','맛있어요',50,50,'/brazil.png'); --insert into product values(2,1002,'과테말라 안티구아','향이 기가 막혀요',100,60,'/gua.png'); --insert into product values(3,1003,'에티오피아 모카','조금 써요',150,40,'/etiopia.png'); insert into product values(11,1004,'에스프레소(별다방)','조금 달아요',150,50,'/espressoStart.png'); insert into product values(10,1005,'에스프레소(시그니처)','새콤해요',200,80,'/espressoSign.png'); --insert into product values(6,1006,'에스프레소(신사)','많이 써요',200,70,'/espresso(Sin).png'); insert into product values(9,1007,'에스프레소(아우라)','많이 달아요',250,40,'/espressoaura.png'); insert into product values(8,1008,'에스프레소(여왕)','엄청 고소해요',250,50,'/espressoQueen.png'); insert into product values(7,1009,'에스프레소(연인)','조금 셔요',300,60,'/espressoCouple.png'); insert into product values(6,1010,'에스프레소(이태리)','많이 셔요',350,70,'/espressoItely.png'); --insert into product values(11,1011,'예맨 모카','적극 추천해요',100,60,'/yemen.png'); insert into product values(5,1012,'온두라스','향이 진짜 좋아요',150,50,'/ondu.png'); insert into product values(4,1013,'인도네시아 만델링','많이 고소해요',400,40,'/indonesia.png'); insert into product values(3,1014,'케냐AA','고소하고 맛있어요',350,40,'/kena.png'); insert into product values(2,1015,'코스타리카 따라주','중독성 있어요',220,50,'/cos.png'); insert into product values(1,1016,'콜롬비아 수프리모','달고 향이 좋아요',180,60,'/col.png'); --insert into product values(17,1017,'탄자니아 AAA','쓴데 중독성 있어요',500,70,'/tan.png'); --insert into product values(18,1018,'하우스 블랜드','호불호가 갈려요 ',450,80,'/house.png'); delete from product select * from PRODUCT
-- 用户表 CREATE TABLE t_user( id INT(10) PRIMARY KEY AUTO_INCREMENT, username VARCHAR(100), PASSWORD VARCHAR(100), nickname VARCHAR(100), STATUS INT(2), TYPE INT(2) ) -- 消息表 CREATE TABLE t_msg( id INT(10) PRIMARY KEY AUTO_INCREMENT, title VARCHAR(255), content TEXT, post_date DATETIME, user_id INT(10), CONSTRAINT FOREIGN KEY (user_id) REFERENCES t_user(id) ) -- 评论表 CREATE TABLE t_comment( id INT(10) PRIMARY KEY AUTO_INCREMENT, post_date DATETIME, content TEXT, user_id INT(10), msg_id INT(10), CONSTRAINT FOREIGN KEY (user_id) REFERENCES t_user(id), CONSTRAINT FOREIGN KEY (msg_id) REFERENCES t_msg(id) )
SELECT prod_id, quantity FROM OrderItems WHERE prod_id = '^BNBG' UNION SELECT prod_id, quantity FROM OrderItems WHERE quantity = 100 ORDER BY prod_id;
insert into user(id, username, name, age, balance) values (1, 'account1', 'Charlie', 31, 100.00); insert into user(id, username, name, age, balance) values (2, 'account2', 'Lisa', 31, 200.00); insert into user(id, username, name, age, balance) values (3, 'account3', 'Jingqin', 1, 150.00);
desc book; create table book( bookNo number generated always as identity, lib_idid varchar2(50) primary key, title varchar2(512) not null, auth varchar2(512), publ varchar2(512), pyb varchar2(10), call_no varchar2(50) not null, brch_code number not null ); select auth from book; delete from book where brch_code = 3; --bookNo이 마지막인 컬럼 보기 select * from( select * from book order by book.bookno desc) where rownum = 1; --book테이블의 행 갯수 확인 select count(bookNo) from book; commit;
Create Procedure sp_InsertRecdMarketInfoDetail (@RecID Int, @District Nvarchar(250), @Sub_District Nvarchar(250), @MarketID Int, @MarketName Nvarchar(240), @Pop_Group Nvarchar(250), @DefaultMarketFlag Int, @Active Int) As Begin Set DATEFormat DMY If isnull(@District,'') <> '' Begin If isnull(@MarketID,'') <> '' Begin If isnull(@MarketName,'') <> '' Begin INSERT INTO RecdMarketInfoDetail (RecMMID,District,Sub_District,MarketID,MarketName,Pop_Group,DefaultMarketFlag,Active,Status,CreationDate) Select @RecID, @District ,@Sub_District ,@MarketID ,@MarketName ,@Pop_Group ,@DefaultMarketFlag ,@Active ,0,Getdate() End Else Update RecdMarketInfoAbstract Set Status = 2 , RecFlag = 2 Where DocumentID = @RecID End Else Update RecdMarketInfoAbstract Set Status = 2 , RecFlag = 2 Where DocumentID = @RecID End Else Update RecdMarketInfoAbstract Set Status = 2 , RecFlag = 2 Where DocumentID = @RecID End
BEGIN TRAN UPDATE t1 SET t1.CalledNumber = t1.CallingNumber --SELECT t1.CallingNumber , t1.CalledNumber FROM imp_KoreDetail t1 WHERE rid IN (732534) UPDATE t1 SET t1.CallingNumber = t1.CalledNumber --SELECT t1.CallingNumber , t1.CalledNumber FROM imp_KoreDetail t1 WHERE rid IN ( 350440 ,522159 ,370207 ,68278 ,338603 ,853591 ,295189 ,498742 ,337116 ,484419 ,513994 ,575591 ,575605 ,575616 ,575691 ,837980 ,838060 ,838061 ,243021 ,243024 ,662601 ,118533 ,138664 ,350463 ,30661 ,732533 ,506484 ,506485 ,664617 ,240304 ,679742 ,828323 ,828409 ,829585 ,758470 ,295268 ,337400 ,575584 ,575585 ,575586 ,575587 ,575588 ,575589 ,575590 ,828382 ) UPDATE t1 SET Quantity = 1 --SELECT * FROM imp_KoreSummary2 t1 WHERE GSM LIKE '%5705097712%' AND UsageClass = 'M2M International SMS MT' DELETE t1 --SELECT * FROM imp_KoreSummary2 t1 WHERE GSM LIKE '%5706928502%' AND UsageClass = 'M2M International SMS MT' /* COMMIT ROLLBACK */ SELECT t1.CallingNumber , t1.CalledNumber FROM imp_KoreDetail t1 WHERE rid IN (732534) SELECT t1.CallingNumber , t1.CalledNumber FROM imp_KoreDetail t1 WHERE rid IN ( 350440 ,522159 ,370207 ,68278 ,338603 ,853591 ,295189 ,498742 ,337116 ,484419 ,513994 ,575591 ,575605 ,575616 ,575691 ,837980 ,838060 ,838061 ,243021 ,243024 ,662601 ,118533 ,138664 ,350463 ,30661 ,732533 ,506484 ,506485 ,664617 ,240304 ,679742 ,828323 ,828409 ,829585 ,758470 ,295268 ,337400 ,575584 ,575585 ,575586 ,575587 ,575588 ,575589 ,575590 ,828382 ) SELECT * FROM imp_KoreSummary2 t1 WHERE GSM LIKE '%5705097712%' AND UsageClass = 'M2M International SMS MT' SELECT * FROM imp_KoreSummary2 t1 WHERE GSM LIKE '%5706928502%' AND UsageClass = 'M2M International SMS MT'
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 02, 2020 at 04:27 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.4 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: `absensi` -- -- -------------------------------------------------------- -- -- Table structure for table `absen` -- CREATE TABLE `absen` ( `nama` char(255) NOT NULL, `ket` char(11) NOT NULL, `tgl` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `absen` -- INSERT INTO `absen` (`nama`, `ket`, `tgl`) VALUES ('Sri Nurlaela', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'), ('Yulia Nur Safitri', 'Hadir', '0000-00-00'); -- -------------------------------------------------------- -- -- Table structure for table `siswa` -- CREATE TABLE `siswa` ( `id` int(11) NOT NULL, `no_absen` char(11) NOT NULL, `nama` varchar(255) NOT NULL, `kelas` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `siswa` -- INSERT INTO `siswa` (`id`, `no_absen`, `nama`, `kelas`) VALUES (3, '01', 'A. Rifaldi', 'XI TKJ 1'), (4, '02', 'Ade Maulana', 'XI TKJ 1'), (5, '03', 'Adelya Puspita Sari', 'XI TKJ 1'), (6, '04', 'Ahmad Faisal', 'XI TKJ 1'), (7, '05', 'Amanda Natasya', 'XI TKJ 1'), (8, '06', 'Beres Ronaldo Pangabean', 'XI TKJ 1'), (9, '07', 'Bintang Maharani', 'XI TKJ 1'), (10, '08', 'Devi Amalia Isthainy', 'XI TKJ 1'), (11, '09', 'Dewi Silvianti', 'XI TKJ 1'), (12, '10', 'Dwi Mulya Arif Fahri', 'XI TKJ 1'), (13, '11', 'Edelweiz Ulayah Salsabilah', 'XI TKJ 1'), (14, '12', 'Haikal Fattan', 'XI TKJ 1'), (15, '13', 'Heru Fadilah Satya Putra', 'XI TKJ 1'), (16, '14', 'Indah Fadilla', 'XI TKJ 1'), (17, '15', 'Ira Widya Putri', 'XI TKJ 1'), (18, '16', 'Irfan Dwiky Fahmi', 'XI TKJ 1'), (19, '17', 'Kearen Septiana Dermawan', 'XI TKJ 1'), (20, '18', 'Lusi Susilawati', 'XI TKJ 1'), (21, '19', 'Melly Kurnia Isar D', 'XI TKJ 1'), (22, '20', 'Muhammad Adib Fariqi', 'XI TKJ 1'), (23, '21', 'Muhammad Fadjar S', 'XI TKJ 1'), (24, '22', 'Muhammad Fahri Aditia Candra', 'XI TKJ 1'), (25, '23', 'Muhammad Fadjar As Sidiq', 'XI TKJ 1'), (26, '24', 'Muhammad Rizky Putra Suja', 'XI TKJ 1'), (27, '25', 'Mutia Afrina Cisarella', 'XI TKJ 1'), (28, '26', 'Nanda Febriyansah', 'XI TKJ 1'), (29, '27', 'Neviani', 'XI TKJ 1'), (30, '28', 'Nimat', 'XI TKJ 1'), (31, '29', 'Novia Fadillah', 'XI TKJ 1'), (32, '30', 'Pupus Saira', 'XI TKJ 1'), (33, '31', 'Nurindah Jaenaturohmah', 'XI TKJ 1'), (34, '32', 'Riska Rahmawati', 'XI TKJ 1'), (35, '33', 'Rona Nisrina', 'XI TKJ 1'), (36, '34', 'Saharani Nabila', 'XI TKJ 1'), (37, '35', 'Sinta Nuriyah', 'XI TKJ 1'), (38, '36', 'Siti Mutiara Hartati', 'XI TKJ 1'), (39, '37', 'Sri Ludiyanti', 'XI TKJ 1'), (40, '38', 'Sri Nurlaela', 'XI TKJ 1'), (41, '39', 'Sri Nurlaeli', 'XI TKJ 1'), (42, '40', 'Triyana Julianti', 'XI TKJ 1'), (43, '41', 'Widia Rahmawati', 'XI TKJ 1'), (44, '42', 'Yulia Nur Safitri', 'XI TKJ 1'); -- -- Indexes for dumped tables -- -- -- Indexes for table `siswa` -- ALTER TABLE `siswa` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `siswa` -- ALTER TABLE `siswa` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=89; 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 TRIGGER trg_elimina_poligono BEFORE DELETE ON "poligonos"."poligono" FOR EACH ROW EXECUTE PROCEDURE "poligonos"."elimina_poligono_trg"();
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 31, 2019 at 07:54 AM -- Server version: 10.3.16-MariaDB -- PHP Version: 7.3.7 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: `scaffolding_team` -- -- -------------------------------------------------------- -- -- Table structure for table `client_register` -- CREATE TABLE `client_register` ( `client_id` int(11) NOT NULL, `client_name` varchar(100) NOT NULL, `client_address` varchar(100) NOT NULL, `client_contact_person_1` varchar(100) NOT NULL, `client_contact_person_2` varchar(100) NOT NULL, `client_contact_Tel1` int(11) NOT NULL, `client_contact_Tel2` int(11) NOT NULL, `client_contact_Fax1` int(11) NOT NULL, `client_contact_Fax2` int(11) NOT NULL, `client_email` varchar(100) NOT NULL, `client_recorded_by` int(11) NOT NULL, `remarks` text DEFAULT NULL, `password` varchar(255) NOT NULL, `account_type` varchar(10) DEFAULT NULL, `created_at` datetime NOT NULL DEFAULT current_timestamp(), `order_num` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `client_register` -- INSERT INTO `client_register` (`client_id`, `client_name`, `client_address`, `client_contact_person_1`, `client_contact_person_2`, `client_contact_Tel1`, `client_contact_Tel2`, `client_contact_Fax1`, `client_contact_Fax2`, `client_email`, `client_recorded_by`, `remarks`, `password`, `account_type`, `created_at`, `order_num`) VALUES (5, 'System User', 'null', 'No One', 'No One', 123456, 123456, 3216464, 3216465, 'systemuser@scaff.com', 1, '', '$2y$10$NmLUel/RETnx2xxRYVyFdOsXD5qhmr0VTXsws5hJPagLlipfIFpWe', 'SU', '2019-11-04 19:29:13', 1), (6, 'System Admin', 'dawer', 'asdedf', 'asdfwef', 123456, 123456, 1234, 48799, 'systemadmin@scaff.com', 1, '', '$2y$10$LR135ifopqcx1l7gRadLE.BAuUNy.DjCGrCRFfJ3uUNA00Neq48/.', 'SA', '2019-11-04 19:31:25', 1), (7, 'Client Viewer', 'asdwe adeas', 'Sdfadf', 'asdfwef', 12564, 123456, 3216464, 3216465, 'clientviewer@scaff.com', 1, '', '$2y$10$bO1u13HA7BTbvKbxGAjZ2uCm0bJ/6dNEonCxAO5408lfH.IdWE6EW', 'CV', '2019-11-04 19:32:42', 1), (8, 'Client Admin', 'asdhfp npiosd', 'Sdfadf', 'asdfwef', 12564, 458654, 3216464, 48799, 'clientadmin@scaff.com', 1, 'asdfwe daf wee df', '$2y$10$tuB023l30xI1sWPgvIhduexI0tjCIdwXUVDNGVhCfFf.6MzXfp3lG', 'CA', '2019-11-04 19:33:27', 13); -- -------------------------------------------------------- -- -- Table structure for table `dn_cn_buffer` -- CREATE TABLE `dn_cn_buffer` ( `product_material_item_code` varchar(20) NOT NULL, `product_name` varchar(255) NOT NULL, `product_brand_new_selling_rate` int(11) NOT NULL, `quantity` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `dn_cn_register` -- CREATE TABLE `dn_cn_register` ( `tx_number` int(11) NOT NULL, `tx_type` varchar(10) NOT NULL, `tx_date` date NOT NULL, `tx_product` int(11) NOT NULL, `tx_quantity` int(11) NOT NULL, `tx_truck_type` varchar(10) NOT NULL, `tx_truck_plate_number` varchar(20) NOT NULL, `tx_truck_rate` int(11) NOT NULL, `tx_recorded_by` int(11) NOT NULL, `remark` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `dn_cn_register` -- INSERT INTO `dn_cn_register` (`tx_number`, `tx_type`, `tx_date`, `tx_product`, `tx_quantity`, `tx_truck_type`, `tx_truck_plate_number`, `tx_truck_rate`, `tx_recorded_by`, `remark`) VALUES (12, 'a', '0000-00-00', 123, 55, 'c', '12456', 4500, 2, NULL), (45, 'a', '0000-00-00', 12345, 55, '2345', '12456', 4500, 2, ''); -- -------------------------------------------------------- -- -- Table structure for table `product_register` -- CREATE TABLE `product_register` ( `product_name` varchar(100) NOT NULL, `product_material_item_code` varchar(20) NOT NULL, `product_brand_new_selling_rate` int(11) NOT NULL, `product_second_hand_selling_rate` int(11) NOT NULL, `product_loss_rate` int(11) NOT NULL, `product_repair_rate` int(11) NOT NULL, `product_cleaning_rate` int(11) NOT NULL, `product_daily_rental_rate` int(11) NOT NULL, `product_weekly_rental_rate` int(11) NOT NULL, `product_monthly_rental_rate` int(11) NOT NULL, `product_daily_hire_charge` int(11) NOT NULL, `product_weekly_hire_charge` int(11) NOT NULL, `product_monthly_hire_charge` int(11) NOT NULL, `product_recorded_by` int(11) NOT NULL, `supplier_name` int(11) NOT NULL, `remarks` text DEFAULT NULL, `Stock` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product_register` -- INSERT INTO `product_register` (`product_name`, `product_material_item_code`, `product_brand_new_selling_rate`, `product_second_hand_selling_rate`, `product_loss_rate`, `product_repair_rate`, `product_cleaning_rate`, `product_daily_rental_rate`, `product_weekly_rental_rate`, `product_monthly_rental_rate`, `product_daily_hire_charge`, `product_weekly_hire_charge`, `product_monthly_hire_charge`, `product_recorded_by`, `supplier_name`, `remarks`, `Stock`) VALUES ('steel rod', '0', 5500, 3000, 3000, 300, 50, 50, 300, 1000, 50, 300, 1000, 123, 0, 'l;aksdfl', 0), ('abcd', '12345', 4500, 2000, 4500, 300, 500, 50, 350, 1000, 50, 350, 1000, 1, 0, 'kjkjuukjjk', 0), ('brick', 'bcd45', 100, 50, 80, 60, 20, 10, 60, 250, 10, 60, 250, 5, 3, 'awd', 0), ('ss rod', 'ss2546', 400, 220, 400, 50, 10, 10, 50, 200, 10, 50, 200, 4, 0, 'afdv adsfe', 0); -- -------------------------------------------------------- -- -- Table structure for table `project_register` -- CREATE TABLE `project_register` ( `project_id` varchar(100) NOT NULL, `project_title` varchar(100) NOT NULL, `project_contract_no` int(11) NOT NULL, `project_site_location` varchar(100) NOT NULL, `project_mail_location` varchar(100) NOT NULL, `project_order_no` int(11) NOT NULL, `project_status` varchar(100) NOT NULL, `project_recorded_by` int(11) NOT NULL, `remarks` text DEFAULT NULL, `tx_truck_rates` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `project_register` -- INSERT INTO `project_register` (`project_id`, `project_title`, `project_contract_no`, `project_site_location`, `project_mail_location`, `project_order_no`, `project_status`, `project_recorded_by`, `remarks`, `tx_truck_rates`) VALUES ('1234', 'abcd', 45684, 'sdaf', 'asdfwe', 12, 'running', 1, 'sadlfsdh hellos kdjfsdf', 0), ('124kj', 'kjhkj', 123456, 'kjh', 'mkoi', 456, 'Uncomplete', 123, 'jjiuhjj', 4500), ('as123', 'Scaffolding', 123456, 'A', 'M', 12, 'Uncomplete', 123, '', 0); -- -------------------------------------------------------- -- -- Table structure for table `quotation_items` -- CREATE TABLE `quotation_items` ( `quotation_id` varchar(20) NOT NULL, `product_material_item_code` varchar(20) NOT NULL, `product_name` varchar(255) NOT NULL, `product_brand_new_selling_rate` int(11) NOT NULL, `quantity` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `quotation_items` -- INSERT INTO `quotation_items` (`quotation_id`, `product_material_item_code`, `product_name`, `product_brand_new_selling_rate`, `quantity`) VALUES ('CLI82019112', '12345', 'abcd', 4500, 15), ('CLI82019112', 'bcd45', 'brick', 100, 7), ('CLI82019113', '0', 'steel rod', 5500, 1), ('CLI82019113', '12345', 'abcd', 4500, 1), ('CLI82019113', 'bcd45', 'brick', 100, 1), ('CLI82019113', 'ss2546', 'ss rod', 400, 1), ('CLI82019114', '12345', 'abcd', 4500, 10), ('CLI82019114', 'bcd45', 'brick', 100, 98), ('CLI82019115', '12345', 'abcd', 4500, 15), ('CLI82019116', '0', 'steel rod', 5500, 10), ('CLI82019117', '12345', 'abcd', 4500, 1), ('CLI82019117', 'bcd45', 'brick', 100, 1), ('CLI82019118', '12345', 'abcd', 4500, 1), ('CLI82019118', 'bcd45', 'brick', 100, 1), ('CLI82019119', 'bcd45', 'brick', 100, 1), ('CLI820191110', '12345', 'abcd', 4500, 1), ('CLI820191110', 'bcd45', 'brick', 100, 1), ('CLI820191111', '0', 'steel rod', 5500, 1), ('CLI820191212', '0', 'steel rod', 5500, 10), ('CLI820191212', '12345', 'abcd', 4500, 1); -- -------------------------------------------------------- -- -- Table structure for table `quotation_register` -- CREATE TABLE `quotation_register` ( `quotation_id` varchar(20) NOT NULL, `user_id` varchar(20) NOT NULL, `total_price` decimal(15,2) NOT NULL, `discount_rate` decimal(4,2) DEFAULT -1.00, `payment_amount` decimal(15,2) NOT NULL DEFAULT 0.00, `payment_advance` decimal(15,2) NOT NULL DEFAULT 0.00, `tx_number` varchar(20) DEFAULT 'NULL', `client_admin_approved` int(11) NOT NULL, `system_user_approved` int(11) NOT NULL, `yard_manager_approved` int(11) NOT NULL, `project_manager_approved` int(11) NOT NULL, `timestamp` datetime NOT NULL DEFAULT current_timestamp(), `status` varchar(20) NOT NULL DEFAULT 'ACTIVE', `payment_advance_confirm` int(11) NOT NULL DEFAULT 0, `payment_clearance_confirm` int(11) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `quotation_register` -- INSERT INTO `quotation_register` (`quotation_id`, `user_id`, `total_price`, `discount_rate`, `payment_amount`, `payment_advance`, `tx_number`, `client_admin_approved`, `system_user_approved`, `yard_manager_approved`, `project_manager_approved`, `timestamp`, `status`, `payment_advance_confirm`, `payment_clearance_confirm`) VALUES ('CLI820191110', '8', '4600.00', '15.00', '0.00', '1000.00', 'NULL', 8, 6, 0, 0, '2019-11-24 22:54:10', 'ORDER CONF', 0, 0), ('CLI820191111', '8', '5500.00', '10.00', '0.00', '2000.00', 'NULL', 8, 6, 0, 0, '2019-11-25 06:09:13', 'ORDER CONFIRMED', 0, 0), ('CLI82019112', '8', '68200.00', '2.00', '0.00', '0.00', 'NULL', 8, 6, 0, 0, '2019-11-24 14:59:19', 'ORDER CONFIRMED', 0, 0), ('CLI82019113', '8', '10500.00', '2.00', '0.00', '0.00', 'NULL', 8, 6, 0, 0, '2019-11-24 16:08:27', 'ORDER CONFIRMED', 0, 0), ('CLI82019114', '8', '54800.00', '16.00', '0.00', '20000.00', 'NULL', 8, 6, 0, 0, '2019-11-24 20:26:12', 'ORDER CONF', 0, 0), ('CLI82019115', '8', '67500.00', '17.00', '0.00', '30000.00', 'NULL', 8, 6, 0, 0, '2019-11-24 21:04:29', 'ORDER CONF', 0, 0), ('CLI82019116', '8', '55000.00', '13.00', '0.00', '25000.00', 'NULL', 8, 6, 0, 0, '2019-11-24 21:16:57', 'ORDER CONFIRMED', 0, 0), ('CLI82019117', '8', '4600.00', '45.00', '0.00', '2000.00', 'NULL', 8, 6, 0, 0, '2019-11-24 22:09:37', 'ORDER CONFIRMED', 0, 0), ('CLI82019118', '8', '4600.00', '15.25', '0.00', '1500.00', 'NULL', 8, 6, 0, 0, '2019-11-24 22:40:21', 'ORDER CONF', 0, 0), ('CLI82019119', '8', '100.00', '12.00', '0.00', '20.00', 'NULL', 8, 6, 0, 0, '2019-11-24 22:46:08', 'ORDER CONFIRMED', 0, 0), ('CLI820191212', '8', '59500.00', '12.50', '25000.00', '25000.00', 'NULL', 8, 6, 0, 0, '2019-12-28 04:13:27', 'PACKING', 6, 0); -- -------------------------------------------------------- -- -- Table structure for table `saleo68c7v0ll8dm3n3jnh6ahjqhtk` -- CREATE TABLE `saleo68c7v0ll8dm3n3jnh6ahjqhtk` ( `product_material_item_code` varchar(20) NOT NULL, `product_name` varchar(255) NOT NULL, `product_brand_new_selling_rate` int(11) NOT NULL, `quantity` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `supplier_register` -- CREATE TABLE `supplier_register` ( `supplier_id` int(11) NOT NULL, `supplier_name` varchar(100) NOT NULL, `supplier_address` varchar(255) NOT NULL, `supplier_url` varchar(100) NOT NULL, `supplier_contact_person` varchar(100) NOT NULL, `supplier_contact_tel1` int(11) NOT NULL, `supplier_contact_tel2` int(11) NOT NULL, `supplier_contact_fax` int(11) NOT NULL, `supplier_email` varchar(100) NOT NULL, `supplier_recorded_by` int(11) NOT NULL, `supplier_hire_quantity` int(11) NOT NULL, `supplier_discount` float NOT NULL, `supplier_payment_terms` int(11) NOT NULL, `remarks` text DEFAULT NULL, `quotation_payment_terms` int(11) NOT NULL, `quotation_recorded_by` int(11) NOT NULL, `tx_truck_rates` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `client_register` -- ALTER TABLE `client_register` ADD PRIMARY KEY (`client_id`); -- -- Indexes for table `dn_cn_buffer` -- ALTER TABLE `dn_cn_buffer` ADD PRIMARY KEY (`product_material_item_code`); -- -- Indexes for table `dn_cn_register` -- ALTER TABLE `dn_cn_register` ADD PRIMARY KEY (`tx_number`); -- -- Indexes for table `product_register` -- ALTER TABLE `product_register` ADD PRIMARY KEY (`product_material_item_code`); -- -- Indexes for table `project_register` -- ALTER TABLE `project_register` ADD PRIMARY KEY (`project_id`); -- -- Indexes for table `quotation_register` -- ALTER TABLE `quotation_register` ADD PRIMARY KEY (`quotation_id`); -- -- Indexes for table `saleo68c7v0ll8dm3n3jnh6ahjqhtk` -- ALTER TABLE `saleo68c7v0ll8dm3n3jnh6ahjqhtk` ADD PRIMARY KEY (`product_material_item_code`); -- -- Indexes for table `supplier_register` -- ALTER TABLE `supplier_register` ADD PRIMARY KEY (`supplier_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `client_register` -- ALTER TABLE `client_register` MODIFY `client_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `supplier_register` -- ALTER TABLE `supplier_register` MODIFY `supplier_id` int(11) NOT NULL AUTO_INCREMENT; 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 */;
SELECT COUNT(*), jokecategory_name FROM Jokes2CategoryCleaned GROUP BY jokecategory_name -- WHERE jokecategory_name="Adult"; -- WHERE jokecategory_name="Classic Structures";
select division, cost_center, account, account_group as group, account_type as type, account_statement as statement, cost_center_agg as pl_cost_center from google_sheets.gl_full_account a
CREATE Procedure sp_ser_rpt_Jobs as Select JobID,'JobID' = JObID, 'Job Name' = JobName, (case Isnull(JobMaster.[Free],0) when 0 then 'No' when 1 then 'Yes'else '' end) as 'Free', (case JobMaster.Active when 1 then 'Active' when 0 then 'Inactive'else '' end) as 'Active' from Jobmaster
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Tempo de geração: 28-Maio-2020 às 00:01 -- Versão do servidor: 5.7.30-0ubuntu0.18.04.1 -- versão do PHP: 7.2.30-1+ubuntu18.04.1+deb.sury.org+1 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 */; -- -- Banco de dados: `acmrs_associados` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `associados` -- CREATE TABLE `associados` ( `id` int(3) NOT NULL, `nome` varchar(70) NOT NULL, `data_nascimento` varchar(10) NOT NULL, `rg` varchar(13) NOT NULL, `cpf` varchar(14) NOT NULL, `email` varchar(50) DEFAULT NULL, `qto_filhos` int(2) DEFAULT NULL, `nome_pai` varchar(40) DEFAULT NULL, `nome_mae` varchar(70) DEFAULT NULL, `empregado` varchar(3) DEFAULT NULL, `telefone` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Índices para tabelas despejadas -- -- -- Índices para tabela `associados` -- ALTER TABLE `associados` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `cpf` (`cpf`), ADD UNIQUE KEY `rg` (`rg`); -- -- AUTO_INCREMENT de tabelas despejadas -- -- -- AUTO_INCREMENT de tabela `associados` -- ALTER TABLE `associados` MODIFY `id` int(3) NOT NULL AUTO_INCREMENT; 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 */;
DROP TABLE IF EXISTS christine.calendar_julian; CREATE TABLE IF NOT EXISTS christine.calendar_julian ( isodate DATE PRIMARY KEY, year INT, month INT, day INT );
SELECT SUM(CAST(DURATION_SECONDS as BIGINT)) as Duration, COUNT(ERROR_MESSAGE) as [Total Error], MAX(ERROR_TYPE) as [Error Type], TRIM(ERROR_MESSAGE) as [Error Message] FROM dbo.FMDS_ERRORS GROUP BY ERROR_MESSAGE ORDER BY [Total Error] DESC
create database EmployeeCourse; use EmployeeCourse; create table Employee( EmployeeID INT NOT NULL auto_increment, EmployeeFirstName varchar (20), EmployeeLastName varchar (20), Supervisor Int, primary key (EmployeeID) ); INSERT INTO Employee(EmployeeFirstName,EmployeeLastName,Supervisor) VALUES ('JOSH', 'WHITE', 1), ('Malcom', 'Brown', 3), ('Sarah', 'Miller', 1), ('Adam', 'Gordon', 2), ('Greg', 'Leroy', 2); create table Course( CourseID int not null, CourseTitle varchar (30), primary key (CourseID) ); Insert Into Course(CourseID,CourseTitle) values (1001, 'English 1'), (1002, 'English 2'), (2001, 'Math 1'), (3001, 'Science 1'), (3002, 'English 2'); Create table EmployeeClasses( EID int not null auto_increment, EmployeeID int, CourseID int, primary key (EID), foreign key (EmployeeID) references Employee(EMployeeID), foreign key (CourseID) references Course(CourseID) ); Insert Into EmployeeClasses(EmployeeID,CourseID) values (1,1001), (2,1002), (3,2001), (4,3001), (5,3002);
Select * from ( SELECT case when JSON_EXTRACT_SCALAR(raw_tbl.content, "$.Option_Desc") like '%\n%' then concat(raw_tbl.content,'|','column contains newline char') end as error_record_with_reason, current_timestamp() as load_ts FROM `breuninger-datalake-dev.airflow_playground.options_data_raw` raw_tbl ) result where result.error_record_with_reason is not null;
DROP SCHEMA IF EXISTS todo_manager; CREATE SCHEMA todo_manager; USE todo_manager;
CREATE procedure sp_acc_prn_arvdetail(@DocumentID as int) as select Type, AccountID, Amount, Particular,dbo.getaccountname(AccountID),TaxPercentage,TaxAmount from ARVDetail where DocumentID = @DocumentID
CREATE TABLE allstars( id integer PRIMARY KEY, name varchar(50), sport varchar(25), country varchar(50), age integer(3) ); INSERT INTO allstars (id, name, sport, country, age) VALUES(1, 'Lebron James', 'Basketball', 'USA',32), (2, 'Roger Federer', 'Tennis', 'Switzerland', 35), (3, 'Larisa Latynina', 'Gymnastics', 'Soviet Union',82), (4, 'Aaron Ramsey', 'Soccer', 'UK', 26); SELECT * FROM allstars ORDER BY name;
INSERT INTO dc_ui.category(category_name) VALUES ($1);
-- Para os exercícios a seguir, vamos usar a tabela sakila.actor USE sakila; -- 1. Escreva uma query que exiba apenas os sobrenomes únicos cadastrados. SELECT DISTINCT(last_name) FROM actor; -- 2. Quantos sobrenomes únicos temos na tabela? SELECT COUNT(DISTINCT(last_name)) FROM actor; -- 3. Ordene os valores na tabela em ordem crescente de sobrenomes e em ordem decrescente de nome. SELECT * FROM actor ORDER BY first_name DESC, last_name; -- 4. Vá até a tabela language do sakila e crie uma pesquisa que mostre os 5 primeiros idiomas cadastrados, mas não mostre o idioma english. SELECT * FROM language LIMIT 5 OFFSET 1; -- 5. Vá até a tabela film e selecione todos os dados da tabela. Pronto, fez isso? SELECT * FROM film; -- 6. Agora vamos tentar fazer o seguinte: Crie uma query para encontrar os 20 primeiros filmes, incluindo o título, o ano de lançamento, a duração, a classificação indicativa e o custo de substituição. Ordene os resultados pelos filmes com a maior duração e depois pelo menor custo de substituição. SELECT title, release_year, length, rating, replacement_cost FROM film ORDER BY length DESC, replacement_cost LIMIT 20;
UPDATE `bdCinema`.`sala` SET `idSala` = <{idSala: }>, `descriçao` = <{descriçao: }> WHERE `idSala` = <{expr}>;
-- phpMyAdmin SQL Dump -- version 4.5.2 -- http://www.phpmyadmin.net -- -- Host: localhost:3306 -- Generation Time: Apr 12, 2016 at 02:48 AM -- Server version: 10.1.9-MariaDB-log -- PHP Version: 5.6.16 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 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: `3rdyearassignment` -- -- -------------------------------------------------------- -- -- Table structure for table `classtables` -- CREATE TABLE `classtables` ( `id` int(11) NOT NULL, `day` varchar(30) NOT NULL, `activity` varchar(30) NOT NULL, `time` varchar(30) NOT NULL, `grade` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `classtables` -- INSERT INTO `classtables` (`id`, `day`, `activity`, `time`, `grade`) VALUES (1, 'Monday', 'sparring', '19:00-20:00', 'white belt & blue belt'), (2, 'Monday', 'sparring', '19:00-20:00', 'white belt & blue belt'), (3, 'Monday', 'kicks', '20:00-21:00', 'blue belt & above'), (4, 'Monday', 'kicks', '20:00-21:00', 'blue belt & above'), (5, 'Wednesday', 'technical patterns', '19:00-20:00', 'age up to 13'), (6, 'Wednesday', 'technical patterns', '19:00-20:00', 'age up to 13'), (7, 'Wednesday', 'stretching', '20:00-21:00', 'over 13'), (8, 'Wednesday', 'stretching', '20:00-21:00', 'over 13'), (9, 'Friday', 'techniques', '19:00-20:00', 'white belt & above'), (10, 'Friday', 'pad work', '20:00-21:00', 'blue belt & above'), (11, 'Friday', 'techniques', '19:00-20:00', 'white belt & above'), (12, 'Friday', 'pad work', '20:00-21:00', 'blue belt & above'); -- -------------------------------------------------------- -- -- Table structure for table `students` -- CREATE TABLE `students` ( `id` int(11) NOT NULL, `firstName` text NOT NULL, `surname` text NOT NULL, `currentBeltGrade` text NOT NULL, `currentStatus` text NOT NULL, `nextGrading` text NOT NULL, `nextBeltGradingSyllabus` text NOT NULL, `requiredStatus` text NOT NULL, `role` tinyint(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `students` -- INSERT INTO `students` (`id`, `firstName`, `surname`, `currentBeltGrade`, `currentStatus`, `nextGrading`, `nextBeltGradingSyllabus`, `requiredStatus`, `role`) VALUES (27, 'david', 'Grey', 'rainbow', 'active', 'ok', 'sure', 'i guess', 1), (32, 'john', 'Grey', 'asdf', 'asdf', 'ok', 'sure', 'i ', 0); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `username` text NOT NULL, `password` text NOT NULL, `role` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`, `role`) VALUES (29, 'david', '$2y$10$nmkxzw729IYsk5uBzzFR5uP9RDKoxZBPcVJrJ5hgLHhKOysY3Onye', 1), (30, 'john', '$2y$10$EhrFYZFyXWJcwCOw94jMd.nl.WmWmLfqobYhfC32rnr8faxc5Sx/u', 0), (31, 'david', '$2y$10$icxEL0HOf5njANwd.p.H2eWUUfR3/T10z8TTK97ReOnf7KKhutO5m', 1), (32, 'john', '$2y$10$.Jy.IXokNIjDEK65Z2demeLYqPuUVFOKbGocP91Dts7ZhPGN4opUa', 0), (33, 'admin', '$2y$10$mDTNFmkRBLfyjo5JFd2PlePTDpKDSL7jFsc0OR2MfI3XlmRK8JTZK', 1), (34, 'david', '$2y$10$1P1ZfL/b64xtXH4Rblyd1Oy77lJH9mdUkTeMI/v8vupYG.auMugR2', 1), (35, 'john', '$2y$10$aC11yqpAgpCnUjY8AB9DlublL4OUFPT3w6MHWeCaWFtKCEotpjuGW', 0), (36, 'admin', '$2y$10$VtF06u8Xf/woBK6kEs.JCOMN2yXT7W5T0LiO0Ft6ZFuj2yoo0D9FK', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `classtables` -- ALTER TABLE `classtables` ADD PRIMARY KEY (`id`); -- -- Indexes for table `students` -- ALTER TABLE `students` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `classtables` -- ALTER TABLE `classtables` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `students` -- ALTER TABLE `students` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37; /*!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 */;
select version(); \set libfile '\''`pwd`'/lib/StringsPackage.so\''; CREATE LIBRARY StringsLib AS :libfile; CREATE FUNCTION EditDistance AS LANGUAGE 'C++' NAME 'EditDistanceFactory' LIBRARY StringsLib; CREATE TRANSFORM FUNCTION StringTokenizer AS LANGUAGE 'C++' NAME 'StringTokenizerFactory' LIBRARY StringsLib; CREATE TRANSFORM FUNCTION StringTokenizerDelim AS LANGUAGE 'C++' NAME 'StringTokenizerDelimFactory' LIBRARY StringsLib;
--// First migration. -- Migration SQL that makes the change goes here. CREATE TABLE test3 ( ID NUMERIC(20,0) NOT NULL, ); --//@UNDO DROP TABLE test3;
delimiter // DROP PROCEDURE IF EXISTS createPatientPermission; DROP PROCEDURE IF EXISTS createPatientRole; DROP PROCEDURE IF EXISTS createPatientRoleHasPatientPermission; DROP PROCEDURE IF EXISTS createPatientUser; DROP PROCEDURE IF EXISTS createPatientUserHasPatientRole; create procedure createPatientPermission($permissionName varchar(50)) begin insert into permissions (permissionName) values ($permissionName); end // create procedure createPatientRole($roleName varchar(50), out $id int) begin insert into roles (rolename) values ($roleName); set $id := last_insert_id(); end // create procedure createPatientRoleHasPatientPermission($roleId int, $permissionName varchar(50)) begin declare _permissionId int; select id from permissions where permissionname = $permissionName into _permissionId; insert into role_permissions (role_id, permission_id) values($roleId, _permissionId); end // create procedure createPatientUser($username varchar(50), $password varchar(100), $enable tinyint(1), out $id int) begin insert into users (username, password, enabled) values ($username, $password, $enable); set $id := last_insert_id(); end // create procedure createPatientUserHasPatientRole($userId int, $roleId int) begin insert into user_roles (user_id, role_id) values ($userId, $roleId); end // delimiter ;