blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 3 276 | src_encoding stringclasses 33
values | length_bytes int64 23 9.61M | score float64 2.52 5.28 | int_score int64 3 5 | detected_licenses listlengths 0 44 | license_type stringclasses 2
values | text stringlengths 23 9.43M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
04616ea52d176b596da7b9ff6b974de3dce35320 | SQL | Mediagroup5/BarrocIt | /portfolio.sql | UTF-8 | 1,069 | 2.859375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50540
Source Host : localhost:3306
Source Database : barroc_it
Target Server Type : MYSQL
Target Server Version : 50540
File Encoding : 65001
Date: 2014-11-12 20:03:29
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for portfolio
-- ----------------------------
DROP TABLE IF EXISTS `portfolio`;
CREATE TABLE `portfolio` (
`port_id` int(11) NOT NULL AUTO_INCREMENT,
`gebruikers_id` int(11) NOT NULL DEFAULT '0',
`type` varchar(20) DEFAULT '0',
`omschrijving` text,
`aanv_datum` varchar(100) DEFAULT '0',
`eind_datum` varchar(100) DEFAULT '0',
`opmerking` text,
PRIMARY KEY (`port_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of portfolio
-- ----------------------------
INSERT INTO `portfolio` VALUES ('1', '3', '0', 'fdgfdg', '0003-02-23', '0003-02-23', 'fdgfdg');
INSERT INTO `portfolio` VALUES ('2', '3', '0', 'rgfhf', '55', '55', 'hgfh');
| true |
fa75bb2b40145b0f21345ce64c87d9586a2dffd8 | SQL | genoufox/sql-scripts | /神鬼传奇白金vip 充值登陆情况0224.sql | GB18030 | 3,373 | 3.875 | 4 | [] | no_license | select a.userid as ˺id,
a.passport as ˺,
case a.rank
when 1 then
''
when 2 then
''
when 3 then
''
when 4 then
''
else
null
end as VIPȼ,
a.mobilephone as ֻ,
a.tamount as ۼƳֵ,
NVL(c.pay_total2, 0) as 3³ֵ,
d.lev as ɫȼ,
d.groupname as ,
d.roleid as ɫID,
d.name as ɫ,
e.f_province_name as ½ʡ,
e.f_city_name as ½,
trunc(f.last_logout_time) as ¼ʱ
from (select userid, passport, rank, mobilephone, tamount
from bitask.t_dw_vip_vipinfo
where logtime = to_char(sysdate - 2)
and rank >= 1
and game = 8) a
/* join (select userid,
sum(money) / 100 as pay_total,
row_number() over(order by sum(money) desc) as pay_rank
from (select userid, money
from bitask.t_dw_au_billlog
where userid > 33
and game_id = 8
union all
select userid, money
from bitask.t_dw_au_billlog @racdb
where logtime < to_date('20140307', 'yyyymmdd')
-- and logtime > to_date('20130601', 'yyyymmdd')
and userid > 33
and game_id = 8)
group by userid) b
on a.userid = b.userid]
*/
left join (select userid, sum(money) / 100 as pay_total2
from bitask.t_dw_au_billlog
where userid > 33
and game_id = 8
and logtime >= to_char(sysdate - 90)
group by userid) c
on a.userid = c.userid
left join (select userid,
roleid,
groupname,
name,
lev,
-- factionid,
row_number() over(partition by userid order by lev desc, exp desc) as rolelev_rank
from bitask.t_dw_sg_gdb_chardata
where userid > 33
and logtime = to_charsysdate - 2) d
on a.userid = d.userid
and d.rolelev_rank = 1
left join (select c.userid,
c.f_province_name,
c.f_city_name,
c.cnt,
row_number() over(partition by c.userid order by c.cnt desc) as rn
from (select a.userid,
b.f_province_name,
b.f_city_name,
count(*) as cnt
from (select userid, ip_num
from bitask.t_dw_sg_glog_accountlogout
where logtime >= to_date('20151201', 'yyyymmdd')) a,
bitask.t_dic_ipseg_int_db b
where a.ip_num between b.f_bip and b.f_eip
and b.f_floor = trunc(a.ip_num / 65536, 0)
group by a.userid, f_province_name, f_city_name) c) e
on a.userid = e.userid
and e.rn = 1
left join bitask.t_dw_sg_account_status f
on a.userid = f.userid
order by a.rank desc, c.pay_total2 desc;
| true |
550ccdc2207f2e9fea93cc925c3a7be74649f30a | SQL | chidambaranadig/QueryEvaluator | /test/TPCH_Q10.SQL | UTF-8 | 1,445 | 3.875 | 4 | [] | no_license | CREATE TABLE CUSTOMER (
custkey int,
name string,
address string,
nationkey int,
phone string,
acctbal float,
mktsegment string,
comment string
) FROM FILE 'customer.tbl' USING TPCH('customer');
CREATE TABLE ORDERS (
orderkey int,
custkey int,
orderstatus string,
totalprice float,
orderdate int,
orderpriority string,
clerk string,
shippriority int,
comment string
) FROM FILE 'orders.tbl' USING TPCH('orders');
CREATE TABLE LINEITEM (
orderkey int,
partkey int,
suppkey int,
linenumber int,
quantity float,
extendedprice float,
discount float,
tax float,
returnflag string,
linestatus string,
shipdate int,
commitdate int,
receiptdate int,
shipinstruct string,
shipmode string,
comment string
) FROM FILE 'lineitem.tbl' USING TPCH('lineitem');
CREATE TABLE NATION (
nationkey int,
name string,
regionkey int,
comment string
) FROM FILE 'nation.tbl' USING TPCH('nation');
SELECT c.custkey, c.name,
c.acctbal, n.name, c.address, c.phone, c.comment,
sum(l.extendedprice * (1 - l.discount)) as revenue
FROM CUSTOMER c, ORDERS o, LINEITEM l, NATION n
WHERE (c.custkey = o.custkey)
AND (l.orderkey = o.orderkey)
AND (o.orderdate >= 19931001)
AND (o.orderdate < 19940101)
AND (l.returnflag = 'R')
AND (c.nationkey = n.nationkey)
GROUP BY c.custkey, c.name, c.acctbal, c.phone, n.name, c.address, c.comment;
| true |
7b385549197bffacd158f25358f397e8e4745596 | SQL | User2018610/reading-MySQL | /第十六章-创建高级联结.sql | UTF-8 | 1,560 | 4.125 | 4 | [] | no_license | # 第16章-创建高级联结
# 使用表别名
SELECT cust_name, cust_contact
FROM customers AS c, orders AS o, orderitems AS oi
WHERE c.cust_id = o.cust_id
AND oi.order_num = o.order_num
AND prod_id = 'TNT2';
# 自联结
SELECT prod_id, prod_name
FROM products
WHERE vend_id = (SELECT vend_id
FROM products
WHERE prod_id = 'DTNTR');
SELECT p1.prod_id, p2.prod_name
FROM products AS p1, products AS p2
WHERE p1.vend_id = p2.vend_id
AND p2.prod_id = 'DTNTR';
# 自然联结
SELECT c.*, o.order_num, o.order_date,
oi.prod_id, oi.quantity, oi.item_price
FROM customers AS c, orders AS o, orderitems AS oi
WHERE c.cust_id = o.cust_id
AND oi.order_num = o.order_num
AND prod_id = 'FB';
# 外部联结
SELECT customers.cust_id, orders.order_num
FROM customers INNER JOIN orders
ON customers.cust_id = orders.cust_id;
SELECT customers.cust_id, orders.order_num
FROM customers LEFT OUTER JOIN orders
ON customers.cust_id = orders.cust_id;
SELECT customers.cust_id, orders.order_num
FROM customers RIGHT OUTER JOIN orders
ON customers.cust_id = orders.cust_id;
# 使用带聚集函数的联结
SELECT customers.cust_name,
customers.cust_id,
COUNT(orders.order_num) AS num_ord
FROM customers INNER JOIN orders
ON customers.cust_id = orders.cust_id
GROUP BY customers.cust_id;
SELECT customers.cust_name,
customers.cust_id,
COUNT(orders.order_num) AS num_ord
FROM customers LEFT OUTER JOIN orders
ON customers.cust_id = orders.cust_id
GROUP BY customers.cust_id;
| true |
653f132f8f29389a5d614de936358b15a6c38b9f | SQL | jjung219/BootcampX | /4_queries/7_average_assistance_request_wait_time.sql | UTF-8 | 178 | 2.671875 | 3 | [] | no_license | -- average time that students wait for an assistance
-- started_at - created_at = waiting time
SELECT avg(started_at - created_at) as average_wait_time
FROM assistance_requests; | true |
f0f780e8fd93e3d11a87ed0822af7a35e139d843 | SQL | ocean-wave/fep | /db_script/update/2012-12-19(实时任务表增加字段).sql | GB18030 | 449 | 2.9375 | 3 | [] | no_license | ALTER TABLE R_REALTIME_TASK
ADD TERMINAL_PROTOCOL VARCHAR2(2) DEFAULT '0';
ALTER TABLE R_REALTIME_TASK
ADD METER_PROTOCOL VARCHAR2(2) DEFAULT '0';
-- Add comments to the columns
comment on column R_REALTIME_TASK.TERMINAL_PROTOCOL
is 'ն˹Լ03761棻';
comment on column R_REALTIME_TASK.METER_PROTOCOL
is 'ƣԼ0645971645072棻5QLLB6HDLB';
| true |
095d901663f1bbe06452b1b0fb0261497985a961 | SQL | hzbarcea/cosmo | /archive/migration/src/main/resources/110-to-120-MySQL5-pre.sql | UTF-8 | 1,545 | 3.140625 | 3 | [] | no_license | # 110-to-120-MySQL5-pre.sql
# alter existing tables
# subscription
alter table subscription add column etag varchar(255);
# users
alter table users add column etag varchar(255);
# user_preferences
alter table user_preferences add column etag varchar(255);
#item
alter table item add column etag varchar(255);
#stamp
alter table stamp add column etag varchar(255);
#attribute
alter table attribute add column etag varchar(255);
# migrate data
insert into attribute (itemid, attributetype, namespace, localname, stringvalue, createdate, modifydate) select s.itemid, 'string', 'org.osaf.cosmo.model.CalendarCollectionStamp', 'description', cs.description, s.createdate, s.modifydate from stamp s, calendar_stamp cs where s.id=cs.stampid and s.stamptype='calendar';
insert into attribute (itemid, attributetype, namespace, localname, stringvalue, createdate, modifydate) select s.itemid, 'string', 'org.osaf.cosmo.model.CalendarCollectionStamp', 'language', cs.language, s.createdate, s.modifydate from stamp s, calendar_stamp cs where s.id=cs.stampid and s.stamptype='calendar';
insert into attribute (itemid, attributetype, namespace, localname, textvalue, createdate, modifydate) select s.itemid, 'icalendar', 'org.osaf.cosmo.model.CalendarCollectionStamp', 'timezone', cs.timezone, s.createdate, s.modifydate from stamp s, calendar_stamp cs where s.id=cs.stampid and s.stamptype='calendar';
update item set icaluid=null where modifiesitemid is not null;
update attribute set etag='';
update stamp set etag=''; | true |
fd7d73e125314342101e99b33111642e5dece98a | SQL | rhelmer/graphs | /sql/schema.sql | UTF-8 | 2,992 | 3.453125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS machines (
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
os_id INT UNSIGNED NOT NULL,
is_throttling TINYINT UNSIGNED NOT NULL DEFAULT '0',
cpu_speed VARCHAR(255),
name VARCHAR(255) NOT NULL,
is_active TINYINT UNSIGNED NOT NULL DEFAULT '0',
date_added INT UNSIGNED NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY (name)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS os_list (
id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY (name)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS tests (
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
pretty_name VARCHAR(255),
is_chrome TINYINT UNSIGNED NOT NULL DEFAULT '0',
is_active TINYINT UNSIGNED NOT NULL DEFAULT '0',
pageset_id INT UNSIGNED,
PRIMARY KEY (id),
UNIQUE KEY (name),
KEY (pageset_id)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS branches (
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY (name)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS builds (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
ref_build_id BIGINT UNSIGNED,
ref_changeset VARCHAR(255),
branch_id SMALLINT UNSIGNED NOT NULL,
date_added INT UNSIGNED NOT NULL,
PRIMARY KEY (id),
KEY (ref_changeset),
KEY (ref_build_id),
KEY (branch_id, date_added)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS pagesets (
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY (name)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS pages (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
pageset_id SMALLINT UNSIGNED NOT NULL,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY (pageset_id, name)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS test_runs (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
machine_id SMALLINT UNSIGNED NOT NULL,
test_id MEDIUMINT UNSIGNED NOT NULL,
build_id INT UNSIGNED NOT NULL,
run_number TINYINT UNSIGNED NOT NULL DEFAULT '0',
date_run INT UNSIGNED NOT NULL,
average FLOAT,
PRIMARY KEY (id),
KEY (test_id, build_id),
KEY (test_id, build_id, date_run)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS test_run_values (
test_run_id INT UNSIGNED NOT NULL,
interval_id SMALLINT UNSIGNED NOT NULL,
value FLOAT NOT NULL,
page_id INT UNSIGNED,
PRIMARY KEY (test_run_id, interval_id)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS annotations (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
test_run_id int UNSIGNED NOT NULL,
note text NOT NULL,
bug_id INT UNSIGNED NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS valid_test_combinations_updated (
-- This matches test_runs.date_run:
last_updated INT NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS valid_test_combinations (
test_id INT NOT NULL,
branch_id INT NOT NULL,
os_id INT NOT NULL
) ENGINE=InnoDB;
| true |
c5057c3772e85564202a035d6c2053cb2dfc01ff | SQL | bpasbuddies/buddies2 | /MyProjects/eEMRT/EEMRT/Tables/SUB_TASKS.sql | UTF-8 | 666 | 2.75 | 3 | [] | no_license | CREATE TABLE eemrt.sub_tasks (
sub_tasks_id NUMBER NOT NULL,
work_orders_id NUMBER NOT NULL,
sub_task_number VARCHAR2(20 BYTE) NOT NULL,
sub_task_title VARCHAR2(1000 BYTE),
start_date DATE,
end_date DATE,
description VARCHAR2(2000 BYTE),
"ORGANIZATION" VARCHAR2(200 BYTE),
faa_poc VARCHAR2(2000 BYTE),
period_of_performance_id NUMBER,
status VARCHAR2(20 BYTE),
st_fee NUMBER,
created_by VARCHAR2(50 BYTE),
created_on TIMESTAMP,
last_modified_by VARCHAR2(50 BYTE),
last_modified_on TIMESTAMP,
CONSTRAINT sub_tasks_pk PRIMARY KEY (sub_tasks_id),
CONSTRAINT sub_tasks_uk1 UNIQUE (sub_task_number,work_orders_id)
); | true |
ae8d340f560caa802aa77384696b7ae4cc868420 | SQL | sumeyyekilic/CSharpCampProject | /MyNotes/SQLQuery2.sql | UTF-8 | 3,213 | 3.890625 | 4 | [] | no_license | --YORUM SATIRI..
--çalıştırmak istediğimiz kodu seçip execute ederiz.
--case insensitive
SELECT * FROM Customers
select ContactName, City, CompanyName from Customers --bunu çalıştırınca arka planda c# daki array gibi bir fake tablo oluşur.
--alias
--ANSII
select ContactName Adi, City Sehir, CompanyName SirketAdi from Customers
-- tüm müşterileri tüm kolonları ile getir ama şehri London olanları:
SELECT *FROM Customers where City='London'
--ürünler tablosunu tüm kolonları ile getir
select * from Products order by CategoryID, ProductName
select * from Products order by UnitPrice asc --acsending
select * from Products order by UnitPrice desc --descending *azalan
select count(*) from Products --bazı web sitelerinde 3000 ürün var gibi bir bilgi görürüz. kullanıcıya hava atmak
--count tek bir koon tek bir satır gelir, çünkü sayi isteriz
select count(*) from Products where CategoryID=2
select count(*) Adet from Products where CategoryID=2
--group by : kullanılıuyorsa ; select edilen kolon sadece gruop by da yazılan alan olabilir...
select CategoryID from Products group by CategoryID --her bir grup için arka planda grup oluşturuyormuş gibi düşün
select CategoryID, count(*) from Products group by CategoryID --count her bir kategori için ayrı bir count hesaplar
--2kolona birden group by yapılabilir.
--karar destek sistemler : hangi kategorilerde az ürünümz varsa onları besleyelim. yönetim ürün sayısı 10dan az olan kategorielerin listelenmesini isterse , where koşulu kümülatif dataya yazılır:
--having : kümülatif dataya yazılır
select CategoryID, count(*) from Products group by CategoryID having count(*)<10
--join birleştirme
select * from Products inner join Categories on Products.CategoryID=Categories.CategoryID --hem ürün hem kategirlerilen bir araya getirilmesi
select * from Products inner join Categories on Products.CategoryID=Categories.CategoryID where Products.UnitPrice>10 --fiyatı 10dan büyük olanlaro
--DTO : Data transformation object (bankadaki krediler için ayrı class yapıyorsak, joinler yapıp bizim için dto olarak karşımıza çıkar.)
--inner join : sadce 2 tabloda da eşleşenleri getirir,
--eşleşmeyen data varsa onu getirmez.
select * from Products p inner join [Order Details] od on p.ProductID=od.ProductID --tablodaki boşluk old için köşeli parantezle yazılı. tablo old anlasın
--(inner join sadece eşleşen kayıtları getirir...)
--yönetim : hiç satış yapamadığımız ürünleri söyle derse ?
--inner left yapılırsa bu sağlanır. yani left join(solda olup **ürünler tablosunda olup satışı olamayan*)
select * from Products p left join [Order Details] od on p.ProductID=od.ProductID
select * from Customers c left join Orders o on c.CustomerID=o.CustomerID
--yönetim : sistemimize kayıtlı ama bizden ürün almayan kişileri getir.
--bazı web sitelerinde *sana özel* demesi:
select * from Customers c left join Orders o on c.CustomerID=o.CustomerID where o.CustomerID is null
--
select * from Products p inner join [Order Details] od on p.ProductID=od.ProductID inner join Orders o on o.OrderID=od.OrderID
| true |
1f00e4ee03e4fbe97b05d44d390c13ba1b077a1d | SQL | radudilirici/FMI | /Year 2/Sem 2/BD/lab3-explicatii.sql | UTF-8 | 1,557 | 4.15625 | 4 | [] | no_license | select e1.employee_id, e1.last_name, e2.employee_id, e2.last_name
from employees e1, employees e2
where e1.manager_id = e2.employee_id(+);
select * from employees
natural join departments;
select d.department_id, e.employee_id from employees e
join departments d on (d.department_id <> e.department_id);
-- fara where face produs cartezian
select * from employees, departments;
select * from employees e, departments d
where e.department_id = d.department_id;
select * from employees e
left join departments d using (department_id);
select * from employees e
right join departments d using (department_id);
select * from departments;
select e1.employee_id, e1.manager_id, e1.department_id from employees e1
join employees e2 on (e1.manager_id = e2.employee_id)
join departments d on (e1.department_id = d.department_id)
join departments d2 on (d2.department_id = e2.department_id);
select * from employees
natural join departments
natural join locations;
select * from employees e1
right join employees e2 on (e1. manager_id = e2.employee_id);
select employee_id from employees
where department_id = 90
UNION
select employee_id from employees
where salary > 1000
order by 1;
select department_id from departments where department_name like '%r'
UNION
select department_id from employees where job_id = 'SA_REP';
select * from employees
where employee_id in
(select department_id from departments where department_name like '%re');
select * from employees
where hire_date > (select hire_date from employees where lower(last_name) = 'gates'); | true |
ada809d00913710dc263af75d48fdc03c03c7d28 | SQL | FoodBusiness/Database | /CLIENT_FEATURES.tbl.sql | UTF-8 | 373 | 2.859375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `food`.`CLIENT_FEATURES` (
`CLIENT_ID` INT NOT NULL,
`FACEBOOK` VARCHAR(250) NULL,
`FOURSQUARE` VARCHAR(250) NULL,
`YELP` VARCHAR(250) NULL,
PRIMARY KEY (`CLIENT_ID`),
CONSTRAINT `CLIENT_FEATURES_FK`
FOREIGN KEY (`CLIENT_ID`)
REFERENCES `food`.`CLIENT` (`CLIENT_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION); | true |
136d3bba1cec2a745596ad67a83d52075faa775f | SQL | TimStOnge/CodingBootcamp_HW7_SQL | /SQL_HW_Part2.sql | UTF-8 | 1,182 | 3.9375 | 4 | [] | no_license | -- PART 2 -----------------------------------------------------------
-- Using your gwsis database, develop a stored procedure that will drop an individual student's enrollment
-- from a class. Be sure to refer to the existing stored procedures, enroll_student and
-- terminate_all_class_enrollment in the gwsis database for reference. The procedure should be called
-- terminate_student_enrollment and should accept the course code, section, student ID, and effective date of
-- the withdrawal as parameters.
USE gwsis;
START TRANSACTION;
CREATE PROCEDURE terminate_student_enrollment(
-- This procedure accepts four parameters
CourseCode_in varchar(45),
Section_in varchar(45),
StudentID_in varchar(45),
WithdrawalDate_in date
)
BEGIN
SELECT * FROM student s
INNER JOIN classparticipant cp
ON s.ID_Student = cp.ID_Student
INNER JOIN class c
ON cp.ID_Class = c.ID_Class;
-- IF A STUDENT_ID IS GIVEN:
DELETE FROM student
WHERE student.ID_Student = StudentID_in
AND class.ID_Course = CourseCode_in
AND class.Section = Section_in;
INSERT INTO ClassParticipant(EndDate)
VALUES (WithdrawalDate_in)
WHERE student.ID_Student = StudentID_in;
END;
ROLLBACK;
COMMIT; | true |
8951aea53b77d69c903648f6f0bee6610e697edd | SQL | shohag-cse-knu/SRS-Code | /sql_geo_functions.sql | UTF-8 | 1,811 | 3.046875 | 3 | [] | no_license |
/* Function structure for function `district_name` */
/*!50003 DROP FUNCTION IF EXISTS `district_name` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `district_name`(div_code INT, dis_code INT) RETURNS varchar(50) CHARSET latin1
BEGIN
DECLARE `name` VARCHAR(50);
SELECT district INTO `name` FROM tbl_geocode WHERE division_code = div_code AND district_code = dis_code LIMIT 1;
RETURN `name`;
END */$$
DELIMITER ;
/* Function structure for function `division_name` */
/*!50003 DROP FUNCTION IF EXISTS `division_name` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `division_name`(div_code INT) RETURNS varchar(50) CHARSET latin1
BEGIN
DECLARE `name` VARCHAR(50);
SELECT division INTO `name` FROM tbl_geocode WHERE division_code = div_code LIMIT 1;
RETURN `name`;
END */$$
DELIMITER ;
/* Function structure for function `thana_name` */
/*!50003 DROP FUNCTION IF EXISTS `thana_name` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `thana_name`(div_code INT, dis_code INT, upz_code INT) RETURNS varchar(50) CHARSET latin1
BEGIN
DECLARE `name` VARCHAR(50);
SELECT upazilla INTO `name` FROM tbl_geocode WHERE division_code = div_code AND district_code = dis_code AND upazilla_code = upz_code LIMIT 1;
RETURN `name`;
END */$$
DELIMITER ;
/* Function structure for function `union_name` */
/*!50003 DROP FUNCTION IF EXISTS `union_name` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `union_name`(div_code INT, dis_code INT, upz_code INT, unn_code INT) RETURNS varchar(50) CHARSET latin1
BEGIN
DECLARE `name` VARCHAR(50);
SELECT `union` INTO `name` FROM tbl_geocode WHERE division_code = div_code AND district_code = dis_code AND upazilla_code = upz_code LIMIT 1;
RETURN `name`;
END */$$
DELIMITER ;
| true |
f7be133a1d5aed43919078cf50c5374c68f9c0f8 | SQL | weder96/weder96.github.io | /fullPageMaster/database/sqls/19_jsonEvents.sql | UTF-8 | 1,956 | 3.921875 | 4 | [
"MIT"
] | permissive | --A real world example
--OK, let’s give this a go with a real life use case. Let’s say we’re tracking analytics, so we have an events table:
CREATE TABLE events (
name varchar(200),
visitor_id varchar(200),
properties json,
browser json
);
--We’re going to store events in this table, like pageviews. Each event has properties, which could be anything (e.g. current page) and also sends information about the browser (like OS, screen resolution, etc). Both of these are completely free form and could change over time (as we think of extra stuff to track).
--Let’s insert a couple of events:
INSERT INTO events VALUES (
'pageview', '1',
'{ "page": "/" }',
'{ "name": "Chrome", "os": "Mac", "resolution": { "x": 1440, "y": 900 } }'
);
INSERT INTO events VALUES (
'pageview', '2',
'{ "page": "/" }',
'{ "name": "Firefox", "os": "Windows", "resolution": { "x": 1920, "y": 1200 } }'
);
INSERT INTO events VALUES (
'pageview', '1',
'{ "page": "/account" }',
'{ "name": "Chrome", "os": "Mac", "resolution": { "x": 1440, "y": 900 } }'
);
INSERT INTO events VALUES (
'purchase', '5',
'{ "amount": 10 }',
'{ "name": "Firefox", "os": "Windows", "resolution": { "x": 1024, "y": 768 } }'
);
INSERT INTO events VALUES (
'purchase', '15',
'{ "amount": 200 }',
'{ "name": "Firefox", "os": "Windows", "resolution": { "x": 1280, "y": 800 } }'
);
INSERT INTO events VALUES (
'purchase', '15',
'{ "amount": 500 }',
'{ "name": "Firefox", "os": "Windows", "resolution": { "x": 1280, "y": 800 } }'
);
--01 - Crie uma consulta de agrupa os browser por nome e mostra quantos de cada um.
--02 - Busque as visitor_id agrupando as mesma pela somatoria da visitas, sendo que as mesma deverao ser maior que zero
--03 - Busque as media agrupada pela resolution na parte X(width) e na Parte Y(height).
--04 - ache a maior resolução e qual sistema e Navegador
--05 - ache a menor resolução e qual sistema e Navegador
| true |
284333c03be8e817eb94bc530a5137b60d1cbca0 | SQL | EdLuo/GIMS | /DB/gims_db.sql | UTF-8 | 8,124 | 3.4375 | 3 | [] | no_license | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2018/3/17 22:44:26 */
/*==============================================================*/
drop table if exists T_companyinfo;
drop table if exists T_intentinfo;
drop table if exists T_logininfo;
drop table if exists T_news;
drop table if exists T_recruitinfo;
drop table if exists T_resourceinfo;
drop table if exists T_selfintent;
drop table if exists T_stuinfo;
drop table if exists T_user;
/*==============================================================*/
/* Table: T_companyinfo */
/*==============================================================*/
create table T_companyinfo
(
CompId int not null auto_increment,
CompName varchar[50] comment '企业名称',
CompIntro varchar[50] comment '企业简介',
CompPofit varchar[50] comment '企业资本',
CompManager varchar[50] comment '企业负责人',
CompAddress varchar[50] comment '企业地址',
CompContact varchar[50] comment '联系方式',
CompMail varchar(50) comment '邮箱',
primary key (CompId)
);
alter table T_companyinfo comment '企业信息表';
/*==============================================================*/
/* Table: T_intentinfo */
/*==============================================================*/
create table T_intentinfo
(
IntentId int not null auto_increment,
IntentName varchar[50] comment '意向名',
Comment varchar[50] comment '备注',
primary key (IntentId)
);
/*==============================================================*/
/* Table: T_logininfo */
/*==============================================================*/
create table T_logininfo
(
LoginId int not null auto_increment,
UId int comment '账号ID',
LoginTime datetime comment '登录时间',
LoginIp varchar(30) comment '登录IP',
Operation varchar[50] comment '操作类型',
primary key (LoginId)
);
/*==============================================================*/
/* Table: T_news */
/*==============================================================*/
create table T_news
(
NewsId int not null auto_increment,
UId int,
NewsTitle varchar(50) comment '标题',
PolishTime datetime comment '发布时间',
NewsContent text comment '内容',
primary key (NewsId)
);
alter table T_news comment '新闻表';
/*==============================================================*/
/* Table: T_recruitinfo */
/*==============================================================*/
create table T_recruitinfo
(
RecruitId int not null auto_increment,
CompId int,
RecruitPosition varchar[50] comment '岗位名称',
RecruitDemand varchar[50] comment '岗位需求',
RecruitDuty varchar[50] comment '岗位职责',
RecruitNumber varchar[4] comment '需求人数',
WorkLocation varchar[50] comment '工作地点',
RecruitTime datetime comment '招聘时间',
RecrutiManage varchar[50] comment '招聘负责人',
RecruitContact varchar[50] comment '联系方式',
primary key (RecruitId)
);
alter table T_recruitinfo comment '招聘信息';
/*==============================================================*/
/* Table: T_resourceinfo */
/*==============================================================*/
create table T_resourceinfo
(
ResourceId int not null auto_increment,
NewsId int,
ResourceName varchar[50] comment '资源名称',
ResourcePath varchar[100] comment '资源路径',
primary key (ResourceId)
);
/*==============================================================*/
/* Table: T_selfintent */
/*==============================================================*/
create table T_selfintent
(
SelfId int not null auto_increment,
IntentId int,
StuId int,
CreatedTime datetime comment '创建时间',
primary key (SelfId)
);
alter table T_selfintent comment '个人意向表';
/*==============================================================*/
/* Table: T_stuinfo */
/*==============================================================*/
create table T_stuinfo
(
StuId int not null auto_increment,
StuName varchar(50) comment '学生姓名',
StuSex varchar(4) comment '学生性别',
StuAge varchar(10) comment '学生性别',
StuBirth varchar[30] comment '出生日期',
StuOrigin varchar[50] comment '籍贯',
StuMajor varchar[30] comment '专业',
StuClass varchar[30] comment '班级',
StuNumber varchar(30) comment '学号',
StuQualifie varchar[30] comment '学历',
StuType varchar(4) comment '学习形式',
StuAddress varchar(50) comment '家庭地址',
StuContact varchar[30] comment '联系电话',
StuMail varchar[50] comment '邮箱',
StuPost varchar[30] comment '邮编',
StuIdNumber varchar[50] comment '身份证号码',
StuEnterTime varchar[50] comment '入学时间',
StuEndTime varchar[50] comment '毕业时间',
StuEthnic varchar[30] comment '民族',
StuPolitic varchar(30) comment '政治面貌',
StuRegion varchar[30] comment '宗教信仰',
StuSchooling varchar[4] comment '学制',
primary key (StuId)
);
alter table T_stuinfo comment '学生信息表';
/*==============================================================*/
/* Table: T_user */
/*==============================================================*/
create table T_user
(
UId int not null auto_increment,
StuId int comment '当用户类型为学生时有效',
CompId int,
AccountId varchar[50] comment '账号',
Password varchar[50] comment '密码',
Type int comment '用户类型(1: 管理员 2:学生 3:企业)',
Created_Time datetime comment '创建时间',
primary key (UId)
);
alter table T_user comment '用户信息表';
alter table T_logininfo add constraint FK_Reference_2 foreign key (UId)
references T_user (UId) on delete restrict on update restrict;
alter table T_news add constraint FK_Reference_7 foreign key (UId)
references T_user (UId) on delete restrict on update restrict;
alter table T_recruitinfo add constraint FK_Reference_6 foreign key (CompId)
references T_companyinfo (CompId) on delete restrict on update restrict;
alter table T_resourceinfo add constraint FK_Reference_8 foreign key (NewsId)
references T_news (NewsId) on delete restrict on update restrict;
alter table T_selfintent add constraint FK_Reference_3 foreign key (IntentId)
references T_intentinfo (IntentId) on delete restrict on update restrict;
alter table T_selfintent add constraint FK_Reference_4 foreign key (StuId)
references T_stuinfo (StuId) on delete restrict on update restrict;
alter table T_user add constraint FK_Reference_1 foreign key (StuId)
references T_stuinfo (StuId) on delete restrict on update restrict;
alter table T_user add constraint FK_Reference_5 foreign key (CompId)
references T_companyinfo (CompId) on delete restrict on update restrict;
| true |
189b91b8b382b8f8e37ef824735a8594d3e30e5d | SQL | fairfield-university-is510-fall2017/movies-tonight-parts-1-4-Vincentrella | /MoviesTonightDDL.sql | UTF-8 | 1,488 | 4.15625 | 4 | [] | no_license | CREATE DATABASE MoviesTonight;
USE MoviesTonight;
#Creating Table "Theater"
CREATE TABLE THEATER (
TheaterID int(11) NOT NULL auto_increment,
TNAME varchar(50) default NULL,
Location varchar(50) default NULL,
Phone int(11) default NULL,
PRIMARY KEY (TheaterID)
);
#Creating Table "Show"
CREATE TABLE SHOWS (
ShowID int(11) NOT NULL auto_increment,
MovieID int(11) default NULL,
TheaterID int(11) default NULL,
Showtime time default NULL,
PRIMARY KEY (ShowID)
);
#Creating Table "Movie"
CREATE TABLE MOVIE (
MovieID int(11) NOT NULL auto_increment,
Title varchar(50) default NULL,
Rating varchar(11) default NULL,
PRIMARY KEY (MovieID)
);
#CREATING Table "Credit"
CREATE TABLE CREDIT (
CreditID int(11) NOT NULL auto_increment,
CCode int (11),
ArtistID int(11),
MovieID int(11),
PRIMARY KEY (CreditID)
);
#Creating table artist
CREATE TABLE ARTIST (
ArtistID int (11) NOT NULL auto_increment,
AName varchar(50) default NULL,
PRIMARY KEY (ArtistID)
);
#Creating foreign key for CREDIT
ALTER TABLE CREDIT
ADD FOREIGN KEY (ArtistID)
REFERENCES ARTIST (ArtistID);
#Creating foreign key for CREDIT
ALTER TABLE CREDIT
ADD FOREIGN KEY (MovieID)
REFERENCES Movie (MovieID);
##Creating foreign key for SHOWS
ALTER TABLE SHOWS
ADD FOREIGN KEY (TheaterID)
REFERENCES THEATER (TheaterID);
#Creating foreign key for SHOWS
ALTER TABLE SHOWS
ADD FOREIGN KEY (MovieID)
REFERENCES MOVIE (MovieID);
| true |
6ce27ed547396f6586eedf6a309fb5be885e357c | SQL | Gasbuddel/Zeiterfassungsprojekt | /Zeiterfassung/SQL Skripte/install+daten aktuell.sql | UTF-8 | 9,352 | 3.171875 | 3 | [] | no_license | -- DDL-Skript für das BONN-IT-Projekt <Zeiterfassung>
-- Datenbank erstellen
CREATE DATABASE /*!32312 IF NOT EXISTS*/ zeiterfassung /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci */;
USE zeiterfassung;
-- Vorhandene Datensätze löschen
DROP TABLE IF EXISTS TZeiterfassung;
DROP TABLE IF EXISTS TMita_Proj;
DROP TABLE IF EXISTS TProj_Taet;
DROP TABLE IF EXISTS TProjekt;
DROP TABLE IF EXISTS TMitarbeiter;
DROP TABLE IF EXISTS TKunde;
DROP TABLE IF EXISTS TTaetigkeitenvorlage;
DROP TABLE IF EXISTS TRolle;
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 28. Jun 2012 um 10:35
-- Server Version: 5.5.16
-- PHP-Version: 5.3.8
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 */;
--
-- Datenbank: `zeiterfassung`
--
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `tkunde`
--
CREATE TABLE IF NOT EXISTS `tkunde` (
`kuID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kuFirma` varchar(64) DEFAULT NULL,
`kuStrasse` varchar(64) NOT NULL,
`kuPLZ` varchar(5) NOT NULL,
`kuOrt` varchar(64) NOT NULL,
`kuTel` varchar(32) NOT NULL,
`kuFax` varchar(32) DEFAULT NULL,
`kuAnsprechpartner` varchar(64) NOT NULL,
`kuEMail` varchar(32) NOT NULL,
PRIMARY KEY (`kuID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
--
-- Daten für Tabelle `tkunde`
--
INSERT INTO `tkunde` (`kuID`, `kuFirma`, `kuStrasse`, `kuPLZ`, `kuOrt`, `kuTel`, `kuFax`, `kuAnsprechpartner`, `kuEMail`) VALUES
(1, 'Testfirma', 'Teststraße 23', '12312', 'Testhausen', '12312312', '1234234', 'Schorsch', 'sch@orsch.de'),
(2, 'MultiCom', 'Blumenstrasse 2', '45878', 'Aachen', '454-6874554', '454-68745545', 'Diddi Schubert', 'Diddi@hotmail.mobi.co.uk'),
(3, 'Blumen AG', 'Auf der Terrasse 17', '85878', 'Hamburg', '0221-6544554', '02221-68745548', 'Oskar Lafontaine', 'Oskar@web.de'),
(4, 'Telekom GmbH', 'Bonner Talweg 1-9999', '50545', 'Bonn', '0228-523447', '0228-524654', 'Pamela Schultze', 'Pamela@Schultzens.de'),
(5, 'ICEA GmbH & Co. KG', 'Auf den Wegen 1-3', '45874', 'Münster', '0229-5478756', '0229-5465466', 'Jürgen Schuster', 'Juergen.Schuster@office.de');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `tmitarbeiter`
--
CREATE TABLE IF NOT EXISTS `tmitarbeiter` (
`miID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`roID` int(10) unsigned NOT NULL,
`miName` varchar(32) NOT NULL,
`miVorname` varchar(32) DEFAULT NULL,
`miUsername` varchar(32) NOT NULL,
`miPasswort` varchar(32) NOT NULL,
`miEMail` varchar(32) DEFAULT NULL,
PRIMARY KEY (`miID`),
KEY `fk_miroID` (`roID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;
--
-- Daten für Tabelle `tmitarbeiter`
--
INSERT INTO `tmitarbeiter` (`miID`, `roID`, `miName`, `miVorname`, `miUsername`, `miPasswort`, `miEMail`) VALUES
(1, 1, 'Admin', 'NA', 'Admin', '0337a6e35928b71c3b86d63c8517acf4', 'NA'),
(2, 2, 'User', 'NA', 'User', '2a2422c9488f36cb76255c420cdc27d7', 'NA'),
(3, 2, 'Seipel', 'Günther', 'gseipel', '115be2d911d728bf216dae29e270f0e4', 'gunther@seipel.de'),
(8, 2, 'Vogt', 'Holger', 'H01gA', 'd9ac6d3777fc852dd8ac4ada300f4060', 'holger@office.de'),
(9, 2, 'Müller', 'Juppi', 'Jupp', '9a65fc07ae974db5e108dd16d6d91bbd', 'Juppinator@webmail.to'),
(10, 1, 'Frings', 'Thorsten', 'Toddy', '60a9395633f0816726967dee3db443d5', 'Toddy@webmail.to');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `tmita_proj`
--
CREATE TABLE IF NOT EXISTS `tmita_proj` (
`miID` int(10) unsigned NOT NULL,
`prID` int(10) unsigned NOT NULL,
`mpAktiv` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`miID`,`prID`),
KEY `fk_mpprID` (`prID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Daten für Tabelle `tmita_proj`
--
INSERT INTO `tmita_proj` (`miID`, `prID`, `mpAktiv`) VALUES
(1, 1, 1),
(1, 2, 1),
(1, 5, 1),
(1, 6, 1),
(2, 6, 1),
(3, 1, 1),
(3, 6, 1),
(8, 2, 1),
(8, 6, 1),
(9, 3, 0),
(10, 4, 1),
(10, 6, 1);
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `tprojekt`
--
CREATE TABLE IF NOT EXISTS `tprojekt` (
`prID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kuID` int(10) unsigned NOT NULL,
`prName` varchar(64) NOT NULL,
`prBeschreibung` varchar(128) DEFAULT NULL,
PRIMARY KEY (`prID`),
KEY `fk_prkuID` (`kuID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
--
-- Daten für Tabelle `tprojekt`
--
INSERT INTO `tprojekt` (`prID`, `kuID`, `prName`, `prBeschreibung`) VALUES
(1, 1, 'Essen gehen', 'Man isst ein Brötchen.'),
(2, 1, 'Operation Flashpoint', 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquy'),
(3, 2, 'Operation Walküre', 'Die Operation Walküre war ursprünglich ein Plan der deutschen Wehrmacht zur Unterdrückung eines möglichen Aufstandes während der'),
(4, 3, 'Project Zero', 'Project Zero, in den USA als Fatal Frame vertrieben, ist ein japanisches Survival-Horror-Adventure von Tecmo aus dem Jahr 2001, '),
(5, 4, 'Project X', 'Three seemingly anonymous high school seniors attempt to finally make a name for themselves. Their idea is innocent enough - let'),
(6, 1, 'Essen gehen', 'Man isst ein Brötchen.');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `tproj_taet`
--
CREATE TABLE IF NOT EXISTS `tproj_taet` (
`prID` int(10) unsigned NOT NULL,
`taID` int(10) unsigned NOT NULL,
PRIMARY KEY (`prID`,`taID`),
KEY `fk_pttaID` (`taID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Daten für Tabelle `tproj_taet`
--
INSERT INTO `tproj_taet` (`prID`, `taID`) VALUES
(1, 1),
(3, 1),
(5, 1),
(2, 2),
(3, 2),
(5, 2),
(1, 3),
(4, 3),
(1, 5),
(5, 5),
(4, 6),
(5, 6),
(2, 7),
(1, 9);
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `trolle`
--
CREATE TABLE IF NOT EXISTS `trolle` (
`roID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`roBezeichnung` varchar(32) NOT NULL,
PRIMARY KEY (`roID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Daten für Tabelle `trolle`
--
INSERT INTO `trolle` (`roID`, `roBezeichnung`) VALUES
(1, 'Geschaeftsleitung'),
(2, 'Mitarbeiter');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `ttaetigkeitenvorlage`
--
CREATE TABLE IF NOT EXISTS `ttaetigkeitenvorlage` (
`taID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`taBeschreibung` varchar(50) NOT NULL,
PRIMARY KEY (`taID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
--
-- Daten für Tabelle `ttaetigkeitenvorlage`
--
INSERT INTO `ttaetigkeitenvorlage` (`taID`, `taBeschreibung`) VALUES
(1, 'Essen'),
(2, 'feißig arbeiten'),
(3, 'Konzeptentwicklung'),
(4, 'Konzeptumsetzung'),
(5, 'Ideensammlung'),
(6, 'Brain Storming'),
(7, 'Meeting'),
(8, 'Dientreise'),
(9, 'test');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `tzeiterfassung`
--
CREATE TABLE IF NOT EXISTS `tzeiterfassung` (
`zeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`miID` int(10) unsigned NOT NULL,
`prID` int(10) unsigned NOT NULL,
`zeTag` date NOT NULL,
`zeTaetigkeit` varchar(50) NOT NULL,
`zeDauer` decimal(4,2) NOT NULL,
`zeReisekosten` decimal(6,2) DEFAULT '0.00',
PRIMARY KEY (`zeID`),
KEY `fk_zemiID` (`miID`),
KEY `fk_zeprID` (`prID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
--
-- Daten für Tabelle `tzeiterfassung`
--
INSERT INTO `tzeiterfassung` (`zeID`, `miID`, `prID`, `zeTag`, `zeTaetigkeit`, `zeDauer`, `zeReisekosten`) VALUES
(2, 8, 2, '2012-06-17', 'gearbeitet', 9.50, 3.00),
(3, 9, 3, '2011-05-17', 'gearbeitet', 4.50, 60.00),
(4, 10, 4, '2012-04-01', 'geschufftet', 12.15, 0.00),
(8, 1, 5, '2012-06-28', 'Enenemenemu', 3.00, 0.00),
(9, 1, 5, '2012-06-07', 'fdgsd', 1.25, 0.00),
(10, 1, 1, '2012-06-28', 'Essen', 0.50, 17.00);
--
-- Constraints der exportierten Tabellen
--
--
-- Constraints der Tabelle `tmitarbeiter`
--
ALTER TABLE `tmitarbeiter`
ADD CONSTRAINT `fk_miroID` FOREIGN KEY (`roID`) REFERENCES `trolle` (`roID`);
--
-- Constraints der Tabelle `tmita_proj`
--
ALTER TABLE `tmita_proj`
ADD CONSTRAINT `fk_mpmiID` FOREIGN KEY (`miID`) REFERENCES `tmitarbeiter` (`miID`),
ADD CONSTRAINT `fk_mpprID` FOREIGN KEY (`prID`) REFERENCES `tprojekt` (`prID`);
--
-- Constraints der Tabelle `tprojekt`
--
ALTER TABLE `tprojekt`
ADD CONSTRAINT `fk_prkuID` FOREIGN KEY (`kuID`) REFERENCES `tkunde` (`kuID`);
--
-- Constraints der Tabelle `tproj_taet`
--
ALTER TABLE `tproj_taet`
ADD CONSTRAINT `fk_ptprID` FOREIGN KEY (`prID`) REFERENCES `tprojekt` (`prID`),
ADD CONSTRAINT `fk_pttaID` FOREIGN KEY (`taID`) REFERENCES `ttaetigkeitenvorlage` (`taID`);
--
-- Constraints der Tabelle `tzeiterfassung`
--
ALTER TABLE `tzeiterfassung`
ADD CONSTRAINT `fk_zemiID` FOREIGN KEY (`miID`) REFERENCES `tmitarbeiter` (`miID`),
ADD CONSTRAINT `fk_zeprID` FOREIGN KEY (`prID`) REFERENCES `tprojekt` (`prID`);
/*!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 */;
| true |
5d207990df66bd131c597e73856a6a34fd96e0d8 | SQL | NikitaDeepaklal/people-management | /src/main/resources/__schema.sql | UTF-8 | 415 | 3.03125 | 3 | [] | no_license | DROP TABLE IF EXISTS PERSON;
CREATE TABLE "PERSON"(
"ID" INTEGER NOT NULL,
"FIRST_NAME" VARCHAR(255) NOT NULL,
"LAST_NAME" VARCHAR(255) NOT NULL,
"ADDRESS_ID" INTEGER DEFAULT NULL
);
DROP TABLE IF EXISTS ADDRESS;
CREATE TABLE "ADDRESS"(
"ID" INTEGER NOT NULL,
"CITY" VARCHAR(255),
"POSTAL_CODE" INTEGER NOT NULL,
"STATE" VARCHAR(255),
"STREET" VARCHAR(255)
); | true |
dadf24a9852df4e194c799b030979bfa965a0658 | SQL | luutruonghailan/hoc-lap-trinh-online-zendvn | /khoa-hoc-lap-trinh-php/ch07/sql/15-insert-update-delete.sql | UTF-8 | 585 | 3.234375 | 3 | [] | no_license | -- 01. INSERT
-- 01. 1 - Insert đầy đủ thông tin
INSERT INTO contractor VALUES ('7', 'Nguyen Van An', 123456, 'Sai Gon');
-- 01. 2 - Insert không đầy đủ thông tin
INSERT INTO contractor(name, address, phone) VALUES ('Nguyen Van An 2', 'Ho CHi MInh', 987654);
-- 01. 3 - Insert nhiều dòng
INSERT INTO contractor VALUES
(8, 'Nguyen Van B', 123456, 'Sai Gon'),
(9, 'Nguyen Van C', 123456, 'Sai Gon 2');
-- 02. UPDATE
UPDATE contractor
SET phone = 123456789
WHERE id = 8;
UPDATE contractor
SET phone = '987654321'
WHERE address = 'Sai Gon';
-- 03. DELETE
DELETE FROM contractor;
| true |
185c952d6063f65176944f826b8da786db9faf7c | SQL | kinwang6632/vb6 | /App/CSMIS/EMC-Nick/整合模組/Scripts/二階代碼/複製 -AddTable.sql | BIG5 | 1,213 | 3.09375 | 3 | [] | no_license | PROMPT *** CateCodeList1 NX ***
DROP TABLE CateCodeList1 CASCADE CONSTRAINT;
CREATE TABLE CateCodeList1 (
TableName VARCHAR2(30),
TableDescription Varchar2(50),
OPERATOR VARCHAR2(20),
UPDTIME VARCHAR2(20),
CONSTRAINT PK_CateCodeList1 PRIMARY KEY (TableName)
);
DROP INDEX I_CateCodeList1_1;
CREATE INDEX I_CateCodeList1_1 ON CateCodeList1 (TableName);
PROMPT *** CateCodeList2 O ***
DROP TABLE CateCodeList2 CASCADE CONSTRAINT;
CREATE TABLE CateCodeList2 (
CodeNo Number(3),
TableName VARCHAR2(30),
Description VARCHAR2(20),
RefNo Number(3),
ServiceType Char(1),
StopFlag Number(1),
OPERATOR VARCHAR2(20),
UPDTIME VARCHAR2(20)
);
DROP INDEX I_CateCodeList2_1;
CREATE INDEX I_CateCodeList2_1 ON CateCodeList2 (CodeNo);
PROMPT *** CateCodeList3 ӹ ***
DROP TABLE CateCodeList3 CASCADE CONSTRAINT;
CREATE TABLE CateCodeList3 (
CompCode Number(3),
TableName VARCHAR2(30),
MasterCodeNo Number(3),
DetailCodeNo Number(3),
StopFlag Number(1),
OPERATOR VARCHAR2(20),
UPDTIME VARCHAR2(20)
);
DROP INDEX I_CateCodeList3_1;
CREATE INDEX I_CateCodeList3_1 ON CateCodeList3 (CompCode,TableName) ;
| true |
ac862698af6328af879f857e71e5568620c6629a | SQL | Zxgg/svn-to-git | /source/dataserver/sql/0222/20210219增量.sql | UTF-8 | 8,007 | 2.9375 | 3 | [] | no_license | CREATE TABLE `base_data_request_notification` (
`id` varchar(38) COLLATE utf8mb4_bin NOT NULL COMMENT '唯一标识',
`create_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` varchar(1) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '删除标志(0代表存在 1代表删除)',
`remark` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注',
`community_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '社区id',
`community_child_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '小区id',
`person_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '领取人personID',
`material_type` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '领取材料类型(门禁卡、社保卡、居住证)',
`get_status` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '领取状态(待领取、已经领取、',
`get_time` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '领取时间点(比如每天的9点到18点,枚举)',
`get_location` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '领取地点',
`get_by_certificate` varchar(3072) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '领取时需要的携带的材料(比如本人身份证)',
`get_the` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '是否必须本人领取',
`get_replace_by_certificate` varchar(3072) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '带领人需要携带的证件(如果允许带领)',
`get_the_name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '领取人姓名',
`pics` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '照片列表(比如领取签字)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='资料领取通知表';
CREATE TABLE `base_certify_application_form` (
`id` varchar(38) COLLATE utf8mb4_bin NOT NULL COMMENT '唯一标识',
`create_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` varchar(1) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '删除标志(0代表存在 1代表删除)',
`remark` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注',
`community_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '社区id',
`community_child_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '小区id',
`person_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '申请人personID',
`certificate_type` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '申请办理的证件类型',
`required_material` varchar(3072) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '所需申请人提供的材料信息(由配置项中获取)',
`pics` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '申请人上传的图片列表',
`transaction_status` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '办理状态(已申请、审核通过、审核拒绝、待领取,已经领取)',
`apply_date` datetime DEFAULT NULL COMMENT '申请时间(创建时间)',
`receive_date` datetime DEFAULT NULL COMMENT '领取时间(状态改为已经领取的时间)',
`audit_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '审核人',
`audit_date` datetime DEFAULT NULL COMMENT '审核时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='证明办理申请单';
CREATE TABLE `base_entrance_guard_apply` (
`id` varchar(38) COLLATE utf8mb4_bin NOT NULL COMMENT '唯一标识',
`create_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` varchar(1) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '删除标志(0代表存在 1代表删除)',
`remark` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注',
`community_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '社区id',
`community_child_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '小区id',
`person_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '申请人personID',
`person_name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '申请人姓名',
`community_houses_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '申请人房屋ID(显示时抓换成具体地址)',
`stat` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '状态(待审核、审核通过、审核拒绝、待领取,已经领取)',
`reason` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '申请理由(新领门禁卡、补领门禁卡)',
`pics` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '照片列表(比如领取签字)',
`receive_time` datetime DEFAULT NULL COMMENT '领取时间(状态改为已经领取的时间)',
`checker_name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '审核人',
`check_time` datetime DEFAULT NULL COMMENT '审核时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT=' 门禁申请表';
CREATE TABLE `base_elevator_information` (
`id` varchar(38) COLLATE utf8mb4_bin NOT NULL COMMENT '唯一标识',
`create_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` varchar(1) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '删除标志(0代表存在 1代表删除)',
`remark` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注',
`community_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '社区id',
`community_child_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '小区id',
`community_building_id` varchar(38) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '楼栋id',
`unit` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '单元',
`elevator_number` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '电梯编号',
`elevator_model` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '电梯型号',
`elevator_install_date` datetime DEFAULT NULL COMMENT '电梯安装时间',
`check_record` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '年检记录json,年检人员,年检人员联系电话,年检人员编号,年检时间,年检结果',
`last_check_data` datetime DEFAULT NULL COMMENT '最后一次年检时间',
`last_check_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '最后一次年检人员',
`last_check_by_phone` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '最后一次年检人员联系电话',
`last_check_by_number` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '最后一次年检人员编号',
`last_check_result` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '最后一次年检结果',
`check_interval` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '年检间隔(多久检查一次,单位月)',
`elevator_factory_name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '电梯厂家名称',
`elevator_factory_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '电梯厂家联系人',
`elevator_factory_phone` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '电梯厂家联系电话',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='电梯信息表';
| true |
8955e73bfa6526b0c406df80ce4de2ac70b2e4f7 | SQL | PhilMurwin/SQLScripts | /DB_Lines_Of_Code.sql | UTF-8 | 1,626 | 4.625 | 5 | [] | no_license | -- Find the total number of lines of user written code in the database as a whole
select sum(t.lines_of_code) as lines_ofcode
from
(
select o.name as sp_name
,(len(c.text) - len(replace(c.text, char(10), ''))) as lines_of_code
,case when o.xtype = 'P' then 'Stored Procedure'
when o.xtype in ('FN', 'IF', 'TF') then 'Function'
end as type_desc
from sysobjects o
join syscomments c on c.id = o.id
where o.xtype in ('P', 'FN', 'IF', 'TF')
and o.category = 0
and o.name not in ('fn_diagramobjects', 'sp_alterdiagram', 'sp_creatediagram', 'sp_dropdiagram', 'sp_helpdiagramdefinition', 'sp_helpdiagrams', 'sp_renamediagram', 'sp_upgraddiagrams', 'sysdiagrams')
) t
-- List the number of lines of code for each user created object in the database
select t.sp_name as name, sum(t.lines_of_code) - 1 as lines_ofcode, t.type_desc as typedesc
from
(
select o.name as sp_name
,(len(c.text) - len(replace(c.text, char(10), ''))) as lines_of_code
,case when o.xtype = 'P' then 'Stored Procedure'
when o.xtype in ('FN', 'IF', 'TF') then 'Function'
end as type_desc
from sysobjects o
join syscomments c on c.id = o.id
where o.xtype in ('P', 'FN', 'IF', 'TF')
and o.category = 0
and o.name not in ('fn_diagramobjects', 'sp_alterdiagram', 'sp_creatediagram', 'sp_dropdiagram', 'sp_helpdiagramdefinition', 'sp_helpdiagrams', 'sp_renamediagram', 'sp_upgraddiagrams', 'sysdiagrams')
) t
group by t.sp_name, t.type_desc
--having sum(t.lines_of_code) - 1 > 500 --This line is useful to display only the items with more lines than specified
order by sum(t.lines_of_code) - 1 desc
| true |
23b3e88e05ed7e701b4b98a60c4d3b8d2b46bd83 | SQL | rhayeksads01/kampus-stmik-mj-bekasi | /semester-5-part-1/praktikum_5(php_mysql)-jum'at/uts/data_ekskul_per_tahun/import.sql | UTF-8 | 2,122 | 3.84375 | 4 | [] | no_license | create database data_ekskul_per_tahun;
use data_ekskul_per_tahun;
-- tables
create table ekskul(
id_ekskul int not null auto_increment,
tahun year not null,
nama_ekskul varchar(45) not null,
jumlah_peserta_ekskul int not null,
primary key (id_ekskul, nama_ekskul)
);
create table peserta_masuk(
id_peserta_masuk int not null auto_increment,
banyak_peserta_masuk int not null,
deskripsi varchar(255),
id_ekskul int not null,
primary key (id_peserta_masuk),
constraint fk_peserta_masuk_ekskul1 foreign key (id_ekskul) references ekskul (id_ekskul)
);
create table peserta_keluar(
id_peserta_keluar int not null auto_increment,
banyak_peserta_keluar int not null,
deskripsi varchar(255),
id_ekskul int not null,
primary key (id_peserta_keluar),
constraint fk_peserta_keluar_ekskul1 foreign key (id_ekskul) references ekskul (id_ekskul)
);
-- dummy data
insert into ekskul
values (1, 2015, 'Karate', 70),
(2, 2015, 'Sepak Bola', 60),
(3, 2015, 'Voli', 40);
insert into peserta_masuk
values (1, 70, '', 1),
(2, 60, '', 2),
(3, 40, '', 3);
insert into peserta_keluar
values (1, 0, '', 1),
(2, 0, '', 2),
(3, 0, '', 3);
-- triggers
delimiter //
create trigger after_peserta_masuk_insert
after insert
on peserta_masuk for each row
begin
update ekskul
set jumlah_peserta_ekskul = jumlah_peserta_ekskul + new.banyak_peserta_masuk
where id_ekskul = new.id_ekskul;
end //
delimiter //
create trigger after_peserta_keluar_insert
after insert
on peserta_keluar for each row
begin
update ekskul
set jumlah_peserta_ekskul = jumlah_peserta_ekskul - new.banyak_peserta_keluar
where id_ekskul = new.id_ekskul;
end //
delimiter //
create trigger after_peserta_masuk_delete
after delete
on peserta_masuk for each row
begin
update ekskul
set jumlah_peserta_ekskul = jumlah_peserta_ekskul - old.banyak_peserta_masuk
where id_ekskul = old.id_ekskul;
end //
delimiter //
create trigger after_peserta_keluar_delete
after delete
on peserta_keluar for each row
begin
update ekskul
set jumlah_peserta_ekskul = jumlah_peserta_ekskul + old.banyak_peserta_keluar
where id_ekskul = old.id_ekskul;
end // | true |
fcadf70a7c35a71cadc8108061416d938b698758 | SQL | rowindatas25/Project2--Quotation-Station | /db/seed.sql | UTF-8 | 422 | 3.1875 | 3 | [] | no_license | DROP DATABASE IF EXISTS quotes_db;
CREATE DATABASE quotes_db;
\c quotes_db
DROP TABLE IF EXISTS quotes;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR NOT NULL UNIQUE,
password_digest VARCHAR NOT NULL,
thread_id VARCHAR NOT NULL
);
CREATE TABLE quotes (
id SERIAL PRIMARY KEY,
quote VARCHAR,
author VARCHAR,
link VARCHAR,
user_id INTEGER REFERENCES users(id)
);
| true |
03dd01484301781d9535db6d85c84ffb0f2d3c77 | SQL | andresjjn/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/10-genre_id_by_show.sql | UTF-8 | 250 | 3.3125 | 3 | [] | no_license | -- Script that lists all shows contained in hbtn_0d_tvshows that have at least one genre linked.
SELECT title, genre_id FROM tv_shows, tv_show_genres
WHERE tv_shows.id=tv_show_genres.show_id
ORDER BY tv_shows.title ASC, tv_show_genres.genre_id ASC;
| true |
ff50c334d6df64fc8a5a04a5a4d2c953875c7fe4 | SQL | killbill/killbill | /beatrix/src/main/resources/org/killbill/billing/beatrix/ddl.sql | UTF-8 | 1,844 | 3.78125 | 4 | [
"Apache-2.0"
] | permissive | /*! SET default_storage_engine=INNODB */;
DROP TABLE IF EXISTS bus_ext_events;
CREATE TABLE bus_ext_events (
record_id serial unique,
class_name varchar(128) NOT NULL,
event_json text NOT NULL,
user_token varchar(36),
created_date datetime NOT NULL,
creating_owner varchar(50) NOT NULL,
processing_owner varchar(50) DEFAULT NULL,
processing_available_date datetime DEFAULT NULL,
processing_state varchar(14) DEFAULT 'AVAILABLE',
error_count int /*! unsigned */ DEFAULT 0,
/* Note: account_record_id can be NULL (e.g. TagDefinition events) */
search_key1 bigint /*! unsigned */ default null,
search_key2 bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX idx_bus_ext_where ON bus_ext_events (processing_state, processing_owner, processing_available_date);
CREATE INDEX bus_ext_events_tenant_account_record_id ON bus_ext_events(search_key2, search_key1);
DROP TABLE IF EXISTS bus_ext_events_history;
CREATE TABLE bus_ext_events_history (
record_id serial unique,
class_name varchar(128) NOT NULL,
event_json text NOT NULL,
user_token varchar(36),
created_date datetime NOT NULL,
creating_owner varchar(50) NOT NULL,
processing_owner varchar(50) DEFAULT NULL,
processing_available_date datetime DEFAULT NULL,
processing_state varchar(14) DEFAULT 'AVAILABLE',
error_count int /*! unsigned */ DEFAULT 0,
/* Note: account_record_id can be NULL (e.g. TagDefinition events) */
search_key1 bigint /*! unsigned */ default null,
search_key2 bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX bus_ext_events_history_tenant_account_record_id ON bus_ext_events_history(search_key2, search_key1);
| true |
b37d39c74620fbf201fb3a5e9630fba934388c1e | SQL | abcteams/abc_procurement | /procurement.sql | UTF-8 | 88,162 | 2.625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 04, 2018 at 06:26 AM
-- Server version: 5.7.20
-- PHP Version: 5.6.25
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: `procurement`
--
-- --------------------------------------------------------
--
-- Table structure for table `boq`
--
CREATE TABLE `boq` (
`id` int(10) UNSIGNED NOT NULL,
`work_zone_id` int(11) NOT NULL,
`sub_work_zone_id` int(11) NOT NULL,
`sub_gml_id` int(11) NOT NULL,
`status` int(11) NOT NULL,
`inquiry_is_created` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `boq`
--
INSERT INTO `boq` (`id`, `work_zone_id`, `sub_work_zone_id`, `sub_gml_id`, `status`, `inquiry_is_created`) VALUES
(4, 1, 0, 2, 3, 1),
(5, 2, 0, 4, 3, 1),
(6, 2, 0, 3, 3, 1),
(8, 2, 0, 4, 3, 0),
(9, 3, 0, 4, 3, 0),
(10, 4, 0, 4, 3, 1),
(11, 4, 0, 3, 3, 1),
(12, 4, 0, 7, 3, 0),
(13, 9, 0, 7, 3, 0),
(14, 8, 0, 9, 3, 1),
(15, 16, 0, 4, 3, 1),
(16, 20, 0, 7, 3, 1),
(17, 19, 0, 4, 3, 1),
(18, 6, 0, 4, 3, 1),
(19, 20, 0, 9, 3, 1),
(20, 20, 0, 4, 3, 1),
(21, 20, 0, 7, 3, 0),
(22, 21, 0, 10, 3, 1),
(23, 21, 0, 11, 3, 1),
(24, 21, 0, 10, 3, 1),
(25, 22, 0, 10, 3, 1),
(26, 23, 0, 10, 3, 1),
(27, 23, 0, 11, 3, 1),
(28, 24, 0, 11, 3, 1),
(29, 25, 0, 10, 3, 1),
(30, 25, 0, 10, 3, 1),
(31, 26, 0, 11, 3, 1),
(32, 26, 0, 1, 2, 1),
(33, 26, 0, 11, 3, 1),
(34, 26, 0, 10, 1, 0),
(35, 22, 0, 1, 2, 1),
(36, 26, 0, 12, 1, 0),
(37, 12, 0, 9, 3, 1),
(38, 5, 0, 10, 3, 1),
(39, 4, 0, 10, 1, 0),
(40, 5, 0, 10, 3, 1),
(41, 5, 0, 10, 3, 1),
(42, 5, 0, 12, 1, 0),
(43, 8, 62, 10, 1, 0),
(48, 9, 64, 10, 3, 1),
(47, 9, 63, 1, 2, 0),
(46, 9, 63, 10, 3, 1),
(49, 9, 64, 9, 4, 1),
(50, 9, 65, 10, 3, 1),
(51, 5, 23, 10, 3, 1),
(52, 5, 66, 10, 3, 1),
(53, 3, 22, 10, 2, 0),
(54, 3, 21, 10, 2, 0),
(55, 3, 20, 10, 2, 0),
(56, 2, 8, 10, 3, 1),
(57, 2, 2, 10, 3, 1),
(58, 9, 65, 4, 4, 1);
-- --------------------------------------------------------
--
-- Table structure for table `boq_accessories`
--
CREATE TABLE `boq_accessories` (
`id` int(11) NOT NULL,
`sub_boq_id` int(11) NOT NULL,
`description` mediumtext NOT NULL,
`quantity` int(11) NOT NULL DEFAULT '1',
`model` varchar(150) DEFAULT NULL,
`rest_quantity` int(11) NOT NULL DEFAULT '0',
`rate` double NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `boq_accessories`
--
INSERT INTO `boq_accessories` (`id`, `sub_boq_id`, `description`, `quantity`, `model`, `rest_quantity`, `rate`) VALUES
(2, 33, 'fsf', 4, 'vfdsdg', 0, 0),
(3, 33, 'new accessory', 4, 'fre32', 0, 0),
(4, 36, 'cameras', 23, 'canon', 12, 300),
(5, 36, 'ilpo', 32, 'ewq', 12, 100),
(6, 39, 'cameras', 40, 'canon', 30, 100),
(7, 39, 'mrabet', 100, 'sonic', 90, 30),
(8, 37, 'anything', 20, 'fasdfa', 10, 3.5),
(9, 40, 'tr', 4, NULL, 0, 0),
(10, 43, '7', 7, NULL, 0, 0),
(11, 43, '8', 8, NULL, 0, 0),
(12, 70, 'cameras', 50, NULL, 0, 0),
(13, 70, 'anything', 50, NULL, 0, 0),
(14, 69, 'lamps', 20, NULL, 0, 0),
(15, 66, 'fsda', 10, NULL, 0, 0),
(16, 71, 'cameras', 12, NULL, 0, 0),
(17, 71, 'anything', 4, NULL, 0, 0),
(18, 72, 'lamp', 10, NULL, 0, 0),
(19, 73, 'lamps', 100, NULL, 0, 0),
(20, 75, 'cameras', 10, NULL, 0, 0),
(21, 75, 'lamps', 10, NULL, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `boq_status`
--
CREATE TABLE `boq_status` (
`id` int(11) NOT NULL,
`status` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `boq_status`
--
INSERT INTO `boq_status` (`id`, `status`) VALUES
(1, 'Add Materials & Quantity'),
(2, 'Ready to be procured'),
(3, 'Currently under procurement'),
(4, 'Ready to order');
-- --------------------------------------------------------
--
-- Table structure for table `boq_sub_materials`
--
CREATE TABLE `boq_sub_materials` (
`id` int(10) UNSIGNED NOT NULL,
`boq_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`quantity_unit` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`budgetory_price` double(8,2) NOT NULL,
`size` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`size_unit` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci,
`rest_quantity` int(11) NOT NULL DEFAULT '0',
`model` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`rate` double NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `boq_sub_materials`
--
INSERT INTO `boq_sub_materials` (`id`, `boq_id`, `quantity`, `quantity_unit`, `budgetory_price`, `size`, `size_unit`, `description`, `rest_quantity`, `model`, `rate`) VALUES
(2, 4, 24, 'Piece', 423.00, '213', 'cm', 'fsd', 0, NULL, 0),
(3, 6, 20, 'Piece', 45.00, '56', 'cm', 'derf', 0, NULL, 0),
(4, 6, 23, 'Piece', 23423.00, '67', 'cm', 'ettr5e', 0, 'canon', 0),
(5, 5, 20, 'Piece', 20.00, '20', 'cm', 'fasdf', 0, 'ewq', 0),
(7, 8, 20, 'Piece', 200.00, '50', 'cm', 'fads', 0, NULL, 0),
(8, 9, 21, 'Piece', 32.00, 'er', 'cm', '3', 0, NULL, 0),
(9, 10, 5, 'Piece', 5.00, '5', 'cm', '5', 0, NULL, 0),
(10, 10, 21, 'Piece', 321.00, '23 d', 'cm', 'fasdfas', 0, NULL, 0),
(11, 9, 23, 'Piece', 213.00, 'das', 'cm', 'eqw', 0, NULL, 0),
(12, 9, 23, 'Piece', 123.00, '321', 'cm', '312', 0, NULL, 0),
(13, 9, 12, 'PiecePiece', 21.00, '21', 'cm', '12', 0, NULL, 0),
(14, 11, 20, 'Piece', 10.00, '10', 'cm', '10', 0, NULL, 0),
(15, 11, 100, 'peice', 5000.00, '20', 'cm', 'fdsafads', 0, NULL, 0),
(16, 13, 34, 'piece', 34.00, '4', 'inch', '4sadf', 0, NULL, 0),
(17, 13, 23, 'meter', 23.00, '32', 'inch', '123', 0, NULL, 0),
(18, 14, 20, 'piece', 15000.00, '15', 'inch', 'adsfasd', 0, NULL, 0),
(19, 14, 25, 'piece', 4000.00, '30', 'inch', 'rffra', 0, NULL, 0),
(20, 15, 12, 'piece', 500.00, '50', 'inch', 'anything', 0, NULL, 0),
(21, 16, 500, 'piece', 15000.00, '23', 'inch', 'fasf', 0, NULL, 0),
(22, 16, 1500, 'piece', 5432.00, '20', 'inch', 'fasd', 0, NULL, 0),
(23, 16, 4577, 'meter', 4235.00, '4523', 'inch', 'sgfdgs', 0, NULL, 0),
(24, 16, 12434, 'piece', 3123.00, '312', 'inch', 'fsdfa', 0, NULL, 0),
(25, 17, 2, 'piece', 123.00, '2', 'mm', 'fasdffasd', 0, NULL, 0),
(26, 18, 100, 'piece', 500.00, '20', 'mm', 'anythinh', 0, NULL, 0),
(27, 18, 21, 'meter', 144.00, '14', 'set', 'this is the final price', 0, NULL, 0),
(28, 19, 1500, 'piece', 1450.00, '20', 'inch', 'fa', 0, NULL, 0),
(29, 20, 34, 'piece', 456.00, '23', 'mm', 'ghggg', 0, NULL, 0),
(30, 21, 50, 'meter', 235.00, '20', 'set', 'qrwerqw', 0, NULL, 0),
(31, 23, 100, 'piece', 1000.00, '23', 'inch', NULL, 0, NULL, 0),
(32, 23, 50, 'piece', 200.00, '40', 'inch', 'an', 0, NULL, 0),
(33, 24, 34, 'piece', 400.00, '54', 'inch', 'fdghgfh', 0, NULL, 0),
(34, 24, 20, 'metersquare', 654.00, '15', 'ls', 'hgjh', 0, NULL, 0),
(35, 25, 20, 'meter', 2000.00, '12', 'inch', 'fsd', 12, 'gfd5', 1500),
(36, 25, 32, 'piece', 1000.00, '13', 'mm', 'fds', 12, 'ed23', 7000),
(37, 26, 30, 'piece', 500.00, '12', 'mm', 'fas', 30, 'gfd5', 3.7),
(38, 26, 500, 'meter', 500.00, '40', 'metersquare', 'fdsa', 300, 'rwe', 1.5),
(39, 26, 50, 'piece', 500.00, '2', 'inch', 'gsdfg', 50, 'eqwe', 0.5),
(40, 27, 100, 'piece', 4000.00, '12', 'inch', 'rreewr rew', 0, NULL, 0),
(41, 28, 3, 'piece', 3.00, '3', 'mm', '3', 0, NULL, 0),
(42, 22, 12, 'piece', 500.00, '10', 'mm', 'fasdfasdf asdf asd', 0, NULL, 0),
(43, 29, 7, 'piece', 7.00, '7', 'mm', '7', 0, NULL, 0),
(44, 29, 6, 'piece', 6.00, '6', 'inch', '6', 0, NULL, 0),
(45, 30, 65, 'piece', 100.00, '12', 'inch', 'hgjgjh', 0, 'anything', 1),
(46, 30, 12, 'piece', 100.00, '54', 'inch', 'fasdfa', 0, NULL, 0),
(47, 31, 12, 'piece', 4000.00, '100', 'set', 'dasfsd', 1, NULL, 0),
(48, 32, 14, 'piece', 44.00, '14', 'mm', 'fads', 0, NULL, 0),
(49, 33, 67, 'piece', 54.00, '15', 'inch', 'gfs', 3, 'gfd5', 12),
(50, 34, 2, 'meter', 2.00, '20', 'set', '2', 0, NULL, 0),
(51, 35, 21, 'No\'s', 21.00, '21', 'mm', 'asdfa', 0, NULL, 0),
(52, 37, 3, NULL, 3.00, '3', NULL, '3', 0, NULL, 0),
(53, 36, 3, 'Meter', 4.00, '3', 'Ls', '4AFSD', 0, NULL, 0),
(54, 38, 12, NULL, 50.00, '12', NULL, 'fsdfaf', 0, NULL, 0),
(55, 40, 2, 'Meter', 26.00, '12', 'Inch', 'sdasfd', 0, NULL, 0),
(56, 41, 2, NULL, 800.00, '12', NULL, 'fsadf', 0, NULL, 0),
(57, 41, 3, NULL, 15.00, '12', NULL, 'asdf', 0, NULL, 0),
(58, 46, 2, 'Meter', 10.00, '5', 'mm', 'first item', 0, NULL, 0),
(59, 46, 6, 'Meter', 192.00, '12', 'mm', 'fasdfasd asdf', 0, NULL, 0),
(60, 48, 65, 'Ls', 2795.00, '54', 'mm', 'gsfddg sdfg sdf g', 0, NULL, 0),
(61, 47, 5, 'Ls', 50.00, '12', 'mm', 'asdf', 0, NULL, 0),
(62, 49, 15, NULL, 750.00, '12', NULL, 'jhjkh', 0, NULL, 0),
(63, 50, 20, 'Meter', 2000.00, '5', 'mm', 'bvbnv vbnb', 0, NULL, 0),
(64, 50, 55, 'Ls', 11000.00, '54', 'mm', 'kkkkk', 0, NULL, 0),
(65, 51, 12, 'Meter', 120.00, '12', 'mm', 'dfasfa', 0, NULL, 0),
(66, 51, 12, 'Meter', 960.00, '30', 'mm', 'sdfa fdsaf asd', 0, NULL, 0),
(67, 51, 90, 'Meter', 3600.00, '50', 'Set', 'fdadsfads safdda', 0, NULL, 0),
(68, 52, 60, 'Meter', 2400.00, '50', 'mm', 'daf asdfas', 0, NULL, 0),
(69, 52, 50, 'Meter', 1150.00, '12', 'mm', 'erqw rwer', 0, NULL, 0),
(70, 52, 45, 'Meter', 3915.00, '30', 'mm', 'jdg hdfh dfhdf', 0, NULL, 0),
(71, 53, 50, 'Meter', 5000.00, '12', 'mm', 'dasdf asdf fsda', 0, NULL, 0),
(72, 53, 67, 'No\'s', 804.00, '30', 'Inch', 'asdf asdf asd', 0, NULL, 0),
(73, 54, 6, 'No\'s', 300.00, '30', 'Inch', 'dsaf asdfa', 0, NULL, 0),
(74, 55, 5, 'No\'s', 50.00, '30', 'Inch', 'fdsaf asdf asd', 0, NULL, 0),
(75, 56, 2, 'No\'s', 40.00, '2', 'Inch', 'tttttttt', 0, NULL, 0),
(76, 57, 2, 'No\'s', 200.00, '2', 'Inch', 'fasdfa sf', 0, NULL, 0),
(77, 58, 2, 'No\'s', 4.00, '23', 'Set', '2', 0, NULL, 0);
-- --------------------------------------------------------
--
-- Table structure for table `carts`
--
CREATE TABLE `carts` (
`id` int(11) NOT NULL,
`boq_id` int(11) NOT NULL,
`delivery_date` datetime NOT NULL,
`order_date` datetime NOT NULL,
`user_id` int(11) NOT NULL,
`manger_approved` int(11) NOT NULL,
`warehouse_approved` int(11) NOT NULL,
`status` int(11) NOT NULL COMMENT '1- ready 2-manger approve 3-warehouse approve 4- tecnical approve 5- procurement approve 6-commercial approve 7-supplier approve',
`type` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `cart_items`
--
CREATE TABLE `cart_items` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`item_type` int(11) NOT NULL COMMENT 'type 1 material , type 2 accessory'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `cart_items`
--
INSERT INTO `cart_items` (`id`, `user_id`, `item_id`, `item_type`) VALUES
(1, 2, 42, 1),
(2, 2, 42, 1),
(3, 2, 42, 1),
(4, 2, 42, 1),
(5, 2, 42, 1),
(6, 2, 35, 1),
(7, 2, 36, 1),
(8, 2, 4, 2),
(9, 2, 5, 2),
(10, 2, 35, 1),
(11, 2, 36, 1),
(12, 2, 35, 1),
(13, 2, 35, 1),
(14, 2, 35, 1),
(15, 2, 35, 1),
(16, 2, 36, 1),
(17, 2, 4, 2),
(18, 2, 35, 1),
(19, 2, 36, 1),
(20, 2, 4, 2),
(21, 2, 35, 1),
(22, 2, 36, 1),
(23, 2, 4, 2);
-- --------------------------------------------------------
--
-- Table structure for table `cc_emails`
--
CREATE TABLE `cc_emails` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`email` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `cc_emails`
--
INSERT INTO `cc_emails` (`id`, `user_id`, `email`) VALUES
(10, 10, 'samerx@abc-gcc.com'),
(11, 10, 'ffff@fdsdf.com'),
(12, 0, 'miqdad.mohammad@abc-gcc.com'),
(14, 13, 'miqdad.mohammad@abc-gcc.com'),
(15, 13, 'ahmadqw@gmail.com'),
(16, 15, 'abuabdallah@gmail.com');
-- --------------------------------------------------------
--
-- Table structure for table `country`
--
CREATE TABLE `country` (
`id` int(11) NOT NULL,
`nicename` varchar(80) NOT NULL,
`phonecode` int(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `country`
--
INSERT INTO `country` (`id`, `nicename`, `phonecode`) VALUES
(1, 'Afghanistan', 93),
(2, 'Albania', 355),
(3, 'Algeria', 213),
(4, 'American Samoa', 1684),
(5, 'Andorra', 376),
(6, 'Angola', 244),
(7, 'Anguilla', 1264),
(8, 'Antarctica', 0),
(9, 'Antigua and Barbuda', 1268),
(10, 'Argentina', 54),
(11, 'Armenia', 374),
(12, 'Aruba', 297),
(13, 'Australia', 61),
(14, 'Austria', 43),
(15, 'Azerbaijan', 994),
(16, 'Bahamas', 1242),
(17, 'Bahrain', 973),
(18, 'Bangladesh', 880),
(19, 'Barbados', 1246),
(20, 'Belarus', 375),
(21, 'Belgium', 32),
(22, 'Belize', 501),
(23, 'Benin', 229),
(24, 'Bermuda', 1441),
(25, 'Bhutan', 975),
(26, 'Bolivia', 591),
(27, 'Bosnia and Herzegovina', 387),
(28, 'Botswana', 267),
(29, 'Bouvet Island', 0),
(30, 'Brazil', 55),
(31, 'British Indian Ocean Territory', 246),
(32, 'Brunei Darussalam', 673),
(33, 'Bulgaria', 359),
(34, 'Burkina Faso', 226),
(35, 'Burundi', 257),
(36, 'Cambodia', 855),
(37, 'Cameroon', 237),
(38, 'Canada', 1),
(39, 'Cape Verde', 238),
(40, 'Cayman Islands', 1345),
(41, 'Central African Republic', 236),
(42, 'Chad', 235),
(43, 'Chile', 56),
(44, 'China', 86),
(45, 'Christmas Island', 61),
(46, 'Cocos (Keeling) Islands', 672),
(47, 'Colombia', 57),
(48, 'Comoros', 269),
(49, 'Congo', 242),
(50, 'Congo, the Democratic Republic of the', 242),
(51, 'Cook Islands', 682),
(52, 'Costa Rica', 506),
(53, 'Cote D\'Ivoire', 225),
(54, 'Croatia', 385),
(55, 'Cuba', 53),
(56, 'Cyprus', 357),
(57, 'Czech Republic', 420),
(58, 'Denmark', 45),
(59, 'Djibouti', 253),
(60, 'Dominica', 1767),
(61, 'Dominican Republic', 1809),
(62, 'Ecuador', 593),
(63, 'Egypt', 20),
(64, 'El Salvador', 503),
(65, 'Equatorial Guinea', 240),
(66, 'Eritrea', 291),
(67, 'Estonia', 372),
(68, 'Ethiopia', 251),
(69, 'Falkland Islands (Malvinas)', 500),
(70, 'Faroe Islands', 298),
(71, 'Fiji', 679),
(72, 'Finland', 358),
(73, 'France', 33),
(74, 'French Guiana', 594),
(75, 'French Polynesia', 689),
(76, 'French Southern Territories', 0),
(77, 'Gabon', 241),
(78, 'Gambia', 220),
(79, 'Georgia', 995),
(80, 'Germany', 49),
(81, 'Ghana', 233),
(82, 'Gibraltar', 350),
(83, 'Greece', 30),
(84, 'Greenland', 299),
(85, 'Grenada', 1473),
(86, 'Guadeloupe', 590),
(87, 'Guam', 1671),
(88, 'Guatemala', 502),
(89, 'Guinea', 224),
(90, 'Guinea-Bissau', 245),
(91, 'Guyana', 592),
(92, 'Haiti', 509),
(93, 'Heard Island and Mcdonald Islands', 0),
(94, 'Holy See (Vatican City State)', 39),
(95, 'Honduras', 504),
(96, 'Hong Kong', 852),
(97, 'Hungary', 36),
(98, 'Iceland', 354),
(99, 'India', 91),
(100, 'Indonesia', 62),
(101, 'Iran, Islamic Republic of', 98),
(102, 'Iraq', 964),
(103, 'Ireland', 353),
(104, 'Israel', 972),
(105, 'Italy', 39),
(106, 'Jamaica', 1876),
(107, 'Japan', 81),
(108, 'Jordan', 962),
(109, 'Kazakhstan', 7),
(110, 'Kenya', 254),
(111, 'Kiribati', 686),
(112, 'Korea, Democratic People\'s Republic of', 850),
(113, 'Korea, Republic of', 82),
(114, 'Kuwait', 965),
(115, 'Kyrgyzstan', 996),
(116, 'Lao People\'s Democratic Republic', 856),
(117, 'Latvia', 371),
(118, 'Lebanon', 961),
(119, 'Lesotho', 266),
(120, 'Liberia', 231),
(121, 'Libyan Arab Jamahiriya', 218),
(122, 'Liechtenstein', 423),
(123, 'Lithuania', 370),
(124, 'Luxembourg', 352),
(125, 'Macao', 853),
(126, 'Macedonia, the Former Yugoslav Republic of', 389),
(127, 'Madagascar', 261),
(128, 'Malawi', 265),
(129, 'Malaysia', 60),
(130, 'Maldives', 960),
(131, 'Mali', 223),
(132, 'Malta', 356),
(133, 'Marshall Islands', 692),
(134, 'Martinique', 596),
(135, 'Mauritania', 222),
(136, 'Mauritius', 230),
(137, 'Mayotte', 269),
(138, 'Mexico', 52),
(139, 'Micronesia, Federated States of', 691),
(140, 'Moldova, Republic of', 373),
(141, 'Monaco', 377),
(142, 'Mongolia', 976),
(143, 'Montserrat', 1664),
(144, 'Morocco', 212),
(145, 'Mozambique', 258),
(146, 'Myanmar', 95),
(147, 'Namibia', 264),
(148, 'Nauru', 674),
(149, 'Nepal', 977),
(150, 'Netherlands', 31),
(151, 'Netherlands Antilles', 599),
(152, 'New Caledonia', 687),
(153, 'New Zealand', 64),
(154, 'Nicaragua', 505),
(155, 'Niger', 227),
(156, 'Nigeria', 234),
(157, 'Niue', 683),
(158, 'Norfolk Island', 672),
(159, 'Northern Mariana Islands', 1670),
(160, 'Norway', 47),
(161, 'Oman', 968),
(162, 'Pakistan', 92),
(163, 'Palau', 680),
(164, 'Palestinian Territory, Occupied', 970),
(165, 'Panama', 507),
(166, 'Papua New Guinea', 675),
(167, 'Paraguay', 595),
(168, 'Peru', 51),
(169, 'Philippines', 63),
(170, 'Pitcairn', 0),
(171, 'Poland', 48),
(172, 'Portugal', 351),
(173, 'Puerto Rico', 1787),
(174, 'Qatar', 974),
(175, 'Reunion', 262),
(176, 'Romania', 40),
(177, 'Russian Federation', 70),
(178, 'Rwanda', 250),
(179, 'Saint Helena', 290),
(180, 'Saint Kitts and Nevis', 1869),
(181, 'Saint Lucia', 1758),
(182, 'Saint Pierre and Miquelon', 508),
(183, 'Saint Vincent and the Grenadines', 1784),
(184, 'Samoa', 684),
(185, 'San Marino', 378),
(186, 'Sao Tome and Principe', 239),
(187, 'Saudi Arabia', 966),
(188, 'Senegal', 221),
(189, 'Serbia and Montenegro', 381),
(190, 'Seychelles', 248),
(191, 'Sierra Leone', 232),
(192, 'Singapore', 65),
(193, 'Slovakia', 421),
(194, 'Slovenia', 386),
(195, 'Solomon Islands', 677),
(196, 'Somalia', 252),
(197, 'South Africa', 27),
(198, 'South Georgia and the South Sandwich Islands', 0),
(199, 'Spain', 34),
(200, 'Sri Lanka', 94),
(201, 'Sudan', 249),
(202, 'Suriname', 597),
(203, 'Svalbard and Jan Mayen', 47),
(204, 'Swaziland', 268),
(205, 'Sweden', 46),
(206, 'Switzerland', 41),
(207, 'Syrian Arab Republic', 963),
(208, 'Taiwan, Province of China', 886),
(209, 'Tajikistan', 992),
(210, 'Tanzania, United Republic of', 255),
(211, 'Thailand', 66),
(212, 'Timor-Leste', 670),
(213, 'Togo', 228),
(214, 'Tokelau', 690),
(215, 'Tonga', 676),
(216, 'Trinidad and Tobago', 1868),
(217, 'Tunisia', 216),
(218, 'Turkey', 90),
(219, 'Turkmenistan', 7370),
(220, 'Turks and Caicos Islands', 1649),
(221, 'Tuvalu', 688),
(222, 'Uganda', 256),
(223, 'Ukraine', 380),
(224, 'United Arab Emirates', 971),
(225, 'United Kingdom', 44),
(226, 'United States', 1),
(227, 'United States Minor Outlying Islands', 1),
(228, 'Uruguay', 598),
(229, 'Uzbekistan', 998),
(230, 'Vanuatu', 678),
(231, 'Venezuela', 58),
(232, 'Viet Nam', 84),
(233, 'Virgin Islands, British', 1284),
(234, 'Virgin Islands, U.s.', 1340),
(235, 'Wallis and Futuna', 681),
(236, 'Western Sahara', 212),
(237, 'Yemen', 967),
(238, 'Zambia', 260),
(239, 'Zimbabwe', 263);
-- --------------------------------------------------------
--
-- Table structure for table `decline_replay`
--
CREATE TABLE `decline_replay` (
`id` int(11) NOT NULL,
`decline_id` int(11) NOT NULL,
`subject` varchar(255) NOT NULL,
`body` mediumtext NOT NULL,
`date` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `decline_replay`
--
INSERT INTO `decline_replay` (`id`, `decline_id`, `subject`, `body`, `date`) VALUES
(1, 2, 'test', 'fsadf', NULL),
(2, 2, 'replay x', 'xxxxxxxxxxxx', NULL),
(3, 2, 'replay x', 'xxxxxxxxxxxx', NULL),
(4, 3, 'fsd', 'afsdfsadf', '2018-10-08 06:31:13'),
(5, 4, 'test', 'dasf asdf as', '2018-11-03 03:06:19');
-- --------------------------------------------------------
--
-- Table structure for table `gml`
--
CREATE TABLE `gml` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_approved` int(11) NOT NULL DEFAULT '1',
`is_approved2` int(11) NOT NULL DEFAULT '1',
`is_approved3` int(11) NOT NULL DEFAULT '1',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `gml`
--
INSERT INTO `gml` (`id`, `title`, `description`, `remember_token`, `is_approved`, `is_approved2`, `is_approved3`, `created_at`) VALUES
(1, 'meqdad', NULL, NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(2, 'Pipes', 'this material for pips', NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(3, 'afsdf', 'asdf', NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(4, 'hussein', 'ff', NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(5, 'HVAC', 'i dont know whats mean', NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(6, 'General Items', NULL, NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(7, 'test', 'rdsfa', NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(8, 'wq', 'asdf dsf a', NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(9, 'al horya school', 'test', NULL, 1, 1, 1, '2018-10-30 10:38:39'),
(10, 'test school', 'sssss', NULL, 1, 1, 1, '2018-10-30 10:50:11'),
(11, 'test', 'sdafasdf', NULL, 1, 1, 1, '2018-10-30 10:50:07'),
(12, 'test school', 'xxxxxx', NULL, 1, 1, 1, '2018-10-30 10:50:05'),
(13, 'new school', 'dddd', NULL, 1, 1, 1, '2018-10-30 12:15:56');
-- --------------------------------------------------------
--
-- Table structure for table `inquiry_extend`
--
CREATE TABLE `inquiry_extend` (
`id` int(11) NOT NULL,
`inq_id` int(11) NOT NULL,
`days` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `material_inquiry`
--
CREATE TABLE `material_inquiry` (
`id` int(10) UNSIGNED NOT NULL,
`work_zone_id` int(11) NOT NULL,
`sub_gml_id` int(11) NOT NULL,
`date` date NOT NULL,
`close_date` date NOT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`is_approved` int(11) NOT NULL DEFAULT '0',
`is_closed` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `material_inquiry`
--
INSERT INTO `material_inquiry` (`id`, `work_zone_id`, `sub_gml_id`, `date`, `close_date`, `description`, `is_approved`, `is_closed`) VALUES
(1, 4, 0, '2018-02-10', '2018-03-03', 'fsdfadsf adsf a', 1, 1),
(2, 6, 0, '2018-01-18', '2018-02-08', 'this is the pips inquiry', 1, 1),
(3, 5, 0, '2018-01-10', '2018-01-16', 'fasdfsad', 1, 1),
(4, 10, 0, '2018-01-31', '2018-02-10', 'dfa asdf asdf', 1, 1),
(5, 11, 0, '2018-01-31', '2018-02-09', 'anything', 1, 1),
(6, 14, 0, '2018-03-01', '2018-03-10', 'ereee', 1, 1),
(7, 15, 0, '2018-03-08', '2018-03-10', 'fasdf asdf asdf', 1, 1),
(8, 16, 0, '2018-03-08', '2018-03-10', 'fasdfasd', 1, 1),
(9, 17, 0, '2018-03-14', '2018-03-30', 'fasdf asdf asd', 1, 1),
(10, 18, 0, '2018-03-28', '2018-03-31', 'fdsa fasdf', 1, 1),
(11, 20, 0, '2018-04-01', '2018-04-07', 'hhhhhhhhhh', 1, 1),
(26, 26, 0, '2018-04-26', '2018-05-01', '', 1, 1),
(25, 26, 0, '2018-04-26', '2018-05-01', '', 1, 1),
(24, 25, 0, '2018-05-04', '2018-05-25', 'rewrwe', 1, 1),
(23, 24, 0, '2018-04-25', '2018-05-25', 'yte bf bbf', 1, 1),
(22, 23, 0, '2018-04-05', '2018-04-07', 'anything', 1, 1),
(21, 19, 0, '2018-03-06', '2018-03-28', '', 0, 1),
(27, 27, 0, '2018-04-26', '2018-04-27', '', 1, 1),
(28, 28, 0, '2018-04-10', '2018-04-24', '', 1, 1),
(29, 28, 0, '2018-04-10', '2018-04-24', '', 1, 1),
(30, 22, 0, '2018-05-01', '2018-05-23', '', 1, 1),
(31, 29, 0, '2018-05-01', '2018-05-06', '', 1, 1),
(32, 30, 0, '2018-05-08', '2018-05-16', '', 1, 1),
(33, 31, 0, '2018-05-31', '2018-06-07', '', 1, 1),
(34, 32, 0, '2018-06-07', '2018-06-09', 'fasdf asdf asdf', 0, 1),
(35, 33, 0, '2018-05-23', '2018-06-09', 'gsfdgsdf sdfg', 1, 1),
(36, 35, 0, '2018-06-27', '2018-07-05', 'afsdf adsf sd', 1, 1),
(37, 37, 0, '2017-11-12', '2018-04-30', '', 1, 1),
(38, 38, 0, '2018-10-26', '2018-10-27', 'test', 1, 1),
(39, 40, 0, '2018-10-16', '2018-11-09', 'adsfasdf f a', 0, 1),
(40, 40, 0, '2018-10-16', '2018-11-09', 'adsfasdf f a', 0, 1),
(41, 41, 0, '2018-10-16', '2018-10-26', 'dAD asd DD', 0, 1),
(42, 9, 10, '2018-10-27', '2018-11-10', 'first test x', 1, 1),
(44, 5, 10, '2018-10-30', '2018-11-10', 'yyyyyyy', 1, 1),
(45, 9, 9, '2018-10-30', '2018-11-10', 'sddfasdf asdf a', 1, 1),
(46, 2, 10, '2018-11-01', '2018-12-08', 'xxxxxxxxxxx', 1, 1),
(47, 9, 4, '2018-11-03', '2018-12-08', 'fasdf asd fas', 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `material_inquiry_materials`
--
CREATE TABLE `material_inquiry_materials` (
`id` int(11) NOT NULL,
`work_zone_id` int(11) NOT NULL,
`sub_gml_id` int(11) NOT NULL,
`description` mediumtext NOT NULL,
`quantity` int(11) NOT NULL,
`quantity_unit` varchar(255) DEFAULT NULL,
`size` int(11) NOT NULL,
`size_unit` varchar(255) DEFAULT NULL,
`budgetory_price` int(11) NOT NULL,
`status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `material_inquiry_materials`
--
INSERT INTO `material_inquiry_materials` (`id`, `work_zone_id`, `sub_gml_id`, `description`, `quantity`, `quantity_unit`, `size`, `size_unit`, `budgetory_price`, `status`) VALUES
(76, 9, 10, 'fasdfasd asdf', 6, 'Meter', 12, 'mm', 192, 3),
(80, 9, 10, 'first item', 22, 'Meter', 5, 'mm', 2010, 3),
(81, 9, 10, 'gsfddg sdfg sdf g', 120, 'Ls', 54, 'mm', 13795, 3),
(118, 5, 10, 'fsda', 10, '', 0, '', 0, 3),
(119, 5, 10, 'fdadsfads safdda', 90, 'Meter', 50, 'Set', 3600, 3),
(120, 5, 10, 'daf asdfas', 60, 'Meter', 50, 'mm', 2400, 3),
(122, 5, 10, 'lamps', 20, '', 0, '', 0, 3),
(124, 5, 10, 'cameras', 50, '', 0, '', 0, 3),
(125, 5, 10, 'anything', 50, '', 0, '', 0, 3),
(126, 5, 10, 'dfasfa', 62, 'Meter', 12, 'mm', 1270, 3),
(127, 5, 10, 'sdfa fdsaf asd', 57, 'Meter', 30, 'mm', 4875, 3),
(129, 9, 1, 'asdf', 5, 'Ls', 12, 'mm', 50, 2),
(130, 9, 9, 'jhjkh', 15, NULL, 12, NULL, 750, 4),
(134, 3, 10, 'dasdf asdf fsda', 50, 'Meter', 12, 'mm', 5000, 2),
(135, 3, 10, 'cameras', 12, '', 0, '', 0, 2),
(136, 3, 10, 'anything', 4, '', 0, '', 0, 2),
(139, 3, 10, 'lamps', 110, '', 0, '', 0, 2),
(140, 3, 10, 'fdsaf asdf asd', 78, 'No\'s', 30, 'Inch', 1154, 2),
(143, 2, 10, 'cameras', 10, '', 0, '', 0, 3),
(144, 2, 10, 'lamps', 10, '', 0, '', 0, 3),
(145, 2, 10, 'fasdfa sf', 4, 'No\'s', 2, 'Inch', 240, 3),
(146, 9, 4, '2', 2, 'No\'s', 23, 'Set', 4, 4);
-- --------------------------------------------------------
--
-- Table structure for table `material_inquiry_suppliers`
--
CREATE TABLE `material_inquiry_suppliers` (
`id` int(11) NOT NULL,
`material_inquiry_id` int(11) NOT NULL,
`suppliers_list` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `material_inquiry_suppliers`
--
INSERT INTO `material_inquiry_suppliers` (`id`, `material_inquiry_id`, `suppliers_list`) VALUES
(1, 40, '["10", "14", "16"]'),
(2, 41, '["16", "17"]'),
(3, 42, '["10", "14", "16", "17"]'),
(4, 43, '["6"]'),
(5, 44, '["10"]'),
(6, 45, '["10"]'),
(7, 46, '["10"]'),
(8, 47, '["10"]');
-- --------------------------------------------------------
--
-- Table structure for table `material_requisition`
--
CREATE TABLE `material_requisition` (
`id` int(10) UNSIGNED NOT NULL,
`boq_id` int(11) NOT NULL,
`delivery_date` date NOT NULL,
`complete_date` date NOT NULL,
`order_date` date DEFAULT NULL,
`is_approved` int(11) NOT NULL DEFAULT '0',
`is_checked_out` int(11) NOT NULL DEFAULT '0',
`supplier_approved` int(11) NOT NULL DEFAULT '0',
`is_approved_req` int(11) NOT NULL DEFAULT '0',
`is_approved_lpo` int(11) NOT NULL DEFAULT '0',
`is_awaiting` int(11) NOT NULL DEFAULT '0',
`is_delivered` int(11) NOT NULL DEFAULT '0',
`freight` float NOT NULL DEFAULT '0',
`discount` float NOT NULL DEFAULT '0',
`proposal_id` int(11) DEFAULT '0',
`site_in_charge` int(11) NOT NULL DEFAULT '0',
`job_no` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`order_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `material_requisition`
--
INSERT INTO `material_requisition` (`id`, `boq_id`, `delivery_date`, `complete_date`, `order_date`, `is_approved`, `is_checked_out`, `supplier_approved`, `is_approved_req`, `is_approved_lpo`, `is_awaiting`, `is_delivered`, `freight`, `discount`, `proposal_id`, `site_in_charge`, `job_no`, `order_number`) VALUES
(1, 24, '2018-05-01', '2018-05-05', NULL, 1, 1, 1, 1, 1, 1, 0, 0, 0, NULL, 0, NULL, NULL),
(2, 33, '2018-05-23', '2018-05-31', NULL, 1, 1, 1, 1, 1, 1, 0, 0, 0, NULL, 0, NULL, NULL),
(10, 33, '2018-01-31', '2017-10-30', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, NULL),
(4, 33, '2018-06-06', '2018-06-09', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, NULL),
(5, 33, '2018-05-09', '2018-06-08', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, NULL),
(6, 31, '2018-06-08', '2018-06-09', NULL, 1, 1, 1, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, NULL),
(7, 33, '2018-06-01', '2018-06-09', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, NULL),
(8, 25, '2018-06-07', '2018-06-09', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, NULL),
(9, 25, '2018-06-06', '2018-06-08', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, NULL),
(11, 25, '2018-06-26', '2018-07-06', '2018-06-21', 1, 1, 0, 0, 0, 0, 0, 0, 0, 18, 2, 'Do1', ' P46/09R1'),
(12, 26, '2018-06-29', '2018-07-07', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 19, 9, NULL, NULL),
(13, 33, '2018-06-20', '2018-06-30', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 26, 9, 'do1', NULL),
(14, 19, '2018-05-02', '2018-05-05', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 0, 13, 8, '3', NULL),
(15, 25, '2018-10-20', '2018-11-02', '2018-07-07', 1, 0, 0, 0, 0, 0, 0, 0, 0, 18, 2, 'Do1', 'Do1011'),
(16, 25, '2018-05-02', '2018-07-27', '2018-07-11', 1, 1, 0, 0, 0, 0, 0, 0, 0, 18, 2, 'do1', 'Do1011'),
(17, 33, '2018-07-24', '2018-08-04', '2018-07-12', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL),
(18, 24, '2018-07-17', '2018-08-04', '2018-07-14', 1, 0, 0, 0, 0, 0, 0, 0, 0, 17, 2, 'Do1', 'Do1011'),
(19, 25, '2018-08-08', '2018-08-09', '2018-07-17', 1, 1, 0, 0, 0, 0, 0, 0, 0, 18, 9, 'do1', 'P43');
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2017_10_18_072929_create_gml_table', 1),
(2, '2017_10_18_074611_create_sub_gml_table', 2),
(3, '2017_10_21_121027_create_work_zone_table', 3),
(4, '2017_10_22_071426_create_screens_table', 4),
(5, '2017_10_22_071445_create_rules_table', 4),
(6, '2017_10_23_062511_create_sub_work_zone_table', 5),
(7, '2017_10_24_074554_create_boq_table', 6),
(8, '2017_10_24_075818_create_boqs_table', 7),
(9, '2017_10_24_142159_create_boq_sub_materials_table', 7),
(10, '2017_10_25_120457_create_material_inquiry_table', 8),
(11, '2017_10_28_094746_create_material_inquiries_table', 9),
(12, '2017_10_29_100522_create_supplier_materials_table', 9),
(13, '2017_10_31_133518_create_supplier_proposal_table', 10),
(14, '2017_10_31_133600_create_supplier_proposal_details_table', 10),
(15, '2017_11_02_171944_create_supplier_agreement_table', 11),
(16, '2017_11_03_170218_create_scl_table', 12),
(17, '2017_11_03_170344_create_sub_scl_table', 12),
(18, '2017_11_04_105433_create_scr_table', 13),
(19, '2017_11_04_105558_create_scr_sub_category_table', 13),
(20, '2017_11_05_100637_create_subcontractor_request_table', 14),
(21, '2017_11_05_103700_create_subcontractor_proposal_table', 14),
(22, '2017_11_05_104315_create_subcontractor_agreement_table', 14),
(23, '2017_11_06_054716_create_subcontractor_category_table', 15),
(24, '2017_11_06_054813_create_subcontractor_proposal_details_table', 15),
(25, '2017_11_08_071313_create_users_general_info_table', 16),
(26, '2017_11_08_071342_create_users_work_info_table', 16),
(27, '2017_11_11_071619_create_positions_table', 17),
(28, '2017_11_11_121724_create_position_rules_table', 18),
(29, '2017_11_14_090649_create_material_requisition_table', 19),
(30, '2018_02_12_092902_create_notifications_table', 20);
-- --------------------------------------------------------
--
-- Table structure for table `notifications`
--
CREATE TABLE `notifications` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`link` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `notifications`
--
INSERT INTO `notifications` (`id`, `title`, `description`, `link`) VALUES
(1, 'New Sub GMLtest', 'there is a new sub genral material list wating to approval to see it plaeas folow the link below .', 'http://127.0.0.1:8000/gml/pendingSub'),
(2, 'New Sub GMLtest', 'there is a new sub genral material list wating to approval to see it plaeas folow the link below .', 'http://127.0.0.1:8000/gml/pendingSub'),
(3, 'New Sub GMLtest', 'there is a new sub genral material list wating to approval to see it plaeas folow the link below .', 'http://127.0.0.1:8000/gml/pendingSub'),
(4, 'New Sub GMLtest98', 'there is a new sub genral material list wating for approval , to check it folow the link below .', 'http://127.0.0.1:8000/gml/pendingSub'),
(5, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq41'),
(6, 'New Sub GMLfasd', 'there is a new sub genral material list wating for approval , to check it folow the link below .', 'http://127.0.0.1:8000/gml/pendingSub'),
(7, 'New Sub GMLsecond item', 'there is a new sub genral material list wating for approval , to check it folow the link below .', 'http://127.0.0.1:8000/gml/pendingSub'),
(8, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq46'),
(9, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq48'),
(10, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq47'),
(11, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq49'),
(12, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq50'),
(13, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq51'),
(14, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq52'),
(15, 'New GML', 'A new general material list is waiting for Your approval', 'http://127.0.0.1:8000/gml/pendingGml'),
(16, 'GML', 'A material waiting for approval', 'http://127.0.0.1:8000/gml/pendingGml'),
(17, 'GML', 'A material waiting for approval', 'http://127.0.0.1:8000/gml/pendingGml'),
(18, 'GML', 'A material waiting for approval', 'http://127.0.0.1:8000/gml/pendingGml'),
(19, 'GML', 'A material is approved', 'http://127.0.0.1:8000/gml/pendingGml'),
(20, 'GML', 'A material is approved', 'http://127.0.0.1:8000/gml/pendingGml'),
(21, 'GML', 'A material is approved', 'http://127.0.0.1:8000/gml/pendingGml'),
(22, 'New Sub GML 22222', 'A new sub general material list is waiting for approval', 'http://127.0.0.1:8000/gml/pendingSub'),
(23, 'Sub GML ', 'A sub general material list is waiting for approval', 'http://127.0.0.1:8000/gml/pendingSub'),
(24, 'Sub GML ', 'A sub general material list is waiting for approval', 'http://127.0.0.1:8000/gml/pendingSub'),
(25, 'Sub GML ', 'A sub general material list is approved', 'http://127.0.0.1:8000/gml/pendingSub'),
(26, 'New GML', 'A new general material list is waiting for Your approval', 'http://127.0.0.1:8000/gml/pendingGml'),
(27, 'GML', 'A material waiting for approval', 'http://127.0.0.1:8000/gml/pendingGml'),
(28, 'GML', 'A material waiting for approval', 'http://127.0.0.1:8000/gml/pendingGml'),
(29, 'GML', 'A material is approved', 'http://127.0.0.1:8000/gml/pendingGml'),
(30, 'New Sub GML xsdsa', 'A new sub general material list is waiting for approval', 'http://127.0.0.1:8000/gml/pendingSub'),
(31, 'Sub GML ', 'A sub general material list is waiting for approval', 'http://127.0.0.1:8000/gml/pendingSub'),
(32, 'Sub GML ', 'A sub general material list is waiting for approval', 'http://127.0.0.1:8000/gml/pendingSub'),
(33, 'Sub GML ', 'A sub general material list is approved', 'http://127.0.0.1:8000/gml/pendingSub'),
(34, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq53'),
(35, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq54'),
(36, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq55'),
(37, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq57'),
(38, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq56'),
(39, 'New Inquiry ready', 'there is a new Inquiry Ready to Inquire', 'http://127.0.0.1:8000/boq/showsubboq58'),
(40, 'Inquiry ready to approve', 'There is a new Inquiry Ready to Approve', 'http://127.0.0.1:8000/materialinquiry/pending'),
(41, 'Supplier Declined', 'A supplier declined the order', 'http://127.0.0.1:8000/materialinquiry/decline/47'),
(42, 'Supplier Accepted', 'A supplier accepted the order', 'http://127.0.0.1:8000/materialinquiry/suplierProposal/47'),
(43, 'New Proposal waiting for Approval', 'New Proposal is waiting for commercial manager approval', 'http://127.0.0.1:8000/materialinquiry/pendingtoclose'),
(44, 'Proposal waiting for Approval', 'New Proposal is waiting for operations manager approval', 'http://127.0.0.1:8000/materialinquiry/pendingtoclose'),
(45, 'Proposal Approved', 'New Proposal is approved', 'http://127.0.0.1:8000/materialinquiry/closed'),
(46, 'Supplier Declined', 'A supplier declined the agreement', 'http://127.0.0.1:8000/supplier/showDecline/23'),
(47, 'Supplier Accepted Agreement', 'A supplier accepted the agreement', 'http://127.0.0.1:8000/materialinquiry/showAccepted');
-- --------------------------------------------------------
--
-- Table structure for table `notification_users`
--
CREATE TABLE `notification_users` (
`id` int(11) NOT NULL,
`notification_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`is_read` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `notification_users`
--
INSERT INTO `notification_users` (`id`, `notification_id`, `user_id`, `is_read`, `created_at`) VALUES
(1, 1, 3, 1, '2018-10-30 10:39:25'),
(2, 1, 2, 1, '2018-10-30 10:39:25'),
(3, 2, 3, 0, '2018-10-30 10:39:25'),
(4, 2, 2, 1, '2018-10-31 07:35:36'),
(5, 3, 3, 0, '2018-10-30 10:39:25'),
(6, 3, 2, 1, '2018-10-31 07:35:36'),
(7, 4, 3, 0, '2018-10-30 10:39:25'),
(8, 4, 2, 1, '2018-10-31 07:35:36'),
(9, 5, 2, 1, '2018-10-31 07:35:36'),
(10, 6, 2, 1, '2018-10-31 07:35:36'),
(11, 6, 3, 0, '2018-10-30 10:39:25'),
(12, 7, 2, 1, '2018-10-31 07:35:37'),
(13, 7, 3, 0, '2018-10-30 10:39:25'),
(14, 8, 2, 1, '2018-10-31 07:35:37'),
(15, 9, 2, 1, '2018-10-31 07:35:37'),
(16, 10, 2, 1, '2018-10-31 07:35:45'),
(17, 11, 2, 1, '2018-10-31 07:35:45'),
(18, 12, 2, 1, '2018-10-31 07:35:45'),
(19, 13, 2, 1, '2018-10-31 07:35:45'),
(20, 14, 2, 1, '2018-10-31 07:35:45'),
(21, 15, 2, 1, '2018-10-30 10:47:08'),
(22, 15, 3, 0, '2018-10-30 10:46:52'),
(23, 16, 2, 1, '2018-10-31 07:35:36'),
(24, 16, 3, 0, '2018-10-30 10:47:18'),
(25, 17, 2, 1, '2018-10-31 07:35:35'),
(26, 17, 3, 0, '2018-10-30 10:50:02'),
(27, 18, 2, 1, '2018-10-31 07:35:35'),
(28, 19, 2, 1, '2018-10-31 07:35:35'),
(29, 20, 2, 1, '2018-10-31 07:35:35'),
(30, 21, 2, 1, '2018-10-30 10:50:14'),
(31, 22, 2, 1, '2018-10-30 10:50:28'),
(32, 22, 3, 0, '2018-10-30 10:50:24'),
(33, 23, 2, 1, '2018-10-31 07:35:35'),
(34, 23, 3, 0, '2018-10-30 10:50:30'),
(35, 24, 2, 1, '2018-10-31 07:35:35'),
(36, 25, 2, 1, '2018-10-31 07:35:35'),
(37, 26, 2, 1, '2018-10-30 12:15:44'),
(38, 26, 3, 0, '2018-10-30 12:15:40'),
(39, 27, 2, 1, '2018-10-30 12:15:51'),
(40, 27, 3, 0, '2018-10-30 12:15:48'),
(41, 28, 2, 1, '2018-10-31 07:33:42'),
(42, 29, 2, 1, '2018-10-31 07:33:42'),
(43, 30, 2, 1, '2018-10-30 12:16:10'),
(44, 30, 3, 0, '2018-10-30 12:16:08'),
(45, 31, 2, 1, '2018-10-30 12:16:14'),
(46, 31, 3, 0, '2018-10-30 12:16:12'),
(47, 32, 2, 1, '2018-10-31 07:33:42'),
(48, 33, 2, 1, '2018-10-31 07:33:42'),
(49, 34, 2, 1, '2018-10-31 07:33:42'),
(50, 35, 2, 1, '2018-10-31 07:33:42'),
(51, 36, 2, 1, '2018-10-31 07:33:42'),
(52, 37, 2, 0, '2018-11-01 10:21:40'),
(53, 37, 19, 0, '2018-11-01 10:21:40'),
(54, 38, 2, 0, '2018-11-01 10:21:43'),
(55, 38, 19, 0, '2018-11-01 10:21:43'),
(56, 39, 2, 0, '2018-11-03 07:03:10'),
(57, 39, 19, 0, '2018-11-03 07:03:10'),
(58, 40, 2, 1, '2018-11-03 07:03:36'),
(59, 40, 19, 0, '2018-11-03 07:03:28'),
(60, 41, 2, 1, '2018-11-03 07:06:10'),
(61, 41, 19, 0, '2018-11-03 07:06:04'),
(62, 42, 2, 0, '2018-11-03 07:06:49'),
(63, 42, 19, 0, '2018-11-03 07:06:49'),
(64, 44, 2, 0, '2018-11-03 07:10:56'),
(65, 45, 2, 0, '2018-11-03 07:10:58'),
(66, 46, 2, 1, '2018-11-03 07:15:05'),
(67, 47, 2, 0, '2018-11-03 07:20:18');
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `positions`
--
CREATE TABLE `positions` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `positions`
--
INSERT INTO `positions` (`id`, `title`) VALUES
(1, 'fasd'),
(2, 'QS Engineer'),
(3, 'new position'),
(4, 'admin');
-- --------------------------------------------------------
--
-- Table structure for table `position_rules`
--
CREATE TABLE `position_rules` (
`id` int(10) UNSIGNED NOT NULL,
`position_id` int(11) NOT NULL,
`screen_id` int(11) NOT NULL,
`can_show` int(11) NOT NULL,
`can_edit` int(11) NOT NULL,
`can_approve` int(11) NOT NULL,
`can_approve2` int(11) NOT NULL DEFAULT '0',
`can_approve3` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `position_rules`
--
INSERT INTO `position_rules` (`id`, `position_id`, `screen_id`, `can_show`, `can_edit`, `can_approve`, `can_approve2`, `can_approve3`) VALUES
(1, 1, 1, 1, 1, 1, 0, 0),
(2, 1, 2, 0, 0, 0, 0, 0),
(3, 1, 3, 0, 0, 0, 0, 0),
(4, 1, 4, 0, 0, 0, 0, 0),
(5, 1, 5, 0, 0, 0, 0, 0),
(6, 1, 6, 0, 0, 0, 0, 0),
(7, 1, 7, 0, 0, 0, 0, 0),
(8, 1, 8, 0, 0, 0, 0, 0),
(9, 1, 9, 0, 0, 0, 0, 0),
(10, 1, 10, 0, 0, 0, 0, 0),
(11, 2, 1, 0, 1, 0, 0, 0),
(12, 2, 2, 0, 0, 0, 0, 0),
(13, 2, 3, 0, 0, 0, 0, 0),
(14, 2, 4, 1, 1, 0, 0, 0),
(15, 2, 5, 1, 1, 0, 0, 0),
(16, 2, 6, 1, 1, 0, 0, 0),
(17, 2, 7, 0, 0, 0, 0, 0),
(18, 2, 8, 0, 0, 0, 0, 0),
(19, 2, 9, 1, 1, 1, 0, 0),
(20, 2, 10, 1, 1, 1, 1, 0),
(21, 3, 1, 1, 1, 1, 0, 0),
(22, 3, 2, 1, 1, 1, 0, 0),
(23, 3, 3, 0, 0, 0, 0, 0),
(24, 3, 4, 0, 0, 0, 0, 0),
(25, 3, 5, 0, 0, 0, 0, 0),
(26, 3, 6, 0, 0, 0, 0, 0),
(27, 3, 7, 0, 0, 0, 0, 0),
(28, 3, 8, 0, 0, 0, 0, 0),
(29, 3, 9, 0, 0, 0, 0, 0),
(30, 3, 10, 0, 0, 0, 0, 0),
(31, 4, 1, 1, 1, 1, 0, 0),
(32, 4, 2, 1, 1, 1, 0, 0),
(33, 4, 3, 1, 1, 1, 0, 0),
(34, 4, 4, 1, 1, 1, 0, 0),
(35, 4, 5, 1, 1, 1, 0, 0),
(36, 4, 6, 1, 1, 1, 0, 0),
(37, 4, 7, 1, 0, 1, 0, 0),
(38, 4, 8, 1, 0, 1, 0, 0),
(39, 4, 9, 1, 1, 1, 0, 0),
(40, 4, 10, 1, 1, 1, 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `proposal_reply`
--
CREATE TABLE `proposal_reply` (
`id` int(11) NOT NULL,
`proposal_id` int(11) NOT NULL,
`subject` varchar(255) NOT NULL,
`body` mediumtext NOT NULL,
`date` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `proposal_reply`
--
INSERT INTO `proposal_reply` (`id`, `proposal_id`, `subject`, `body`, `date`) VALUES
(1, 29, 'test', 'this is just for test', '2018-10-30 07:35:15');
-- --------------------------------------------------------
--
-- Table structure for table `requisition_accessory`
--
CREATE TABLE `requisition_accessory` (
`id` int(11) NOT NULL,
`requisition_id` int(11) NOT NULL,
`sub_material_id` int(11) NOT NULL,
`accsessory_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `requisition_accessory`
--
INSERT INTO `requisition_accessory` (`id`, `requisition_id`, `sub_material_id`, `accsessory_id`, `quantity`) VALUES
(1, 1, 36, 4, 10),
(2, 1, 36, 5, 10),
(3, 8, 36, 4, 12),
(4, 9, 36, 4, 4),
(5, 9, 36, 5, 5),
(6, 11, 36, 4, 12),
(7, 11, 36, 5, 12),
(8, 12, 37, 8, 20),
(9, 12, 37, 8, 10),
(10, 12, 39, 6, 30),
(11, 12, 39, 7, 90),
(12, 12, 39, 6, 30),
(13, 12, 39, 7, 90),
(14, 15, 36, 4, 4),
(15, 16, 36, 4, 2),
(16, 18, 33, 2, 6),
(17, 18, 33, 3, 6),
(18, 19, 36, 4, 2);
-- --------------------------------------------------------
--
-- Table structure for table `requisition_materials`
--
CREATE TABLE `requisition_materials` (
`id` int(11) NOT NULL,
`requisition_id` int(11) NOT NULL,
`sub_material_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `requisition_materials`
--
INSERT INTO `requisition_materials` (`id`, `requisition_id`, `sub_material_id`, `quantity`) VALUES
(1, 1, 35, 10),
(2, 1, 36, 10),
(3, 2, 49, 10),
(5, 4, 49, 10),
(6, 5, 49, 10),
(7, 6, 47, 1),
(8, 7, 49, 15),
(9, 9, 35, 2),
(10, 9, 36, 3),
(11, 10, 49, 3),
(12, 11, 35, 12),
(13, 11, 36, 12),
(14, 12, 37, 20),
(15, 12, 37, 30),
(16, 12, 38, 100),
(17, 12, 38, 300),
(18, 12, 39, 40),
(19, 12, 39, 50),
(20, 13, 49, 3),
(21, 14, 28, 2),
(22, 15, 35, 3),
(23, 15, 36, 4),
(24, 16, 36, 1),
(25, 17, 49, 4),
(26, 18, 34, 6),
(27, 18, 33, 6),
(28, 19, 36, 2);
-- --------------------------------------------------------
--
-- Table structure for table `rules`
--
CREATE TABLE `rules` (
`id` int(10) UNSIGNED NOT NULL,
`user_id` int(11) NOT NULL,
`screen_id` int(11) NOT NULL,
`can_show` int(11) NOT NULL,
`can_edit` int(11) NOT NULL,
`can_approve` int(11) NOT NULL,
`can_approve2` int(11) NOT NULL DEFAULT '0',
`can_approve3` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `rules`
--
INSERT INTO `rules` (`id`, `user_id`, `screen_id`, `can_show`, `can_edit`, `can_approve`, `can_approve2`, `can_approve3`) VALUES
(1, 2, 1, 1, 1, 1, 1, 1),
(2, 2, 2, 1, 1, 1, 0, 0),
(3, 2, 3, 1, 1, 0, 0, 0),
(4, 2, 4, 1, 1, 1, 0, 0),
(5, 2, 5, 1, 1, 1, 1, 1),
(6, 2, 6, 1, 1, 1, 0, 0),
(7, 2, 9, 1, 1, 1, 0, 0),
(8, 2, 10, 1, 1, 1, 1, 0),
(9, 2, 11, 0, 0, 0, 0, 0),
(10, 2, 8, 1, 0, 1, 1, 0),
(11, 2, 7, 1, 0, 1, 1, 0),
(12, 2, 12, 1, 1, 0, 0, 0),
(13, 2, 13, 1, 1, 0, 0, 0),
(14, 2, 14, 1, 1, 0, 0, 0),
(15, 5, 1, 0, 0, 0, 0, 0),
(16, 5, 2, 0, 0, 0, 0, 0),
(17, 5, 3, 0, 0, 0, 0, 0),
(18, 5, 4, 0, 0, 0, 0, 0),
(19, 5, 5, 0, 0, 0, 0, 0),
(20, 5, 6, 0, 0, 0, 0, 0),
(21, 5, 7, 0, 0, 0, 0, 0),
(22, 5, 8, 0, 0, 0, 0, 0),
(23, 5, 9, 0, 0, 0, 0, 0),
(24, 5, 10, 0, 0, 0, 0, 0),
(25, 4, 1, 0, 0, 0, 0, 0),
(26, 4, 2, 0, 0, 0, 0, 0),
(27, 4, 3, 0, 0, 0, 0, 0),
(28, 4, 4, 0, 0, 0, 0, 0),
(29, 4, 5, 0, 0, 0, 0, 0),
(30, 4, 6, 0, 0, 0, 0, 0),
(31, 4, 7, 0, 0, 0, 0, 0),
(32, 4, 8, 0, 0, 0, 0, 0),
(33, 4, 9, 0, 0, 0, 0, 0),
(34, 4, 10, 0, 0, 0, 0, 0),
(35, 4, 11, 0, 0, 0, 0, 0),
(36, 4, 12, 0, 0, 0, 0, 0),
(37, 4, 13, 0, 0, 0, 0, 0),
(38, 4, 14, 0, 0, 0, 0, 0),
(39, 8, 1, 0, 0, 0, 0, 0),
(40, 8, 2, 0, 0, 0, 0, 0),
(41, 8, 3, 0, 0, 0, 0, 0),
(42, 8, 4, 0, 0, 0, 0, 0),
(43, 8, 5, 0, 0, 0, 0, 0),
(44, 8, 6, 0, 0, 0, 0, 0),
(45, 8, 7, 0, 0, 0, 0, 0),
(46, 8, 8, 0, 0, 0, 0, 0),
(47, 8, 9, 0, 0, 0, 0, 0),
(48, 8, 10, 0, 0, 0, 0, 0),
(49, 9, 1, 0, 1, 0, 0, 0),
(50, 9, 2, 1, 0, 0, 0, 0),
(51, 9, 3, 0, 0, 0, 0, 0),
(52, 9, 4, 1, 0, 0, 0, 0),
(53, 9, 5, 0, 0, 0, 0, 0),
(54, 9, 6, 0, 0, 0, 0, 0),
(55, 9, 7, 0, 0, 0, 0, 0),
(56, 9, 8, 0, 0, 0, 0, 0),
(57, 9, 9, 1, 1, 1, 0, 0),
(58, 9, 10, 1, 1, 1, 1, 0),
(59, 9, 11, 0, 0, 0, 0, 0),
(60, 9, 12, 0, 0, 0, 0, 0),
(61, 9, 13, 0, 0, 0, 0, 0),
(62, 9, 14, 0, 0, 0, 0, 0),
(63, 5, 11, 0, 0, 0, 0, 0),
(64, 5, 12, 0, 0, 0, 0, 0),
(65, 5, 13, 0, 0, 0, 0, 0),
(66, 5, 14, 0, 0, 0, 0, 0),
(67, 8, 11, 0, 0, 0, 0, 0),
(68, 8, 12, 0, 0, 0, 0, 0),
(69, 8, 13, 0, 0, 0, 0, 0),
(70, 8, 14, 0, 0, 0, 0, 0),
(71, 3, 1, 1, 1, 1, 0, 0),
(72, 3, 2, 1, 1, 1, 0, 0),
(73, 3, 3, 0, 0, 0, 0, 0),
(74, 3, 4, 0, 0, 0, 0, 0),
(75, 3, 5, 0, 0, 0, 0, 0),
(76, 3, 6, 0, 0, 0, 0, 0),
(77, 3, 9, 0, 0, 0, 0, 0),
(78, 3, 10, 0, 0, 0, 0, 0),
(79, 3, 11, 0, 0, 0, 0, 0),
(80, 3, 8, 0, 0, 0, 0, 0),
(81, 3, 7, 0, 0, 0, 0, 0),
(82, 3, 12, 0, 0, 0, 0, 0),
(83, 3, 13, 0, 0, 0, 0, 0),
(84, 3, 14, 0, 0, 0, 0, 0),
(85, 19, 1, 1, 1, 1, 1, 1),
(86, 19, 2, 1, 1, 1, 0, 0),
(87, 19, 3, 1, 1, 0, 0, 0),
(88, 19, 4, 1, 1, 1, 0, 0),
(89, 19, 5, 1, 1, 1, 0, 0),
(90, 19, 6, 1, 1, 1, 0, 0),
(91, 19, 7, 1, 0, 1, 1, 0),
(92, 19, 8, 1, 0, 1, 1, 0),
(93, 19, 9, 1, 1, 1, 0, 0),
(94, 19, 10, 1, 1, 1, 1, 0),
(95, 19, 11, 0, 0, 0, 0, 0),
(96, 19, 12, 1, 1, 0, 0, 0),
(97, 19, 13, 1, 1, 0, 0, 0),
(98, 19, 14, 1, 1, 0, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `scl`
--
CREATE TABLE `scl` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `scl`
--
INSERT INTO `scl` (`id`, `title`, `description`) VALUES
(1, 'asdf', 'ewfads'),
(2, 'jkkljkjk', 'jlkjkljopi poi lklk;lk');
-- --------------------------------------------------------
--
-- Table structure for table `scr`
--
CREATE TABLE `scr` (
`id` int(10) UNSIGNED NOT NULL,
`sub_work_zone_id` int(11) NOT NULL,
`sub_scl_id` int(11) NOT NULL,
`status` int(11) NOT NULL,
`request_is_created` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `scr`
--
INSERT INTO `scr` (`id`, `sub_work_zone_id`, `sub_scl_id`, `status`, `request_is_created`) VALUES
(2, 26, 1, 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `screens`
--
CREATE TABLE `screens` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `screens`
--
INSERT INTO `screens` (`id`, `name`) VALUES
(1, 'GML'),
(2, 'Work Zone'),
(3, 'Scl'),
(4, 'Boq'),
(5, 'Material inquiry'),
(6, 'Subcontractor Request'),
(7, 'Supplier'),
(8, 'Subcontractor'),
(9, 'Material Requisition'),
(10, 'Material Requisition'),
(11, 'Material Requisition'),
(12, 'Users'),
(13, 'Rules'),
(14, 'Positions');
-- --------------------------------------------------------
--
-- Table structure for table `scr_sub_category`
--
CREATE TABLE `scr_sub_category` (
`id` int(10) UNSIGNED NOT NULL,
`scr_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`budgetory_price` double NOT NULL,
`description` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`work_scope` mediumtext COLLATE utf8mb4_unicode_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `scr_sub_category`
--
INSERT INTO `scr_sub_category` (`id`, `scr_id`, `quantity`, `budgetory_price`, `description`, `work_scope`) VALUES
(5, 2, 2, 2, '2', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `subcontractor_agreement`
--
CREATE TABLE `subcontractor_agreement` (
`id` int(10) UNSIGNED NOT NULL,
`subcontractor_id` int(11) NOT NULL,
`sub_scl_id` int(11) NOT NULL,
`proposal_id` int(11) NOT NULL,
`final_price` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`payment_terms` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`delivery_agreement` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`approve_date` date NOT NULL,
`is_approved` int(11) NOT NULL DEFAULT '0',
`is_subcontractor_accepted` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `subcontractor_category`
--
CREATE TABLE `subcontractor_category` (
`id` int(10) UNSIGNED NOT NULL,
`subcontractor_id` int(11) NOT NULL,
`sub_category_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `subcontractor_decline`
--
CREATE TABLE `subcontractor_decline` (
`id` int(11) NOT NULL,
`subcontractor_id` int(11) NOT NULL,
`subcontractor_request_id` int(11) NOT NULL,
`decline_reason` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `subcontractor_proposal`
--
CREATE TABLE `subcontractor_proposal` (
`id` int(10) UNSIGNED NOT NULL,
`subcontractor_id` int(11) NOT NULL,
`scr_id` int(11) NOT NULL,
`subcontractor_request_id` int(11) NOT NULL,
`proposal` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`consider` int(11) NOT NULL DEFAULT '0',
`is_accepted` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `subcontractor_proposal_details`
--
CREATE TABLE `subcontractor_proposal_details` (
`id` int(10) UNSIGNED NOT NULL,
`proposal_id` int(11) NOT NULL,
`sub_category_id` int(11) NOT NULL,
`price` int(11) NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `subcontractor_request`
--
CREATE TABLE `subcontractor_request` (
`id` int(10) UNSIGNED NOT NULL,
`scr_id` int(11) NOT NULL,
`date` date NOT NULL,
`close_date` date NOT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`is_approved` int(11) NOT NULL DEFAULT '0',
`is_closed` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `sub_gml`
--
CREATE TABLE `sub_gml` (
`id` int(10) UNSIGNED NOT NULL,
`gml_id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_approved` int(11) NOT NULL,
`is_approved2` int(11) NOT NULL DEFAULT '1',
`is_approved3` int(11) NOT NULL DEFAULT '1',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `sub_gml`
--
INSERT INTO `sub_gml` (`id`, `gml_id`, `title`, `description`, `remember_token`, `is_approved`, `is_approved2`, `is_approved3`, `created_at`) VALUES
(1, 1, 'meqdad22', 'jkhjk', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(2, 1, 'fgjhg', NULL, NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(3, 2, 'pips 60', 'aklsdjf fds', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(4, 2, 'pips 50', 'fsdaf', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(7, 3, 'fasdfa asdf', 'fadsfa asdf asd', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(9, 4, 'ahmad', 'ccc', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(10, 5, 'pips', NULL, NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(11, 5, 'chillers', NULL, NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(12, 6, 'general material', 'ddd', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(13, 6, 'test', 'fff', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(14, 6, 'test', 'fff', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(15, 6, 'test', 'fff', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(16, 9, 'fasd', 'fasdfads', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(17, 9, 'second item', 'yyyyyyyyyyyy', NULL, 1, 1, 1, '2018-10-30 10:38:57'),
(18, 12, '22222', 'sss', NULL, 1, 1, 1, '2018-10-30 10:50:40'),
(19, 13, 'xsdsa', 'dsad', NULL, 1, 1, 1, '2018-10-30 12:16:17');
-- --------------------------------------------------------
--
-- Table structure for table `sub_scl`
--
CREATE TABLE `sub_scl` (
`id` int(10) UNSIGNED NOT NULL,
`scl_id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci,
`is_approved` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `sub_scl`
--
INSERT INTO `sub_scl` (`id`, `scl_id`, `title`, `description`, `is_approved`) VALUES
(1, 1, 'meqdad', 'fasdfasd', 1),
(4, 2, 'ffff', 'ffff', 0);
-- --------------------------------------------------------
--
-- Table structure for table `sub_work_zone`
--
CREATE TABLE `sub_work_zone` (
`id` int(10) UNSIGNED NOT NULL,
`work_zone_id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `sub_work_zone`
--
INSERT INTO `sub_work_zone` (`id`, `work_zone_id`, `title`) VALUES
(1, 1, 'xxxxx'),
(2, 2, 'ajman school'),
(3, 1, 'test test'),
(4, 2, 'fasdfadsfasd'),
(5, 2, 'fasd'),
(6, 2, 'al horya school'),
(7, 2, 'shhhhh'),
(8, 2, 'cccv'),
(9, 3, 'sad'),
(10, 3, 'x'),
(11, 3, 's'),
(12, 3, 'q'),
(13, 3, 'e'),
(14, 3, 'qw'),
(15, 3, 'wq'),
(16, 3, 'ewq'),
(17, 3, 'rew'),
(18, 3, 'rwe'),
(19, 3, 're'),
(20, 3, 're'),
(21, 3, 'first floor'),
(22, 3, 'scound floor'),
(23, 5, 'first Floor'),
(24, 5, 'fff'),
(25, 5, 'test7'),
(26, 5, 'test'),
(27, 4, 'ddddddd'),
(28, 4, 'ddas'),
(29, 4, 'test'),
(30, 4, 'test'),
(31, 4, 't'),
(32, 4, 'gf'),
(33, 4, 'f'),
(34, 4, 'ss'),
(35, 4, 'ww'),
(36, 4, 'wq'),
(37, 4, 'wq'),
(38, 4, 'wq'),
(39, 4, 'wq'),
(40, 4, 'wq'),
(41, 4, 'wq'),
(42, 4, 'ff'),
(43, 4, 'gsdf'),
(44, 4, 'dsa'),
(45, 4, 'dsa'),
(46, 4, 'fsdaf'),
(47, 4, '12'),
(48, 4, 'dSA'),
(49, 4, 'dSA'),
(50, 4, 'dSA'),
(51, 4, 'dadsf'),
(52, 4, 'fsdg'),
(53, 4, 'gsdf'),
(54, 4, 'gsdf'),
(55, 4, 'das'),
(56, 4, 'fa'),
(57, 4, 'rw'),
(58, 4, 'dsf'),
(59, 4, 'dsf'),
(60, 4, 'das'),
(61, 4, 'fasd'),
(62, 8, 'first floor'),
(63, 9, 'first floor'),
(64, 9, 'second floor'),
(65, 9, 'thered floor'),
(66, 5, 'basment');
-- --------------------------------------------------------
--
-- Table structure for table `supplier_agreement`
--
CREATE TABLE `supplier_agreement` (
`id` int(10) UNSIGNED NOT NULL,
`supplier_id` int(11) NOT NULL,
`sub_gml_id` int(11) NOT NULL,
`work_zone_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
`proposal_id` int(11) NOT NULL,
`quotation_ref` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`payment_terms` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`supplier_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`all_materials` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`submital_requisted` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`copies_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_approved` int(11) NOT NULL DEFAULT '0',
`is_supplier_accepted` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `supplier_agreement`
--
INSERT INTO `supplier_agreement` (`id`, `supplier_id`, `sub_gml_id`, `work_zone_id`, `proposal_id`, `quotation_ref`, `payment_terms`, `supplier_code`, `all_materials`, `submital_requisted`, `copies_number`, `is_approved`, `is_supplier_accepted`) VALUES
(1, 10, 3, '0', 1, 'ds21', 'fkajhf', 'klsdjg43214', NULL, 'Hard Copy', '0', 1, 1),
(2, 10, 4, '0', 2, '321e', 'fasdf', 'fsdfas', NULL, 'Hard Copy', '0', 1, 1),
(3, 6, 3, '0', 4, 'e21', 'fsdaf', 'rew23', NULL, 'Hard Copy', '0', 1, 1),
(4, 10, 9, '0', 13, '31ew', 'asdf', '4', 'All Materials', 'Hard Copy', '0', 1, 1),
(11, 10, 10, '0', 17, '124XV', '20 days', 're23', 'All Materials', 'Hard Copy', '3', 1, 1),
(12, 10, 10, '0', 18, '21', '5days', '423ew', 'All Materials', 'Hard Copy', '3', 1, 1),
(10, 10, 11, '0', 16, 'de12', '4', 'fd2', 'All Materials', 'Soft Copy', '4', 1, 1),
(13, 10, 10, '0', 19, '23', '4 days', '34dfas', '0', 'Softcopy', '5', 1, 1),
(14, 10, 11, '0', 20, '54', 'y', 'rt5', '0', 'hardcopy', '3', 1, 1),
(15, 10, 11, '0', 21, '3', '3', '3', '0', 'Softcopy', '0', 1, 1),
(16, 10, 10, '0', 22, '3de', 'asdf', 'fer2', '0', 'hardcopy', '4', 1, 1),
(17, 10, 10, '0', 23, '124XV', '3', '21332', '0', 'hardcopy', '6', 1, 1),
(18, 10, 10, '0', 24, '124XV', '3', '21332', '0', 'Softcopy', '12', 1, 1),
(19, 10, 11, '0', 25, '34', '3', 'e3', 'Some Materials', 'Softcopy', '5', 1, 1),
(20, 10, 11, '0', 26, '124XV', '3', '3e4', 'All Materials', 'Hard Copy', '3', 1, 1),
(21, 6, 9, '0', 27, '124XV', '3', '21332', 'All Materials', 'Softcopy', '3', 1, 1),
(22, 10, 9, '9', 29, '124XV', '3', '21332', 'All Materials', 'Soft Copy', '1', 1, 1),
(23, 10, 4, '9', 32, '124XV', '3', '21332', 'All Materials', 'Soft Copy', '1', 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `supplier_agreement_decline`
--
CREATE TABLE `supplier_agreement_decline` (
`id` int(11) NOT NULL,
`agreement_id` int(11) NOT NULL,
`reason` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `supplier_agreement_decline`
--
INSERT INTO `supplier_agreement_decline` (`id`, `agreement_id`, `reason`) VALUES
(1, 3, 'das asd sad qwad adf asdfasd fasd'),
(2, 22, 'i dont want to accept this agreement'),
(3, 23, 'fasdf afasd fasd');
-- --------------------------------------------------------
--
-- Table structure for table `supplier_decline`
--
CREATE TABLE `supplier_decline` (
`id` int(11) NOT NULL,
`supplier_id` int(11) NOT NULL,
`material_inquiry_id` int(11) NOT NULL,
`decline_reason` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `supplier_decline`
--
INSERT INTO `supplier_decline` (`id`, `supplier_id`, `material_inquiry_id`, `decline_reason`) VALUES
(1, 10, 7, 'fdsfas dfa sdf as'),
(2, 10, 38, 'this is not okay i want more specific things'),
(3, 10, 38, 'test decline 2'),
(4, 10, 47, 'dddddddddddd'),
(5, 10, 47, 'dddddddddddd');
-- --------------------------------------------------------
--
-- Table structure for table `supplier_materials`
--
CREATE TABLE `supplier_materials` (
`id` int(10) UNSIGNED NOT NULL,
`supplier_id` int(11) NOT NULL,
`submaterila_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `supplier_materials`
--
INSERT INTO `supplier_materials` (`id`, `supplier_id`, `submaterila_id`) VALUES
(1, 10, 4),
(2, 10, 3),
(12, 6, 3),
(14, 6, 9),
(11, 6, 4),
(13, 6, 1),
(8, 6, 2),
(15, 6, 7),
(21, 10, 10),
(17, 10, 11),
(18, 13, 9),
(20, 10, 9),
(22, 15, 12),
(23, 15, 13),
(24, 15, 14),
(25, 15, 15),
(26, 17, 10),
(27, 17, 11),
(28, 16, 10),
(29, 16, 11),
(30, 14, 10),
(31, 14, 11);
-- --------------------------------------------------------
--
-- Table structure for table `supplier_proposal`
--
CREATE TABLE `supplier_proposal` (
`id` int(10) UNSIGNED NOT NULL,
`supplier_id` int(11) NOT NULL,
`boq_id` int(11) NOT NULL,
`material_inquiry_id` int(11) NOT NULL,
`proposal` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`total_price` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`compliance` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL,
`delivery_period` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`contact_person` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`consider` int(11) NOT NULL DEFAULT '0',
`is_accepted` int(11) NOT NULL DEFAULT '0',
`is_approved` int(11) NOT NULL DEFAULT '0',
`is_approved2` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `supplier_proposal`
--
INSERT INTO `supplier_proposal` (`id`, `supplier_id`, `boq_id`, `material_inquiry_id`, `proposal`, `total_price`, `compliance`, `delivery_period`, `contact_person`, `email`, `consider`, `is_accepted`, `is_approved`, `is_approved2`) VALUES
(1, 10, 6, 2, 'this is zen proposal', '', '', '', '', '', 1, 1, 1, 1),
(2, 10, 5, 3, 'fasdfadsf afsdf', '', '', '', '', '', 1, 1, 1, 1),
(3, 6, 10, 4, 'tre erwtwer er', '', '', '', '', '', 1, 1, 1, 1),
(4, 6, 11, 5, 'fghfg jjjj fjh j', '', '', '', '', '', 1, 1, 1, 1),
(5, 6, 14, 6, 'trte', '', '', '', '', '', 1, 1, 1, 1),
(6, 10, 15, 7, '', '15000', '', '23days', 'ahmad', 'ahmad@abc-gcc.com', 1, 0, 1, 1),
(7, 10, 15, 7, '', '15000', '', '23days', 'ahmad', 'ahmad@abc-gcc.com', 0, 0, 1, 1),
(8, 10, 15, 7, '', '234.2', '', '1das', 'dsa', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(9, 10, 15, 7, '', '0.0', 'Full', 'ds', 'ds', 'abo.ateleh@gmail.com', 0, 0, 1, 1),
(10, 10, 17, 9, '', '500', 'Partial', '2', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(11, 10, 20, 11, '', '666', 'Full', '75', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(13, 10, 19, 21, '', '0.0', 'Full', '12', 'd', 'ahmad@abc-gcc.com', 1, 1, 1, 1),
(14, 10, 23, 22, '', '5000', 'Full', '20', 'Ahmad', 'ahmad@abc-gcc.com', 0, 0, 1, 1),
(15, 10, 23, 22, '', '5000', 'Full', '20', 'Ahmad', 'ahmad@abc-gcc.com', 0, 0, 1, 1),
(16, 10, 23, 22, '', '5000', 'Full', '20', 'Ahmad', 'ahmad@abc-gcc.com', 1, 1, 1, 1),
(17, 10, 24, 23, '', '1500', 'Full', '12 days', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(18, 10, 25, 24, '', '300', 'Full', '12 days', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(19, 10, 26, 26, '', '100', 'Partial', '4', 'ahmad', 'ahmad@abc-gcc.com', 1, 1, 1, 1),
(20, 10, 27, 27, '', '900', 'Full', '6', 'yy', 'fsdf@das.com', 1, 1, 1, 1),
(21, 10, 28, 29, '', '0.0', 'Full', '3', 'e', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(22, 10, 22, 30, '', '0.0', 'Partial', '3 days', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(23, 10, 29, 31, '', '67', 'Full', '3', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(24, 10, 30, 32, '', '100', 'Full', '3', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(25, 10, 31, 33, '', '200', 'Full', '3', 'ahmad', 'fsdf@das.com', 1, 1, 1, 1),
(26, 10, 33, 35, '', '500', 'Full', '3', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(27, 6, 37, 37, '', '45444', 'Full', '3', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(28, 10, 0, 44, '', '500', 'Full', '3', NULL, NULL, 1, 1, 1, 1),
(29, 10, 0, 45, '', '500', 'Full', '12', 'ahmad', 'abo.ateleh@gmail.com', 1, 1, 1, 1),
(30, 10, 0, 42, '', '500', 'Full', '3 days', NULL, NULL, 1, 1, 1, 1),
(31, 10, 0, 46, '', '500', 'Full', '3 days', 'ahmad', NULL, 1, 1, 1, 1),
(32, 10, 0, 47, '', '500', 'Full', '3 days', NULL, NULL, 1, 1, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `supplier_proposal_details`
--
CREATE TABLE `supplier_proposal_details` (
`id` int(10) UNSIGNED NOT NULL,
`propsal_id` int(11) NOT NULL,
`sub_materials_id` int(11) NOT NULL,
`price` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`model_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `supplier_proposal_details`
--
INSERT INTO `supplier_proposal_details` (`id`, `propsal_id`, `sub_materials_id`, `price`, `model_number`, `description`) VALUES
(1, 1, 3, '200', '432erw', '534tervt esr ts t'),
(2, 1, 4, '500', '534rewr', 'ertsertset ert et ert'),
(3, 2, 5, '50', 'df213', 'sdafasd'),
(4, 3, 9, '500', 'df3424', 'gfsd sdfg sfg'),
(5, 3, 10, '2500', 'wer234', 'sdfg er tsdfgsdf re'),
(6, 4, 14, '765', '756', '7nju'),
(7, 4, 15, '56756', '7657', 'dh'),
(8, 5, 18, '4500', '231', '234gfe'),
(9, 5, 19, '6000', NULL, 'terwt');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`user_type` int(11) NOT NULL,
`is_approved` int(11) NOT NULL DEFAULT '0',
`is_approved2` int(11) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`, `user_type`, `is_approved`, `is_approved2`) VALUES
(3, 'miqdad', 'mekdad_da@yahoo.com', '$2y$10$6dzAmQrk1btSz9pONN9HlOb/7LJCx9853hJjXTJfZ4MTVMq/oagvC', 'kW6ywqgccdlBsKHRhucsxjTQ0Q0pnK4brZqvRAJq', '2017-12-27 02:01:31', '2018-09-09 01:54:13', 1, 1, 1),
(2, 'miqdad abu ateleh', 'abo.ateleh@gmail.com', '$2y$10$rAWeO62hA2OSMKXf2uvl/eKnoHbSHQF59AGAnqrdYw6T/pJ3rYslC', '3wwZe30yVAUOsZ4iivn1Izmje01djplG59uz1P40TomxKOzXjotFcbP01ZFe', '2017-12-25 20:00:00', '2018-01-02 08:19:26', 1, 1, 1),
(4, 'hussein shareef', 'husseinshareef1@yahoo.com', '$2y$10$CZnjaeNzsfudvbp/ICYJFesbAcoGfOKFIVfOVevnuUyqmQxiSnIaC', 'j1mi4AWP9MGy4y4jQK2R2Q6hT4StWL3NKssvGabH', '2017-12-27 02:02:37', '2018-01-02 03:54:14', 1, 1, 1),
(5, 'ali saleem', 'ali@abc-gcc.com', '$2y$10$iYZ//CX6kVyXlpmm3kASMervl1p8jPnff1XrPX.AnzGy0A.hhNrU2', 'lJ5RFLzFPD6KQa8ZY6TqzYvzPhwez61mgbZ8dXHA', '2017-12-27 02:03:41', '2017-12-27 02:03:41', 1, 1, 1),
(6, 'hussein shareef', 'husseinshareef1@gmail.com', '$2y$10$jOyrqmLREQhFErIFGdIxReSlfsFfN1e679ZWjQMRO6Ea8Pta1iLTa', '7RKODTvHwBJ3YIKYriQBsrg0vCRuDQ7V30NI07hr5Y2krJu9p0FQb8roSV0w', '2017-12-28 02:36:59', '2017-12-28 02:36:59', 2, 1, 1),
(7, 'ali mosa', 'ali_ahmad@gmail.com', '$2y$10$6RixHeW9uWGRbTLvuyWiIO6C4/IZBWJ48d3hfIkW596KBrSjERUUm', 'XOs4e119LPZuJ5FOYjO5Tcgi5ismPApi8oKYG9rjkOfNDzbVZ0BGOpIxA0CA', '2017-12-28 03:06:04', '2017-12-28 03:06:04', 3, 1, 1),
(8, 'fasd', 'fajen@abc-gcc.com', '$2y$10$OJKYYd0WqIS2OlmC9PRdSOlK6SevZ5XJRORomAtcd78mvxH50rAV6', 'j1mi4AWP9MGy4y4jQK2R2Q6hT4StWL3NKssvGabH', '2018-01-02 03:57:41', '2018-01-02 03:58:27', 1, 1, 1),
(9, 'qen samer', 'gen@abc-gcc.com', '$2y$10$MKnhpkPIC1HHZPNfPNSl6.1YYsrYsLpX0xW3ZXUNdzZgEDOn55..W', '2hnMMWCE9WYjBJmpspYQKWWzC0OoWF5XbwhVAgOteFtzZCAkIozSBAtJch9P', '2018-01-09 04:13:22', '2018-01-09 04:13:22', 1, 1, 1),
(10, 'miqdad mohammad', 'miqdad.mohammad@abc-gcc.com', '$2y$10$rAWeO62hA2OSMKXf2uvl/eKnoHbSHQF59AGAnqrdYw6T/pJ3rYslC', 'hFGt0cBypg36MYRBjFE9dWz3hnsmURHtcF2EsAf9c3sGyePPr1EloYxAN3t8', '2018-01-09 04:30:37', '2018-01-09 04:30:37', 2, 1, 1),
(13, 'abu abdallah', 'h.alkhateeb@gmail.com', '$2y$10$7FchuvrzDnIvN6QexebEr.y2kkRvmhyMBuaFg.LBscR4Iw8WwHeVa', NULL, '2018-09-17 06:25:12', '2018-09-17 06:25:12', 2, 1, 1),
(14, 'fasdfa', 'fsdf@das.com', '$2y$10$ZPlHibK0hQHMHo/ub23.fOafxNZTdHZUQhd9IHXJCk8pxWOSy1qdG', NULL, '2018-09-18 03:48:07', '2018-09-18 03:48:07', 2, 1, 1),
(15, 'omar', 'omarx12@gmail.com', '$2y$10$wTXaSqCXGiK.WVDx2Dkssed9mdG3fLxUApcXMHSJ//mSq7Ii3LRxm', NULL, '2018-09-22 08:28:04', '2018-09-22 08:28:04', 2, 1, 1),
(16, 'xsx', 'fsdfsxx@das.com', '$2y$10$6CDBSXZDuitK9oykGvqe2u64.dFhhfZXmjwkqjTIt3LOEoETdrfAW', NULL, '2018-10-11 05:47:04', '2018-10-11 05:47:04', 2, 1, 1),
(17, 'sssssss', 'umerxxx@abc-gcc.com', '$2y$10$4g2FPcJs4M6V2IwrEq/4FezC38KwVvLdrhDDaErb66NKTV4aG4KLi', NULL, '2018-10-11 05:48:04', '2018-10-11 05:48:04', 2, 1, 1),
(18, 'qqqqqqq', 'qqqq@q.com', '$2y$10$e0Y3fIBPBFA6T5fgV6tLpOgHq077vAccOgo1v7rlus2qpBvu60wyS', NULL, '2018-10-17 07:03:39', '2018-10-17 07:03:39', 2, 1, 1),
(19, 'User', 'user@abc-gcc.com', '$2y$10$SQ7n7Q2sQzq4KMbHFObaxO6rcXNAQleMjsUomTvfpPEdFQsw4Gmme', 'VcC1MDETpe0OEWY4zRy9dlAygX2Sv2h9DjFdau3O', '2018-10-31 04:53:17', '2018-10-31 04:53:17', 1, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `users_details`
--
CREATE TABLE `users_details` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`company_name` varchar(255) NOT NULL,
`phone_number` varchar(255) NOT NULL,
`phone_number2` varchar(255) DEFAULT NULL,
`country` int(11) NOT NULL,
`address` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users_details`
--
INSERT INTO `users_details` (`id`, `user_id`, `company_name`, `phone_number`, `phone_number2`, `country`, `address`) VALUES
(1, 6, 'ABC', '00971529777915', '543231', 224, 'Ajman , Al bustan'),
(2, 7, 'Menarits', '0962785024249', NULL, 224, 'souq al thahab'),
(3, 10, 'zen company', '052152454554', '140546465', 224, 'fasdfasd'),
(5, 13, 'hammar', '213123213', NULL, 164, 'anythng'),
(6, 14, 'fasd', '42314241234123', NULL, 2, 'adsf'),
(7, 15, 'omar company', '054525456', NULL, 169, 'ssss'),
(8, 16, 'ABC', '3123', '12312', 2, 'dfsa'),
(9, 17, 'sssss', '2312412432', '32412342134123', 2, 'ssssss'),
(10, 18, 'qqqq', '3212312', NULL, 2, 'qqqq');
-- --------------------------------------------------------
--
-- Table structure for table `users_general_info`
--
CREATE TABLE `users_general_info` (
`id` int(10) UNSIGNED NOT NULL,
`user_id` int(11) NOT NULL,
`age` int(11) NOT NULL,
`country` int(25) NOT NULL,
`material_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`gender` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users_general_info`
--
INSERT INTO `users_general_info` (`id`, `user_id`, `age`, `country`, `material_status`, `address`, `phone_number`, `gender`) VALUES
(1, 3, 27, 108, 'single', 'fads', '2314534', 'mail'),
(2, 5, 32, 224, 'single', 'fasd', '324523', 'mail'),
(3, 8, 32, 1, 'single', 'fsd', '234143432', 'femail'),
(4, 2, 20, 224, 'single', 'fasdfa', '0527999715', 'mail'),
(5, 9, 45, 224, 'single', 'asdf', '0527999715', 'mail'),
(6, 19, 20, 224, 'single', NULL, NULL, 'mail');
-- --------------------------------------------------------
--
-- Table structure for table `users_work_info`
--
CREATE TABLE `users_work_info` (
`id` int(10) UNSIGNED NOT NULL,
`user_id` int(11) NOT NULL,
`position_id` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users_work_info`
--
INSERT INTO `users_work_info` (`id`, `user_id`, `position_id`) VALUES
(1, 3, 0),
(2, 5, 1),
(3, 8, 1),
(4, 9, 2),
(5, 19, 4);
-- --------------------------------------------------------
--
-- Table structure for table `work_zone`
--
CREATE TABLE `work_zone` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `work_zone`
--
INSERT INTO `work_zone` (`id`, `title`, `location`) VALUES
(1, 'xxxxxxxxxxxxxxxxxx', 's'),
(2, 'schools', 'w'),
(3, 'mPower', 'e'),
(4, 'meqdad', '3'),
(5, 'dubai Land', 'dubai , mohammad ben rashed street'),
(9, 'al horya school', 'amman ,jordan');
-- --------------------------------------------------------
--
-- Table structure for table `work_zone_rules`
--
CREATE TABLE `work_zone_rules` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`work_zone_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `work_zone_rules`
--
INSERT INTO `work_zone_rules` (`id`, `user_id`, `work_zone_id`) VALUES
(17, 9, 3),
(18, 9, 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `boq`
--
ALTER TABLE `boq`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `boq_accessories`
--
ALTER TABLE `boq_accessories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `boq_status`
--
ALTER TABLE `boq_status`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `boq_sub_materials`
--
ALTER TABLE `boq_sub_materials`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `carts`
--
ALTER TABLE `carts`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cart_items`
--
ALTER TABLE `cart_items`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cc_emails`
--
ALTER TABLE `cc_emails`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `country`
--
ALTER TABLE `country`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `decline_replay`
--
ALTER TABLE `decline_replay`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `gml`
--
ALTER TABLE `gml`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `inquiry_extend`
--
ALTER TABLE `inquiry_extend`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `material_inquiry`
--
ALTER TABLE `material_inquiry`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `material_inquiry_materials`
--
ALTER TABLE `material_inquiry_materials`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `material_inquiry_suppliers`
--
ALTER TABLE `material_inquiry_suppliers`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `material_requisition`
--
ALTER TABLE `material_requisition`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `notification_users`
--
ALTER TABLE `notification_users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `positions`
--
ALTER TABLE `positions`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `position_rules`
--
ALTER TABLE `position_rules`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `position_id` (`position_id`,`screen_id`);
--
-- Indexes for table `proposal_reply`
--
ALTER TABLE `proposal_reply`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `requisition_accessory`
--
ALTER TABLE `requisition_accessory`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `requisition_materials`
--
ALTER TABLE `requisition_materials`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rules`
--
ALTER TABLE `rules`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `user_id` (`user_id`,`screen_id`);
--
-- Indexes for table `scl`
--
ALTER TABLE `scl`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `scr`
--
ALTER TABLE `scr`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `screens`
--
ALTER TABLE `screens`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `scr_sub_category`
--
ALTER TABLE `scr_sub_category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `subcontractor_agreement`
--
ALTER TABLE `subcontractor_agreement`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `subcontractor_category`
--
ALTER TABLE `subcontractor_category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `subcontractor_decline`
--
ALTER TABLE `subcontractor_decline`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `subcontractor_proposal`
--
ALTER TABLE `subcontractor_proposal`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `subcontractor_proposal_details`
--
ALTER TABLE `subcontractor_proposal_details`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `subcontractor_request`
--
ALTER TABLE `subcontractor_request`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sub_gml`
--
ALTER TABLE `sub_gml`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sub_scl`
--
ALTER TABLE `sub_scl`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sub_work_zone`
--
ALTER TABLE `sub_work_zone`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `supplier_agreement`
--
ALTER TABLE `supplier_agreement`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `supplier_agreement_decline`
--
ALTER TABLE `supplier_agreement_decline`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `supplier_decline`
--
ALTER TABLE `supplier_decline`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `supplier_materials`
--
ALTER TABLE `supplier_materials`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `supplier_id` (`supplier_id`,`submaterila_id`);
--
-- Indexes for table `supplier_proposal`
--
ALTER TABLE `supplier_proposal`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `supplier_proposal_details`
--
ALTER TABLE `supplier_proposal_details`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users_details`
--
ALTER TABLE `users_details`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users_general_info`
--
ALTER TABLE `users_general_info`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users_work_info`
--
ALTER TABLE `users_work_info`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `work_zone`
--
ALTER TABLE `work_zone`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `work_zone_rules`
--
ALTER TABLE `work_zone_rules`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `boq`
--
ALTER TABLE `boq`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=59;
--
-- AUTO_INCREMENT for table `boq_accessories`
--
ALTER TABLE `boq_accessories`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `boq_status`
--
ALTER TABLE `boq_status`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `boq_sub_materials`
--
ALTER TABLE `boq_sub_materials`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78;
--
-- AUTO_INCREMENT for table `carts`
--
ALTER TABLE `carts`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cart_items`
--
ALTER TABLE `cart_items`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `cc_emails`
--
ALTER TABLE `cc_emails`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `country`
--
ALTER TABLE `country`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=240;
--
-- AUTO_INCREMENT for table `decline_replay`
--
ALTER TABLE `decline_replay`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `gml`
--
ALTER TABLE `gml`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `inquiry_extend`
--
ALTER TABLE `inquiry_extend`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `material_inquiry`
--
ALTER TABLE `material_inquiry`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48;
--
-- AUTO_INCREMENT for table `material_inquiry_materials`
--
ALTER TABLE `material_inquiry_materials`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=147;
--
-- AUTO_INCREMENT for table `material_inquiry_suppliers`
--
ALTER TABLE `material_inquiry_suppliers`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `material_requisition`
--
ALTER TABLE `material_requisition`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;
--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48;
--
-- AUTO_INCREMENT for table `notification_users`
--
ALTER TABLE `notification_users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=68;
--
-- AUTO_INCREMENT for table `positions`
--
ALTER TABLE `positions`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `position_rules`
--
ALTER TABLE `position_rules`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;
--
-- AUTO_INCREMENT for table `proposal_reply`
--
ALTER TABLE `proposal_reply`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `requisition_accessory`
--
ALTER TABLE `requisition_accessory`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `requisition_materials`
--
ALTER TABLE `requisition_materials`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `rules`
--
ALTER TABLE `rules`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=99;
--
-- AUTO_INCREMENT for table `scl`
--
ALTER TABLE `scl`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `scr`
--
ALTER TABLE `scr`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `screens`
--
ALTER TABLE `screens`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `scr_sub_category`
--
ALTER TABLE `scr_sub_category`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `subcontractor_agreement`
--
ALTER TABLE `subcontractor_agreement`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subcontractor_category`
--
ALTER TABLE `subcontractor_category`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subcontractor_decline`
--
ALTER TABLE `subcontractor_decline`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subcontractor_proposal`
--
ALTER TABLE `subcontractor_proposal`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subcontractor_proposal_details`
--
ALTER TABLE `subcontractor_proposal_details`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subcontractor_request`
--
ALTER TABLE `subcontractor_request`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `sub_gml`
--
ALTER TABLE `sub_gml`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `sub_scl`
--
ALTER TABLE `sub_scl`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `sub_work_zone`
--
ALTER TABLE `sub_work_zone`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67;
--
-- AUTO_INCREMENT for table `supplier_agreement`
--
ALTER TABLE `supplier_agreement`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `supplier_agreement_decline`
--
ALTER TABLE `supplier_agreement_decline`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `supplier_decline`
--
ALTER TABLE `supplier_decline`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `supplier_materials`
--
ALTER TABLE `supplier_materials`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT for table `supplier_proposal`
--
ALTER TABLE `supplier_proposal`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT for table `supplier_proposal_details`
--
ALTER TABLE `supplier_proposal_details`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `users_details`
--
ALTER TABLE `users_details`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `users_general_info`
--
ALTER TABLE `users_general_info`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `users_work_info`
--
ALTER TABLE `users_work_info`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `work_zone`
--
ALTER TABLE `work_zone`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `work_zone_rules`
--
ALTER TABLE `work_zone_rules`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
/*!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 */;
| true |
4eaceb98fd570a0c82e7d1287c04b22f9c5204c6 | SQL | JohnLizana/Google-Auth | /users.sql | UTF-8 | 1,705 | 2.859375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 12-10-2018 a las 20:04:39
-- Versión del servidor: 5.7.23
-- Versión de PHP: 7.2.10
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: `googleauth`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(45) COLLATE utf8_spanish_ci DEFAULT NULL,
`email` varchar(120) COLLATE utf8_spanish_ci DEFAULT NULL,
`password` varchar(200) COLLATE utf8_spanish_ci DEFAULT NULL,
`name` varchar(100) COLLATE utf8_spanish_ci DEFAULT NULL,
`google_auth_code` varchar(16) COLLATE utf8_spanish_ci DEFAULT NULL,
PRIMARY KEY (`uid`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `users`
--
INSERT INTO `users` (`uid`, `username`, `email`, `password`, `name`, `google_auth_code`) VALUES
(1, 'JohnL', 'john.lizana.96@gmail.com', '54d5cb2d332dbdb4850293caae4559ce88b65163f1ea5d4e4b3ac49d772ded14', 'John Lizana', 'W6G7FBTPEELJNELO');
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 */;
| true |
a5f980bebfa814ae4b7f13c91cf16f78eff6b2a8 | SQL | jyotipixolo/Attendance-Management | /attendance_management.sql | UTF-8 | 8,361 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 04, 2016 at 09:44 AM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.4
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: `attendance_management`
--
-- --------------------------------------------------------
--
-- Table structure for table `subject`
--
CREATE TABLE `subject` (
`sub_id` int(6) NOT NULL,
`subject` varchar(13) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `subject`
--
INSERT INTO `subject` (`sub_id`, `subject`) VALUES
(1, 'PHYSICS'),
(2, 'CHEMISTRY'),
(3, 'MATHEMATICS'),
(4, 'STATITSTICS'),
(5, 'ZOOLOGY'),
(6, 'BOTANY'),
(7, 'MICROBIOLOGY'),
(8, 'BIOTECHNOLOGY'),
(9, 'GEOLOGY'),
(10, 'BIOCHEMISTRY'),
(11, 'COMP SC'),
(12, 'FC'),
(13, 'ECONOMICS'),
(14, 'ACCOUNTS'),
(15, 'COMMERCE'),
(16, 'EVS'),
(17, 'BUSI COMM'),
(18, 'LAW'),
(19, 'FIN ACC'),
(20, 'TAX'),
(21, 'IAPM'),
(22, 'COMP'),
(23, 'EXPORT'),
(24, 'ADVT'),
(25, 'COSTING');
-- --------------------------------------------------------
--
-- Table structure for table `subject_paper`
--
CREATE TABLE `subject_paper` (
`csp_id` int(6) NOT NULL,
`comb_id` int(7) DEFAULT NULL,
`sub_id` int(6) DEFAULT NULL,
`paper_id` varchar(8) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `subject_paper`
--
INSERT INTO `subject_paper` (`csp_id`, `comb_id`, `sub_id`, `paper_id`) VALUES
(1, 1, 1, 'I'),
(2, 1, 1, 'II'),
(3, 1, 1, 'PR'),
(4, 1, 2, 'I'),
(5, 1, 2, 'II'),
(6, 1, 2, 'PR'),
(7, 1, 3, 'I'),
(8, 1, 3, 'II'),
(9, 1, 3, 'TUT'),
(10, 1, 12, ''),
(11, 2, 1, 'I'),
(12, 2, 1, 'II'),
(13, 2, 1, 'PR'),
(14, 2, 3, 'I'),
(15, 2, 3, 'II'),
(16, 2, 3, 'TUT'),
(17, 2, 4, 'I'),
(18, 2, 4, 'II'),
(19, 2, 4, 'PR'),
(20, 2, 12, ''),
(21, 3, 1, 'I'),
(22, 3, 1, 'II'),
(23, 3, 1, 'PR'),
(24, 3, 3, 'I'),
(25, 3, 3, 'II'),
(26, 3, 3, 'TUT'),
(27, 3, 11, 'I'),
(28, 3, 11, 'II'),
(29, 3, 11, 'PR'),
(30, 3, 12, ''),
(31, 4, 2, 'I'),
(32, 4, 2, 'II'),
(33, 4, 2, 'PR'),
(34, 4, 6, 'I'),
(35, 4, 6, 'II'),
(36, 4, 6, 'PR'),
(37, 4, 5, 'I'),
(38, 4, 5, 'II'),
(39, 4, 5, 'PR'),
(40, 4, 12, ''),
(41, 5, 1, 'I'),
(42, 5, 1, 'II'),
(43, 5, 1, 'PR'),
(44, 5, 2, 'I'),
(45, 5, 2, 'II'),
(46, 5, 2, 'PR'),
(47, 5, 5, 'I'),
(48, 5, 5, 'II'),
(49, 5, 5, 'PR'),
(50, 5, 12, ''),
(51, 6, 1, 'I'),
(52, 6, 1, 'II'),
(53, 6, 1, 'PR'),
(54, 6, 2, 'I'),
(55, 6, 2, 'II'),
(56, 6, 2, 'PR'),
(57, 6, 6, 'I'),
(58, 6, 6, 'II'),
(59, 6, 6, 'PR'),
(60, 6, 12, ''),
(61, 7, 1, 'I'),
(62, 7, 1, 'II'),
(63, 7, 1, 'PR'),
(64, 7, 2, 'I'),
(65, 7, 2, 'II'),
(66, 7, 2, 'PR'),
(67, 7, 9, 'I'),
(68, 7, 9, 'II'),
(69, 7, 9, 'PR'),
(70, 7, 12, ' '),
(71, 8, 1, 'I'),
(72, 8, 1, 'II'),
(73, 8, 1, 'PR'),
(74, 8, 2, 'I'),
(75, 8, 2, 'II'),
(76, 8, 2, 'PR'),
(77, 8, 7, 'I'),
(78, 8, 7, 'II'),
(79, 8, 7, 'PR'),
(80, 8, 12, ''),
(81, 9, 2, 'I'),
(82, 9, 2, 'II'),
(83, 9, 2, 'PR'),
(84, 9, 6, 'I'),
(85, 9, 6, 'II'),
(86, 9, 6, 'PR'),
(87, 9, 8, 'I'),
(88, 9, 8, 'II'),
(89, 9, 8, 'PR'),
(90, 9, 12, ''),
(91, 10, 1, 'I'),
(92, 10, 1, 'II'),
(93, 10, 1, 'III'),
(94, 10, 1, 'PR'),
(95, 10, 3, 'I'),
(96, 10, 3, 'II'),
(97, 10, 3, 'III'),
(98, 10, 3, 'PR'),
(99, 10, 12, ''),
(100, 11, 3, 'I'),
(101, 11, 3, 'II'),
(102, 11, 3, 'III'),
(103, 11, 3, 'PR'),
(104, 11, 4, 'I'),
(105, 11, 4, 'II'),
(106, 11, 4, 'III'),
(107, 11, 4, 'PR'),
(108, 11, 12, ''),
(109, 12, 1, 'I'),
(110, 12, 1, 'II'),
(111, 12, 1, 'III'),
(112, 12, 1, 'PR'),
(113, 12, 9, 'I'),
(114, 12, 9, 'II'),
(115, 12, 9, 'III'),
(116, 12, 9, 'PR'),
(117, 12, 12, ''),
(118, 13, 2, 'I'),
(119, 13, 2, 'II'),
(120, 13, 2, 'III'),
(121, 13, 2, 'PR'),
(122, 13, 9, 'I'),
(123, 13, 9, 'II'),
(124, 13, 9, 'III'),
(125, 13, 9, 'PR'),
(126, 13, 12, ''),
(127, 14, 2, 'I'),
(128, 14, 2, 'II'),
(129, 14, 2, 'III'),
(130, 14, 2, 'PR'),
(131, 14, 7, 'I'),
(132, 14, 7, 'II'),
(133, 14, 7, 'III'),
(134, 14, 7, 'PR'),
(135, 14, 12, ''),
(136, 15, 1, 'I'),
(137, 15, 1, 'II'),
(138, 15, 1, 'III'),
(139, 15, 1, 'PR'),
(140, 15, 2, 'I'),
(141, 15, 2, 'II'),
(142, 15, 2, 'III'),
(143, 15, 2, 'PR'),
(144, 15, 12, ''),
(145, 16, 2, 'I'),
(146, 16, 2, 'II'),
(147, 16, 2, 'III'),
(148, 16, 2, 'PR'),
(149, 16, 5, 'I'),
(150, 16, 5, 'II'),
(151, 16, 5, 'III'),
(152, 16, 5, 'PR'),
(153, 16, 12, ''),
(154, 17, 2, 'I'),
(155, 17, 2, 'II'),
(156, 17, 2, 'III'),
(157, 17, 2, 'PR'),
(158, 17, 6, 'I'),
(159, 17, 6, 'II'),
(160, 17, 6, 'III'),
(161, 17, 6, 'PR'),
(162, 17, 12, ''),
(163, 18, 2, 'I'),
(164, 18, 2, 'II'),
(165, 18, 2, 'III'),
(166, 18, 2, 'PR'),
(167, 18, 8, 'I'),
(168, 18, 8, 'II'),
(169, 18, 8, 'III'),
(170, 18, 8, 'PR'),
(171, 18, 12, ''),
(172, 19, 1, 'I'),
(173, 19, 1, 'II'),
(174, 19, 1, 'III'),
(175, 19, 1, 'PR'),
(176, 19, 11, 'I'),
(177, 19, 11, 'II'),
(178, 19, 11, 'III'),
(179, 19, 11, 'PR'),
(180, 19, 12, ''),
(181, 20, 3, 'I'),
(182, 20, 3, 'II'),
(183, 20, 3, 'III'),
(184, 20, 3, 'PR'),
(185, 20, 11, 'I'),
(186, 20, 11, 'II'),
(187, 20, 11, 'III'),
(188, 20, 11, 'PR'),
(189, 20, 12, ''),
(190, 21, 1, 'I'),
(191, 21, 1, 'II'),
(192, 21, 1, 'III'),
(193, 21, 1, 'IV'),
(194, 21, 1, 'AC'),
(195, 22, 2, 'I'),
(196, 22, 2, 'II'),
(197, 22, 2, 'III'),
(198, 22, 2, 'IV'),
(199, 22, 2, 'AC'),
(200, 23, 3, 'I'),
(201, 23, 3, 'II'),
(202, 23, 3, 'III'),
(203, 23, 3, 'IV'),
(204, 23, 3, 'AC'),
(205, 24, 4, 'I'),
(206, 24, 4, 'II'),
(207, 24, 4, 'III'),
(208, 24, 4, 'IV'),
(209, 24, 4, 'AC'),
(210, 25, 5, 'I'),
(211, 25, 5, 'II'),
(212, 25, 5, 'III'),
(213, 25, 5, 'IV'),
(214, 25, 5, 'AC'),
(215, 26, 6, 'I'),
(216, 26, 6, 'II'),
(217, 26, 6, 'III'),
(218, 26, 6, 'IV'),
(219, 26, 6, 'AC'),
(220, 27, 7, 'I'),
(221, 27, 7, 'II'),
(222, 27, 7, 'III'),
(223, 27, 7, 'IV'),
(224, 27, 7, 'AC'),
(225, 28, 8, 'I'),
(226, 28, 8, 'II'),
(227, 28, 8, 'III'),
(228, 28, 8, 'IV'),
(229, 28, 8, 'AC'),
(230, 29, 9, 'I'),
(231, 29, 9, 'II'),
(232, 29, 9, 'III'),
(233, 29, 9, 'IV'),
(234, 29, 9, 'AC'),
(237, 30, 10, 'I'),
(238, 30, 10, 'II'),
(239, 30, 2, 'AC'),
(240, 31, 7, 'I'),
(241, 31, 7, 'II'),
(242, 31, 10, 'I'),
(243, 31, 10, 'II'),
(244, 31, 7, 'AC');
-- --------------------------------------------------------
--
-- Table structure for table `sub_combination`
--
CREATE TABLE `sub_combination` (
`comb_id` int(7) NOT NULL,
`sub_comb` varchar(9) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `sub_combination`
--
INSERT INTO `sub_combination` (`comb_id`, `sub_comb`) VALUES
(1, 'PH-CH-MT'),
(2, 'PH-MT-ST'),
(3, 'PH-MT-CS'),
(4, 'CH-BO-ZO'),
(5, 'PH-CH-ZO'),
(6, 'PH-CH-BO'),
(7, 'PH-CH-GE'),
(8, 'PH-CH-MI'),
(9, 'CH-BO-BT'),
(10, 'PH-MT'),
(11, 'MT-ST'),
(12, 'PH-GE'),
(13, 'CH-GE'),
(14, 'CH-MI'),
(15, 'PH-CH'),
(16, 'CH-ZO'),
(17, 'CH-BO'),
(18, 'CH-BT'),
(19, 'CH-MI'),
(20, 'PH-CS'),
(21, 'PH'),
(22, 'CH'),
(23, 'MT'),
(24, 'ST'),
(25, 'ZO'),
(26, 'BO'),
(27, 'BT'),
(28, 'GE'),
(29, 'MI'),
(30, 'CH-BI'),
(31, 'MI-BI'),
(32, 'BCOM1'),
(33, 'BCOM2-C'),
(34, 'BCOM2-A'),
(35, 'BCOM3-C'),
(36, 'BCOM3-E'),
(37, 'BCOM3-I');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `subject`
--
ALTER TABLE `subject`
ADD PRIMARY KEY (`sub_id`);
--
-- Indexes for table `subject_paper`
--
ALTER TABLE `subject_paper`
ADD PRIMARY KEY (`csp_id`),
ADD KEY `sub_id_fk` (`sub_id`),
ADD KEY `comb_id_fk` (`comb_id`);
--
-- Indexes for table `sub_combination`
--
ALTER TABLE `sub_combination`
ADD PRIMARY KEY (`comb_id`);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `subject_paper`
--
ALTER TABLE `subject_paper`
ADD CONSTRAINT `comb_id` FOREIGN KEY (`comb_id`) REFERENCES `sub_combination` (`comb_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `comb_id_fk` FOREIGN KEY (`comb_id`) REFERENCES `sub_combination` (`comb_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `sub_id_fk` FOREIGN KEY (`sub_id`) REFERENCES `subject` (`sub_id`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!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 */;
| true |
c55c4f93b96953057a04277d61e15fe82e16f6c9 | SQL | jriverar2020/SABD | /e. original_schema.sql | UTF-8 | 13,192 | 2.890625 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 11.7
-- Dumped by pg_dump version 12.2
-- Started on 2020-08-25 23:21:52
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
--
-- TOC entry 196 (class 1259 OID 32769)
-- Name: cliente; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.cliente (
dni character(9) NOT NULL,
nombre character varying(10),
apellidos character varying(30),
domicilio character(30),
telefono character varying(9)
);
ALTER TABLE public.cliente OWNER TO postgres;
--
-- TOC entry 197 (class 1259 OID 32772)
-- Name: empleado; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.empleado (
numreg integer NOT NULL,
nombre character varying(32),
incorporacion date,
sueldo integer,
cods integer
);
ALTER TABLE public.empleado OWNER TO postgres;
--
-- TOC entry 198 (class 1259 OID 32775)
-- Name: factura; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.factura (
codigof integer NOT NULL,
entrada date,
salida date,
dni character(9),
numero integer NOT NULL,
supletoria integer,
forma character varying(8) NOT NULL,
total real
);
ALTER TABLE public.factura OWNER TO postgres;
--
-- TOC entry 199 (class 1259 OID 32778)
-- Name: factura_prov; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.factura_prov (
codfp integer NOT NULL,
fecha date,
importe integer,
nif character varying(10) NOT NULL,
numreg integer NOT NULL
);
ALTER TABLE public.factura_prov OWNER TO postgres;
--
-- TOC entry 200 (class 1259 OID 32781)
-- Name: formapago; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.formapago (
forma character varying(8) NOT NULL,
comision integer,
CONSTRAINT formapago_forma_check CHECK (((forma)::text = ANY (ARRAY[('efectivo'::character varying)::text, ('tarjeta'::character varying)::text, ('talon'::character varying)::text])))
);
ALTER TABLE public.formapago OWNER TO postgres;
--
-- TOC entry 201 (class 1259 OID 32785)
-- Name: habitacion; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.habitacion (
numero integer NOT NULL,
superficie integer,
bar character(2),
terraza character(2),
puedesupletoria character(2),
tipo character varying(10) NOT NULL,
CONSTRAINT habitacion_bar_check CHECK ((bar = ANY (ARRAY['SI'::bpchar, 'NO'::bpchar]))),
CONSTRAINT habitacion_puedesupletoria_check CHECK ((puedesupletoria = ANY (ARRAY['SI'::bpchar, 'NO'::bpchar]))),
CONSTRAINT habitacion_terraza_check CHECK ((terraza = ANY (ARRAY['SI'::bpchar, 'NO'::bpchar])))
);
ALTER TABLE public.habitacion OWNER TO postgres;
--
-- TOC entry 202 (class 1259 OID 32791)
-- Name: incluye; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.incluye (
codigof integer NOT NULL,
cods integer NOT NULL,
coste integer,
fecha date NOT NULL
);
ALTER TABLE public.incluye OWNER TO postgres;
--
-- TOC entry 203 (class 1259 OID 32794)
-- Name: limpieza; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.limpieza (
numreg integer NOT NULL,
numero integer NOT NULL,
fecha date NOT NULL
);
ALTER TABLE public.limpieza OWNER TO postgres;
--
-- TOC entry 204 (class 1259 OID 32797)
-- Name: precio; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.precio (
tipo character varying(10) NOT NULL,
precio integer,
CONSTRAINT precio_tipo_check CHECK (((tipo)::text = ANY (ARRAY[('individual'::character varying)::text, ('doble'::character varying)::text])))
);
ALTER TABLE public.precio OWNER TO postgres;
--
-- TOC entry 205 (class 1259 OID 32801)
-- Name: proveedor; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.proveedor (
nif character varying(10) NOT NULL,
nombre character varying(16),
direccion character(30),
numreg integer NOT NULL
);
ALTER TABLE public.proveedor OWNER TO postgres;
--
-- TOC entry 206 (class 1259 OID 32804)
-- Name: reserva; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.reserva (
dni character(9) NOT NULL,
numero integer NOT NULL,
entrada date,
salida date
);
ALTER TABLE public.reserva OWNER TO postgres;
--
-- TOC entry 207 (class 1259 OID 32807)
-- Name: servicio; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.servicio (
cods integer NOT NULL,
descripcion character(15),
costeinterno integer,
numreg integer NOT NULL,
CONSTRAINT servicio_descripcion_check CHECK ((descripcion = ANY (ARRAY['tintoreria'::bpchar, 'plancha'::bpchar, 'lavanderia'::bpchar, 'bar'::bpchar, 'restaurante'::bpchar, 'floristeria'::bpchar])))
);
ALTER TABLE public.servicio OWNER TO postgres;
--
-- TOC entry 208 (class 1259 OID 32811)
-- Name: usa; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.usa (
cods integer NOT NULL,
servicio_cods integer NOT NULL,
fecha date NOT NULL
);
ALTER TABLE public.usa OWNER TO postgres;
--
-- TOC entry 2738 (class 2606 OID 32815)
-- Name: cliente cliente_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.cliente
ADD CONSTRAINT cliente_pkey PRIMARY KEY (dni);
--
-- TOC entry 2740 (class 2606 OID 32817)
-- Name: empleado empleado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.empleado
ADD CONSTRAINT empleado_pkey PRIMARY KEY (numreg);
--
-- TOC entry 2742 (class 2606 OID 32819)
-- Name: factura factura_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.factura
ADD CONSTRAINT factura_pkey PRIMARY KEY (codigof);
--
-- TOC entry 2744 (class 2606 OID 32821)
-- Name: factura_prov factura_prov_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.factura_prov
ADD CONSTRAINT factura_prov_pkey PRIMARY KEY (codfp);
--
-- TOC entry 2746 (class 2606 OID 32823)
-- Name: formapago formapago_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.formapago
ADD CONSTRAINT formapago_pkey PRIMARY KEY (forma);
--
-- TOC entry 2748 (class 2606 OID 32825)
-- Name: habitacion habitacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.habitacion
ADD CONSTRAINT habitacion_pkey PRIMARY KEY (numero);
--
-- TOC entry 2750 (class 2606 OID 32827)
-- Name: incluye incluye_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.incluye
ADD CONSTRAINT incluye_pkey PRIMARY KEY (codigof, cods, fecha);
--
-- TOC entry 2752 (class 2606 OID 32829)
-- Name: limpieza limpieza_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.limpieza
ADD CONSTRAINT limpieza_pkey PRIMARY KEY (numreg, numero, fecha);
--
-- TOC entry 2754 (class 2606 OID 32831)
-- Name: precio precio_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.precio
ADD CONSTRAINT precio_pkey PRIMARY KEY (tipo);
--
-- TOC entry 2756 (class 2606 OID 32833)
-- Name: proveedor proveedor_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.proveedor
ADD CONSTRAINT proveedor_pkey PRIMARY KEY (nif);
--
-- TOC entry 2758 (class 2606 OID 32835)
-- Name: reserva reserva_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.reserva
ADD CONSTRAINT reserva_pkey PRIMARY KEY (dni, numero);
--
-- TOC entry 2760 (class 2606 OID 32837)
-- Name: servicio servicio_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.servicio
ADD CONSTRAINT servicio_pkey PRIMARY KEY (cods);
--
-- TOC entry 2762 (class 2606 OID 32839)
-- Name: usa usa_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.usa
ADD CONSTRAINT usa_pkey PRIMARY KEY (cods, servicio_cods, fecha);
--
-- TOC entry 2763 (class 2606 OID 32840)
-- Name: empleado empleado_cods_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.empleado
ADD CONSTRAINT empleado_cods_fkey FOREIGN KEY (cods) REFERENCES public.servicio(cods);
--
-- TOC entry 2764 (class 2606 OID 32845)
-- Name: factura factura_dni_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.factura
ADD CONSTRAINT factura_dni_fkey FOREIGN KEY (dni) REFERENCES public.cliente(dni) ON UPDATE CASCADE;
--
-- TOC entry 2765 (class 2606 OID 32850)
-- Name: factura factura_forma_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.factura
ADD CONSTRAINT factura_forma_fkey FOREIGN KEY (forma) REFERENCES public.formapago(forma) ON UPDATE CASCADE;
--
-- TOC entry 2766 (class 2606 OID 32855)
-- Name: factura factura_numero_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.factura
ADD CONSTRAINT factura_numero_fkey FOREIGN KEY (numero) REFERENCES public.habitacion(numero) ON UPDATE CASCADE;
--
-- TOC entry 2767 (class 2606 OID 32860)
-- Name: factura_prov factura_prov_nif_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.factura_prov
ADD CONSTRAINT factura_prov_nif_fkey FOREIGN KEY (nif) REFERENCES public.proveedor(nif) ON UPDATE CASCADE;
--
-- TOC entry 2768 (class 2606 OID 32865)
-- Name: factura_prov factura_prov_numreg_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.factura_prov
ADD CONSTRAINT factura_prov_numreg_fkey FOREIGN KEY (numreg) REFERENCES public.empleado(numreg);
--
-- TOC entry 2769 (class 2606 OID 32870)
-- Name: habitacion habitacion_tipo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.habitacion
ADD CONSTRAINT habitacion_tipo_fkey FOREIGN KEY (tipo) REFERENCES public.precio(tipo) ON UPDATE CASCADE;
--
-- TOC entry 2770 (class 2606 OID 32875)
-- Name: incluye incluye_codigof_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.incluye
ADD CONSTRAINT incluye_codigof_fkey FOREIGN KEY (codigof) REFERENCES public.factura(codigof) ON UPDATE CASCADE;
--
-- TOC entry 2771 (class 2606 OID 32880)
-- Name: incluye incluye_cods_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.incluye
ADD CONSTRAINT incluye_cods_fkey FOREIGN KEY (cods) REFERENCES public.servicio(cods) ON UPDATE CASCADE;
--
-- TOC entry 2772 (class 2606 OID 32885)
-- Name: limpieza limpieza_numero_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.limpieza
ADD CONSTRAINT limpieza_numero_fkey FOREIGN KEY (numero) REFERENCES public.habitacion(numero) ON UPDATE CASCADE;
--
-- TOC entry 2773 (class 2606 OID 32890)
-- Name: limpieza limpieza_numreg_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.limpieza
ADD CONSTRAINT limpieza_numreg_fkey FOREIGN KEY (numreg) REFERENCES public.empleado(numreg) ON UPDATE CASCADE;
--
-- TOC entry 2774 (class 2606 OID 32895)
-- Name: proveedor proveedor_numreg_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.proveedor
ADD CONSTRAINT proveedor_numreg_fkey FOREIGN KEY (numreg) REFERENCES public.empleado(numreg) ON UPDATE CASCADE;
--
-- TOC entry 2775 (class 2606 OID 32900)
-- Name: reserva reserva_dni_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.reserva
ADD CONSTRAINT reserva_dni_fkey FOREIGN KEY (dni) REFERENCES public.cliente(dni) ON UPDATE CASCADE;
--
-- TOC entry 2776 (class 2606 OID 32905)
-- Name: reserva reserva_numero_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.reserva
ADD CONSTRAINT reserva_numero_fkey FOREIGN KEY (numero) REFERENCES public.habitacion(numero) ON UPDATE CASCADE;
--
-- TOC entry 2777 (class 2606 OID 32910)
-- Name: servicio servicio_numreg_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.servicio
ADD CONSTRAINT servicio_numreg_fkey FOREIGN KEY (numreg) REFERENCES public.empleado(numreg) ON UPDATE CASCADE;
--
-- TOC entry 2778 (class 2606 OID 32915)
-- Name: usa usa_cods_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.usa
ADD CONSTRAINT usa_cods_fkey FOREIGN KEY (cods) REFERENCES public.servicio(cods);
--
-- TOC entry 2779 (class 2606 OID 32920)
-- Name: usa usa_servicio_cods_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.usa
ADD CONSTRAINT usa_servicio_cods_fkey FOREIGN KEY (servicio_cods) REFERENCES public.servicio(cods);
-- Completed on 2020-08-25 23:21:52
--
-- PostgreSQL database dump complete
--
| true |
3782d5b3d20f55062237917c5133d190424e6231 | SQL | mazayazyn/tugas1_sivaksin_1906399000 | /sivaksin.sql | UTF-8 | 1,251 | 3.25 | 3 | [] | no_license | CREATE TABLE faskes (
id int not null AUTO_INCREMENT,
id_vaksin int not null,
nama varchar(50),
kuota int,
jam_mulai varchar(5),
jam_tutup varchar(5),
provinsi varchar(50),
kabupaten varchar(50),
PRIMARY KEY (id),
FOREIGN KEY (id_vaksin) REFERENCES vaksin(id)
);
CREATE TABLE vaksin (
jenis varchar(50),
asal_negara varchar(50),
efikasi double,
id int not null AUTO_INCREMENT,
PRIMARY KEY (id)
);
CREATE TABLE pasien (
id int not null AUTO_INCREMENT,
jenis_kelamin varchar(50),
tanggal_lahir date,
nik varchar(30) UNIQUE,
pekerjaan varchar(30),
tempat_lahir varchar(20),
nama varchar(50),
nomor_telepon varchar(30),
PRIMARY KEY (id),
FOREIGN KEY (id_faskes) REFERENCES faskes(id)
);
CREATE TABLE dokter (
id int not null AUTO_INCREMENT,
nip varchar(30) UNIQUE,
nomor_telepon varchar(30),
nama varchar(50),
PRIMARY KEY (id),
FOREIGN KEY (id_vaksin) REFERENCES vaksin(id)
);
CREATE TABLE disuntik (
batch_id varchar(13) PRIMARY KEY,
waktu_suntik varchar(5),
id_pasien int not null,
id_dokter int not null,
FOREIGN KEY (id_pasien) REFERENCES pasien(id),
FOREIGN KEY (id_dokter) REFERENCES dokter(id)
); | true |
7c25035b38b564be576461c1120467738d223a9b | SQL | eras0r/example-app-rest-api-php | /sql/create-schema.sql | UTF-8 | 282 | 2.734375 | 3 | [
"MIT"
] | permissive | --
-- Table structure for table `brand`
--
CREATE TABLE IF NOT EXISTS `brand` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET NOT NULL,
`country` varchar(255) CHARACTER SET NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | true |
19953a66583e9e33963a8cbef56c93f4b5f658a2 | SQL | askor2005/blagosfera | /Blagosfera/data-jpa/src/main/resources/mybatis_migrations/oldscripts/2015/09/20150910143607_add_for_custom_link.sql | UTF-8 | 1,366 | 3.078125 | 3 | [] | no_license | -- // add for custom link
-- Migration SQL that makes the change goes here.
-- Создание группы полей настроек профиля
do $$
begin
insert into fields_groups (id, internal_name, name, position, object_type, list_editor_item_id)
select nextval('seq_fields_groups'), 'SHARER_PROFILE_SETTINGS', 'Настройки профиля', 0, 'SHARER', null
where not exists(select 1 from fields_groups where internal_name = 'SHARER_PROFILE_SETTINGS');
end $$;
-- Создание поля короткой ссылки пользователя
do $$
declare
fieldsGroupId bigint;
begin
select id into fieldsGroupId from fields_groups where internal_name = 'SHARER_PROFILE_SETTINGS';
insert into fields (id, hideable, internal_name, name, position, fields_group_id, type, comment, example, hidden_by_default, is_unique, points, required, verified_editable, use_case, attached_file)
select nextval('seq_fields'), FALSE, 'SHARER_SHORT_LINK_NAME', 'Короткое имя участника для использования в символических ссылках', 7, fieldsGroupId, 0, '', '', FALSE, FALSE, 0, FALSE, FALSE, FALSE, FALSE
where not exists(select 1 from fields where internal_name = 'SHARER_SHORT_LINK_NAME' and fields_group_id = fieldsGroupId);
end $$;
-- //@UNDO
-- SQL to undo the change goes here.
| true |
55876079cc8176777fea9044a201870c751e40a6 | SQL | docXU/PointBook | /pointbook-server/sql构建文件/pointbook.sql | UTF-8 | 4,887 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | -- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: localhost Database: pointbook
-- ------------------------------------------------------
-- Server version 5.7.21-0ubuntu0.16.04.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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `contentimage`
--
DROP TABLE IF EXISTS `contentimage`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contentimage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`wid` int(11) NOT NULL,
`imgurl` varchar(150) NOT NULL,
`sequence` smallint(6) NOT NULL,
PRIMARY KEY (`id`),
KEY `wid` (`wid`)
) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `marker`
--
DROP TABLE IF EXISTS `marker`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `marker` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sid` varchar(15) NOT NULL DEFAULT '_',
`lat` float NOT NULL DEFAULT '0',
`lon` float NOT NULL DEFAULT '0',
`title` varchar(20) NOT NULL DEFAULT '未命名',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `sid` (`sid`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tbl_marker_tag`
--
DROP TABLE IF EXISTS `tbl_marker_tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tbl_marker_tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`mid` varchar(16) NOT NULL,
`uid` int(11) NOT NULL,
`content` varchar(16) DEFAULT NULL,
`create_time` int(11) NOT NULL,
`update_time` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tbl_user`
--
DROP TABLE IF EXISTS `tbl_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tbl_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(20) NOT NULL,
`sex` tinyint(4) DEFAULT NULL,
`age` varchar(10) DEFAULT NULL,
`address` varchar(64) DEFAULT NULL,
`password` varchar(32) NOT NULL,
`telephone` varchar(16) DEFAULT NULL,
`wechat_id` varchar(16) DEFAULT NULL,
`weibo_name` varchar(16) DEFAULT NULL,
`dangerous` tinyint(1) DEFAULT '0',
`username` varchar(20) NOT NULL,
`headimg` varchar(200) NOT NULL,
`describe` varchar(300) DEFAULT NULL,
`create_time` int(11) DEFAULT NULL,
`update_time` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tbl_user_email_uindex` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `weibo`
--
DROP TABLE IF EXISTS `weibo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `weibo` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL DEFAULT '0',
`sid` varchar(15) NOT NULL DEFAULT '0',
`username` char(14) NOT NULL DEFAULT 'xxw',
`headimg` varchar(150) NOT NULL,
`content` varchar(300) NOT NULL DEFAULT '......',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
`msglevel` char(16) NOT NULL DEFAULT 'the bigbang',
`likecount` int(11) unsigned NOT NULL DEFAULT '0',
`lowcount` int(10) unsigned NOT NULL DEFAULT '0',
`commentcount` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `sid` (`sid`)
) ENGINE=InnoDB AUTO_INCREMENT=165 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-05-15 19:41:40
| true |
66c0a0c2399f5af95425a040ed9e109e072ab8a9 | SQL | ollleg111/java-jdbc-grom | /src/main/sql/sql/CREATE_USERS_TABLE.sql | UTF-8 | 563 | 3.40625 | 3 | [] | no_license |
-- private long id;
-- private String userName;
-- private String password;
-- private String country;
-- private UserType userType;
-- private List orders;
CREATE TABLE USERS(
USERS_ID NUMBER,
CONSTRAINT USERS_PK PRIMARY KEY(USERS_ID),
USER_NAME NVARCHAR2(50) NOT NULL,
USER_PASS NVARCHAR2(50) NOT NULL,
USER_COUNTRY NVARCHAR2(50) NOT NULL,
USER_TYPE NVARCHAR2(5) DEFAULT 'USER' NOT NULL,
CHECK (USER_TYPE = 'ADMIN' OR USER_TYPE = 'USER')
);
--CHECK (USER_TYPE BETWEEN 'ADMIN' AND 'USER')
--CHECK (USER_TYPE = 'ADMIN' OR USER_TYPE = 'USER')
| true |
cd7a4ce106452f846feaef5b3cd101ca1c05e269 | SQL | rldutch1/sql_repo | /MySQL/alter_table.sql | UTF-8 | 2,802 | 4.03125 | 4 | [] | no_license | -- Rename a table column named tasklist to entry.
ALTER TABLE tablename CHANGE column1 column1newname MEDIUMTEXT NOT NULL
-- ALTER THE COLUMN DEFINITION
alter table tablename modify column1 timestamp not null default current_timestamp on update current_timestamp
-- ALTER TABLE COMMENT
ALTER TABLE `weapons` CHANGE `active_ind` `active_ind` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' COMMENT '1 Disposed, 0 Not Disposed'
/*
Note: Everything after the column name is ths same as
creating a column.
Also you can use "change" instead of modify.
*/
-- Adding a colum to a table:
ALTER TABLE tablename add column columnname varchar(100) not null after id;
-- Making a column unique:
ALTER TABLE tablename add unique (column1);
-- Giving the unique index a name:
ALTER TABLE tablename add unique uniquename (column1);
-- Create a unique index with a name and a comment (MySQL v8):
CREATE UNIQUE INDEX `idx_videos_videoname` ON `videos`.`videos` (videoname) COMMENT 'Unique videoname' ALGORITHM DEFAULT LOCK DEFAULT
/*
Also you might get ERROR 1062 Duplicate entry '' for key ??? if
the column you are trying to make unique, already has duplicate data. This includes
NULL and spaces.
*/
-- Removing the unique index:
ALTER TABLE tablename drop index column1; /* <-- Notice the missing parenthesis. */
-- Rename a MySQL table. The "to" keyword is part of the command.
rename table oldtable to newtable;
-- Rename a Database;
For InnoDB, the following seems to work: create the new empty database, then rename each table in turn into the new database:
RENAME TABLE old_db.table TO new_db.table;
You will need to adjust the permissions after that.
For scripting in a shell, you can use either of the following:
mysql -u username -ppassword old_db -sNe 'show tables' | while read table; \
do mysql -u username -ppassword -sNe "rename table old_db.$table to new_db.$table"; done
Or
for table in `mysql -u root -s -N -e "show tables from old_db"\`; do mysql -u root -s -N -e "rename table old_db.$table to new_db.$table"; done;`
Notes: there is no space between the option -p and the password. If your database has no password, remove the -u username -ppassword part.
Also, if you have stored procedures, you can copy them afterwards:
mysqldump -R old_db | mysql new_db
-- Remove the primary key:
-- Without an index, maintaining an autoincrement column becomes too expensive, that's why MySQL requires an autoincrement column to be a leftmost part of an index.
-- You should remove the autoincrement property before dropping the key:
ALTER TABLE tablename MODIFY id INT NOT NULL; -- Removing autoincrement.
ALTER TABLE tablename DROP PRIMARY KEY;
-- Set field value to default to nothing instead of NULL:
alter table ffl_customers modify address2 varchar(100) null default "";
| true |
16e44614b6142bf4eb7702561920352f9ce61ca6 | SQL | ehullander/PSQL | /SQL/social.sql | UTF-8 | 2,458 | 4.21875 | 4 | [] | no_license | --1.
SELECT CONCAT(DATE_PART('day', tmstmp), '-',
DATE_PART('month', tmstmp), '-',
DATE_PART('year', tmstmp)) AS date,
COUNT(*)
FROM registrations
GROUP BY date
-- DATE_PART('day', tmstmp),
-- DATE_PART('month', tmstmp),
-- DATE_PART('year', tmstmp);
ORDER BY date;
--ORDER BY tmstmp;
--2.
SELECT DATE_PART('dow', tmstmp) as weekday,
COUNT(*)
FROM registrations
GROUP BY weekday
-- DATE_PART('day', tmstmp),
-- DATE_PART('month', tmstmp),
-- DATE_PART('year', tmstmp);
ORDER BY weekday;
--3.
WITH
U AS (
SELECT DISTINCT userid
FROM LOGINS
),
R AS (
SELECT *
FROM LOGINS
WHERE tmstmp BETWEEN '2014-08-07' and '2014-08-14'
)
SELECT *
FROM U
LEFT JOIN R
ON U.userid=R.userid
LEFT JOIN optout
ON optout.userid = U.userid
WHERE tmstmp IS NULL
AND optout.userid IS NULL
;
--4.
WITH
Reg_Day AS (
SELECT userid, CONCAT(DATE_PART('day', tmstmp), '-',
DATE_PART('month', tmstmp), '-',
DATE_PART('year', tmstmp)) AS date
from registrations
)
SELECT R1.userid, count(*) FROM Reg_Day R1
JOIN Reg_Day R2
ON R1.date=R2.date Group by R1.userid;
--5.
--Select logins join test_group on userid where grp A
--WITH
-- web_mobile AS (
SELECT logins.userid,
avg(CASE WHEN type='mobile' Then -1
ELSE 1
END)
FROM logins
JOIN test_group ON logins.userid=test_group.userid
WHERE test_group.grp='A' group by logins.userid;
--)
--SELECT count(web_mobile.avg) from web_mobile
--where web_mobile.avg > 0
--6.
-- messages
-- where sender + where recipient
WITH reverse AS (
SELECT recipient, sender
FROM messages
)
SELECT U.sender, COUNT(U.sender)
FROM (SELECT sender, recipient FROM messages
UNION ALL
SELECT * FROM reverse) AS U
GROUP BY U.sender;
--7.
WITH reverse AS (
SELECT recipient, sender, char_length(message) AS m_len
FROM messages
),
Amax AS (
SELECT P.A, MAX(P.SUM) as MAX1
FROM
(SELECT U.sender AS A, U.recipient AS B, SUM(U.m_len)
FROM (SELECT sender, recipient, char_length(message) AS m_len FROM messages
UNION ALL
SELECT * FROM reverse) AS U
GROUP BY U.sender, U.recipient
ORDER BY A) AS P
GROUP BY P.A
),
A AS (
SELECT U.sender AS A, U.recipient AS B, SUM(U.m_len) as SUM1
FROM (SELECT sender, recipient, char_length(message) AS m_len FROM messages
UNION ALL
SELECT * FROM reverse) AS U
GROUP BY U.sender, U.recipient
ORDER BY A
)
select *
from A
join Amax on Amax.A=A.A and Amax.max1=A.SUM1
; | true |
e75fd0fda990ab1c8b8fb96a56a51b1325e1964e | SQL | OlgaTal/popcorn | /src/test/resources/db-structure.sql | UTF-8 | 5,403 | 3.390625 | 3 | [] | no_license | CREATE SCHEMA `Popcorn` DEFAULT CHARACTER SET utf8 ;
-- ++++++++++++++++++++++
USE Popcorn;
-- ++++++++++++++++++++++++
CREATE TABLE `studios` (
`id` INT NOT NULL AUTO_INCREMENT,
`version` INT NOT NULL,
`name` VARCHAR(45) NOT NULL,
`est` DATE NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
PRIMARY KEY (`id`));
insert into studios (created_at, est, name, updated_at, version) values ('2016-08-22', '1901-03-11', 'MGM', '2016-08-22', 0);
insert into studios (created_at, est, name, updated_at, version) values ('2016-08-22', '1901-04-12', 'Fox', '2016-08-22', 0);
insert into studios (created_at, est, name, updated_at, version) values ('2016-08-22', '1901-05-13', 'Universal', '2016-08-22', 0);
insert into studios (created_at, est, name, updated_at, version) values ('2016-08-22', '1901-06-14', 'WB', '2016-08-22', 0);
insert into studios (created_at, est, name, updated_at, version) values ('2016-08-22', '1901-07-15', 'Paramount', '2016-08-22', 0);
-- ++++++++++++++++++++++++++++++++++
CREATE TABLE `movies` (
`id` INT NOT NULL AUTO_INCREMENT,
`version` INT NOT NULL,
`name` VARCHAR(45) NOT NULL,
`released` DATE NULL,
`genre` ENUM('ACTION', 'SCIFI', 'HORROR') NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
`rating` ENUM('G', 'PG', 'R') NULL,
`studio_id` INT NULL,
PRIMARY KEY (`id`),
INDEX `fk_studios_idx` (`studio_id` ASC),
CONSTRAINT `fk_studios`
FOREIGN KEY (`studio_id`)
REFERENCES `Popcorn`.`studios` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
INSERT INTO `Popcorn`.`movies` (`version`, `name`, `released`, `created_at`, `updated_at`, `genre`, `rating`, `studio_id`)
VALUES
('0', 'The Matrix', '1999-03-15', '2001-01-11', '2001-01-11', 'scifi', 'r', '1'),
('0', 'Avatar', '1998-03-15', '2001-01-11', '2001-01-11', 'scifi', 'pg', '2'),
('0', 'Star Wars I', '1998-03-15', '2001-01-11', '2001-01-11', 'scifi', 'pg', '2'),
('0', 'Harry Potter', '1998-03-15', '2001-01-11', '2001-01-11', 'scifi', 'pg', '2'),
('0', 'Lord of the Rings', '1998-03-15', '2001-01-11', '2001-01-11', 'scifi', 'pg', '2'),
('0', 'Titantic', '1997-03-15', '2001-01-11', '2001-01-11', 'action', 'pg', '2');
-- ++++++++++++++++++++++++++++++++++
CREATE TABLE `actors` (
`id` INT NOT NULL AUTO_INCREMENT,
`version` INT NOT NULL,
`name` VARCHAR(45) NULL,
`birthday` DATE NULL,
`gender` ENUM('M', 'F') NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
PRIMARY KEY (`id`));
ALTER TABLE `actors`
CHANGE COLUMN `name` `name` VARCHAR(45) NOT NULL ;
INSERT INTO `actors` (`version`, `name`, `birthday`, `created_at`, `updated_at`, `gender`)
VALUES
('0', 'Keanu Reeves', '1952-03-15', '2001-01-11', '2001-01-11', 'm'),
('0', 'Tom Cruise', '1953-03-15', '2001-01-11', '2001-01-11', 'm'),
('0', 'Jessica Chastain', '1954-03-15', '2001-01-11', '2001-01-11', 'f'),
('0', 'Halley Berry', '1955-03-15', '2001-01-11', '2001-01-11', 'f'),
('0', 'Jake Gyllenhaal', '1956-03-15', '2001-01-11', '2001-01-11', 'm'),
('0', 'Maggie Gyllenhall', '1957-03-15', '2001-01-11', '2001-01-11', 'f'),
('0', 'Liam Nieson', '1958-03-15', '2001-01-11', '2001-01-11', 'm'),
('0', 'Matt Damon', '1959-03-15', '2001-01-11', '2001-01-11', 'm'),
('0', 'Leo DiCaprio', '1960-03-15', '2001-01-11', '2001-01-11', 'm'),
('0', 'Abby Winters', '1961-03-15', '2001-01-11', '2001-01-11', 'f'),
('0', 'Jennifer Harris', '1962-03-15', '2001-01-11', '2001-01-11', 'f'),
('0', 'Margret Robb', '1963-03-15', '2001-01-11', '2001-01-11', 'f'),
('0', 'Ben Travis', '1964-03-15', '2001-01-11', '2001-01-11', 'm'),
('0', 'Patrick Stewart', '1965-03-15', '2001-01-11', '2001-01-11', 'm');
-- ++++++++++++++++++++++++++++++++++++++++++++++++
CREATE TABLE `Popcorn`.`actors_movies` (
`actor_id` INT NOT NULL,
`movie_id` INT NOT NULL,
PRIMARY KEY (`actor_id`, `movie_id`),
INDEX `fk_movie_idx` (`movie_id` ASC),
CONSTRAINT `fk_actor`
FOREIGN KEY (`actor_id`)
REFERENCES `Popcorn`.`actors` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_movie`
FOREIGN KEY (`movie_id`)
REFERENCES `Popcorn`.`movies` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
ALTER TABLE `Popcorn`.`actors_movies`
ADD COLUMN `pay` INT NULL AFTER `movie_id`;
INSERT INTO `actors_movies` (`actor_id`, `movie_id`, `pay`)
VALUES
(1, 1, 1200000),
(2, 1, 2200000),
(3, 1, 3200000),
(4, 1, 4200000),
(5, 2, 1500000),
(6, 2, 3200000),
(7, 2, 2200000),
(8, 3, 6200000),
(9, 4, 8200000),
(10, 4, 2200000),
(11, 4, 4200000),
(12, 4, 7200000),
(13, 4, 3200000),
(14, 4, 200000),
(1, 4, 12000),
(2, 4, 24000),
(3, 4, 320000),
(4, 4, 4200000),
(5, 4, 52000),
(6, 5, 6200000),
(7, 5, 7200000),
(8, 5, 820000),
(9, 5, 12000),
(10, 5, 12000),
(11, 5, 22000),
(12, 5, 3200000),
(13, 5, 4200000),
(14, 5, 1000),
(1, 5, 5200000),
(2, 6, 62000000),
(3, 6, 720000),
(4, 6, 8200000),
(5, 6, 200000),
(6, 6, 4200000),
(7, 6, 8200000),
(8, 6, 1200000),
(9, 6, 2200000),
(10, 6, 32000),
(11, 6, 4200000),
(12, 6, 920000);
| true |
9804b9d647617e67fba019e7c9fdf3162c3cac1a | SQL | jampaniuday/oracle_ETL_Monitoring | /update_CTO_MAIN_monitoring_queries.sql | ISO-8859-7 | 6,956 | 2.96875 | 3 | [] | no_license | /*
1. ETL_MONIOTR.sql CTO-check query --> OK
2. cto_wait.sql script --> OK
3. DWADMIN.CONC_STATS_COLLECTION.CTO_HAS_FINISHED --> OK
4. script
.
. milestones comments query Node milestone
. script main flows (?) ( owb_pa.sql)
d. query CTO & NMR ( script )
*/
SELECT RUN_DATE
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'CTO_LAST_RUN'
-- /
select *
from dba_procedures
where
procedure_name like 'CHECK%CTO%'
ETL_SBL_TRANSFORMATION_PKG.CHECK_FLOWSEND_FORCTO_PROC --> checks if CTO is running. IF not it updates the 'CTO_END_DATE to a future date, to denote execution of the CTO
ETL_SBL_TRANSFORMATION_PKG.CHECK_FLOW_FORCTOWFM_PROC
-- DAILY DWH
SELECT RUN_DATE + 1 INTO temp_date_dw
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'OTE_DW_LAST_RUN';
-- GENESYS
SELECT RUN_DATE + 1
INTO temp_genesys_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'GENESYS_LAST_RUN';
-- WFM
SELECT RUN_DATE + 1
INTO temp_wfm_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'WFM_LAST_RUN';
-- CTO KPI
SELECT RUN_DATE + 1 INTO temp_date_cto
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'CTO_LAST_RUN';
--
WHILE temp_date_cto >= temp_date_dw OR
temp_date_cto >= temp_wfm_date OR
temp_date_cto >= temp_genesys_date LOOP
ETL_SBL_TRANSFORMATION_PKG.CHECK_FLOW_FORCTOORDER_PROC
--
SELECT FLOW_BASEDATE
INTO temp_date
FROM STAGE_PERIF.FLOW_PROGRESS_STG
WHERE FLOW_NAME = 'PERIF_PRESENT_AREA_END';
-- DAILY DWH
SELECT RUN_DATE + 1 INTO temp_date_dw
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'OTE_DW_LAST_RUN';
-- FAULTS
SELECT RUN_DATE + 1
INTO temp_crm_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'FAULT_LAST_RUN';
-- SIEBEL
SELECT RUN_DATE + 1
INTO temp_siebel_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'SOC_END_FORNMR_DATE';
-- CTO KPI
SELECT RUN_DATE + 1 INTO temp_date_cto
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'CTO_LAST_RUN';
--
WHILE temp_date_cto >= temp_date OR
temp_date_cto >= temp_date_dw OR
temp_date_cto >= temp_siebel_date OR
temp_date_cto >= temp_crm_date LOOP
ETL_SBL_TRANSFORMATION_PKG.CHECK_FLOW_FORCTOFAULT_PROC
--
SELECT FLOW_BASEDATE
INTO temp_date
FROM STAGE_PERIF.FLOW_PROGRESS_STG
WHERE FLOW_NAME = 'PERIF_PRESENT_AREA_END';
-- DAILY DWH
SELECT RUN_DATE + 1 INTO temp_date_dw
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'OTE_DW_LAST_RUN';
-- FAULTS
SELECT RUN_DATE + 1
INTO temp_crm_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'FAULT_LAST_RUN';
-- CTO KPI
SELECT RUN_DATE + 1 INTO temp_date_cto
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'CTO_LAST_RUN';
--
WHILE temp_date_cto >= temp_date OR
temp_date_cto >= temp_date_dw OR
temp_date_cto >= temp_crm_date LOOP
-- *********** 1. ETL_MONIOTR.sql CTO-check query
with
level0 as
(
-- DAILY DWH
SELECT RUN_DATE + 1 temp_level0_dw
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'OTE_DW_LAST_RUN'
),
genesis as
(
-- GENESYS
SELECT RUN_DATE + 1 temp_genesys_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'GENESYS_LAST_RUN'
),
wfm as
(
-- WFM
SELECT RUN_DATE + 1 temp_wfm_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'WFM_LAST_RUN'
),
per_main as
(
--
SELECT FLOW_BASEDATE temp_per_date
FROM STAGE_PERIF.FLOW_PROGRESS_STG
WHERE FLOW_NAME = 'PERIF_PRESENT_AREA_END'
),
faults as
(
-- FAULTS
SELECT RUN_DATE + 1 temp_faults_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'FAULT_LAST_RUN'
),
soc4nmr as
(
-- SIEBEL
SELECT RUN_DATE + 1 temp_soc4nmr_date
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'SOC_END_FORNMR_DATE'
),
cto as
(
-- CTO KPI
SELECT RUN_DATE + 1 temp_date_cto
FROM STAGE_DW.DW_CONTROL_TABLE
WHERE PROCEDURE_NAME = 'CTO_LAST_RUN'
)
select
temp_date_cto CTO_TO_BE_LOADED,
-- WFM subflow: WFM KPIs Genesis
temp_level0_dw,
temp_wfm_date,
temp_genesys_date,
CASE WHEN
temp_date_cto >= temp_level0_dw OR
temp_date_cto >= temp_wfm_date OR
temp_date_cto >= temp_genesys_date
THEN 'WAITING'
ELSE 'OK'
END WFM_SUBFLOW_STATUS,
-- FAULTS subflow: FAULTS KPIs Siebel Faults (LL, )
temp_per_date,
temp_level0_dw,
temp_faults_date,
CASE WHEN
temp_date_cto >= temp_per_date OR
temp_date_cto >= temp_level0_dw OR
temp_date_cto >= temp_faults_date
THEN 'WAITING'
ELSE 'OK'
END FAULTS_SUBFLOW_STATUS,
-- ORDERS subflow: ORDER KPIs Siebel, Woms,
temp_per_date,
temp_level0_dw,
temp_soc4nmr_date,
temp_faults_date,
CASE WHEN
temp_date_cto >= temp_per_date OR
temp_date_cto >= temp_level0_dw OR
temp_date_cto >= temp_soc4nmr_date OR
temp_date_cto >= temp_faults_date
THEN 'WAITING'
ELSE 'OK'
END ORDERS_SUBFLOW_STATUS
from level0, genesis, wfm, per_main, faults, soc4nmr, cto;
| true |
b8bf700511ed2d516aa61c3c0f0e2b51c18f14a1 | SQL | happyguys8/Nutrition | /Nutrition Project/script/mysql/ORNMAPPING.sql | UTF-8 | 290 | 3.015625 | 3 | [] | no_license | /* ********************** ORNMAPPING MASTER TABLE **************************/
DROP TABLE IF EXISTS ORNMAPPING;
CREATE TABLE ORNMAPPING
(
ITMNO VARCHAR(30), -- ITEM CODE
OGNCD VARCHAR(01) NULL, -- ITEM ORGANS CODE
CONSTRAINT PK_ORNMAPPING PRIMARY KEY NONCLUSTERED (ITMNO, OGNCD)
) | true |
11771e1adf6a7d948abeb74a0daace9224228fe9 | SQL | nishanth1007/hackerrank-sql | /The Report.sql | UTF-8 | 176 | 3 | 3 | [] | no_license | Select case when grade<8 then NULL
else Name
END as Name, grade, marks from students, grades where
marks between min_mark and max_mark
order by grade desc, name, marks | true |
5d732152849db82885ec6af34a998d9e7a0ecef6 | SQL | fkazirodek/springproject | /src/main/resources/data.sql | UTF-8 | 835 | 2.546875 | 3 | [] | no_license | INSERT INTO category(category_name)
VALUES ("Telefony i Akcesoria");
INSERT INTO category(category_name)
VALUES ("Telewizory");
INSERT INTO category(category_name)
VALUES ("Laptopy");
INSERT INTO category(category_name)
VALUES ("Samochody osobowe");
INSERT INTO category(category_name)
VALUES ("Motocykle");
INSERT INTO category(category_name)
VALUES ("Akcesoria");
INSERT INTO payments(method, delivery_costs)
VALUES ("Płatność kartą kredytową", 10);
INSERT INTO payments(method, delivery_costs)
VALUES ("Płatność przy odbiorze", 15);
INSERT INTO payments(method, delivery_costs)
VALUES ("Odbiór osobisty", 0);
INSERT INTO user_role(role)
VALUES ("ROLE_USER");
INSERT INTO users(id_user, firstname, lastname, username, email, password, enabled) VALUES(1, "Jan", "Kowalski", "jankow", "jankowalski@email.com", "1234567", 1); | true |
194e00d9b5a4eead25d8dc69f3ceec617990105c | SQL | WPI-SGA-Financials/Financial-Database-SQL | /Functions/Fiscal Year Function.sql | UTF-8 | 396 | 3.1875 | 3 | [] | no_license | Drop FUNCTION if EXISTS fnc_FiscalYear;
Create Function fnc_FiscalYear(
hearingDate DATE
)
returns VARCHAR(5)
DETERMINISTIC
BEGIN
DECLARE FiscalYear varchar(15);
if Month(hearingDate) < 7 then
Set FiscalYear = CONCAT('FY ', RIGHT(Year(hearingDate),2));
else
Set FiscalYear = Concat('FY ', RIGHT(Year(hearingDate),2) + 1);
end if;
return FiscalYear;
end; | true |
ef00d33f9ccfa3637c9f18a47ff3fe7b551a7301 | SQL | yuhexiu/mite8-com | /SQL_DATA/jx_gz_dn_edu_gk.sql | UTF-8 | 1,405 | 2.703125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 阿里云MySQL
Source Server Version : 50714
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2017-03-01 16:56:59
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `jx_gz_dn_edu_gk`
-- ----------------------------
DROP TABLE IF EXISTS `jx_gz_dn_edu_gk`;
CREATE TABLE `jx_gz_dn_edu_gk` (
`province` varchar(255) NOT NULL COMMENT '对应省份',
`number` int(11) NOT NULL COMMENT '人数'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of jx_gz_dn_edu_gk
-- ----------------------------
INSERT INTO jx_gz_dn_edu_gk VALUES ('江西', '231');
INSERT INTO jx_gz_dn_edu_gk VALUES ('北京', '34');
INSERT INTO jx_gz_dn_edu_gk VALUES ('湖南', '56');
INSERT INTO jx_gz_dn_edu_gk VALUES ('广东', '132');
INSERT INTO jx_gz_dn_edu_gk VALUES ('上海', '34');
INSERT INTO jx_gz_dn_edu_gk VALUES ('山东', '23');
INSERT INTO jx_gz_dn_edu_gk VALUES ('陕西', '11');
INSERT INTO jx_gz_dn_edu_gk VALUES ('海南', '3');
INSERT INTO jx_gz_dn_edu_gk VALUES ('云南', '4');
INSERT INTO jx_gz_dn_edu_gk VALUES ('黑龙江', '6');
INSERT INTO jx_gz_dn_edu_gk VALUES ('浙江', '14');
INSERT INTO jx_gz_dn_edu_gk VALUES ('香港', '1');
INSERT INTO jx_gz_dn_edu_gk VALUES ('青海', '2');
INSERT INTO jx_gz_dn_edu_gk VALUES ('福建', '9');
| true |
f82f826cb354a323271cccffce56553a5da8970a | SQL | rachelf21/CISC_3140 | /SQL Homework/tutorial_4_SELECT_within_SELECT.sql | UTF-8 | 2,454 | 4.40625 | 4 | [] | no_license | /*TUTORIAL 4 SELECT within SELECT */
/*1. Countries with population larger than that of Russia */
SELECT name FROM world
WHERE population >
(SELECT population FROM world
WHERE name='Russia');
/*2. Show the countries in Europe with a per capita GDP greater than 'United Kingdom*/
SELECT name FROM world
WHERE gdp/population >
(SElECT gdp/population FROM world WHERE name = 'United Kingdom');
/*3. List the name and continent of countries in the continents containing either Argentina or Australia. */
SELECT name, continent FROM world
WHERE continent IN
(SELECT continent FROM world WHERE name IN ('Argentina', 'Australia'))
ORDER BY name;
/*4. Which country has a population that is more than Canada but less than Poland? */
SELECT name, population FROM world
WHERE population >
(SELECT population FROM world WHERE name = 'Canada')
AND population <
(SELECT population FROM world WHERE name = 'Poland');
/*5. Show the name and the population of each country in Europe, as a percentage of the population of Germany. */
SELECT name,
concat(ROUND(100*population/(SELECT population FROM world WHERE name='Germany'),0),'%') AS percentage
FROM world
WHERE continent = 'Europe';
/*6. Which countries have a GDP greater than every country in Europe? */
SELECT name FROM world
WHERE gdp >
ALL(SELECT gdp FROM world WHERE continent = 'Europe' And gdp > 0);
/*7. Find the largest country (by area) in each continent, show the continent, the name and the area */
SELECT continent, name, area FROM world x
WHERE area >= ALL
(SELECT area FROM world y
WHERE y.continent=x.continent
AND area > 0)
/*8. List each continent and the name of the country that comes first alphabetically */
SELECT continent, name FROM world x
WHERE name<= ALL
(SELECT name FROM world y
WHERE y.continent=x.continent)
/*9. Find the continents where all countries have a population <= 25000000. Then find the names of the countries associated with these continents. */
SELECT name, continent, population FROM world x
WHERE 25000000 >= ALL
(SELECT population FROM world y
WHERE y.continent=x.continent)
/*10. Show countries that have populations more than 3 times that of any of their neighbors.*/
SELECT name, continent FROM world x
WHERE population/3 >= ALL
(SELECT population FROM world y
WHERE y.continent=x.continent AND x.name<>y.name)
| true |
c24a18304755f32788506179f0d8263f7f200f39 | SQL | warloc69/freelance | /app/db/test_data.sql | UTF-8 | 24,963 | 3.375 | 3 | [] | no_license | INSERT INTO `mydb`.`project` (`name`, `description`, `cost`, `status`, `owner`,expected_rait,dedline)
VALUES
('Software developer - User interface for real-life game enterprise', 'We are a Berlin-based non-tech start-up. We organise live escape games for groups of 2-6 people who need to solve puzzles in order to escape from a room. We watch the games via webcams and control video & audio in the room from our control room. What we need is a user interface for our game masters which allows them to effectively follow the webcam and send clue texts and pictures to the screen in the game room. An idea of what this interface might look like including its key features can be sent in PowerPoint format upon request.The ideal candidate will have a track record in programming software, possibly in the context of surveillance or game industry.We look forward to your application!', '150', 'N', '1',13,'2016-06-10'),
('Want to hire internet marketer for my online project, contact me if you are ready for this job', 'Want to hire internet marketer for my online project, contact me if you are ready for this job', '150', 'N', '1',2,'2017-06-10'),
('App Developer Needed for Fantasy Sports based App', 'I need someone to program and develop an app that will be loading in data from an api, allowing users to create accounts and set up leagues and track and place selections throughout the week as part of game play. ', '3455', 'N', '1',45,'2016-08-10'),
('Perform state-space modal analysis in Octave/Matlab', 'Perform modal analysis to simulate the application of multiple tuned mass dampers (TMDs) on a structure.
All the parameters of the relevant vibration modes are given for the structure without TMDs. The parameters of the sinusoidal forcing functions representing the dynamic actions on the structure are also given.
Since the TMDs introduce important viscous damping at specifics locations, state-space analysis should be used. The problem should be well represented by a small number of degrees of freedom.
The steps and output of the present project consists in the following:
- the available data for input of the analysis consists in: a) the vibration frequency and mode shape at the points where TMDs will be installed - which are results from a previous FEM analysis. b) The TMD parameters. The 1st step is thus to prepare the available data for input in state-space modal analysis.
- formulation of the problem according to modal analysis theory for the structure with TMDs, see attached document;
- write fully commented Octave/Matlab code in order to calculate:
i) modal parameters of the structure with TMDs;
ii) maximum displacement and acceleration of the structure with TMDs due to application of a sinusoidal forcing function;
iii) maximum relative displacement of the TMD masses (in regard to the displacement of the structure where the TMD is located).
- the analysis shall be performed for 8 different sets of modal structural parameters. For each set of modal parameters you will need to input the data, run the analysis and summarize the results in a document.
- write a small report to explain and complement the Matlab code in order to make clear all the theoretical assumptions and analysis steps, showing intermediate numerical results for one of the 8 cases.
All the materials supplied by us or resulting from the execution of the project should remain confidential.', '10', 'N', '1',1,'2019-06-10'),
('Logo design', 'I would like a logo to be designed.
This is for a bar called "***" inspired by the Marvel character.
The bar interior colours will be themed Black and red.', '3423', 'N', '1',20,'2016-06-10'),
('LOGO CREATIVE DESIGNER', 'We are developing a new retail and wholesale online shop, for eco-friendly clothing (baby clothes, fitness wear, women wear, etc). We need a creative designer to design our brand logo.
If you also have experience in designing images for social media and fashion adv for our website content, we could also use you for other projects.', '4555', 'N', '1',100,'2016-06-10'),
('Partnership for Web Designers', 'Right now, my agency is offering 50% recurring commissions for any SEO client referral. This is going to be very lucrative for you considering we charge most of our clients between $1,000 to $2,000 per month. In this case, you would be pocketing an extra $500-$1000 per month. This added service will end up making you way more money than you are currently making with website design.', '244', 'N', '1',76,'2016-06-10'),
('Mobile Application Developer', 'looking to hire mobile developers to work with me in comming projects, IOS and Android on phone and tablets applications.', '455', 'N', '1',8,'2016-06-10'),
('Create a real estate website with chat and bidding function in english and German', 'requirements and application details can be discussed later, work relationship can be extended based on performance to long relationship as am starting my own business and looking for hiring people.', '344', 'N', '1',45,'2016-06-10'),
('SENIOR FLASH DEVELOPER', 'looking to hire mobile developers to work with me in comming projects, IOS and Android on phone and tablets applications.', '5456', 'N', '1',100,'2016-06-10'),
('Proofreading & Editing Service', 'I need a professional real estate website and 2 landing pages', '155560', 'N', '1',3,'2016-06-10'),
('Business Development Director for the freight/trucking industry', 'The ideal candidate will be also an independent person with a problem solving attitude and propositive about solutions on this plugin development.', '150', 'N', '1',100,'2016-06-10'),
('Simple SQL statement creation (no querying)', 'We are searching for a mechanical engineer / industrial enginneer to design a unique custom made non motorized canine treadmill.', '150', 'N', '1',100,'2016-06-10'),
('Alter an existing menu for a Store in Asia', 'We pay based on value, nothing else.', '150', 'N', '1',56,'2016-06-10'),
('Marketing Internship In New Delhi Region At Certination INC. Certination INC.', 'Posiblidad de montar una Starup si se está interesado', '150', 'N', '1',3,'2016-06-10'),
('Real Estate Flyer Design', 'Who are your favorite film directors, fiction writers, painters, philosophers…?', '150', 'N', '1',65,'2016-06-10'),
('Seeking illustrator for 10-page childrens book, storyboard/all ready to go', 'Serían con paquetes de trabajos puntuales (2/3 semanas) con flexibilidad horaria', '150', 'N', '1',100,'2016-06-10'),
('Data entry, Customer Service', 'We are dedicated to developing and producing quality films based on original stories and the masterpieces of world literature', '150', 'N', '1',67,'2016-06-10'),
('Arabic Speaking Sales Agent for a Very Easy Website Builder', 'Please only apply if you are serious - meaning you work hard, meet deadlines, are teachable, and get things done', '150', 'N', '1',6,'2016-06-10'),
('American Account Manager', 'We need someone or a company to design and develop our web site, we will provide you with a detailed description of what we need for our site. Once you review all the information please send us your proposal. ', '150', 'N', '1',100,'2016-06-10'),
('Elastix Configuration', 'We are looking for native English speakers to provide bilingual proofreading for Russian to English language pair.', '150', 'N', '1',87,'2016-06-10'),
('Clone of jeetle.in with mlm features', 'Please only apply if you are serious - meaning you work hard, meet deadlines, are teachable, and get things done. ', '150', 'N', '1',100,'2016-06-10'),
('Landing Page Designer', 'We are searching for a mechanical engineer / industrial enginneer to design a unique custom made non motorized canine treadmill.', '150', 'N', '1',45,'2016-06-10'),
('architect and 3d Designer', 'I am looking for someone to develop a time/gps tracking application to manage my employees.', '150', 'N', '1',34,'2016-06-10'),
('IMMEDIATE NEED: AN AMERICAN ACCOUNT MANAGER', 'Please only apply if you are serious - meaning you work hard, meet deadlines, are teachable, and get things done. ', '150', 'N', '1',33,'2016-06-10'),
('Gestion Educativa', 'Turn a rough cartoon sketch of a school mascot into a scalable, coloured and professional graphic design that could be used on posters, web pages, printed items and t-shits... The mascot is a Gang Gang - a type of Australian parrot and is coloured black and red. The sketch has the parrot waering a school whirt (white) with red lettering with the name of our school. ', '150', 'N', '1',100,'2016-06-10'),
('Solr specialist needed', 'We only take winners. Do you want to win?', '150', 'N', '1',44,'2016-06-10'),
('LOOKING FOR A NATIVE ENGLISH GRAMMAR WRITER', 'Ideally, we can hire you full time as we continue to grow and scale.', '7655', 'N', '1',56,'2016-06-10'),
('Website Designer/Builder', 'I am currently searching for a Customer support to represent my gallery and work virtually for the gallery. Biding freelancers should have an excellent customer service and must be outcome-oriented.', '150', 'N', '1',100,'2016-06-10'),
('Contract Copywriter Needed!', 'The ideal candidate will be also an independent person with a problem solving attitude and propositive about solutions on this plugin development.', '150', 'N', '1',100,'2016-06-10'),
('Convert Mockup Design to a Wordpress Theme', 'We pay based on value, nothing else.', '150.4565', 'N', '1',3,'2016-06-10'),
('Web Developer For Multi Level User Platform Needed In Syracuse, NY', 'Ideally, we can hire you full time as we continue to grow and scale.', '450', 'N', '1',2,'2016-06-10'),
('Videographer in the USA', 'We are dedicated to developing and producing quality films based on original stories and the masterpieces of world literature', '150', 'N', '1',65,'2016-06-10'),
('Trustworthy Professional Author Needed', 'We only take winners. Do you want to win?', '1504345', 'N', '1',54,'2016-06-10'),
('website graphic design', 'The gallery needs an assistant that will help manage its data entry, customer, Ed services, reply to emails, handle data processing and also handle all that deals with invoicing and recordings, creating and design website.', '550', 'N', '1',23,'2016-06-10'),
('WEB DEVELOPER', 'Hello this is a university level project. I am willing to pay up to $200(10,000 - 13,300 Indian Rupees) for this project and I will be needing it by the 20th-25th of May 2016. Below are the details:So it is an optical character recognition application for smartphones which will allow you to recharge the account of your phone without inserting each numbers by yourself. ', '150', 'N', '1',100,'2016-06-10'),
('Looking for a News Writer: CRE and Retail', 'The ideal candidate will be also an independent person with a problem solving attitude and propositive about solutions on this plugin development.', '150', 'N', '1',99,'2016-06-10'),
('Business to Business Appointment Setters', 'We only take winners. Do you want to win?', '150', 'N', '1',89,'2016-06-10'),
('Prestashop Developer', 'I am looking for someone to develop a time/gps tracking application to manage my employees.', '150', 'N', '1',100,'2016-06-10'),
('Deleting of Duplicate PDFs', 'knowledge of Multitrans Web Editor is an advantage but not mandatory as long as you are familiar with other CAT-tools', '150', 'N', '1',100,'2016-06-10'),
('Content Writer/Copy Writer Freelancer/Work From Home', 'Ideally, we can hire you full time as we continue to grow and scale.', '150', 'N', '1',3,'2016-06-10'),
('Stop Motion Save the Date Video', 'I need a professional real estate website and 2 landing pages', '150', 'N', '1',2,'2016-06-10'),
('Medical Writer Freelancer/Work From Home', 'This is an ongoing project.', '15', 'N', '1',100,'2016-06-10'),
('Wordpress plugin development', 'We are dedicated to developing and producing quality films based on original stories and the masterpieces of world literature', '150', 'N', '1',78,'2016-06-10'),
('MARKETTING', 'We are looking for native English speakers to provide bilingual proofreading for Russian to English language pair.', '150', 'N', '1',66,'2016-06-10'),
('APPLICATION DEVELOPMENT', 'apply website branding on new purchased theme rather than the default theme', '150', 'N', '1',45,'2016-06-10'),
('Website', 'Healthcare Center is in need of persons qualify for the below listed vacancies; Data Entry,Customer Service, Sales and Marketing, Typing/Writing. Applicants must be fluent in English language.', '150', 'N', '1',100,'2016-06-10'),
('Customer service', 'I need to track my employees, and more specifically their time, location, mileage etc...', '10', 'N', '1',46,'2016-06-10'),
('Logo Designer', 'The gallery needs an assistant that will help manage its data entry, customer, Ed services, reply to emails, handle data processing and also handle all that deals with invoicing and recordings, creating and design website.', '150', 'N', '1',100,'2016-06-10'),
('Digital Marketer (Tripadvisor and Google)', 'We are looking for an energetic sales agent to promote our online product mainly in Arab Market.', '150', 'N', '1',43,'2016-06-10'),
('Programmer / Web Developer', 'We are dedicated to developing and producing quality films based on original stories and the masterpieces of world literature', '150', 'N', '1',100,'2016-06-10'),
('Web Product manager - TheDJList.com', 'We are a global company offering an easy-to-use website builder used by numerous customers around the world. ', '150', 'N', '1',78,'2016-06-10'),
('Dating articles for blog', 'apply website branding on new purchased theme rather than the default theme', '0', 'N', '1',100,'2016-06-10'),
('Platform', 'I am currently searching for a Customer support to represent my gallery and work virtually for the gallery. Biding freelancers should have an excellent customer service and must be outcome-oriented.', '150', 'N', '1',100,'2016-06-10'),
('Recharge your account with only two clicks! (OCR system)', 'Please only apply if you are serious - meaning you work hard, meet deadlines, are teachable, and get things done. ', '150', 'N', '1',100,'2016-06-10'),
('Mascot design', 'his position will start at 20 hrs / week. Ideally, we can hire you full time as we continue to grow and scale.', '150', 'N', '1',44,'2016-06-10'),
('Digital analytics expert', 'We are dedicated to developing and producing quality films based on original stories and the masterpieces of world literature', '150', 'N', '1',56,'2016-06-10'),
('FishEye Correction in C#', 'apply website branding on new purchased theme rather than the default theme', '150', 'N', '1',100,'2016-06-10'),
('Website Content Administrator', 'Healthcare Center is in need of persons qualify for the below listed vacancies; Data Entry,Customer Service, Sales and Marketing, Typing/Writing. Applicants must be fluent in English language.', '150', 'N', '1',100,'2016-06-10'),
('Creating an Online Presentation design either on prezi, video scribe, flash or any similar software.', '', '789', 'N', '1',35,'2016-06-10'),
('Front-end Web Page Designer in HTML', 'The following will just be a sample of what we need you to lead', '99', 'N', '1',47,'2016-06-10'),
('PAYROLL ASSISTANT.', 'We are searching for a mechanical engineer / industrial enginneer to design a unique custom made non motorized canine treadmill.', '150', 'N', '1',34,'2016-06-10'),
('Android & iOS Developer', 'existing prestashop website needs some enhancments and bug fixing for the below requirements', '150', 'N', '1',33,'2016-06-10'),
('Data Cleansing Expert', 'I need a professional real estate website and 2 landing pages', '150', 'N', '1',56,'2016-06-10'),
('MSQL / API DEVELOPER', 'Who are your favorite film directors, fiction writers, painters, philosophers…?', '150', 'N', '1',37,'2016-06-10'),
('python code fix', 'We are dedicated to developing and producing quality films based on original stories and the masterpieces of world literature', '150', 'N', '1',54,'2016-06-10'),
('Traductions EN -> FR : termes et conditions', 'I will need you to make this character (a tiger) your own, draw the actual 10-page book (medium to be discussed), and make the book print ready as soon as possible. I am ready to go to print immediately upon completion of these pages; already have printer lined up and waiting.', '150', 'N', '1',78,'2016-06-10'),
('Need to development of voice recognition applications (speaker recognition applications ) on C#.Net.', '', '999', 'N', '1',56,'2016-06-10'),
('Seeking Business Development Manager', 'Have logo, character, website and storyboard completed and ready to go. A friend drew a character based on my logo, as well as a rather detailed story board for book one for me.', '150', 'N', '1',100,'2016-06-10'),
('Logo Designer', 'I am looking for someone to develop a time/gps tracking application to manage my employees.', '150', 'N', '1',100,'2016-06-10'),
('Home Loan Website Content', 'We are looking for native English speakers to provide bilingual proofreading for Russian to English language pair.', '150', 'N', '1',100,'2016-06-10'),
('need programmer', 'We need someone or a company to design and develop our web site, we will provide you with a detailed description of what we need for our site. Once you review all the information please send us your proposal. ', '150', 'N', '1',66,'2016-06-10'),
('Web development & design', 'This position is on a contract basis. Expected duration is 4 months. Work will be performed on site in the AM only (8 AM-1 PM) initially.', '150', 'N', '1',100,'2016-06-10'),
('Post-production for music videos', 'We need aggressive Business to Business Appointment Setters who will actively source new business opportunities through cold calling.', '150', 'N', '1',100,'2016-06-10'),
('Data leads-zoominfo data-- some one has pro account from zoominfo', 'I am looking for someone who loves to draw and is devoted to the project long term if possible. My heart is fully dedicated to this project. A long term goal is to make the series of books into a cartoon (I have a background in television and teaching). I am hard working and no nonsense. I am looking for the same thing in an illustrator.', '150', 'N', '1',34,'2016-06-10'),
('Native English speaking proofreaders needed ASAP', 'There are 15 drawings I would like made, as well as the front and back covers, inside flaps, a holding page for my website (a teaser to let them know the book is coming - so that the style is consistent); as well as a few ancillary materials to go on the website to offer for free to children (like bookmarks, and uncolored pages from the book for the kids to download for free from my website and color themselves). (After this I will also make an e-book version and an ipad applciation based on the book (s).) ', '150', 'N', '1',100,'2016-06-10'),
('Treadmill designer', 'We are expanding our engineering team and are seeking talented software engineers with strong server side C++ development skills, server virtualization experience and a track record of successful commercial software development.', '150', 'N', '1',45,'2016-06-10'),
('Design a site', 'We are searching for a mechanical engineer / industrial enginneer to design a unique custom made non motorized canine treadmill.', '150', 'N', '1',100,'2016-06-10'),
('Web site designer/programmer', 'Have logo, character, website and storyboard completed and ready to go. A friend drew a character based on my logo, as well as a rather detailed story board for book one for me.', '150', 'N', '1',100,'2016-06-10'),
('Android tacking application', 'Looking for an experienced C# developer for a 1 month project. The work is to develop a fish-eye image correction software based on C#.', '150', 'N', '1',100,'2016-06-10'),
('Payroll and AP Assistant - Data Entry', 'I will need you to make this character (a tiger) your own, draw the actual 10-page book (medium to be discussed), and make the book print ready as soon as possible. I am ready to go to print immediately upon completion of these pages; already have printer lined up and waiting.', '150', 'N', '1',99,'2016-06-10'),
('Accounting homework', 'I am looking for someone to write content for roughly 19 pages of content for my mortgage brokerage business.', '150', 'N', '1',4,'2016-06-10'),
('Data Entry/Customer Service Representative', 'Book a minimum of 10 quality appointments a week', '150', 'N', '1',66,'2016-06-10'),
('Video Presentation Creator/ Graphic Designer', 'We need b2b news for professional audience. Our main topic is shopping malls, also we are interested in news about commercial real estate, retail brands and stores, retail chains, e-commerce. Each story have to have at least one photo or illustration. ', '467', 'N', '1',45,'2016-06-10'),
('Backend Node.Js Developer', 'We need aggressive Business to Business Appointment Setters who will actively source new business opportunities through cold calling.', '150', 'N', '1',100,'2016-06-10'),
('Front-End Developer', 'I am looking for someone to write content for roughly 19 pages of content for my mortgage brokerage business.', '150', 'N', '1',67,'2016-06-10'),
('Program that compress a file iusing the algorithm', 'existing prestashop website needs some enhancments and bug fixing for the below requirements', '150', 'N', '1',45,'2016-06-10'),
('Client services Engineer', 'This position is on a contract basis. Expected duration is 4 months. Work will be performed on site in the AM only (8 AM-1 PM) initially.', '150', 'N', '1',78,'2016-06-10'),
('Freelance Online trainers', 'We are searching for a mechanical engineer / industrial enginneer to design a unique custom made non motorized canine treadmill.', '150', 'N', '1',67,'2016-06-10'),
('Mortgage Website Content', 'I am looking for someone to develop a time/gps tracking application to manage my employees.', '150', 'N', '1',56,'2016-06-10'),
('customize wordpress plugin', 'I need a professional real estate website and 2 landing pages', '3334', 'N', '1',45,'2016-06-10'),
('Social Media Manager', 'We need someone or a company to design and develop our web site, we will provide you with a detailed description of what we need for our site. Once you review all the information please send us your proposal. ', '150', 'N', '1',100,'2016-06-10'),
('Blog Writer & SMM for Movie Company', 'We are dedicated to developing and producing quality films based on original stories and the masterpieces of world literature', '150', 'N', '1',4,'2016-06-10'),
(' NATIV Proofreading (RU/UKR-EN) Proofreading ', 'We are looking for native English speakers to provide bilingual proofreading for Russian to English language pair.', '150', 'N', '1',78,'2016-06-10'),
('Layout Designer', 'Who are your favorite film directors, fiction writers, painters, philosophers…?', '555', 'N', '1',2,'2016-06-10'),
('Graphic and Web Designer for Movie Company', 'Aspect Translation Company is looking for experienced freelance-translators in En-Ru language pair to join our translation projects.', '150', 'N', '1',100,'2016-06-10'),
('Translator (En-Ru, medicine, patents)', 'Embroidered Lace manufacturer looking for lace designer using on bridal/fashion dress Guipure Lace/Tulle Lace:4~8 inches Trims&Motifs: 4~6 inches Price varies by the design
Students are welcome
Looking for long term cooperation relationship!', '3466', 'N', '1',100,'2016-06-10'),
('Lace Design', 'The target audience would be ladies and men, 28-65 interested organic and/or healthy alternatives to off the shelf self care products.', '150', 'N', '1',7,'2016-06-10');
INSERT INTO `mydb`.`tags` (`name`)
VALUES
('Illustrator'),
('Sales Representation'),
('Network Administrator'),
('Flash Animation'),
('php'),
('Js'),
('Java'),
('C#'),
('Web Analytics'),
('E-Commerce'),
('Graphics Design'),
('Copyediting'),
('Applications Development'),
('Brand design'),
('Software Development'),
('Logo Design'),
('Copywriting'),
('Web Content'),
('Web Development'),
('Information Security'),
('Mobile Application'),
('Data Mining'),
('Client-Server Applications'),
('Translator'),
('IT Expert'),
('Online Marketing'),
('SEO')
;
INSERT INTO `mydb`.`project_tags` (`project_id`,tag_id)
VALUES
(24,16),
(80,14),
(52,14),
(24,6),
(51,17),
(33,6),
(3,3),
(10,3),
(62,15),
(95,10),
(57,1),
(91,7),
(75,11),
(56,12),
(22,2),
(2,2),
(90,9),
(27,12),
(15,9),
(22,7),
(85,9),
(47,1),
(35,10),
(21,14),
(14,2),
(51,4),
(11,7),
(96,4),
(40,4),
(17,10),
(54,15),
(45,2),
(20,5),
(6,1),
(65,6),
(89,11),
(12,16),
(76,5),
(60,15),
(54,17),
(11,17),
(69,11),
(43,10),
(64,16),
(93,1),
(13,4),
(15,12),
(30,5),
(40,16),
(37,8),
(57,3),
(19,12),
(48,1),
(12,5),
(92,4),
(48,16),
(58,9),
(55,14),
(25,5),
(42,7),
(60,17),
(53,15),
(10,8),
(22,6),
(59,1),
(7,3),
(56,3),
(53,6),
(95,5),
(96,10),
(88,8),
(42,14),
(77,17),
(8,3),
(93,17),
(62,9),
(46,8),
(1,9),
(44,9),
(66,5),
(94,6),
(67,5),
(73,11),
(94,14),
(8,12),
(40,2),
(32,17),
(1,11),
(94,1),
(52,17),
(63,15),
(46,16),
(29,17),
(32,19),
(74,8),
(37,5),
(23,13),
(14,18),
(94,7);
| true |
59cf586ecc0a37fbb08fcb5d83cc1e6628b23910 | SQL | samasri/educo | /DatabaseSQL/DDL.sql | UTF-8 | 10,370 | 3.59375 | 4 | [] | no_license | /*==============================================================*/
/* Database name: EducoDB */
/* DBMS name: MySQL 5.0 */
/* Created on: 4/21/2015 00:32:52 */
/*==============================================================*/
drop database if exists EducoDB;
/*==============================================================*/
/*==============================================================*/
create database EducoDB;
use EducoDB;
/*==============================================================*/
/* Table: AVAILABLE_TIME */
/*==============================================================*/
create table AVAILABLE_TIME
(
Person_ID int not null,
Slot_Number int not null,
primary key (Person_ID, Slot_Number)
);
/*==============================================================*/
/* Table: COURSE */
/*==============================================================*/
create table COURSE
(
ID int not null,
Code varchar(20) not null,
Title varchar(50) not null,
Major int,
Description varchar(1000),
primary key (ID)
);
/*==============================================================*/
/* Table: COURSE_OFFERING */
/*==============================================================*/
create table COURSE_OFFERING
(
Course_ID int not null,
Tutor_ID int not null,
Hours_Taught int,
Rating tinyint,
Status tinyint not null,
Charge_Per_Hour tinyint,
Rated_Hours int default 0,
primary key (Course_ID, Tutor_ID)
);
/*==============================================================*/
/* Table: Days */
/*==============================================================*/
create table Days
(
Code int not null,
Day varchar(10) not null,
primary key (Code)
);
/*==============================================================*/
/* Table: INTERVIEW */
/*==============================================================*/
create table INTERVIEW
(
Interviewer_ID int not null,
Tutor_ID int not null,
Slot_Number int not null,
Status tinyint not null,
Feedback longtext,
primary key (Interviewer_ID, Tutor_ID)
);
/*==============================================================*/
/* Table: MAJOR */
/*==============================================================*/
create table MAJOR
(
Major_Number int not null,
Major_Title varchar(50) not null,
primary key (Major_Number)
);
/*==============================================================*/
/* Table: PERSON */
/*==============================================================*/
create table PERSON
(
ID int AUTO_INCREMENT not null ,
First_Name varchar(30) not null,
Middle_Name varchar(30),
Last_Name varchar(30),
Phone_Number varchar(15) not null,
Email varchar(30) not null unique,
Password varchar(30) not null,
Major int not null,
Role int not null,
Image blob,
Tutor_Status tinyint Default 1,
primary key (ID)
);
/*==============================================================*/
/* Table: RESERVATION */
/*==============================================================*/
create table RESERVATION
(
Student_ID int not null,
Tutor_ID int not null,
Course_ID int not null,
Slot_Number int not null,
Status tinyint not null,
Rated bit not null,
primary key (Student_ID, Tutor_ID, Course_ID, Slot_Number)
);
/*==============================================================*/
/* Table: ROLE */
/*==============================================================*/
create table ROLE
(
Role_Number int not null,
Role_Title varchar(15) not null,
primary key (Role_Number)
);
/*==============================================================*/
/* Table: STATUS */
/*==============================================================*/
create table STATUS
(
Code tinyint not null,
Value varchar(10) not null,
primary key (Code)
);
/*==============================================================*/
/* Table: Start_Times */
/*==============================================================*/
create table Start_Times
(
Code int not null,
Num int not null,
Value Varchar(4) not null,
primary key (Code)
);
/*==============================================================*/
/* Table: TIME_SLOTS */
/*==============================================================*/
create table TIME_SLOTS
(
Slot_Number int not null,
Day int not null,
Time int not null,
primary key (Slot_Number)
);
/*==============================================================*/
/* Table: TIME_SLOTS */
/*==============================================================*/
create table Session
(
PersonID int not null,
SessionNumber int not null,
primary key (PersonID, SessionNumber)
);
/*==============================================================*/
/* Table: NEWSFEED */
/*==============================================================*/
create table EVENTS
(
EventID int AUTO_INCREMENT not null,
CourseID int,
EventTime datetime,
PersonID int,
Person2ID int,
SessionDay varchar (10),
SessionTime varchar (10),
Type int not null,
primary key (EventID)
);
create table EVENT_TYPES
(
Code int not null,
Type varchar (40) not null,
primary key (Code)
);
create table PHOTO
(
PersonID int not null,
picture longblob not null,
primary key (PersonID)
);
alter table EVENTS add constraint FK_Reference_Manual_1 foreign key (PersonID)
references PERSON (ID) on delete restrict on update restrict;
alter table EVENTS add constraint FK_Reference_Manual_2 foreign key (CourseID)
references COURSE (ID) on delete restrict on update restrict;
alter table EVENTS add constraint FK_Reference_Manual_3 foreign key (Type)
references EVENT_TYPES (Code) on delete restrict on update restrict;
alter table PHOTO add constraint FK_Reference_Manual_4 foreign key (PersonID)
references PERSON (ID) on delete restrict on update restrict;
alter table PERSON add constraint FK_Reference_1 foreign key (Major)
references MAJOR (Major_Number) on delete restrict on update restrict;
alter table PERSON add constraint FK_Reference_2 foreign key (Role)
references ROLE (Role_Number) on delete restrict on update restrict;
alter table COURSE_OFFERING add constraint FK_Reference_3 foreign key (Course_ID)
references COURSE (ID) on delete restrict on update restrict;
alter table COURSE_OFFERING add constraint FK_Reference_4 foreign key (Tutor_ID)
references PERSON (ID) on delete restrict on update restrict;
alter table AVAILABLE_TIME add constraint FK_Reference_5 foreign key (Person_ID)
references PERSON (ID) on delete restrict on update restrict;
alter table AVAILABLE_TIME add constraint FK_Reference_6 foreign key (Slot_Number)
references TIME_SLOTS (Slot_Number) on delete restrict on update restrict;
alter table INTERVIEW add constraint FK_Reference_10 foreign key (Interviewer_ID)
references PERSON (ID) on delete restrict on update restrict;
alter table INTERVIEW add constraint FK_Reference_11 foreign key (Tutor_ID)
references PERSON (ID) on delete restrict on update restrict;
alter table INTERVIEW add constraint FK_Reference_12 foreign key (Slot_Number)
references TIME_SLOTS (Slot_Number) on delete restrict on update restrict;
alter table COURSE add constraint FK_Reference_18 foreign key (Major)
references MAJOR (Major_Number) on delete restrict on update restrict;
alter table COURSE_OFFERING add constraint FK_Reference_20 foreign key (Status)
references STATUS (Code) on delete restrict on update restrict;
alter table INTERVIEW add constraint FK_Reference_21 foreign key (Status)
references STATUS (Code) on delete restrict on update restrict;
alter table PERSON add constraint FK_Reference_19 foreign key (Tutor_Status)
references STATUS (Code) on delete restrict on update restrict;
alter table RESERVATION add constraint FK_Reference_13 foreign key (Course_ID, Tutor_ID)
references COURSE_OFFERING (Course_ID, Tutor_ID) on delete restrict on update restrict;
alter table RESERVATION add constraint FK_Reference_14 foreign key (Slot_Number)
references TIME_SLOTS (Slot_Number) on delete restrict on update restrict;
alter table RESERVATION add constraint FK_Reference_15 foreign key (Student_ID)
references PERSON (ID) on delete restrict on update restrict;
alter table RESERVATION add constraint FK_Reference_22 foreign key (Status)
references STATUS (Code) on delete restrict on update restrict;
alter table TIME_SLOTS add constraint FK_Reference_16 foreign key (Day)
references Days (Code) on delete restrict on update restrict;
alter table TIME_SLOTS add constraint FK_Reference_17 foreign key (Time)
references Start_Times (Code) on delete restrict on update restrict;
alter table Session add constraint FK_Reference_30 foreign key (PersonID)
references PERSON (ID) on delete restrict on update restrict;
ALTER TABLE INTERVIEW ADD COLUMN Rating INT DEFAULT 0; | true |
bbd6b13be825884c90411ef25b38ca4225d2891b | SQL | rbe/dmerce | /dmerce2/tmp/sql/oracle/stats/try_sql_trace_for_session.sql | UTF-8 | 1,163 | 3.09375 | 3 | [] | no_license | -- #############################################################################################
--
-- %Purpose: Try to set SQL_TRACE ON for another Session / Program
--
-- Use: SYS-User
--
-- #############################################################################################
--
CREATE OR REPLACE
PROCEDURE try_sql_trace_for_session (ProgName IN VARCHAR2) IS
--
-- Try to enable SQL_TRACE for ProgName
--
-- Example
--
-- SQL> set serveroutput on;
-- SQL> execute sys.TRY_SQL_TRACE_FOR_SESSION('SqlNav');
-- SID: 11 Serial#: 58
-- Tracing enabled ... bye, bye
--
-- PL/SQL procedure successfully completed.
--
nCount NUMBER := 0;
CURSOR curs_get_sid IS
SELECT sid,serial#
FROM v$session
WHERE program LIKE '%'||ProgName||'%';
BEGIN
WHILE nCount = 0
LOOP
FOR rec IN curs_get_sid LOOP
dbms_output.put_line('SID: '||rec.sid||' Serial#: '||rec.serial#);
dbms_system.set_sql_trace_in_session(rec.sid,rec.serial#,TRUE);
nCount := 1;
END LOOP;
dbms_lock.sleep(10);
END LOOP;
dbms_output.put_line('Tracing enabled ... bye, bye');
END;
/
| true |
1e6bdb19e66b25a9c2c623e1e66cead2d0324d47 | SQL | ndleah/SQL-Hackerrank-Challenge-Solutions | /Aggregation/Weather Observation Station 13.sql | UTF-8 | 97 | 2.8125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SELECT
ROUND(SUM(LAT_N), 4) AS SUM_LAT
FROM STATION
WHERE LAT_N BETWEEN 38.7880 AND 137.2345; | true |
c3e2e5f6f458bca03127c06d74958ec2d40a75aa | SQL | Kusayomi/PHP | /tpblogbis/table/blog_users.sql | UTF-8 | 1,710 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Mar 22 Décembre 2015 à 15:59
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12
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 */;
--
-- Base de données : `dev`
--
-- --------------------------------------------------------
--
-- Structure de la table `blog_users`
--
CREATE TABLE IF NOT EXISTS `blog_users` (
`ID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Clé primaire',
`user_login` varchar(60) NOT NULL COMMENT 'Login',
`user_pass` varchar(64) NOT NULL COMMENT 'Password',
`user_email` varchar(100) NOT NULL COMMENT 'Email',
`display_name` varchar(250) NOT NULL COMMENT 'Nom affiché',
`user_photo` varchar(45) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
--
-- Contenu de la table `blog_users`
--
INSERT INTO `blog_users` (`ID`, `user_login`, `user_pass`, `user_email`, `display_name`, `user_photo`) VALUES
(1, 'admin', 'admin', 'admin@blog.com', 'Administrateur 2', NULL),
(2, 'dupont', '123456', 'dupont@lemail.com', 'Jean Dupont', NULL),
(6, 'Jean', 'Pascal', 'mail@mail.com', 'Pascal', NULL),
(8, 'John', '123', 'John@snow.com', 'Snow', NULL),
(9, 'Garen', 'demacia', 'garen@lol.com', 'tourbilol', 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 */;
| true |
b59f89c04e4568da0a27f9b39506c1df0468a36e | SQL | sxtoE/climacts | /db/estem.sql | UTF-8 | 2,271 | 2.8125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 21-08-2018 a las 15:03:14
-- Versión del servidor: 10.1.26-MariaDB
-- Versión de PHP: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `estem`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `registros`
--
CREATE TABLE `registros` (
`id` int(255) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`temperatura` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`humedad` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`presion` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`uv` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`viento` varchar(4) COLLATE utf8_unicode_ci NOT NULL,
`lluvia` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`dioxido` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`monoxido` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`amoniaco` varchar(3) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `registros`
--
INSERT INTO `registros` (`id`, `time`, `temperatura`, `humedad`, `presion`, `uv`, `viento`, `lluvia`, `dioxido`, `monoxido`, `amoniaco`) VALUES
(517, '2018-08-16 16:27:53', '28', '56', '780', '30', '12', '0', '0', '0', '1'),
(518, '2018-08-16 16:33:02', '44', '45', '4', '2', '1', '0', '124', '532', '2');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `registros`
--
ALTER TABLE `registros`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `registros`
--
ALTER TABLE `registros`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=519;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 */;
| true |
fe16237f7c5dae1cad4e1a794a0a01eed4273824 | SQL | KimGwon-su/WWD_00 | /WebContent/ddl.sql | UTF-8 | 623 | 2.84375 | 3 | [] | no_license | /*
CREATE TABLE STUDENT_TBL_01
( STUDENT_NO INT(11) NOT NULL AUTO_INCREMENT,
STUDENT_NAME VARCHAR(20 ),
STUDENT_ADDR VARCHAR(100 ),
STUDENT_PHONE VARCHAR(14 ),
STUDENT_BIRTH DATE,
STUDENT_EMAIL VARCHAR(50 ),
STUDENT_ID VARCHAR(12 ),
STUDENT_PW VARCHAR(50 ),
PRIMARY KEY (`STUDENT_NO`)
);
*/
Insert into STUDENT_TBL_01
(STUDENT_NO,STUDENT_NAME, STUDENT_ADDR, STUDENT_PHONE, STUDENT_BIRTH, STUDENT_EMAIL, STUDENT_ID, STUDENT_PW)
values (201801,'김권수','전라북도 전주시 완산구 효자동','01092799956','2020/01/15','rnjstn123456@naver.com',null,null);
select * from student_tbl_01; | true |
94ac5fe54d7fe8216614fe5320385cb8db68d5d7 | SQL | langpp/kitangaji.com | /db_ngaji.sql | UTF-8 | 1,463 | 2.8125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 11, 2019 at 04:21 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
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: `db_ngaji`
--
-- --------------------------------------------------------
--
-- Table structure for table `tbl_user`
--
CREATE TABLE IF NOT EXISTS `tbl_user` (
`id_user` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(150) NOT NULL,
`email` varchar(150) NOT NULL,
`password` text NOT NULL,
`status_user` int(11) NOT NULL,
PRIMARY KEY (`id_user`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `tbl_user`
--
INSERT INTO `tbl_user` (`id_user`, `username`, `email`, `password`, `status_user`) VALUES
(1, 'admin', 'admin@ngaji.com', '21232f297a57a5a743894a0e4a801fc3', 999),
(2, 'donatur', 'donatur@ngaji.com', '1a5323fe0ccb9955fdf55edb9c70ceea', 1),
(3, 'guru', 'guru@ngaji.com', '77e69c137812518e359196bb2f5e9bb9', 2),
(4, 'murid', 'murid@ngaji.com', '8779fd433a4bbdf35442d79476edafac', 3);
/*!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 */;
| true |
693493712ac95f03277ecab814e12108611dca1c | SQL | fandriyaninkov/plims | /scripts/002_init_data.sql | UTF-8 | 4,302 | 2.625 | 3 | [] | no_license | insert into "Places" ("Name") values
('Место 1'),
('Место 2'),
('Место 3'),
('Место 4'),
('Место 5'),
('Место 6'),
('Место 7');
insert into "Points" ("Name", "PlaceId") values
('Точка 1', 1),
('Точка 2', 1),
('Точка 3', 2),
('Точка 4', 2),
('Точка 5', 3),
('Точка 6', 4),
('Точка 7', 4),
('Точка 8', 5),
('Точка 9', 5),
('Точка 10', 6),
('Точка 11', 6),
('Точка 12', 7),
('Точка 13', 7),
('Точка 14', 1),
('Точка 15', 1),
('Точка 16', 2),
('Точка 17', 3),
('Точка 18', 4),
('Точка 19', 5),
('Точка 20', 6);
insert into "Users" ("FirstName", "LastName", "Patronymic") values
('Анастасий', 'Гапонов', 'Артемьевич'),
('Анатолий', 'Гапошкин', 'Артурович'),
('Андрей', 'Гаранин', 'Архипович'),
('Иван', 'Гараничев', 'Афанасьевич'),
('Даниэль', 'Гарасеев', 'Бенедиктович'),
('Дементий', 'Котёночкин', 'Богданович'),
('Денис', 'Котин', 'Бориславич'),
('Джордж', 'Котлубеев', 'Бориславович'),
('Димитрий', 'Котляров', 'Борисович'),
('Кондрат', 'Чердынин', 'Брониславович'),
('Конон', 'Чердынцев', 'Вадимович'),
('Константин', 'Черевиков', 'Валентинович'),
('Остап', 'Черемин', 'Валерианович'),
('Остромир', 'Черемисин', 'Валерьевич'),
('Отто', 'Котков', 'Валерьянович'),
('Паисий', 'Чередников', 'Васильевич');
insert into "ChemicalAnalysis" ("RegCode", "AnalysisDate", "DeliveringDate", "SamplingDate", "WmrContent", "CondensateContent", "MassFractionOfMethanol", "MassFractionOfMethanolError", "MassFractionOfMethanolNotAvailable", "MassFractionOfWater", "MassFractionOfWaterError", "MassFractionOfWaterNotAvailable", "MassConcentrationOfCorrosionInhibitor", "MassConcentrationOfCorrosionInhibitorNotAvailable", "PointId", "UserId") values
(1, '2020-01-01', '2020-01-01', '2020-01-01', 95, 5, 9.4, 1.5, false, null, null, true, 2, false, 1, 1),
(2, '2020-01-05', '2020-01-05', '2020-01-05', 95, 5, 9.4, 1.5, false, null, null, true, 2, false, 1, 1),
(3, '2020-01-14', '2020-01-14', '2020-01-14', 100, 0, 11.4, 2.5, false, 12.5, 0.5, false, 3, false, 3, 2),
(4, '2020-02-02', '2020-02-02', '2020-02-02', 95, 5, 12.4, 1.5, false, null, null, true, 4, false, 4, 1),
(5, '2020-02-05', '2020-02-05', '2020-02-05', 100, 0, 9.4, 2.5, false, 12.5, 0.5, false, 2, false, 1, 2),
(6, '2020-02-29', '2020-02-29', '2020-02-29', 95, 5, 5.4, 1.5, false, null, null, true, 2, false, 2, 1),
(7, '2020-03-04', '2020-03-04', '2020-03-04', 90, 10, 9.4, 2.5, false, 12.5, 0.5, false, 5, false, 1, 2),
(8, '2020-03-10', '2020-03-10', '2020-03-10', 95, 5, 6.4, 1.5, false, null, null, true, 2, false, 5, 1),
(9, '2020-03-19', '2020-03-19', '2020-03-19', 100, 0, 9.4, 2.5, false, 12.5, 0.5, false, 1, false, 3, 3),
(10, '2020-04-03', '2020-04-03', '2020-04-03', 95, 5, 6.4, 1.5, false, null, null, true, 2, false, 6, 13),
(11, '2020-04-10', '2020-04-10', '2020-04-10', 90, 10, 9.4, 3.5, false, null, null, true, 6, false, 4, 12),
(12, '2020-04-16', '2020-04-16', '2020-04-16', 95, 5, 2.4, 1.5, false, 12.5, 0.5, false, 2, false, 7, 1),
(13, '2020-05-09', '2020-05-09', '2020-05-09', 100, 0, null, null, true, null, null, true, 3, false, 8, 5),
(14, '2020-05-15', '2020-05-15', '2020-05-15', 95, 5, 1.4, 1.5, false, 12.5, 0.5, false, 2, false, 8, 1),
(15, '2020-05-25', '2020-05-25', '2020-05-25', 90, 10, 9.4, 5.5, false, null, null, true, 5, false, 2, 2),
(16, '2020-06-08', '2020-06-08', '2020-06-08', 95, 5, 5.4, 1.5, false, 12.5, 0.5, false, 2, false, 3, 1),
(17, '2020-06-13', '2020-06-13', '2020-06-13', 100, 0, 9.4, 1.5, false, null, null, true, 1, false, 8, 2),
(18, '2020-06-17', '2020-06-17', '2020-06-17', 95, 5, null, null, true, null, null, true, 2, false, 7, 1),
(19, '2020-07-15', '2020-07-15', '2020-07-15', 100, 0, 9.4, 4.5, false, 12.5, 0.5, false, 5, false, 5, 2),
(20, '2020-07-18', '2020-07-18', '2020-07-18', 95, 5, 3.4, 1.5, false, null, null, true, 2, false, 4, 1); | true |
89c5d5b9f39cfead60f1c249709d6b773dcc165d | SQL | Zahco/s7 | /BDD/3/TP3_SPAUR.sql | UTF-8 | 1,327 | 3.5 | 4 | [] | no_license | --2.1
ALTER TABLE gmedecin ADD salaire integer default 2000 not null;
--Table altered.
--2.2
set serveroutput on;
create or replace procedure tp3_2_2 is
begin
delete
from gmedecin
where statut='PATTASS'
and prof_serv='Florence ROUSSEAU';
if sql%rowcount = 0 then
DBMS_OUTPUT.PUT_LINE('Aucune ligne affectée');
else
DBMS_OUTPUT.PUT_LINE(sql%rowcount || ' lignes affectées');
end if;
end;
/
--Procedure created.
--2.3
create or replace function tp3_2_3 (id_medic integer, mon integer, yea integer)
return real is ret real;
begin
select count(*) into ret
from gconsultation
where n_med = id_medic
and extract(month from date_consult) = mon
and extract(year from date_consult) = yea;
return ret;
end;
/
--Procedure created.
create or replace procedure print_tp3_2_3 is
begin
DBMS_OUTPUT.PUT_LINE(tp3_2_3(131,10,2011) || ' consultations');
end;
/
--Procedure created.
--execute print_tp3_2_3;
--5 consultations
--PL/SQL procedure successfully completed.
2.4
create or replace procedure tp3_2_4 is
begin
update gmedecin set salaire = salaire + salaire * 0.08 where statut = 'PUPH';
update gmedecin set salaire = salaire + salaire * 0.05 where statut = 'PATT';
update gmedecin set salaire = salaire + salaire * 0.02 where statut != 'PUPH' and statut != 'PATT';
end;
/
--Procedure created.
| true |
7acb7f822969b591803e70fb807d6eda62a32276 | SQL | AphelionSoftware/DataLoadFrameworks | /DBSchema/Aphelion.DB.DataLoadFramework/Aphelion.DB.Logging/SSIS/Views/vwLatestQueueExecutions.sql | UTF-8 | 1,117 | 3.953125 | 4 | [] | no_license | CREATE VIEW [SSIS].[vwLatestQueueExecutions]
AS
/* This has a lower cost than the correspondingly simpler looking query in comments, due to use of filtered indexes on records with PackageStart and PackageEnd*/
SELECT
StartLog.computer
, StartLog.operator
,StartLog.executionid
, StartLog.starttime
, EndLog.endtime
, DATEDIFF(s, StartLog.starttime, EndLog.endtime) RunTimeSeconds
, DATEDIFF(s, StartLog.starttime, EndLog.endtime) / 60 RunTimeMinutes
, StartLog.[source] StartSource
, EndLog.[source] EndSource
FROM dbo.sysssislog StartLog
INNER JOIN (SELECT TOP 1
executionid AS LatestExecutionID
, computer
FROM dbo.sysssislog
WHERE [Event] = 'User:PackageStart'
AND [Source] = '100_PackageIterator' --This will pick up the last time the controller ran and had a job to process
GROUP BY computer
, executionid
, endtime
ORDER BY endtime DESC
) Latest
ON StartLog.executionid = Latest.LatestExecutionID
LEFT JOIN dbo.sysssislog EndLog
ON StartLog.executionid = EndLog.executionid
AND EndLog.[event] = 'PackageEnd'
WHERE StartLog.[event] ='PackageStart' | true |
f587507aea0144ebe48a09a0a057fdd42f3eddaa | SQL | Bole8823/cst336 | /database_project/teamproject.sql | UTF-8 | 4,172 | 2.8125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.57, for debian-linux-gnu (x86_64)
--
-- Host: 0.0.0.0 Database: teamproject
-- ------------------------------------------------------
-- Server version 5.5.57-0ubuntu0.14.04.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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `artist`
--
DROP TABLE IF EXISTS `artist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `artist` (
`artist_id` int(11) NOT NULL,
`artist_name` varchar(25) NOT NULL,
PRIMARY KEY (`artist_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `artist`
--
LOCK TABLES `artist` WRITE;
/*!40000 ALTER TABLE `artist` DISABLE KEYS */;
INSERT INTO `artist` VALUES (0,'The Chainsmokers'),(1,'David Guetta'),(2,'Marshmello'),(3,'Drake'),(4,'Camila Cabello'),(5,'Eminem');
/*!40000 ALTER TABLE `artist` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `genre`
--
DROP TABLE IF EXISTS `genre`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `genre` (
`genre_id` int(11) NOT NULL,
`genre_name` varchar(25) NOT NULL,
PRIMARY KEY (`genre_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `genre`
--
LOCK TABLES `genre` WRITE;
/*!40000 ALTER TABLE `genre` DISABLE KEYS */;
INSERT INTO `genre` VALUES (0,'pop'),(1,'rap');
/*!40000 ALTER TABLE `genre` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `track`
--
DROP TABLE IF EXISTS `track`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `track` (
`track_id` int(11) NOT NULL,
`track_name` varchar(25) NOT NULL,
`album_name` text,
`genre_id` int(11) NOT NULL,
`artist_id` int(11) NOT NULL,
PRIMARY KEY (`track_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `track`
--
LOCK TABLES `track` WRITE;
/*!40000 ALTER TABLE `track` DISABLE KEYS */;
INSERT INTO `track` VALUES (0,'Sick Boy','Sick Boy...Everybody Hates Me',0,0),(1,'Like I Do','Like I Do',0,1),(2,'FRIENDS','FRIENDS',0,2),(3,'God\'s Plan','Scary Hours',0,3),(4,'Flames','Flames ( Featuring Sia )',0,1),(5,'So Far Away','So Far Away ( Featuring Martin Garrix )',0,1),(6,'Never Be the Same','Camila',0,4),(7,'Havana','Camila ( Featuring Young Thug )',0,4),(8,'Wolves','Wolves (Featuring Marshmello )',0,2),(9,'Silence','Silence ( Featuring Khalid )',0,2),(10,'One Dance','Views',0,3),(11,'Fake Love','More Life',0,3),(12,'Rap God','The Marshall Mathers LP2',1,5),(13,'Love The Way You Lie','Recovery ( Featuring Rihanna )',1,5),(14,'Andromeda','Plagues',0,0),(15,'Don\'t act like a stranger','Don\'t Act Like a Stranger',0,0),(16,'Pleasure','Serene Morning',0,0),(17,'you were the first',' ',0,0),(18,'plastic clouds',' ',0,0),(19,'adolescence','',0,0),(20,'be brave','',0,0),(21,'tempest','',0,0);
/*!40000 ALTER TABLE `track` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-03-29 1:17:52
| true |
a3d8998758df3a9c29a1080f7ce8eb9061bce6be | SQL | Dmit1995Kit/GitProjects | /itstep-crm/src/main/resources/db/migration/V4__user_roles.sql | UTF-8 | 590 | 3.484375 | 3 | [] | no_license | CREATE TABLE `user_roles` (
`user_id` INT UNSIGNED NOT NULL,
`role_id` INT UNSIGNED NOT NULL,
PRIMARY KEY (`user_id`, `role_id`),
CONSTRAINT `FK_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `FK_role_id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4;
INSERT IGNORE INTO `users` (
`username`,
`password`
) VALUES (
"admin",
"$2a$10$b1jhaUmEYFrtD6MI5CC01uV.ILPFKOV0Dh96gOCN8x4Ai7O5U.rpK"
);
INSERT INTO `user_roles`
SELECT u.`id` AS `user_id`, r.`id` AS `role_id`
FROM `roles` r
LEFT JOIN `users` u ON u.`username` = "admin";
| true |
abea79a3d153bb2c06f3744de7f9592b5ad4bb31 | SQL | aarontjackson/Bamazon | /bamazon.sql | UTF-8 | 1,884 | 3.421875 | 3 | [] | no_license | /* Removes any instance of DB in MySQL */
DROP DATABASE IF EXISTS bamazon;
/* Creates DB in MySQL */
CREATE DATABASE bamazon;
/* Sets DB to active */
USE bamazon;
/* Makes a table in the active DB and adds column headings */
CREATE TABLE products(
item_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(255) NOT NULL,
department_name VARCHAR(255) NOT NULL,
price DECIMAL(8,2) NOT NULL,
stock_quantity INT(127) NOT NULL,
PRIMARY KEY (item_id)
);
/* Adds data rows into table */
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Xbox 1", "Electronics", 350.00, 300);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("1500 Live Ladybugs", "Bug Sales",1500.00 , 10);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Golf Cart Seniors Wall Decal", "Home & Office", 21.96, 100);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Peanut Butter & Jelly of the Month Club - 12 Months", "Pantry", 468.90, 2);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Bacon Scented Mustache", "Fashion", 4.07, 15);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Dill Pickle Lip Balm", "Health & Wellness", 11.95, 50);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Baby Mop", "Kitchen", 29.99, 75);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Dancing With Cats", "Electronics", 13.22, 250);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Roast Beef Bath Soak", "Health & Wellness", 17.95, 100);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Nicolas Cage Sequin Pillowcase", "Home & Office", 24.95, 5);
| true |
8aced5ac385944ab3a7df616a71a6bde807af736 | SQL | wook8170/WorkOutput | /[ATC] CASB/ATC_4th_DB.sql | UTF-8 | 12,208 | 3.15625 | 3 | [] | no_license | -- config
service_configCREATE DATABASE config DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE config;
CREATE TABLE service_config (
seq BIGINT NOT NULL AUTO_INCREMENT COMMENT '순서',
limit_log SMALLINT DEFAULT 100 COMMENT '로그 임계치, 단위 (GB)',
limit_doc SMALLINT DEFAULT 80 COMMENT '문서 임계치, 단위 (GB)',
service_admin_email VARCHAR(128) COMMENT '서비스 어드민 이메일',
service_admin_telno VARCHAR(128) COMMENT '서비스 어드민 전화번호'
PRIMARY KEY (seq)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
-- share_status
CREATE TABLE share_status (
seq BIGINT NOT NULL AUTO_INCREMENT COMMENT '공유 상태 코드 (공유요청:0001, 공유진행중:0002, 공유결재: 0003, 공유반려:0004)',
share_status_code TINYINT NOT NULL COMMENT '공유 상태 명 (공유요청:0001, 공유진행중:0002, 공유결재: 0003, 공유반려:0004)',
share_status_name VARCHAR(128) NOT NULL COMMENT '설명',
share_status_description TEXT,
PRIMARY KEY (seq)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
-- tenant_info
CREATE TABLE tenant_info (
tenant_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '순서',
tenant_admin_email VARCHAR(128) NOT NULL COMMENT '고객사 어드민 이메일',
tenant_admin_telno VARCHAR(128) NOT NULL COMMENT '고객사 어드민 전화번호',
tenant_name vARCHAR(128) NOT NULL COMMENT '고객사 이름',
tenant_admin_ip VARCHAR(15) DEFAULT "0.0.0.0" COMMENT '고객사 어드민 접근 허용 아이피',
tenant_admin_password VARCHAR(128) NOT NULL COMMENT '고객사 어드민 암호',
tenant_admin_password_reset_cycle SMALLINT DEFAULT 0 COMMENT '고객사 어드민 암호 재설정 주기. 단위 (일)',
tenant_storage_size SMALLINT DEFAULT 5 COMMENT '고객사 전체 스토리지 용량. 단위 (GB)',
tenant_encrypted_datakey VARCHAR(128) NOT NULL COMMENT '고객사 암호화 키 (via KMS)',
PRIMARY KEY (tenant_id)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
-- -------------------------------------------------------------------------------------------------
-- tentnt table
-- -------------------------------------------------------------------------------------------------
CREATE DATABASE tenant_XXX DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE tenant_XXX;
CREATE TABLE config_info (
seq BIGINT NOT NULL AUTO_INCREMENT COMMENT '순서',
password_reset_cycle SMALLINT DEFAULT 30 COMMENT '사용자 암호 재설정 주기. 단위 (일)',
share_period SMALLINT DEFAULT 7 COMMENT '공유 기간 단위 (일)',
sesstion_timeout SMALLINT DEFAULT 15000 COMMENT '사용사 세션 타임아웃',
PRIMARY KEY (seq)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE user_info (
user_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '사용자 아이디',
user_email VARCHAR(128) NOT NULL COMMENT '사용자 이메일',
user_password VARCHAR(128) COMMENT '사용자 암호',
user_name VARCHAR(128) COMMENT '사용자 이름',config_info
user_profile_image VARCHAR(1024) COMMENT '사용자 프로필 이미지',
user_nick VARCHAR(128) COMMENT '사용자 별칭',
user_telno VARCHAR(16) COMMENT '사용자 전화번호',
dept_code SMALLINT COMMENT '부서 코드',
group_codes SMALLINT COMMENT '그룹 코드들',
position_code TINYINT COMMENT '직급 코드',
policy_code TINYINT COMMENT '정책 코드',
user_is_active BOOL DEFAULT TRUE COMMENT '사용자 활성화 상태',
user_is_approver BOOL DEFAULT FALSE COMMENT '결재 권환 유무',
user_join_time DATETIME COMMENT '사용자 활성화 시작 시간',
user_last_password_change_time DATETIME COMMENT '마지막 암호 변경 날짜',
PRIMARY KEY (user_id)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE external_user_info (
external_user_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '외부 사용자 아이디',
external_user_email VARCHAR(128) NOT NULL COMMENT '외부 사용자 이메일',
external_user_name VARCHAR(128) NOT NULL COMMENT '외부 사용자 이름',
user_id BIGINT NOT NULL COMMENT '관계된 내부 사용자 아디디',
PRIMARY KEY (external_user_id)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE dept_group_info (
dept_code BIGINT NOT NULL AUTO_INCREMENT COMMENT '부서 코드',
dept_name VARCHAR(128) NOT NULL COMMENT '부서 이름',
dept_description VARCHAR(512) NOT NULL COMMENT '부서 설명',
dept_level TINYINT COMMENT '부서 레벨',
dept_is_group BOOL DEFAULT FALSE COMMENT '부서/그룹 구분',
dept_is_active BOOL DEFAULT TRUE COMMENT '부서/그룹 활성화 상태',
policy_code TINYINT NOT NULL COMMENT '정책 코드',
PRIMARY KEY (dept_code)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE position_info (
seq BIGINT NOT NULL AUTO_INCREMENT COMMENT '순서',
position_code TINYINT NOT NULL COMMENT '직급 코드',
position_name VARCHAR(128) NOT NULL COMMENT '직급 이름',
position_description TEXT COMMENT '직급 설명',
PRIMARY KEY (seq)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE policy_info (
policy_code BIGINT NOT NULL AUTO_INCREMENT COMMENT '정책 코드',
policy_type TINYINT NOT NULL COMMENT '정책 타입 (개인:0001, 부서:0002, 그룹:0003)',
policy_description TEXT COMMENT '정책 설명',
allow_read BOOL DEFAULT FALSE COMMENT '읽기 허용',
allow_write BOOL DEFAULT FALSE COMMENT '쓰기/편집 허용(추후 사용)',
allow_extenal BOOL DEFAULT FALSE COMMENT '외부 반출 허용',
allow_download BOOL DEFAULT FALSE COMMENT '다운로드 허용',
PRIMARY KEY (policy_code)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE approval_line_info (
approval_line_code BIGINT NOT NULL AUTO_INCREMENT COMMENT '결재 라인 코드',
approval_line_persons TEXT NOT NULL COMMENT '결재 라인에 포함된 사람들 (결재자 순서)',
approval_lien_description TEXT COMMENT '결재 라인 설명서',
PRIMARY KEY (approval_line_code)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE user_dept_list (
seq BIGINT NOT NULL AUTO_INCREMENT COMMENT '순서',
user_id BIGINT NOT NULL COMMENT '사용자 아이디',
dept_code BIGINT NOT NULL COMMENT '부서 코드',
is_boss BOOL DEFAULT FALSE COMMENT '최상위 그룹/부서장',
PRIMARY KEY (seq)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE docs (
doc_code BIGINT NOT NULL AUTO_INCREMENT COMMENT '문서 코드',
doc_box_name VARCHAR(128) NOT NULL COMMENT '문서 카테고리',
doc_url VARCHAR(1024) NOT NULL COMMENT '문서 URL (S3)',
user_id BIGINT NOT NULL COMMENT '문서 소유자',
doc_create_time DATETIME NOT NULL COMMENT '문서 생성 시간',
doc_modify_time DATETIME NOT NULL COMMENT '문서 수정 시간',
doc_size BIGINT NOT NULL COMMENT '문서 크기',
doc_security_result BOOL DEFAULT FALSE COMMENT '문서 보안 체크 결과 (DLP)',
doc_is_delete BOOL DEFAULT FALSE COMMENT '문서 삭제 상태 (휴지통)',
doc_delete_time DATETIME NOT NULL COMMENT '문서 삭제 시간 (휴지통 보관 한계일)',
doc_share_count SMALLINT NOT NULL COMMENT '문서 공유 횟수',
doc_download_count SMALLINT NOT NULL COMMENT '문서 다운로드 횟수',
doc_hash_tag TEXT COMMENT '해시 태크',
is_favorite BOOL DEFAULT FALSE COMMENT '즐겨 찾기',
PRIMARY KEY (doc_code)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE share_list (
share_code BIGINT NOT NULL AUTO_INCREMENT COMMENT '공유 코드',
doc_code BIGINT NOT NULL COMMENT '문서 코드',
approval_line_code SMALLINT COMMENT '결재 라인 코드',
current_approver BIGINT COMMENT '현재 결재자 아이디',
send_user_id BIGINT NOT NULL COMMENT '공유한 사람 아이디',
recv_user_ids TEXT NOT NULL COMMENT '공유 받은 사람 아이디들',
dept_groups_codes TEXT COMMENT '부서/그룹 코드(부서 공유시)',
policy_code SMALLINT NOT NULL COMMENT '적용된 정책 코드',
share_status_code TINYINT NOT NULL COMMENT '공유 상태 코드',
share_expire_time DATETIME COMMENT '공유 만료 날짜',
share_cancel_time DATETIME COMMENT '공유 취소(해지) 시간',
share_cancel_reason TEXT COMMENT '공유 취소(해지) 사유',
share_reject_time DATETIME COMMENT '공유 반려 시간',
share_reject_reason TEXT COMMENT '공유 반려 사유',
share_is_approved BOOL DEFAULT FALSE COMMENT '공유 완료 상태',
share_alarm_status VARCHAR(128) COMMENT '알람 확인 상태 ( "TRUE:결재 요청" or "FALSE:결재 진행중",... )',
is_favorite BOOL DEFAULT FALSE COMMENT '즐겨 찾기',
PRIMARY KEY (share_code)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE external_share_list (
share_code BIGINT NOT NULL AUTO_INCREMENT COMMENT '공유 코드',
doc_code BIGINT NOT NULL COMMENT '문서 코드',
approval_line_code SMALLINT COMMENT '결재 라인 코드',
current_approver BIGINT COMMENT '현재 결재자 아이디',
send_user_id BIGINT NOT NULL COMMENT '공유한 사람 아이디',
external_user_id VARCHAR(128) NOT NULL COMMENT '공유 받는 외부인 아이디 ???????',
policy_code SMALLINT COMMENT '적용된 정책 코드',
share_status_code TINYINT NOT NULL COMMENT '공유 상태 코드',
share_expire_time DATETIME COMMENT '공유 만료 날짜',
sharE_cancel_time DATETIME COMMENT '공유 취소(해지) 시간',
share_cnacel_reason TEXT COMMENT '공유 취소(해지) 사유',
share_reject_time DATETIME COMMENT '공유 반려 시간',
share_reject_reason TEXT COMMENT '공유 반려 사유',
share_is_approved BOOL DEFAULT FALSE COMMENT '공유 완료 상태',
share_alarm_status VARCHAR(128) COMMENT '알람 확인 상태 ( "TRUE:결재 요청" or "FALSE:결재 진행중",... )',
is_favorite BOOL DEFAULT FALSE COMMENT '즐겨 찾기',
PRIMARY KEY (share_code)
);
CREATE TABLE transactiopn_status (
seq BIGINT NOT NULL AUTO_INCREMENT COMMENT '순서',
transaction_code BIGINT NOT NULL COMMENT '트랜잭션 코드',
transaction_name VARCHAR(128) NOT NULL COMMENT '트랜잭션 이름',
PRIMARY KEY (seq)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
CREATE TABLE last_transaction_list (
transaction_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '트랜잭션 아이디',
user_id BIGINT NOT NULL COMMENT '트랜잭션이 적용된 사용자 아이디',
transaction_code TINYINT NOT NULL COMMENT '트랜잭션 코드(종류)',
trnasaction_time DATETIME NOT NULL COMMENT '트랜잭션 발생 시간',
PRIMARY KEY (transaction_id)
) DEFAULT CHARACTER SET utf8 collate utf8_general_ci;
ALTER DATABASE config CHARACTER SET = 'utf8' COLLATE = 'utf8_general_ci';
ALTER DATABASE tenant_XXX CHARACTER SET = 'utf8' COLLATE = 'utf8_general_ci';
| true |
cff592555ec0c9c11d892612c7b19f94c616df68 | SQL | CircleOfHope/coh_musictable | /db/20131218_DROP_CREATE_PROCEDURE_SearchSongs_fix_duplicates.sql | UTF-8 | 971 | 4.09375 | 4 | [] | no_license | DELIMITER ;;
CREATE DEFINER=`music`@`localhost` PROCEDURE `SearchSongs`(IN `searchString` VARCHAR(200), IN `languages` TINYINT)
SQL SECURITY INVOKER
BEGIN
SELECT distinct s.*
FROM songs s
LEFT JOIN languages_songs ls ON ls.song_id = s.id
LEFT JOIN languages l ON l.id = ls.language_id
LEFT JOIN songs_tags st ON st.song_id = s.id
LEFT JOIN tags t ON t.id = st.tag_id
WHERE
(
searchString IS NULL
OR s.Title LIKE CONCAT('%', searchString, '%')
OR s.Artist LIKE CONCAT('%', searchString, '%')
OR s.Scripture LIKE CONCAT('%', searchString, '%')
OR s.LyricsExcerpt LIKE CONCAT('%', searchString, '%')
OR s.Notes LIKE CONCAT('%', searchString, '%')
OR t.Name LIKE CONCAT('%', searchString, '%')
)
AND
(
languages IS NULL
OR languages = 1 AND l.name = 'English'
OR languages = 2 AND l.name <> 'English'
OR languages = 3
)
ORDER BY s.Title;
END ;;
| true |
5176d5b8c9a58441721e6f4efe18e58fe4b83b9f | SQL | MatheusAraujoDev/Trybe-Exercises-BackEnd | /Exercicios-Bloco 21/exercises_21.3/exercise1.sql | UTF-8 | 381 | 2.984375 | 3 | [] | no_license | USE BeeMovies;
DELIMITER $$
CREATE TRIGGER trigger_movie_insert
BEFORE INSERT ON movies
FOR EACH ROW
BEGIN
SET NEW.release_year = YEAR(NOW());
END $$
CREATE TRIGGER trigger_movie_log_insert
AFTER INSERT ON movies
FOR EACH ROW
BEGIN
INSERT INTO movies_logs(movie_id, executed_action, log_date)
VALUES(NEW.movie_id, 'INSERT', NOW());
END $$
DELIMITER ; | true |
fcd51963f1818a26a37ad50b9370dea81ea69f76 | SQL | quiphung/quanlykho | /kho/lib/db/kho.sql | UTF-8 | 10,510 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 07, 2016 at 06:48 AM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 5.6.15
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: `kho`
--
-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE `products` (
`id` int(11) NOT NULL,
`name` varchar(500) NOT NULL,
`image` varchar(500) NOT NULL,
`status` tinyint(1) NOT NULL,
`note` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `products`
--
INSERT INTO `products` (`id`, `name`, `image`, `status`, `note`) VALUES
(1, 'ac', '', 0, ''),
(2, 'abc', '', 0, 'abc'),
(3, 'abcd', '/khanh/uploads/images/1.jpg', 0, 'avc');
-- --------------------------------------------------------
--
-- Table structure for table `sale`
--
CREATE TABLE `sale` (
`id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`costprice` float NOT NULL,
`price` float NOT NULL,
`quantity` int(11) NOT NULL,
`status` tinyint(1) NOT NULL,
`customer` varchar(500) NOT NULL,
`create_at` varchar(500) NOT NULL,
`delivery_at` date NOT NULL,
`note` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `sale`
--
INSERT INTO `sale` (`id`, `product_id`, `costprice`, `price`, `quantity`, `status`, `customer`, `create_at`, `delivery_at`, `note`) VALUES
(4, 42, 100, 150000, 1, 1, 'Bồ yêu', '1474211120', '2016-09-23', 'Gọi trước khi giao'),
(5, 41, 70000, 110000, 2, 1, 'Phụng', '1474211334', '2016-09-19', 'abc'),
(7, 42, 100000, 100000, 2, 1, '', '1474220514', '2016-09-19', ''),
(8, 41, 70000, 100000, 1, 1, '', '1474221368', '2016-09-20', ''),
(9, 42, 100000, 110000, 2, 1, '', '1474256490', '2016-09-19', ''),
(10, 42, 100000, 120000, 1, 0, '', '1474256515', '2016-09-19', ''),
(11, 42, 100000, 130000, 1, 1, '', '1474256546', '2016-09-19', ''),
(12, 41, 70000, 100000, 1, 0, '', '1474303812', '2016-09-21', ''),
(13, 42, 100000, 110000, 1, 1, 'Khanh', '1474303860', '2016-09-27', ''),
(14, 2, 500000, 600000, 2, 0, '', '1474886954', '2016-09-26', ''),
(15, 2, 300000, 600000, 2, 0, '', '1474887113', '2016-09-26', ''),
(16, 2, 550000, 700000, 1, 0, '', '1474887285', '0000-00-00', '');
-- --------------------------------------------------------
--
-- Table structure for table `supplier`
--
CREATE TABLE `supplier` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`phone` varchar(100) NOT NULL,
`address` varchar(255) NOT NULL,
`email` varchar(100) NOT NULL,
`tax_code` varchar(100) NOT NULL,
`company` varchar(255) NOT NULL,
`note` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `supplier`
--
INSERT INTO `supplier` (`id`, `name`, `phone`, `address`, `email`, `tax_code`, `company`, `note`) VALUES
(1, 'Công ty BDF', '0833975194', 'bdf', 'bdf@gmail.com', '3123213123', 'bdf', 'bdfThe controller (Form.php) has one method: index(). This method initializes the validation class and loads the form helper and URL helper used by your view files. It also runs the validation routine. Based on whether the validation was successful it either presents the form or the success page.'),
(4, 'Công ty ABC', '', '', '', '', '', ''),
(5, 'Bo Shop', '', '', '', '', '', '');
-- --------------------------------------------------------
--
-- Table structure for table `warehouse`
--
CREATE TABLE `warehouse` (
`id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`costprice` float NOT NULL,
`price` float NOT NULL,
`quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `warehouse`
--
INSERT INTO `warehouse` (`id`, `product_id`, `costprice`, `price`, `quantity`) VALUES
(1, 22, 100000, 200000, 13),
(2, 23, 300000, 500000, 6),
(3, 24, 100000, 200000, 2),
(4, 32, 3000000, 4000000, 2),
(6, 26, 400000, 500000, 1),
(8, 37, 200000, 300000, 3),
(9, 41, 70000, 0, 2),
(10, 42, 100000, 110000, -1),
(11, 35, 300000, 0, 1),
(12, 2, 500000, 0, 1);
-- --------------------------------------------------------
--
-- Table structure for table `warehouse_detail`
--
CREATE TABLE `warehouse_detail` (
`id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`costprice` float NOT NULL,
`price` float NOT NULL,
`quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `warehouse_detail`
--
INSERT INTO `warehouse_detail` (`id`, `insert_id`, `product_id`, `costprice`, `price`, `quantity`) VALUES
(18, 2, 22, 300000, 350000, 4),
(19, 3, 22, 300000, 400000, 4),
(23, 5, 22, 0, 0, 1),
(24, 5, 24, 0, 0, 1),
(27, 7, 32, 3000000, 4000000, 1),
(34, 8, 22, 100000, 200000, 1),
(35, 8, 23, 100000, 200000, 1),
(36, 8, 24, 100000, 200000, 1),
(37, 1, 22, 300000, 350000, 3),
(38, 1, 23, 300000, 400000, 4),
(44, 6, 23, 300000, 500000, 1),
(45, 6, 26, 400000, 500000, 1),
(46, 10, 24, 300000, 400000, 1),
(47, 10, 27, 300000, 0, 1),
(48, 11, 28, 400000, 0, 1),
(49, 12, 32, 500000, 0, 1),
(51, 14, 23, 300000, 400000, 3),
(52, 14, 24, 400000, 500000, 4),
(53, 14, 25, 500000, 600000, 6),
(54, 15, 23, 300000, 400000, 1),
(55, 15, 25, 400000, 500000, 1),
(56, 15, 27, 500000, 600000, 1),
(60, 16, 37, 200000, 300000, 3),
(62, 18, 40, 300000, 400000, 5),
(63, 19, 41, 70000, 100000, 2),
(64, 20, 42, 100000, 0, 5),
(65, 20, 41, 70000, 0, 2),
(67, 22, 35, 300000, 0, 1),
(71, 21, 41, 65000, 150000, 6),
(72, 23, 41, 65000, 150000, 7),
(73, 24, 2, 500000, 0, 5);
-- --------------------------------------------------------
--
-- Table structure for table `warehouse_enter`
--
CREATE TABLE `warehouse_enter` (
`id` int(11) NOT NULL,
`total_money` float NOT NULL,
`paid` float DEFAULT NULL,
`supplier` int(11) NOT NULL,
`entry_at` varchar(255) NOT NULL,
`hinhthuc` int(11) NOT NULL,
`user` int(11) NOT NULL,
`note` text,
`status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `warehouse_enter`
--
INSERT INTO `warehouse_enter` (`id`, `total_money`, `paid`, `supplier`, `entry_at`, `hinhthuc`, `user`, `note`, `status`) VALUES
(1, 2100000, 2100000, 1, '1470624298', 1, 1, 'Đơn hàng mới', 2),
(2, 1200000, 1200000, 1, '1470204863', 1, 1, 'Đơn hàng mới', 0),
(3, 1200000, 1200000, 0, '1470204902', 1, 1, '', 0),
(5, 0, 0, 0, '1470286124', 1, 0, '', 1),
(6, 700000, 500000, 2, '1470638889', 1, 0, 'Hợp tác lần đầu', 1),
(7, 8000000, 8000000, 0, '1470293511', 1, 0, '', 1),
(8, 300000, 100000, 0, '1470622431', 1, 0, 'Update lần 1', 1),
(9, 400000, 400000, 1, '1470625283', 1, 0, '', 2),
(10, 600000, 500000, 1, '1470644702', 1, 0, '', 0),
(11, 400000, 400000, 1, '1470722608', 1, 0, 'a', 2),
(12, 500000, 0, 0, '1470722903', 1, 0, '', 2),
(13, 0, 0, 0, '1470722911', 1, 0, '', 1),
(14, 5500000, 5000000, 4, '1470815822', 1, 0, '', 0),
(15, 1200000, 1000000, 0, '1470816002', 1, 1, '', 0),
(16, 1800000, 1500000, 4, '1472449701', 1, 1, '', 1),
(17, 2000000, 2000000, 0, '1472449751', 1, 1, '', 1),
(18, 1500000, 1400000, 0, '1472611691', 1, 1, '', 0),
(19, 140000, 0, 0, '1474026344', 1, 1, '', 1),
(20, 640000, 0, 0, '1474027657', 1, 1, '', 1),
(21, 390000, NULL, 5, '1474395328', 0, 1, '', 0),
(22, 300000, 0, 0, '1474395189', 0, 1, '', 1),
(23, 455000, NULL, 5, '1474395520', 0, 1, '', 0),
(24, 2500000, NULL, 0, '1474886920', 0, 1, '', 1);
-- --------------------------------------------------------
--
-- Table structure for table `warehouse_user`
--
CREATE TABLE `warehouse_user` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`address` text NOT NULL,
`phone` varchar(100) NOT NULL,
`level` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`create_at` varchar(255) NOT NULL,
`randomkey` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `warehouse_user`
--
INSERT INTO `warehouse_user` (`id`, `name`, `username`, `password`, `address`, `phone`, `level`, `email`, `create_at`, `randomkey`) VALUES
(1, 'Qui Phụng', 'admin', '7c4a8d09ca3762af61e59520943dc26494f8941b', '', '', 0, 'phung.lequi93@gmail.com', '', ''),
(2, 'Hoàng Long', 'hoanglong', '7c4a8d09ca3762af61e59520943dc26494f8941b', '', '', 1, '', '', ''),
(3, 'abc', 'abc', '7c4a8d09ca3762af61e59520943dc26494f8941b', 'abc', '12323123', 2, 'abc@gmail.com', '', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sale`
--
ALTER TABLE `sale`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `supplier`
--
ALTER TABLE `supplier`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `warehouse`
--
ALTER TABLE `warehouse`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `warehouse_detail`
--
ALTER TABLE `warehouse_detail`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `warehouse_enter`
--
ALTER TABLE `warehouse_enter`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `warehouse_user`
--
ALTER TABLE `warehouse_user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `sale`
--
ALTER TABLE `sale`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `supplier`
--
ALTER TABLE `supplier`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `warehouse`
--
ALTER TABLE `warehouse`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `warehouse_detail`
--
ALTER TABLE `warehouse_detail`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=74;
--
-- AUTO_INCREMENT for table `warehouse_enter`
--
ALTER TABLE `warehouse_enter`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- AUTO_INCREMENT for table `warehouse_user`
--
ALTER TABLE `warehouse_user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=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 */;
| true |
907e2e43c37ee152fd4a869d69d9c886fad9a1e3 | SQL | friday-night-jp/friday-night | /sql/category_affiliate_map.sql | UTF-8 | 210 | 2.546875 | 3 | [] | no_license | create table category_affiliate_map (
id INTEGER NOT NULL AUTO_INCREMENT,
category_id INTEGER NOT NULL,
affiliate_id INTEGER NOT NULL,
PRIMARY KEY ( id )
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
| true |
a3796bde2ea19aacc51c55406bcc549b6eaecce5 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day20/select1418.sql | UTF-8 | 267 | 3.109375 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='Thermometer' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['3226','6088','4062','1403','6052','6072','1427','2228','2082','3054'])
| true |
3709e4681c027fb2ee0c4131f2eeb73adca3c5fe | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day14/select0535.sql | UTF-8 | 178 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-13T05:35:00Z' AND timestamp<'2017-11-14T05:35:00Z' AND temperature>=26 AND temperature<=73
| true |
7ba7f2a3efa9d30616494e6b02c8233410c0a5a2 | SQL | hlkirkness/hlkemployeetracker | /db/seeds.sql | UTF-8 | 480 | 3.171875 | 3 | [] | no_license | USE employee_tracker;
INSERT INTO department (name)
VALUES ("IT"),
("Marketing"),
("HR"),
("Sales");
INSERT INTO role (title, salary, department_id)
VALUES ("Engineer",100000,1),
("Collaborator", 45000,2),
("Recruiter",60000,3),
("Sales Person",50000,4);
INSERT INTO employee (first_name, last_name, role_id)
VALUES ("Austin", "Schwarm", 1),
("Peter", "Larson", 2),
("Matthew", "DePietro", 4),
("Thomas", "Chadwick", 3),
("Harrison", "Trider", 2),
("Heather", "Kirkness", 4); | true |
f1f556a04177f0a64999e22942d8fc7e5e184bcf | SQL | surferstef/Challenge-12-SQL-Employee-Tracker | /db/schema.sql | UTF-8 | 452 | 3.03125 | 3 | [] | no_license | DROP DATABASE IF EXISTS company;
CREATE DATABASE company;
USE company;
CREATE TABLE employees (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
title VARCHAR(40) NOT NULL,
department VARCHAR(30) NOT NULL,
salary INTEGER,
manager VARCHAR(40) NOT NULL
);
CREATE TABLE department (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(30) NULL,
PRIMARY KEY (id)
); | true |
63e4eafffa530e45b00a0627dc113a37e30d02a5 | SQL | ELeonJohnson/MYSQL-command-challenges | /varchar_char.sql | UTF-8 | 792 | 3.5 | 4 | [] | no_license | --Both VARCHAR and CHAR store texts
--Differences:CHAR has a fixed length ex. CHAR(10) - string value only goes up to 10
--CHAR is faster for fixed length text
--Examples: state abbreviations: CA, NY yes/no: Y/N sex:M/F
--The string gets cut off by the fixed length if it's to long
--The string gets spaces to the right by the fixed length if its too short
--Creating a new databse
CREATE DATABASE testing_db;
--Switching to the new database
use testing_db;
--Creating tables in the db
CREATE TABLE artist(name CHAR(5), genre VARCHAR(15));
--Inserting new data into the new table created
INSERT INTO artist (name, genre) VALUES('Earl', 'Rap/Hip-Hop');
INSERT INTO artist (name, genre) VALUES('Kanye', 'Contemporary RB');
--Selecting all data from the artist table
SELECT * FROM artist; | true |
dc4a1febce4a39ef4530a5b2e498b2aafd1eb8b4 | SQL | jha359/Past-Work | /CSE 111/Lab4/jaeha-hwang/test/12.sql | UTF-8 | 100 | 3.140625 | 3 | [] | no_license | SELECT n_name, AVG(s_acctbal) FROM nation, supplier
WHERE s_nationkey = n_nationkey
GROUP BY n_name
| true |
e71d9b155815a97f00eb04c24d7eafb49164005b | SQL | Infixo/Civ6-Mods | /REU/RealEurekas_0_Setup.sql | UTF-8 | 2,144 | 3.328125 | 3 | [] | no_license | --------------------------------------------------------------
-- Real Eurekas
-- Author: Infixo
-- 2019-03-14: Created
--------------------------------------------------------------
-- INSTRUCTIONS
-- There are 3 lines with INSERT statement. It contains so called 'random seed' that determines what boosts will be selected.
-- Depending on your preference and if you play MP or SP games, uncomment ONLY ONE statement. The other two must be commented out.
-- OPTION A - for SP & MP
-- Use this option when you want to randomize boosts once and play entire game with this set.
-- Enable it and put any number instead of 987654321. As long as this number stays the same, the mod will generate the same set of boosts.
-- Different number will give a different set. Please use numbers that have 6 to 9 digits.
-- This is an option for MultiPlayer games. Select a number and make sure that other players also use the same number.
-- That way all players will have the same boosts and they will stay the same through the entire game.
-- This option is also for SinglePlayer if you want to play entire game with the same set of boosts.
--INSERT INTO GlobalParameters (Name, Value) VALUES ('REU_RANDOM_SEED', '987654321');
-- OPTION B - for SP
-- This option rolls randomly new set of boosts each time the game is started or re-loaded.
-- It is basically the same as the mod has been working so far.
-- If you don't mind that boosts change very often then use it.
-- Please do NOT change anything in the statement (except comment ofc).
--INSERT INTO GlobalParameters (Name, Value) VALUES ('REU_RANDOM_SEED', STRFTIME("%d%H%M%S"));
-- OPTION C - for SP
-- This option rolls randomly new set of boosts but it will change every day.
-- If you start a new game or reload a game within the same day - the boosts will be the same.
-- This option is for people who don't like when boosts change every time the game is reloaded, but would like some variety. New day - new boosts :)
-- Please do NOT change anything in the statement (except comment ofc).
INSERT INTO GlobalParameters (Name, Value) VALUES ('REU_RANDOM_SEED', STRFTIME("%Y%m%d"));
| true |
85f9e01e3c71d76a720370a4a8ea3e2485f3631f | SQL | bsujin/dbsql | /2020.10.06.pl.sql | UTF-8 | 7,732 | 4.03125 | 4 | [] | no_license |
헷갈리지 않게 유의하기
변수선언
java : 변수타입 변수이름;
pl/sql : 변수이름 변수타입;
변수 : 스칼라변수(하나의 값만 담을 수 있는 변수)
복합변수
1. %row type 행 정보(컬럼이 복수)를 담을 수 있는 변수(rowtype)
==> java로 비유를 하면 vo (filed가 여러개)
--vo : value 객체
컬럼타입 : 테이블명.컬럼명 *type
row 타입 : 테이블명%ROWTYPE
2. record type : 행 정보, 개발자가 컬럼을 선택하여 타입 생성
3. table type : 행이 여러개인 값을 저장 할 수 있는 변수
%ROWTYPE : 테이블의 행정보를 담을 수 있는 변수
출력기능 활성화 : SET SERVEROUTPUT ON;
emp 테이블에서 7369번 사번의 모든 컬럼정보를 ROWTYPE 변수에 저장
DBMS_OUTPUT.PUT_LINE 함수를 통해 콘솔에 출력
-- 1. emp테이블에서 7369사번의 컬럼정보
DECLARE
--변수명 --타입
v_emp_row emp%ROWTYPE;
BEGIN
SELECT * INTO v_emp_row
FROM emp
WHERE empno = 7369;
DBMS_OUTPUT.PUT('v_emp_row.empno :' || v_emp_row.empno || ', v_emp_row.ename' || v_emp_row.ename);
END;
/
==============================================================
RECORD TYPE : 행의 컬럼정보를 개발자가 직접 구성하여 (커스텀) 타입
=> 지금까지는 타입을 가져다 사용한것, 지금은 타입을 생성(CLASS를 생성)
방법
TYPE 타입이름 IS RECORD(
컬럼명1 컬럼타입1,
컬럼명2 컬럼타입2,
컬럼명3 컬럼타입3
);
변수명 타입이름;
--타입을 이용하여 변수를 선언;
사원테이블에서 empno, ename, deptno 3개의 컬럼을 저장할 수 있는 rowtype을 정의하고
해당 타입의 변수를 선언하여 사번이 7369번인 사원의 위 3가지 컬럼 정보를 담아보기
DECLARE
TYPE t_emp_row IS RECORD( --클래스를 만드는것 (
empno emp.empno%TYPE,
ename emp.ename%TYPE,
deptno emp.deptno%TYPE
);
--변수이름 변수타입
v_emp_row t_emp_row;
BEGIN
SELECT empno, ename, deptno INTO v_emp_row
FROM emp
WHERE empno = 7369;
DBMS_OUTPUT.PUT_LINE('v_emp_row.empno : ' || v_emp_row.empno || ', v_emp_row.ename : ' || v_emp_row.ename);
END;
/
======================================
TABLE 타입 : 여러개의 행을 담을 수 있는 타입
자바로 비유를 하면 List<Vo> --제네릭을 담을 수 있는
자바 배열과 pl/sql table 타입과 차이점
자바 : 배열의 첫번째 값을 접근 : inrArr[0] - index 번호 ==> 숫자로 고정
pl/sql : intArr["userName"] => 문자열이 될수도 있고, 정수로도 될 수 있다
테이블 타입선언
TYPE 테이블_타입이름 IS TABLE OF 행에_대한 타입 INDEX BY BINARY_INTEGER;
--행을 여러개 담을 수 있는 테이블
변수선언 : 테이블_타입_변수명 테이블_타입이름;
기존 : SELECT 쿼리의 결과가 한 행이어야만 정상적으로 통과
변경 : SELECT 쿼리의 결과가 복수 행이어도 상관 없다
==============================================
복수개의 행을 처리하는 방법
DEPT테이블의 모든 행을 조회해서 테이블 타입변수에 담고 테이블 타입변수를 루프(반복문)를 통해 값을 확인
--여러개의 행의 값을 담으므로 루프가 없으면 불가능,
DECLARE
--변수선언 : 테이블타입(DEPT행 정보를 담을 수 있는 타입)-> 모든 행정보이브로 ROWTYPE
TYPE t_dept IS TABLE OF dept%ROWTYPE INDEX BY BINARY_INTEGER;
v_dept t_dept;
BEGIN
--자바 : 자바 배열 - v_dept[0] , 자바 list - v_dept.get(0)
--pl/sql 테이블 타입 : v_dept(0).컬럼명
SELECT * BULK COLLECT INTO v_dept --여러개의 행을 담고있는 변수 (cf.자바의 배열, 리스트)
FROM dept;
FOR i IN 1..v_dept.COUNT LOOP --count ( 배열- length, size 와 같은 개념)
DBMS_OUTPUT.PUT_LINE('v_dpet(i).deptno : ' || v_dept(i).deptno || ', v_dept(i).dname :' || v_dept(i).dname);
END LOOP;
END;
/
=============================================== 결과창
v_dpet(i).deptno : 10, v_dept(i).dname :ACCOUNTING
v_dpet(i).deptno : 20, v_dept(i).dname :RESEARCH
v_dpet(i).deptno : 30, v_dept(i).dname :SALES
v_dpet(i).deptno : 40, v_dept(i).dname :OPERATIONS
PL/SQL 프로시저가 성공적으로 완료되었습니다.
=================================================
조건제어
IF
CASE - 2가지
반복문
FOR LOOP --일반적으로 가장 많이 사용
LOOP
WHILE
- IF 로직제어
IF 조건문 THEN
실행문장;
ELSIF 조건문 THEN
실행문장;
ELSE
실행문장;
END IF;
할당연산자 => :=
DECLARE
/* 자바 : int a, a=5; ==> int a=5;
P NUMBER; P :=5; */
p NUMBER := 5;
BEGIN
/*if(p==1)*/
IF p = 1 THEN
DBMS_OUTPUT.PUT_LINE('p=1');
ELSIF p=2 THEN
DBMS_OUTPUT.PUT_LINE('P=2');
ELSIF p=5 THEN
DBMS_OUTPUT.PUT_LINE('P=5');
ELSE
DBMS_OUTPUT.PUT_LINE('DEFAULT');
END IF;
END;
/
==============================================
일반 CASE (JAVA SWITCH와 유사)
CASE expression (컬럼, 변수,수식) -- ex 컬럼이랑 값이 일치할때 나옴
WHEN value THEN
실행할문장;
WHEN value 2 THEN
실행할 문장 2;
ELSE
기본실행문장;
END CASE;
--DBMS_OUTPUT.PUT_LINE
--PPT28장
DECLARE
c NUMBER := 5;
BEGIN
CASE c
WHEN 1 THEN
DBMS_OUTPUT.PUT_LINE('c=1');
WHEN 2 THEN
DBMS_OUTPUT.PUT_LINE('c=2');
WHEN 5 THEN
DBMS_OUTPUT.PUT_LINE('C=5');
ELSE
DBMS_OUTPUT.PUT_LINE('default');
END CASE;
END;
/
============================================
-CASE 검색 케이스
: CASE 에서 EXPRESSION 제외 하면 IF와 유사
-- := 대입 , = 비교
DECLARE
c NUMBER := 5;
BEGIN
CASE
WHEN c=1 THEN
DBMS_OUTPUT.PUT_LINE('c=1');
WHEN c=2 THEN
DBMS_OUTPUT.PUT_LINE('c=2');
WHEN c=5 THEN
DBMS_OUTPUT.PUT_LINE('C=5');
ELSE
DBMS_OUTPUT.PUT_LINE('default');
END CASE;
END;
/
===================================================
case 표현식
sql에서 사용한 case
case 표현식 : SQL에서 사용한 CASE
변수 := CASE
WHEN 조건문1 THEN 반환할 값1
WHEN 조건문2 THEN 반환할 값2
ELSE 기본 반환값
END;
EMP테이블에서 7369번 사원의 sal 정보를 조회하여
sal 값이 1000보다 크면 sal*1.2 값을
sal 값이 900보다 크면 sal*1.3 값을
sal 값이 800보다 크면 sal*1.4 값을
위 세가지 조건을 만족하지 못할 때는 sal*1.6값을
v_sal 변수에 담고 EMP 테이블의 sal 컬럼에 업데이트
단 case 표현식을 사용
1. 7369번 사번의 sal 정보를 조회하여 변수에 담는다.
2. 1번에서 담은 변수값을 case 표현식을 이용하여 새로운 sal값을 구하고,
v_sal 변수에 할당
3. 7369번 사원의 sal 컬럼을 v_sal값으로 업데이트
DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal INTO v_sal
FROM emp
WHERE empno = 7369;
DBMS_OUTPUT.PUT_LINE( 'v_sal :' || v_sal);
CASE
WHEN v_sal >1000 THEN v_sal := v_sal*1.2;
DBMS_OUTPUT.PUT_LINE( 'v_sal 1000 :' || v_sal);
WHEN v_sal> 900 THEN v_sal := v_sal*1.3;
DBMS_OUTPUT.PUT_LINE( 'v_sal 900 :' || v_sal);
WHEN v_sal>800 THEN v_sal := v_sal*1.4;
DBMS_OUTPUT.PUT_LINE( 'v_sal 800 :' || v_sal);
ELSE v_sal := v_sal*1.6;
DBMS_OUTPUT.PUT_LINE( 'v_sal :' || v_sal);
END CASE;
UPDATE emp SET sal = v_sal WHERE empno = 7369;
END;
/
SELECT *
FROM emp
| true |
4ec37f0a9777f1611a2c7e49099834835b94ccb9 | SQL | wujek-srujek/where-server | /src/main/resources/db/migration/V2__principal.sql | UTF-8 | 333 | 3.15625 | 3 | [] | no_license | create table principal (
id bigserial primary key,
username text unique not null,
password text not null,
permission text not null,
enabled boolean not null,
-- not using PostgreSQL enum types due to lack of native Hibernate support
constraint valid_permission check (permission in ('READ', 'WRITE'))
);
| true |
3c3db0cc983c49bb57078b52a1aebbfc85ea779c | SQL | angelitomg/iGenda | /database.sql | UTF-8 | 10,894 | 3.3125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: 08-Jun-2016 às 20:23
-- Versão do servidor: 5.5.42
-- PHP Version: 5.6.10
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: `igenda`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `activities`
--
CREATE TABLE `activities` (
`id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned NOT NULL,
`activity_type_id` int(10) unsigned NOT NULL,
`description` text COLLATE utf8_unicode_ci NOT NULL,
`start_date` datetime NOT NULL,
`end_date` datetime NOT NULL,
`status` tinyint(4) NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`company_id` int(10) unsigned NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `activity_types`
--
CREATE TABLE `activity_types` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`company_id` int(10) unsigned NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `clients`
--
CREATE TABLE `clients` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`birthdate` date NOT NULL,
`document1` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`document2` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`address` text COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`site` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`contact_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`company_id` int(10) unsigned NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `companies`
--
CREATE TABLE `companies` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`document1` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`document2` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`address` text COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`site` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `deals`
--
CREATE TABLE `deals` (
`id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci NOT NULL,
`amount` decimal(14,2) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`status` tinyint(4) NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`company_id` int(10) unsigned NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `deal_services`
--
CREATE TABLE `deal_services` (
`id` int(10) unsigned NOT NULL,
`deal_id` int(10) unsigned NOT NULL,
`service_id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`price` decimal(14,2) NOT NULL,
`quantity` decimal(10,3) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `permissions`
--
CREATE TABLE `permissions` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`path` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Extraindo dados da tabela `permissions`
--
INSERT INTO `permissions` (`id`, `name`, `path`) VALUES
(5, 'Add Activities', 'Activities/add'),
(6, 'Edit Activities', 'Activities/edit'),
(7, 'List Activities', 'Activities/index'),
(8, 'View Activities', 'Activities/view'),
(9, 'Delete Activities', 'Activities/delete'),
(10, 'Add Clients', 'Clients/add'),
(11, 'Edit Clients', 'Clients/edit'),
(12, 'List Clients', 'Clients/index'),
(13, 'View Clients', 'Clients/view'),
(14, 'Delete Clients', 'Clients/delete'),
(15, 'Add Services', 'Services/add'),
(16, 'Edit Services', 'Services/edit'),
(17, 'List Services', 'Services/index'),
(18, 'Delete Services', 'Services/delete'),
(19, 'Add Activity Types', 'ActivityTypes/add'),
(20, 'Edit Activity Types', 'ActivityTypes/edit'),
(21, 'List Activity Types', 'ActivityTypes/index'),
(22, 'Delete Activity Types', 'ActivityTypes/delete'),
(23, 'Add Users', 'Users/add'),
(24, 'Edit Users', 'Users/edit'),
(25, 'List Users', 'Users/index'),
(26, 'Delete Users', 'Users/delete'),
(27, 'Edit Company Info', 'Companies/edit'),
(28, 'Add Deals', 'Deals/add'),
(29, 'Edit Deals', 'Deals/edit'),
(30, 'List Deals', 'Deals/index'),
(31, 'View Deals', 'Deals/view'),
(32, 'Delete Deals', 'Deals/delete'),
(35, 'View Activities Calendar', 'Activities/calendar');
-- --------------------------------------------------------
--
-- Estrutura da tabela `services`
--
CREATE TABLE `services` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`price` decimal(14,2) NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`company_id` int(10) unsigned NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `users`
--
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`company_id` int(10) unsigned NOT NULL,
`token` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`activated` tinyint(1) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `users_permissions`
--
CREATE TABLE `users_permissions` (
`id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`permission_id` int(10) unsigned NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `activities`
--
ALTER TABLE `activities`
ADD PRIMARY KEY (`id`),
ADD KEY `client_id` (`client_id`),
ADD KEY `activity_type_id` (`activity_type_id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `company_id` (`company_id`);
--
-- Indexes for table `activity_types`
--
ALTER TABLE `activity_types`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `company_id` (`company_id`);
--
-- Indexes for table `clients`
--
ALTER TABLE `clients`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `company_id` (`company_id`);
--
-- Indexes for table `companies`
--
ALTER TABLE `companies`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `deals`
--
ALTER TABLE `deals`
ADD PRIMARY KEY (`id`),
ADD KEY `client_id` (`client_id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `company_id` (`company_id`);
--
-- Indexes for table `deal_services`
--
ALTER TABLE `deal_services`
ADD PRIMARY KEY (`id`),
ADD KEY `deal_id` (`deal_id`),
ADD KEY `service_id` (`service_id`);
--
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `services`
--
ALTER TABLE `services`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `company_id` (`company_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD KEY `company_id` (`company_id`);
--
-- Indexes for table `users_permissions`
--
ALTER TABLE `users_permissions`
ADD PRIMARY KEY (`id`),
ADD KEY `permission_id` (`permission_id`),
ADD KEY `user_id` (`user_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `activities`
--
ALTER TABLE `activities`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `activity_types`
--
ALTER TABLE `activity_types`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `clients`
--
ALTER TABLE `clients`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `companies`
--
ALTER TABLE `companies`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `deals`
--
ALTER TABLE `deals`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `deal_services`
--
ALTER TABLE `deal_services`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `permissions`
--
ALTER TABLE `permissions`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=36;
--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `users_permissions`
--
ALTER TABLE `users_permissions`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
/*!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 */;
| true |
ef32cc7f7338e75ab78b803f3e952e8d9f97811b | SQL | emirlej/Udemy-PostgreSQL-bootcamp | /challenge_1.sql | UTF-8 | 802 | 4 | 4 | [] | no_license | /*
Name: EMLE
Date: 09.11.16
*/
-- Number of payment transactions were greater than 5000 dollars?
SELECT COUNT(amount)
FROM payment
WHERE amount > 5;
-- How many actors have a first name starting with P?
SELECT COUNT(first_name) -- Can also use COUNT(*)
FROM actor
WHERE first_name LIKE 'P%';
-- How many unique districts are our customers from?
SELECT COUNT(DISTINCT district)
FROM address;
-- Retrieve the unique district names
SELECT DISTINCT district
FROM address;
/*
How many films have a rating of R and a replacement cost
between 5 and 15 dollars?
*/
SELECT COUNT(*) -- * means count number of rows
FROM film
WHERE rating = 'R' AND replacement_cost BETWEEN 5 AND 15;
-- How many films have the word Truman somewhere in the title?
SELECT COUNT(*)
FROM film
WHERE title LIKE '%Truman%';
| true |
9f8404fd86ca4025fbf4a0e3e28f2d014ba55cae | SQL | ccortes96/Proyecto-Bases-de-Datos-I | /BD/Procedimientos/SP_ELIMINAR_DESEO.sql | UTF-8 | 819 | 3.109375 | 3 | [] | no_license | DROP PROCEDURE IF EXISTS SP_ELIMINAR_DESEO;
DELIMITER $$
CREATE PROCEDURE SP_ELIMINAR_DESEO(
IN pnidCuenta INT,
IN pnidProducto INT,
OUT pcMensaje VARCHAR(1000),
OUT pbOcurrioError BOOLEAN
)
SP:BEGIN
DECLARE vnConteo INT DEFAULT 0;
DECLARE vnIdProducto INT;
DECLARE vnCantidad INT;
SET autocommit=0;
START TRANSACTION;
SET pcMensaje='';
SET pbOcurrioError = TRUE;
SELECT COUNT(*) INTO vnConteo FROM Deseo WHERE Producto_idProducto = pnidProducto;
IF vnConteo > 0 THEN
DELETE FROM Deseo WHERE Producto_idProducto = pnidProducto;
SET pcMensaje = 'Producto eliminado con éxito.';
SET pbOcurrioError = FALSE;
COMMIT;
ELSE
SET pcMensaje='El Producto no existe en la lista.';
LEAVE SP;
END IF;
END $$ | true |
be4f53c12040945800ec38dd7ec359c0d43a0512 | SQL | jebc88/AlphaDesign | /PROYECTO_FINAL/MySQL/StoredProcedures/Pa_insertarNuevoUsuario.sql | UTF-8 | 1,819 | 3.890625 | 4 | [] | no_license | DELIMITER //
CREATE PROCEDURE insertarUsuarioNuevo
(
p_id varchar(20),
p_nombre varchar(50),
p_apellido1 varchar(50),
p_apellido2 varchar(50),
p_fechaNacimiento date,
p_genero char(1),
p_telefono varchar(20),
p_correo varchar(20),
p_usuario varchar(20),
p_pass varchar(50),
p_tipo int
)
BEGIN
DECLARE existeId bit;
DECLARE existeCorreo bit;
DECLARE existeUsuario bit;
DECLARE exito bit DEFAULT 0;
CREATE TEMPORARY TABLE errorMsg(
Error varchar(100)
);
SET existeId := IFNULL ((SELECT 1
FROM usuario
WHERE identificacion = p_id),0);
SET existeCorreo := IFNULL ((SELECT 1
FROM usuario
WHERE correo = p_correo),0);
SET existeUsuario := IFNULL ((SELECT 1
FROM usuario
WHERE usuario = p_usuario),0);
IF (existeId = 0 AND existeCorreo = 0 AND existeUsuario = 0) THEN
SET exito = 1;
END IF;
IF (exito = 1) THEN
INSERT INTO usuario
(
identificacion,
nombre,
apellido1,
apellido2,
fechaNacimiento,
genero,
telefono,
correo,
usuario,
pass,
tipo,
fechaCreacion,
estado
)
VALUES
(
p_id,
p_nombre,
p_apellido1,
p_apellido2,
p_fechaNacimiento,
p_genero,
p_telefono,
p_correo,
p_usuario,
password(p_pass),
p_tipo,
NOW(),
0
);
ELSE
IF (existeId = 1) THEN
INSERT INTO errorMsg(Error)
VALUES('Identificacion ya existe');
END IF;
IF (existeCorreo = 1) THEN
INSERT INTO errorMsg(Error)
VALUES('Correo ya existe');
END IF;
IF (existeUsuario = 1) THEN
INSERT INTO errorMsg(Error)
VALUES('Nombre de usuario ya existe');
END IF;
SELECT *
FROM errorMsg;
END IF;
END //
DELIMITER ; | true |
6f31bc96760b32b50a7ad71df14eee15654458ec | SQL | WelingtonMoraes/Gerenciador-de-tarefas | /BD.sql | UTF-8 | 1,751 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 24-Mar-2020 às 03:28
-- Versão do servidor: 5.6.34
-- PHP Version: 7.1.11
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: `tarefas`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `agenda_tarefas`
--
CREATE TABLE `agenda_tarefas` (
`id` int(11) NOT NULL,
`titulo` varchar(50) NOT NULL,
`descricao` varchar(50) NOT NULL,
`data_inicio` date NOT NULL,
`data_final` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `agenda_tarefas`
--
INSERT INTO `agenda_tarefas` (`id`, `titulo`, `descricao`, `data_inicio`, `data_final`) VALUES
(1, 'Buscar filhos na escola', 'as 17 devo buscar meus filhos na escola', '2019-12-22', '2019-12-23'),
(3, 'fazer compras', 'comprar coisas para casa', '2019-12-22', '2019-12-26');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `agenda_tarefas`
--
ALTER TABLE `agenda_tarefas`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `agenda_tarefas`
--
ALTER TABLE `agenda_tarefas`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
a2c660b8ddf515e22f761895230409fb12727947 | SQL | Bioconductor/BioconductorAnnotationPipeline | /annosrc/go/script/term_synonym.sql | UTF-8 | 718 | 2.890625 | 3 | [] | no_license | -- MySQL dump 10.9
--
-- Host: localhost Database: go
-- ------------------------------------------------------
-- Server version 4.1.12
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=',MYSQL40' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table term_synonym
--
DROP TABLE IF EXISTS term_synonym;
CREATE TABLE term_synonym (
term_id int(11) NOT NULL default '0',
term_synonym varchar(255) default NULL,
acc_synonym varchar(255) default NULL,
synonym_type_id int(11) NOT NULL default '0',
synonym_category_id int(11) default NULL
);
CREATE INDEX ts1 on term_synonym(term_id);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
| true |
65a56a892785ebd582c3851ea2a0061b90da7962 | SQL | Lizaveta0302/insurance | /src/main/resources/db/migration/V1.4__create_vehicles_table.sql | UTF-8 | 457 | 3.125 | 3 | [] | no_license | CREATE TABLE vehicles
(
id serial NOT NULL,
number integer,
model varchar NOT NULL,
policy_id integer,
driver_id integer,
PRIMARY KEY (id),
CONSTRAINT "FK_policies" FOREIGN KEY (policy_id)
REFERENCES policies (id)
ON UPDATE CASCADE
ON DELETE SET NULL,
CONSTRAINT "FK_drivers" FOREIGN KEY (driver_id)
REFERENCES drivers (id)
ON UPDATE CASCADE
ON DELETE SET NULL
) | true |
c6c30fb04e2d4a059bc85f3be3159567fec35d21 | SQL | medy13/dbshell | /today_shell/CTS_CHKRATE_LIMIT_GPTMP_TODAY.sql | UTF-8 | 810 | 2.703125 | 3 | [] | no_license | \echo ------------------CTS_CHKRATE_LIMIT----------------
select now();
\timing
delete from CTS_CHKRATE_LIMIT_GPTMP;
insert into CTS_CHKRATE_LIMIT_GPTMP (CMD_TYPE,ID) select CMD_TYPE,ID from CTS_CHKRATE_LIMIT_INC_EXT;
delete from CTS_CHKRATE_LIMIT_GPTMP_TODAY using CTS_CHKRATE_LIMIT_GPTMP where CTS_CHKRATE_LIMIT_GPTMP.ID=CTS_CHKRATE_LIMIT_GPTMP_TODAY.ID ;
insert into CTS_CHKRATE_LIMIT_GPTMP_TODAY (CMD_TYPE,ID,CUSTOMS_CODE,I_E_FLAG,MAX_CHK_RATE,MAX_OPEN_RATE,QUICK_CHK_RATE,QUICKUNI_CHK_RATE,UNI_CHK_RATE,UNI_NOCHK_RATE,RANDOM_RECHK_RATE,RANDOM_FOCUS_CHK_RATE) select CMD_TYPE,ID,CUSTOMS_CODE,I_E_FLAG,MAX_CHK_RATE,MAX_OPEN_RATE,QUICK_CHK_RATE,QUICKUNI_CHK_RATE,UNI_CHK_RATE,UNI_NOCHK_RATE,RANDOM_RECHK_RATE,RANDOM_FOCUS_CHK_RATE from CTS_CHKRATE_LIMIT_INC_EXT;
delete from CTS_CHKRATE_LIMIT_GPTMP;
\timing
| true |
d98d5c13bbd74e37c932d91172a3046ba85119c3 | SQL | sprokushev/Delphi | /MASTER/_DATABASE/Tables/MASTER_QUERY_TYPES_DESC.sql | WINDOWS-1251 | 826 | 3.34375 | 3 | [] | no_license | --
-- MASTER_QUERY_TYPES_DESC (Table)
--
CREATE TABLE MASTER.MASTER_QUERY_TYPES_DESC
(
ID NUMBER(10) NOT NULL,
STRUCTURE_ID VARCHAR2(50 BYTE),
TYPE_ID NUMBER(10),
IS_AUTO_LINK NUMBER(1) DEFAULT 0
)
TABLESPACE USERS2
NOCOMPRESS ;
COMMENT ON TABLE MASTER.MASTER_QUERY_TYPES_DESC IS ' "" - " "';
COMMENT ON COLUMN MASTER.MASTER_QUERY_TYPES_DESC.ID IS ' -';
COMMENT ON COLUMN MASTER.MASTER_QUERY_TYPES_DESC.STRUCTURE_ID IS '';
COMMENT ON COLUMN MASTER.MASTER_QUERY_TYPES_DESC.TYPE_ID IS ' ';
COMMENT ON COLUMN MASTER.MASTER_QUERY_TYPES_DESC.IS_AUTO_LINK IS ' ';
| true |
f0b5b03225eec7ca4417aae0b35173722099e34b | SQL | nmanich/eBird_to_postgreSQL | /HowToUpdateNewBreedingCodes/updatenewbreedingcodes.sql | UTF-8 | 1,039 | 3.34375 | 3 | [] | no_license | /*
This is how you overwrite old breeding codes with changed breeding codes.
*/
--make an update csv with 3 columns: the obsid you want to change, and the new breeding code and category
--column names listed below
--make a table structure for the new code data
CREATE TABLE newcodes (
newcode_global_unique_identifier VARCHAR(50) UNIQUE NOT NULL PRIMARY KEY,
newbreeding_code VARCHAR(2),
newbreeding_category CHAR(2));
--load the table you created above with the csv you made from your data with intended changes
COPY NEWCODES FROM 'C:\Users\nicho\Desktop\nawatestdatabase\newcodes.csv' DELIMITER ',' CSV HEADER NULL AS 'NA';
--make changes to update the breeding codes and breeding category within the obs table of the database
UPDATE obs
SET breeding_code = newbreeding_code
FROM newcodes
WHERE global_unique_identifier = newcode_global_unique_identifier;
UPDATE obs
SET breeding_category = newbreeding_category
FROM newcodes
WHERE global_unique_identifier = newcode_global_unique_identifier;
| true |
08a91f88330a0633218a06e40effdcf34b07efe7 | SQL | bryancheng501/BookStore-Application | /SQL/queries.sql | UTF-8 | 1,531 | 4.09375 | 4 | [] | no_license | --Creating new customer account
insert into account(username, password)
values('username', 'password', 'customer');
--Checking if a username already exists
select * from account
where uesrname = 'username';
--Verifying username and password
select * from account
where username = 'username' and password = 'password';
--Different book search queries:
--Search book by title and genre (Case insensitive, subset of whole string)
select ISBN, publisher_name, title, author, genre, num_pages, price
from book
where title ilike '%title%' and genre = 'genre';
--Search book by publisher and genre (Case insensitive, subset of whole string)
select ISBN, publisher_name, title, author, genre, num_pages, price
from book
where publisher ilike '%publisher%' and genre = 'genre';
--Search book by author and genre (Case insensitive, subset of whole string)
select ISBN, publisher_name, title, author, genre, num_pages, price
from book
where author ilike '%author%' and genre = 'genre';
--Search book by ISBN (exact match) and genre
select ISBN, publisher_name, title, author, genre, num_pages, price
from book
where ISBN = 'ISBN' and genre = 'genre';
--NOTE: above 3 queries can search for books based off title, publisher, author
-- or ISBN only (without genre) by simply removing 'and genre = 'genre''
--Checking out books by ISBN
insert into checkout_basket(username, ISBN)
values('username', 'ISBN');
--Getting all books in checkout basket
select ISBN
from checkout_basket
where username = 'username'; | true |
0932c5ffb771d3cc86a19264966bdf00fa509513 | SQL | Mumier/requisicion | /requisicion.sql | UTF-8 | 25,643 | 3.34375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : Local
Source Server Version : 50524
Source Host : localhost:3306
Source Database : requisicion
Target Server Type : MYSQL
Target Server Version : 50524
File Encoding : 65001
Date: 2014-08-11 19:32:38
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `profiles`
-- ----------------------------
DROP TABLE IF EXISTS `profiles`;
CREATE TABLE `profiles` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`lastname` varchar(50) NOT NULL DEFAULT '',
`firstname` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`user_id`),
CONSTRAINT `user_profile_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of profiles
-- ----------------------------
INSERT INTO `profiles` VALUES ('1', 'Admin', 'Administrator');
INSERT INTO `profiles` VALUES ('2', 'Demo', 'Demo');
INSERT INTO `profiles` VALUES ('7', 'Rueda', 'Jorge');
INSERT INTO `profiles` VALUES ('10', 'Rueda', 'Jorge');
-- ----------------------------
-- Table structure for `profiles_fields`
-- ----------------------------
DROP TABLE IF EXISTS `profiles_fields`;
CREATE TABLE `profiles_fields` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`varname` varchar(50) NOT NULL,
`title` varchar(255) NOT NULL,
`field_type` varchar(50) NOT NULL,
`field_size` varchar(15) NOT NULL DEFAULT '0',
`field_size_min` varchar(15) NOT NULL DEFAULT '0',
`required` int(1) NOT NULL DEFAULT '0',
`match` varchar(255) NOT NULL DEFAULT '',
`range` varchar(255) NOT NULL DEFAULT '',
`error_message` varchar(255) NOT NULL DEFAULT '',
`other_validator` varchar(5000) NOT NULL DEFAULT '',
`default` varchar(255) NOT NULL DEFAULT '',
`widget` varchar(255) NOT NULL DEFAULT '',
`widgetparams` varchar(5000) NOT NULL DEFAULT '',
`position` int(3) NOT NULL DEFAULT '0',
`visible` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `varname` (`varname`,`widget`,`visible`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of profiles_fields
-- ----------------------------
INSERT INTO `profiles_fields` VALUES ('1', 'lastname', 'Last Name', 'VARCHAR', '50', '3', '1', '', '', 'Incorrect Last Name (length between 3 and 50 characters).', '', '', '', '', '1', '3');
INSERT INTO `profiles_fields` VALUES ('2', 'firstname', 'First Name', 'VARCHAR', '50', '3', '1', '', '', 'Incorrect First Name (length between 3 and 50 characters).', '', '', '', '', '0', '3');
-- ----------------------------
-- Table structure for `shop_address`
-- ----------------------------
DROP TABLE IF EXISTS `shop_address`;
CREATE TABLE `shop_address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`street` varchar(255) NOT NULL,
`zipcode` varchar(255) DEFAULT NULL,
`city` varchar(255) NOT NULL,
`country` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of shop_address
-- ----------------------------
INSERT INTO `shop_address` VALUES ('1', 'Jorge', 'Rueda', '1', '1', '1', '1');
INSERT INTO `shop_address` VALUES ('2', 'Jorge', 'Rueda', '1', '1', '1', '1');
INSERT INTO `shop_address` VALUES ('3', 'Jorge', 'Rueda', '1', '1', '1', '1');
INSERT INTO `shop_address` VALUES ('4', 'Jorge', 'Rueda', '1', '1', '1', '1');
INSERT INTO `shop_address` VALUES ('5', 'Jorge', 'Rueda', 'Popular', 'Cúcuta', '540003', 'Colombia');
INSERT INTO `shop_address` VALUES ('6', 'Jorge', 'Rueda', 'Popular', 'Cúcuta', '540003', 'Colombia');
INSERT INTO `shop_address` VALUES ('7', 'Jorge', 'Rueda', 'Popular', 'Cúcuta', '540003', 'Colombia');
INSERT INTO `shop_address` VALUES ('8', 'Antonio', 'Rueda', 'popular', 'cucuta', '2014', 'Colombia');
INSERT INTO `shop_address` VALUES ('9', 'Antonio', 'Rueda', 'Desarrollo de software', 'Cúcuta', '201', 'Colombia');
INSERT INTO `shop_address` VALUES ('10', 'Jorge', 'Antonio', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('11', 'Jorge', 'Antonio', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('12', 'Jorge', 'Antonio', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('13', 'Linda', 'Rueda', 'Popular', '54003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('14', 'Linda', 'Rueda', 'Popular', '54003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('15', 'Linda', 'Rueda', 'Popular', '54003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('16', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Cp');
INSERT INTO `shop_address` VALUES ('17', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Cp');
INSERT INTO `shop_address` VALUES ('18', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Cp');
INSERT INTO `shop_address` VALUES ('19', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('20', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('21', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('22', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('23', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('24', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('25', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('26', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('27', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('28', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('29', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('30', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('31', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('32', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('33', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('34', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('35', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('36', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('37', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('38', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('39', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('40', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('41', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('42', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('43', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('44', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('45', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('46', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('47', 'Jorge', 'Rueda', 'Software', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('48', 'Jorge', 'Rueda', 'Popular', '54564', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('49', 'Jorge', 'Rueda', 'Popular', '54564', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('50', 'Jorge', 'Rueda', 'Popular', '54564', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('51', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('52', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('53', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('54', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('55', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('56', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('57', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('58', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('59', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('60', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('61', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('62', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('63', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
INSERT INTO `shop_address` VALUES ('64', 'Jorge', 'Rueda', 'Popular', '540003', 'Cúcuta', 'Colombia');
-- ----------------------------
-- Table structure for `shop_category`
-- ----------------------------
DROP TABLE IF EXISTS `shop_category`;
CREATE TABLE `shop_category` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`parent_id` int(11) DEFAULT NULL,
`title` varchar(45) COLLATE utf8_spanish_ci NOT NULL,
`description` text COLLATE utf8_spanish_ci,
`language` varchar(45) COLLATE utf8_spanish_ci DEFAULT NULL,
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- ----------------------------
-- Records of shop_category
-- ----------------------------
INSERT INTO `shop_category` VALUES ('1', '0', 'Electrodomesticos', '', '');
INSERT INTO `shop_category` VALUES ('2', '0', 'Secondary Articles', null, null);
INSERT INTO `shop_category` VALUES ('3', '1', 'Red Primary Articles', null, null);
INSERT INTO `shop_category` VALUES ('4', '1', 'Green Primary Articles', null, null);
INSERT INTO `shop_category` VALUES ('5', '2', 'Red Secondary Articles', null, null);
INSERT INTO `shop_category` VALUES ('6', '0', 'Muebles', '', '');
-- ----------------------------
-- Table structure for `shop_customer`
-- ----------------------------
DROP TABLE IF EXISTS `shop_customer`;
CREATE TABLE `shop_customer` (
`customer_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`address_id` int(11) NOT NULL,
`delivery_address_id` int(11) NOT NULL,
`billing_address_id` int(11) NOT NULL,
`email` varchar(45) COLLATE utf8_spanish_ci NOT NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- ----------------------------
-- Records of shop_customer
-- ----------------------------
INSERT INTO `shop_customer` VALUES ('1', '1', '0', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('2', '0', '2', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('3', '0', '5', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('4', '0', '9', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('5', '0', '0', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('6', '0', '10', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('7', '0', '13', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('8', '0', '16', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('9', '0', '19', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('10', '0', '48', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('11', '0', '0', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('12', '0', '51', '0', '0', 'ja_mumi@hotmail.com');
INSERT INTO `shop_customer` VALUES ('13', '0', '54', '0', '0', 'ja_mumi@hotmail.com');
-- ----------------------------
-- Table structure for `shop_image`
-- ----------------------------
DROP TABLE IF EXISTS `shop_image`;
CREATE TABLE `shop_image` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(45) COLLATE utf8_spanish_ci NOT NULL,
`filename` varchar(45) COLLATE utf8_spanish_ci NOT NULL,
`product_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk_Image_Products` (`product_id`),
CONSTRAINT `fk_Image_Products` FOREIGN KEY (`product_id`) REFERENCES `shop_products` (`product_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- ----------------------------
-- Records of shop_image
-- ----------------------------
INSERT INTO `shop_image` VALUES ('1', 'de', 'Desert.jpg', '5');
-- ----------------------------
-- Table structure for `shop_order`
-- ----------------------------
DROP TABLE IF EXISTS `shop_order`;
CREATE TABLE `shop_order` (
`order_id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`delivery_address_id` int(11) NOT NULL,
`billing_address_id` int(11) NOT NULL,
`ordering_date` int(11) NOT NULL,
`ordering_done` tinyint(1) DEFAULT NULL,
`ordering_confirmed` tinyint(1) DEFAULT NULL,
`payment_method` int(11) NOT NULL,
`shipping_method` int(11) NOT NULL,
`comment` text COLLATE utf8_spanish_ci,
PRIMARY KEY (`order_id`),
KEY `fk_order_customer` (`customer_id`),
CONSTRAINT `fk_order_customer1` FOREIGN KEY (`customer_id`) REFERENCES `shop_customer` (`customer_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- ----------------------------
-- Records of shop_order
-- ----------------------------
INSERT INTO `shop_order` VALUES ('1', '2', '3', '4', '1404869843', null, null, '5', '1', '');
INSERT INTO `shop_order` VALUES ('2', '3', '6', '7', '1404869978', null, null, '1', '1', '');
INSERT INTO `shop_order` VALUES ('3', '6', '11', '12', '1405027681', null, null, '1', '1', 'Hello');
INSERT INTO `shop_order` VALUES ('4', '7', '14', '15', '1405027835', null, null, '1', '1', 'Hola');
INSERT INTO `shop_order` VALUES ('5', '8', '17', '18', '1405029316', null, null, '1', '1', 'HAi');
INSERT INTO `shop_order` VALUES ('6', '9', '20', '21', '1405035094', null, null, '1', '1', 'Hola');
INSERT INTO `shop_order` VALUES ('7', '9', '24', '25', '1405035297', null, null, '1', '1', 'Hola');
INSERT INTO `shop_order` VALUES ('8', '9', '28', '29', '1405035406', null, null, '1', '1', 'Hola');
INSERT INTO `shop_order` VALUES ('9', '9', '32', '33', '1405035449', null, null, '1', '1', 'Hola');
INSERT INTO `shop_order` VALUES ('10', '9', '34', '35', '1405035817', null, null, '1', '1', '');
INSERT INTO `shop_order` VALUES ('11', '9', '38', '39', '1405035880', null, null, '1', '1', 'holo');
INSERT INTO `shop_order` VALUES ('12', '9', '42', '43', '1405035977', null, null, '1', '1', 'holo');
INSERT INTO `shop_order` VALUES ('13', '9', '44', '45', '1405036529', null, null, '1', '1', '');
INSERT INTO `shop_order` VALUES ('14', '9', '46', '47', '1405037174', null, null, '1', '1', '');
INSERT INTO `shop_order` VALUES ('15', '10', '49', '50', '1405037468', null, null, '1', '1', 'aa');
INSERT INTO `shop_order` VALUES ('16', '12', '52', '53', '1405037769', null, null, '1', '1', 'aaa');
INSERT INTO `shop_order` VALUES ('17', '13', '55', '56', '1405038000', null, null, '1', '1', 'hoolo\r\n');
INSERT INTO `shop_order` VALUES ('18', '13', '57', '58', '1405038320', null, null, '1', '1', 'oooo');
INSERT INTO `shop_order` VALUES ('19', '13', '59', '60', '1405038362', null, null, '1', '1', 'aaa');
INSERT INTO `shop_order` VALUES ('20', '13', '61', '62', '1405038683', null, null, '1', '1', 'aaaa');
INSERT INTO `shop_order` VALUES ('21', '13', '63', '64', '1405039385', null, null, '1', '1', 'fafafafa');
-- ----------------------------
-- Table structure for `shop_order_position`
-- ----------------------------
DROP TABLE IF EXISTS `shop_order_position`;
CREATE TABLE `shop_order_position` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`amount` int(11) NOT NULL,
`specifications` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of shop_order_position
-- ----------------------------
INSERT INTO `shop_order_position` VALUES ('1', '1', '1', '1', '{\"5\":[\"1\"],\"1\":[\"1\"]}');
INSERT INTO `shop_order_position` VALUES ('2', '2', '3', '3', 'null');
INSERT INTO `shop_order_position` VALUES ('3', '3', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('4', '4', '2', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('5', '5', '4', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('6', '6', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('7', '7', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('8', '8', '4', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('9', '9', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('10', '10', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('11', '11', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('12', '12', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('13', '13', '4', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('14', '14', '4', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('15', '15', '5', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('16', '16', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('17', '17', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('18', '18', '5', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('19', '19', '5', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('20', '20', '3', '1', 'null');
INSERT INTO `shop_order_position` VALUES ('21', '21', '5', '1', 'null');
-- ----------------------------
-- Table structure for `shop_payment_method`
-- ----------------------------
DROP TABLE IF EXISTS `shop_payment_method`;
CREATE TABLE `shop_payment_method` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`description` text,
`tax_id` int(11) NOT NULL,
`price` double NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of shop_payment_method
-- ----------------------------
INSERT INTO `shop_payment_method` VALUES ('1', 'cash', 'You pay cash', '1', '0');
INSERT INTO `shop_payment_method` VALUES ('2', 'advance Payment', 'You pay in advance, we deliver', '1', '0');
INSERT INTO `shop_payment_method` VALUES ('3', 'cash on delivery', 'You pay when we deliver', '1', '0');
INSERT INTO `shop_payment_method` VALUES ('4', 'invoice', 'We deliver and send a invoice', '1', '0');
INSERT INTO `shop_payment_method` VALUES ('5', 'paypal', 'You pay by paypal', '1', '0');
-- ----------------------------
-- Table structure for `shop_products`
-- ----------------------------
DROP TABLE IF EXISTS `shop_products`;
CREATE TABLE `shop_products` (
`product_id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`tax_id` int(11) NOT NULL,
`title` varchar(45) COLLATE utf8_spanish_ci NOT NULL,
`description` text COLLATE utf8_spanish_ci,
`price` varchar(45) COLLATE utf8_spanish_ci DEFAULT NULL,
`language` varchar(45) COLLATE utf8_spanish_ci DEFAULT NULL,
`specifications` text COLLATE utf8_spanish_ci,
PRIMARY KEY (`product_id`),
KEY `fk_products_category` (`category_id`),
CONSTRAINT `fk_products_category` FOREIGN KEY (`category_id`) REFERENCES `shop_category` (`category_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- ----------------------------
-- Records of shop_products
-- ----------------------------
INSERT INTO `shop_products` VALUES ('1', '1', '1', 'Demonstration of Article with variations', 'Hello, World!', '19.99', null, null);
INSERT INTO `shop_products` VALUES ('2', '1', '2', 'Another Demo Article with less Tax', '!!', '29.99', null, null);
INSERT INTO `shop_products` VALUES ('3', '2', '1', 'Demo3', '', '', null, null);
INSERT INTO `shop_products` VALUES ('4', '4', '1', 'Demo4', '', '7, 55', null, null);
INSERT INTO `shop_products` VALUES ('5', '1', '0', 'Monitor', '', '200000', null, '{\"Size\":\"21 pulgadas\",\"Color\":\"\",\"Some random attribute\":\"\",\"Material\":\"\",\"Specific number\":\"\"}');
-- ----------------------------
-- Table structure for `shop_product_specification`
-- ----------------------------
DROP TABLE IF EXISTS `shop_product_specification`;
CREATE TABLE `shop_product_specification` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`is_user_input` tinyint(1) DEFAULT NULL,
`required` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of shop_product_specification
-- ----------------------------
INSERT INTO `shop_product_specification` VALUES ('1', 'Size', '0', '1');
INSERT INTO `shop_product_specification` VALUES ('2', 'Color', '0', '0');
INSERT INTO `shop_product_specification` VALUES ('3', 'Some random attribute', '0', '0');
INSERT INTO `shop_product_specification` VALUES ('4', 'Material', '0', '1');
INSERT INTO `shop_product_specification` VALUES ('5', 'Specific number', '1', '1');
-- ----------------------------
-- Table structure for `shop_product_variation`
-- ----------------------------
DROP TABLE IF EXISTS `shop_product_variation`;
CREATE TABLE `shop_product_variation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`specification_id` int(11) NOT NULL,
`position` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`price_adjustion` float NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of shop_product_variation
-- ----------------------------
INSERT INTO `shop_product_variation` VALUES ('1', '1', '1', '2', 'variation1', '3');
INSERT INTO `shop_product_variation` VALUES ('2', '1', '1', '3', 'variation2', '6');
INSERT INTO `shop_product_variation` VALUES ('3', '1', '2', '4', 'variation3', '9');
INSERT INTO `shop_product_variation` VALUES ('4', '1', '5', '1', 'please enter a number here', '0');
-- ----------------------------
-- Table structure for `shop_shipping_method`
-- ----------------------------
DROP TABLE IF EXISTS `shop_shipping_method`;
CREATE TABLE `shop_shipping_method` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`description` text,
`tax_id` int(11) NOT NULL,
`price` double NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of shop_shipping_method
-- ----------------------------
INSERT INTO `shop_shipping_method` VALUES ('1', 'Delivery by postal Service', 'We deliver by Postal Service. 2.99 units of money are charged for that', '1', '2.99');
-- ----------------------------
-- Table structure for `shop_tax`
-- ----------------------------
DROP TABLE IF EXISTS `shop_tax`;
CREATE TABLE `shop_tax` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`percent` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of shop_tax
-- ----------------------------
INSERT INTO `shop_tax` VALUES ('1', '19%', '19');
INSERT INTO `shop_tax` VALUES ('2', '7%', '7');
-- ----------------------------
-- Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(20) NOT NULL,
`password` varchar(128) NOT NULL,
`email` varchar(128) NOT NULL,
`activkey` varchar(128) NOT NULL DEFAULT '',
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`lastvisit_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`superuser` int(1) NOT NULL DEFAULT '0',
`status` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`),
KEY `status` (`status`),
KEY `superuser` (`superuser`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('1', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'webmaster@example.com', '9a24eff8c15a6a141ece27eb6947da0f', '2014-07-08 20:26:08', '2014-08-01 19:22:17', '1', '1');
INSERT INTO `users` VALUES ('2', 'demo', 'fe01ce2a7fbac8fafaed7c982a04e229', 'demo@example.com', '099f825543f7850cc038b90aaff39fac', '2014-07-08 20:26:08', '2014-08-12 00:29:13', '0', '1');
INSERT INTO `users` VALUES ('7', 'jorge', 'c8da4a1a803d2d0ce965ad88c93a0af7', 'ja_mumi@hotmail.com', '6aea1c1f99e3525ba90f96638278f67e', '2014-07-10 16:47:46', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `users` VALUES ('10', 'JRSOFT', 'c8da4a1a803d2d0ce965ad88c93a0af7', 'jrsoft.jorge@gmail.com', 'c0b730bf636e43a4f925d69d2d9fa659', '2014-07-10 18:30:10', '0000-00-00 00:00:00', '0', '0');
| true |
523c8d147a319d5a0545da7bde10e14051db0e4a | SQL | rekharokkam/t-sql | /Learning SQLForOracle/Joining Multiple Tables/DISTINCT_keyword.sql | UTF-8 | 1,075 | 4.65625 | 5 | [] | no_license | --Distinct returns Unique rows of data. Applies to whole row not columns. Applies to everything in the select statement
select count (distinct state) from author
--When distinct is used with 2 or more columns then it is the combination of columns that do not repeat.
select distinct Price, advance from book
--Code a SELECT statement to show the set of unique publication dates, but don't show any NULL values.
select distinct pubdate from book where pubdate is not null
--Code a SELECT statement to show the last and first names for authors who have published books.
select distinct a.firstname, a.lastname from Author a
join bookauthor ba
on a.author_id = ba.author_id
--Sort the column by Alias name
--Code a SELECT statement to show the profit a book has made so far using the formula: (price * ytd_sales) - advance. Use a column aliases of "Profit" and sort in this order. Be sure to eliminate NULL values.
select (price * ytd_sales) - advance as 'Profit' from book
where price is not null OR advance is not null OR ytd_sales is not null
order by profit asc
| true |
69f61b38c14d1dcbc5802da8e7177185ea3acc1f | SQL | DKLynch/LeetCode-Challenges | /Database/Big Countries/BigCountries.sql | UTF-8 | 171 | 2.875 | 3 | [
"Unlicense"
] | permissive | /*Problem URL: https://leetcode.com/problems/big-countries/ */
SELECT
NAME,
POPULATION,
AREA
FROM
World
WHERE
POPULATION > 25000000
OR AREA > 3000000
| true |
f46bf011384aeae607c2ed14bce46c254390af70 | SQL | marcel099/sti-menus-vero-dellaudo | /Inserts_de_Menus.sql | UTF-8 | 8,740 | 2.859375 | 3 | [] | no_license | --
-- Observações iniciais:
-- ATENÇÃO Antes de alterar qualquer coisa neste script INTERPRETAR bem e REVISAR adequadamente para evitar ERROS e INCONSISTÊNCIAS
-- Ao colar novos inserts neste arquivo manter em ORDEM CRESCENTE por CODCONTROLE
--
-- Participantes:
-- Lucas Gehlen
-- Gregori Schuster
-- Marcelo Lupatini
-- Vinicius Meng
-- Central de Marcação
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (52, 0, 'Central de Marcação', '#', 'S', null, 'calendar');
-- Cadastro
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (53, 52, 'Cadastro', '#', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (54, 53, 'Recurso', '/Cm_Recurso', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (58, 53, 'Cidade', '/Cidade', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (59, 53, 'Escala', '/Cm_Escala', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (60, 53, 'Equipamento', '/Cm_Equipamento', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (61, 53, 'Lembretes', '/Cm_Lembretes', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (62, 53, 'Feriados', '/Cm_Feriados', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (63, 53, 'Apelido/Realizante', '/Cm_ApelRea', 'S');
--acrescentando campos na table cm_lembretes
alter table cm_lembretes
add diasemana number(1) default 8
add datavigencia date
-- Relatórios
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (64, 52, 'Relatórios', '#', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (65, 64, 'Pacientes Agendados', '/RelPacAgendByUser', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (66, 64, 'Exames por Recurso', '/RelExameRecurso', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (67, 64, 'Exames por Realizante', '/RelExameRealizante', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (68, 64, 'Convênios por Recurso', '/RelConvenioRecurso', 'S');
--Relatórios Controle
INSERT INTO web_controle (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (69, 17, 'Relatórios', '#', 'S', null, '');
INSERT INTO web_controle (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (70, 69, 'Laudos Corrigidos', '/RelStatusCorrigido', 'S', null, '');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (71, 64, ' Horários Livres', '/RelHorLivres', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (72, 64, 'Produção', '/RelProducao', 'S');
-- Gerar
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (73, 52, 'Gerar' , '#', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (74, 73, 'Gerar Horários', '/GerHor', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (75, 73, 'Gerar Bloqueios', '/GerBloq', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (76, 73, 'Excluir Bloqueio Automático', '/GerBloqAut', 'S');
-- 77 usado pelo Lucas
-- Recepção
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, icone)
VALUES (78, 0, 'Recepção', '#', 'S', 'id-card');
-- Cadastro
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (79, 78, 'Cadastros', '#', 'S');
--INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL) -- Não pronta
--VALUES (80, 79, 'Preparo de Exames', '/Preparo', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (81, 79, 'Tempo de Entrega', '/TempoEntrega', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (82, 79, 'Feriado de Entrega', '/FeriadoEntrega', 'S');
-- Central de Marcação - Cadastro
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (83, 53, 'Relação Real./Exame', '/Cm_RealizanteExame', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (84, 53, 'Relação Rec./Exame', '/Cm_RecursoExame', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (85, 53, 'Relação Rec./Conv.', '/Cm_RecursoConvenio', 'S');
-- Controle -> Relatorio de Entregas
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (86, 69, 'Entregas Realizadas', '/RelEntrega', 'S', null, '');
-- Faturamento
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, icone)
VALUES (87, 0, 'Faturamento', '#', 'S', 'bar-chart');
-- Cadastro
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (88, 87, 'Cadastro', '#', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (89, 88, 'Grupo de Faturamento', '/GrpFat', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (90, 87, 'Módulo de Fatura - I.P.E.', '/FatModIpe', 'S');
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL)
VALUES (91, 88, '', '', 'S');
-- Controle -> Relatorio de Laudos PADI 1%
INSERT INTO web_controle (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (92, 69, 'Laudos PADI', '/RelPADI', 'S', null, '');
-- faturamento -> cadastros -> especialidade dos exames
INSERT INTO web_controle(codcontrole, codcontrolepai, label, controle, visivel)
VALUES (93, 87, 'Especialidade dos Exames', '/GrpExame', 'S');
-- faturamento -> TISS
INSERT INTO web_controle(codcontrole, codcontrolepai, label, controle, visivel)
VALUES (94, 87, 'TISS', '#', 'S');
-- faturamento -> TISS -> Versão do Tiss
INSERT INTO web_controle(codcontrole, codcontrolepai, label, controle, visivel)
VALUES (95, 94, 'Versão do Tiss', '/TissVersao', 'S');
-- faturamento -> TISS -> Tipo de logradouro
INSERT INTO web_controle(codcontrole, codcontrolepai, label, controle, visivel)
VALUES (96, 94, 'Tipo de logradouro', '/TipoLogradouro', 'S');
-- Fluxos -> De Controle de Laudos
INSERT INTO web_controle (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (97, 2, 'De Controle de Laudos', '/FluxoControleLaudo', 'S', null, 'list');
-- Laudos Atrasados -> Relatório
INSERT INTO web_controle (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (98, 69, 'Laudos Atrasados', '/RelLaudoAtrasado', 'S', null, '');
--Faturamento -> Tiss -> Convênios
INSERT INTO web_controle (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (99, 94, 'Convênios', '/ConvenioTISS', 'S', null, '');
/* RDM 323 */
INSERT INTO WEB_CONTROLE (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (100, 53, 'Grupo de Salas', '/Cm_GrupoSala', 'S', null, '');
/* RDM 323 */
--Área de Exams -> Gastos de Sala
INSERT INTO web_controle (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (101, 6, 'Gastos de Sala', '/GastosDeSala', 'S', null, '');
--Faturamento -> Fatura CSV
INSERT INTO web_controle (CODCONTROLE, CODCONTROLEPAI, LABEL, CONTROLE, VISIVEL, INDICE, ICONE)
VALUES (102, 93, 'Fatura CSV', '/FaturaCSV', 'S', null, '');
-- faturamento -> TISS -> CBO-S
insert into web_controle(codcontrole, codcontrolepai, label, controle, visivel)
values (103, 94, 'CBO-S', '/Cbos', 'S');
-- faturamento -> Manutenção de Pendências das Consultas
insert into web_controle(codcontrole, codcontrolepai, label, controle, visivel)
values (104, 87, 'Manutenção de Pendências das Consultas', '/Pendencias', 'S');
| true |
82e828878f45106afea1d513a13e5cee254c74d4 | SQL | Ardis84/SaFast | /SaFast/SAProject/WebContent/sql/query1.sql | UTF-8 | 813 | 3.34375 | 3 | [] | no_license | select sa.DATARICHIESTA,
sa.DATASCADENZA,
sa.DATACHIUSURA,
(select c.DESCCLIENTE from ELENCOCLIENTI c where c.IDCLIENTE = sa.IDCLIENTE) as cliente,
(select pr.PROCEDURA from PROCEDUR pr where pr.IDPROCEDURA = sa.IDPROCEDURA) as procedura,
sa.NUMEROSCHEDA ||'/'||rc.NUMERORICHIESTA as scheda,
sa.ANNULLATA,
rc.DATAANNULLATA,
DBMS_LOB.substr(sa.NOTE, 4000) as testo,
(select p2.PERSONALE from personale p2 where p2.IDPERSONALE = sa.IDPERSONALE) as assegnatario,
(select p3.PERSONALE from personale p3 where p3.IDPERSONALE =sa.PRESAINCARICO) as presaincarico,
rc.CONVALIDA,
rc.ANNULLATA,
rc.IDANNULLATORE
from SCHEDEANALISI sa,
PERSONALE p,
RICHIESTECLIENTI rc
where sa.PROGRESSIVO = rc.IDSCHEDAANALISI
and sa.IDPROGRAMMATORE = p.IDPERSONALE
and p.SIGLA = 'SP' | true |
56390e247e51edb5f5fd3e273b3d827cdc5e2f4d | SQL | gwgundersen/databases | /2.2-sql/rating_movies_modifications/ex3.sql | UTF-8 | 296 | 3.640625 | 4 | [] | no_license | /*
* Exercise 4:
* For all movies that have an average rating of 4 stars or higher, add 25 to the release year.
* (Update the existing tuples; don't insert new tuples.)
*/
UPDATE Movie
SET year = year + 25
WHERE mID IN (
SELECT mID
FROM Rating
GROUP BY mID
HAVING AVG(stars) >= 4
); | true |
109ad6edc9c78cb86ec29fcf768f9682ad26429c | SQL | Ariah-Group/Research | /db_scripts/main/KC-RELEASE-3_1-SCRIPT/oracle/dml/KR_DML_99_SEQUENCE_RESET_00S0.sql | UTF-8 | 504 | 3.0625 | 3 | [
"Apache-2.0",
"ECL-2.0"
] | permissive | declare
MaxTblVal INTEGER;
begin
select max(ID) + 1 into MaxTblVal from
((select max(DOC_HDR_ID) as ID from KREW_DOC_HDR_T)
union (select max(DOC_TYP_ID) as ID from KREW_DOC_TYP_T)
union (select max(APP_DOC_STAT_TRAN_ID) as ID from KREW_APP_DOC_STAT_TRAN_T));
execute immediate 'DROP SEQUENCE KREW_DOC_HDR_S';
execute immediate 'CREATE SEQUENCE KREW_DOC_HDR_S START WITH ' || MaxTblVal ||
' MAXVALUE 99999999 MINVALUE 1 NOCYCLE NOCACHE NOORDER';
end;
/
| true |
0f63261a6f3a81e6dc3b5ba3053589014ae8ee58 | SQL | QuaidQ/DatabaseProject | /AmzonGoSqlScripts/createtriggers.sql | UTF-8 | 1,961 | 4.1875 | 4 | [] | no_license | # creates triggers for our database and create sub employees
SET FOREIGN_KEY_CHECKS = 0;
drop table if exists stocker;
drop table if exists customerservice;
drop table if exists shippingemp;
SET FOREIGN_KEY_CHECKS = 1;
create table Stocker(
EmpID int(9) primary key,
StockId int(9) unique key auto_increment,
Fname varchar(25),
Minit varchar(1),
Lname varchar(25),
Title varchar(25),
Wage int(5),
StoreNo int(1),
foreign key fk_Sstore(StoreNo) references Store(StoreNo) on delete set null);
create table CustomerService(
EmpID int(9) primary key,
ServiceId int(9) unique key auto_increment,
Fname varchar(25),
Minit varchar(1),
Lname varchar(25),
Title varchar(25),
Wage int(5),
StoreNo int(1),
foreign key fk_CSstore(StoreNo) references Store(StoreNo) on delete set null);
create table ShippingEmp(
EmpID int(9) primary key,
ShipId int(9) unique key auto_increment,
Fname varchar(25),
Minit varchar(1),
Lname varchar(25),
Title varchar(25),
Wage int(5),
StoreNo int(1),
foreign key fk_Shipstore(StoreNo) references Store(StoreNo) on delete set null);
drop trigger if exists employ;
delimiter //
create trigger employ after insert on employee
for each row
begin
if new.Title = 'Stocker' then
insert into stocker(EmpID, Fname, Minit, Lname, Title, Wage, StoreNo)
values(new.empID, new.Fname, new.Minit, new.Lname, new.Title,new.Wage, new.StoreNo);
elseif new.Title = 'Customer Service' then
insert into customerservice(EmpID, Fname, Minit, Lname, Title, Wage, StoreNo)
values(new.empID, new.Fname,new.Minit, new.Lname,new.Title,new.Wage, new.StoreNo);
elseif new.Title = 'Shipping' then
insert into shippingemp (EmpID, Fname, Minit, Lname, Title, Wage, StoreNo)
values(new.empID,new.Fname,new.Minit, new.Lname,new.Title,new.Wage, new.StoreNo);
end if;
end; //
delimiter ;
| true |
342e6679a740b776afc300ea38ad0ea971144456 | SQL | unepwcmc/cites_dashboards | /db/scripts/export_taxon_concepts.sql | UTF-8 | 9,083 | 3.875 | 4 | [] | no_license | COPY(
WITH cites_eu_taxon_concepts AS (
SELECT
taxon_concepts.id,
taxon_concepts.full_name AS full_name,
author_year,
name_status,
taxon_concepts.data->'rank_name' AS rank_name,
SQUISH_NULL(taxon_concepts.data->'kingdom_name') AS kingdom_name
FROM taxon_concepts
JOIN taxonomies ON taxonomies.id = taxonomy_id AND taxonomies.name = 'CITES_EU'
), accepted_names AS (
SELECT
tc.id,
tc.full_name,
tc.author_year,
tc.name_status,
tc.rank_name,
tc.id AS accepted_name_id,
CASE WHEN kingdom_name IS NULL THEN FALSE ELSE TRUE END AS has_higher_taxonomy
FROM cites_eu_taxon_concepts tc
WHERE name_status IN ('A', 'N')
), synonyms AS (
SELECT
tc.id,
tc.full_name,
tc.author_year,
tc.name_status,
tc.rank_name,
(
ARRAY_AGG_NOTNULL(
accepted_names.id
ORDER BY CASE
WHEN accepted_names.kingdom_name IS NOT NULL THEN 0
ELSE 1 END
)::INT[]
)[1] AS accepted_name_id,
BOOL_OR(accepted_names.kingdom_name IS NOT NULL) AS has_higher_taxonomy
FROM cites_eu_taxon_concepts tc
LEFT JOIN taxon_relationships tr
ON tr.other_taxon_concept_id = tc.id
LEFT JOIN taxon_relationship_types trt
ON trt.id = tr.taxon_relationship_type_id AND trt.name = 'HAS_SYNONYM'
LEFT JOIN cites_eu_taxon_concepts accepted_names
ON tr.taxon_concept_id = accepted_names.id AND accepted_names.name_status IN ('A', 'N')
WHERE tc.name_status = 'S'
GROUP BY tc.id, tc.full_name,
tc.author_year, tc.name_status, tc.rank_name
), trade_names AS (
SELECT
tc.id,
tc.full_name,
tc.author_year,
tc.name_status,
tc.rank_name,
(
ARRAY_AGG_NOTNULL(
accepted_names.id
ORDER BY CASE
WHEN accepted_names.kingdom_name IS NOT NULL THEN 0
ELSE 1 END
)::INT[]
)[1] AS accepted_name_id,
BOOL_OR(accepted_names.kingdom_name IS NOT NULL) AS has_higher_taxonomy
FROM cites_eu_taxon_concepts tc
LEFT JOIN taxon_relationships tr
ON tr.other_taxon_concept_id = tc.id
LEFT JOIN taxon_relationship_types trt
ON trt.id = tr.taxon_relationship_type_id AND trt.name = 'HAS_TRADE_NAME'
LEFT JOIN cites_eu_taxon_concepts accepted_names
ON tr.taxon_concept_id = accepted_names.id AND accepted_names.name_status IN ('A', 'N')
WHERE tc.name_status = 'T'
GROUP BY tc.id, tc.full_name,
tc.author_year, tc.name_status, tc.rank_name
), hybrids AS (
SELECT
tc.id,
tc.full_name,
tc.author_year,
tc.name_status,
tc.rank_name,
(
ARRAY_AGG_NOTNULL(
accepted_names.id
ORDER BY CASE
WHEN accepted_names.kingdom_name IS NOT NULL THEN 0
ELSE 1 END
)::INT[]
)[1] AS accepted_name_id,
BOOL_OR(accepted_names.kingdom_name IS NOT NULL) AS has_higher_taxonomy
FROM cites_eu_taxon_concepts tc
LEFT JOIN taxon_relationships tr
ON tr.other_taxon_concept_id = tc.id
LEFT JOIN taxon_relationship_types trt
ON trt.id = tr.taxon_relationship_type_id AND trt.name = 'HAS_HYBRID'
LEFT JOIN cites_eu_taxon_concepts accepted_names
ON tr.taxon_concept_id = accepted_names.id AND accepted_names.name_status IN ('A', 'N')
WHERE tc.name_status = 'H'
GROUP BY tc.id, tc.full_name,
tc.author_year, tc.name_status, tc.rank_name
), names_without_accepted_name_match AS (
SELECT * FROM accepted_names WHERE NOT has_higher_taxonomy
UNION
SELECT * FROM synonyms WHERE NOT has_higher_taxonomy
UNION
SELECT * FROM trade_names WHERE NOT has_higher_taxonomy
UNION
SELECT * FROM hybrids WHERE NOT has_higher_taxonomy
), names_with_best_effort_accepted_name_match AS (
SELECT
tc.id,
tc.full_name,
tc.author_year,
tc.name_status,
tc.rank_name,
(
ARRAY_AGG_NOTNULL(
accepted_names.id
ORDER BY CASE
WHEN accepted_names.kingdom_name IS NOT NULL THEN 0
ELSE 1 END
)::INT[]
)[1] AS accepted_name_id,
BOOL_OR(accepted_names.kingdom_name IS NOT NULL) AS has_higher_taxonomy
FROM names_without_accepted_name_match tc
JOIN cites_eu_taxon_concepts accepted_names
ON UPPER(SQUISH_NULL(
split_part(
CASE WHEN tc.name_status = 'H' AND strpos(tc.full_name, 'x ') > 0 THEN split_part(tc.full_name, 'x ', 1) ELSE tc.full_name END, ' ', 1
))
) = UPPER(accepted_names.full_name)
AND accepted_names.rank_name = 'GENUS'
WHERE NOT has_higher_taxonomy
GROUP BY tc.id, tc.full_name,
tc.author_year, tc.name_status, tc.rank_name
), names_with_best_effort_accepted_name_match_pro AS (
SELECT
tc.id,
tc.full_name,
tc.author_year,
tc.name_status,
tc.rank_name,
(
ARRAY_AGG_NOTNULL(
accepted_names.id
ORDER BY CASE
WHEN accepted_names.kingdom_name IS NOT NULL THEN 0
ELSE 1 END
)::INT[]
)[1] AS accepted_name_id,
BOOL_OR(accepted_names.kingdom_name IS NOT NULL) AS has_higher_taxonomy
FROM names_with_best_effort_accepted_name_match tc
LEFT JOIN taxon_relationships tr
ON tr.other_taxon_concept_id = tc.id
LEFT JOIN cites_eu_taxon_concepts accepted_names
ON accepted_names.id = tr.taxon_concept_id
LEFT JOIN taxon_relationship_types trt
ON trt.id = tr.taxon_relationship_type_id
WHERE NOT has_higher_taxonomy
GROUP BY tc.id, tc.full_name,
tc.author_year, tc.name_status, tc.rank_name
), taxa_with_higher_taxonomy AS (
SELECT * FROM accepted_names WHERE has_higher_taxonomy
UNION
SELECT * FROM synonyms WHERE has_higher_taxonomy
UNION
SELECT * FROM trade_names WHERE has_higher_taxonomy
UNION
SELECT * FROM hybrids WHERE has_higher_taxonomy
UNION
SELECT * FROM names_with_best_effort_accepted_name_match
WHERE has_higher_taxonomy
UNION
SELECT * FROM names_with_best_effort_accepted_name_match_pro
), taxa_with_higher_taxonomy_resolved AS (
SELECT
tc.id,
tc.full_name,
full_name_with_spp(tc.rank_name, tc.full_name) AS full_name_with_spp,
tc.author_year,
tc.name_status,
tc.rank_name,
accepted_names.taxonomic_position,
SQUISH_NULL(accepted_names.data->'genus_name') AS genus_name,
SQUISH_NULL(accepted_names.data->'family_name') AS family_name,
SQUISH_NULL(accepted_names.data->'order_name') AS order_name,
SQUISH_NULL(accepted_names.data->'class_name') AS class_name,
SQUISH_NULL(accepted_names.data->'phylum_name') AS phylum_name,
SQUISH_NULL(accepted_names.data->'kingdom_name') AS kingdom_name
FROM taxa_with_higher_taxonomy tc
JOIN taxon_concepts accepted_names
ON accepted_names.id = tc.accepted_name_id
GROUP BY tc.id, tc.full_name, tc.author_year, tc.name_status, tc.rank_name, taxonomic_position,
genus_name, family_name, order_name, class_name, phylum_name, kingdom_name, accepted_name_id
), taxa_with_taxon_group AS (
SELECT *,
CASE
WHEN family_name = 'Orchidaceae' THEN 'Orchids'
WHEN family_name = 'Cactaceae' THEN 'Cacti'
WHEN kingdom_name = 'Plantae' AND (
family_name NOT IN ('Orchidaceae', 'Cactaceae') OR COALESCE(family_name, '') = ''
) THEN 'Plants (excluding cacti & orchids)'
WHEN class_name = 'Mammalia' THEN 'Mammals'
WHEN class_name = 'Aves' THEN 'Birds'
WHEN class_name = 'Reptilia' THEN 'Reptiles'
WHEN class_name = 'Amphibia' THEN 'Amphibians'
WHEN class_name IN ('Actinopteri', 'Elasmobranchii', 'Dipneusti', 'Coelacanthi') THEN 'Fish'
WHEN class_name IN ('Anthozoa', 'Hydrozoa') OR (
COALESCE(class_name, '') = '' AND COALESCE(order_name, '') = '' AND COALESCE(family_name, '') = ''
AND COALESCE(genus_name, '') = '' AND phylum_name = 'Cnidaria'
) THEN 'Corals'
WHEN kingdom_name = 'Animalia' AND phylum_name != 'Chordata' AND class_name NOT IN ('Anthozoa', 'Hydrozoa') THEN 'Invertebrates (non-corals)'
WHEN full_name IN ('Chamaeleon', 'Pelophilus') THEN 'Reptiles' -- these synonyms occur in trade and there is no automatic way of inferring the class, because no accepted name is specified
END AS taxon_group
FROM taxa_with_higher_taxonomy_resolved tc
), taxa_without_higher_taxonomy AS (
SELECT id, full_name, author_year, name_status, rank_name
FROM cites_eu_taxon_concepts
EXCEPT
SELECT id, full_name, author_year, name_status, rank_name
FROM taxa_with_higher_taxonomy_resolved
WHERE kingdom_name IS NOT NULL
), taxa_without_higher_taxonomy_in_trade AS (
SELECT t.* FROM taxa_without_higher_taxonomy t
JOIN trade_shipments
ON trade_shipments.taxon_concept_id = t.id
GROUP BY t.id, full_name, author_year, name_status, rank_name
)
SELECT * FROM taxa_with_taxon_group
ORDER BY name_status, taxonomic_position
) TO '/tmp/taxon_concepts.csv' WITH CSV;
| true |
a7592fade037ee7eeed0ed5433cd2fd4bf1bc4eb | SQL | pylrichard/db_study | /mysql/sql/check_table_primary_key.sql | UTF-8 | 389 | 3.953125 | 4 | [] | no_license | -- 找出没有创建主键的表
SELECT
*
FROM
information_schema.TABLES t
LEFT JOIN
information_schema.STATISTICS s
ON t.table_schema = s.table_schema
AND t.table_name = s.table_name
AND s.index_name = 'PRIMARY'
WHERE
t.table_schema NOT IN ('mysql', 'performance_schema',
'information_schema', 'sys')
AND table_type = 'BASE_TABLE'
AND s.index_name IS NULL;
| true |
3013c1223b84341a7d36a13a9c905ca353e7edb5 | SQL | brazvo/litepage | /app/db/lightpage_mysql.sql | UTF-8 | 20,867 | 3.140625 | 3 | [] | no_license | DROP TABLE IF EXISTS `basic_fields`;
CREATE TABLE `basic_fields` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL UNIQUE , `type` VARCHAR(256), `label` VARCHAR(256), `attributes` VARCHAR(256), `db_type` VARCHAR(256), `machine_type` VARCHAR(256));
INSERT INTO `basic_fields` VALUES(1,'text','Text','size:60;maxlength:128','VARCHAR','text');
INSERT INTO `basic_fields` VALUES(2,'textarea','Textbox','cols:30;rows:15;wrap:off','TEXT','textarea');
INSERT INTO `basic_fields` VALUES(3,'text','Dátum a čas','size:19;maxlength:19','DATETIME','datetime');
INSERT INTO `basic_fields` VALUES(4,'text','Dátum','size:10;maxlength:10','DATETIME','date');
INSERT INTO `basic_fields` VALUES(5,'text','Číslo','size:10;maxlength:20;min:0;max:0','NUMERIC','number');
INSERT INTO `basic_fields` VALUES(6,'select','Zoznam',NULL,'TEXT','select');
INSERT INTO `basic_fields` VALUES(7,'checkbox','Zaškrtávacie pole',NULL,'TINYINT(1)','checkbox');
INSERT INTO `basic_fields` VALUES(8,'checkboxgroup','Skupina zaškrtávacích polí','polozka1:popis1;polozka2:popis2','TEXT','checkboxgroup');
INSERT INTO `basic_fields` VALUES(9,'radio','Voľby','polozka1:popis1;polozka2:popis2','TEXT','radio');
INSERT INTO `basic_fields` VALUES(10,'file','Súbor','max_file_size:2;max_files:0;order_by:description','VARCHAR','file');
INSERT INTO `basic_fields` VALUES(11,'file','Obrázok','max_file_size:2;max_files:0;preview_size:640;icon_size:175;thumb_create:cut;order_by:description','VARCHAR','image');
DROP TABLE IF EXISTS `content`;
CREATE TABLE `content` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL UNIQUE , `content_type_id` INTEGER, `content_type_name` VARCHAR(256), `content_type_machine_name` VARCHAR(256), `content_id` INTEGER, `path_alias` VARCHAR(256), `last_update` DATETIME, `content_title` VARCHAR(256), `uid` INTEGER DEFAULT '0', `edit_uid` INTEGER DEFAULT '0', `lang` VARCHAR(2), `module` VARCHAR(128) DEFAULT '0');
INSERT INTO `content` VALUES(1,1,'Stránka','page',1,'hlavna-stranka','2010-12-02 09:30:22','Blahoželáme',0,1,'sk','0');
INSERT INTO `content` VALUES(2,1,'Stránka','page',2,'texy','2011-02-15 18:44:21','TEXY! je SEXY!',0,1,'sk','0');
DROP TABLE IF EXISTS `content_files`;
CREATE TABLE `content_files` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL , `content_type_id` INTEGER DEFAULT '0', `file_name` VARCHAR(128) DEFAULT null, `description` VARCHAR(256) DEFAULT null, `datetime` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `content_id` INTEGER DEFAULT '0', `priority` INTEGER DEFAULT '0', `file_type` VARCHAR(256));
DROP TABLE IF EXISTS `content_images`;
CREATE TABLE `content_images` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL , `content_type_id` INTEGER DEFAULT '0', `image_name` VARCHAR(128) DEFAULT null, `description` VARCHAR(256) DEFAULT null, `datetime` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `content_id` INTEGER DEFAULT '0', `priority` INTEGER DEFAULT '0');
DROP TABLE IF EXISTS `content_type_fields`;
CREATE TABLE `content_type_fields` (`id` INTEGER PRIMARY KEY NOT NULL ,`type` VARCHAR(256),`label` VARCHAR(256),`attributes` VARCHAR(256),`content_type_id` INTEGER,`priority` INTEGER DEFAULT '0' ,`default` VARCHAR(256), `frm_name` VARCHAR(256), `required` TINYINT(1) DEFAULT '0', `basic` TINYINT(1) DEFAULT 1, `field_type` VARCHAR(256), `description` TEXT, `machine_field_type` VARCHAR(256) DEFAULT null, `content_label` VARCHAR(256), `editable` TINYINT(1) DEFAULT 1);
INSERT INTO `content_type_fields` VALUES(1,'text','Titulok','a:2:{s:4:"size";s:2:"60";s:9:"maxlength";s:3:"128";}',1,0,'','title',1,1,'Text','','text','',0);
INSERT INTO `content_type_fields` VALUES(2,'textarea','Telo','a:3:{s:4:"cols";s:2:"50";s:4:"rows";s:2:"30";s:4:"wrap";s:3:"off";}',1,2,'','body',0,1,'Textbox','','textarea','',1);
INSERT INTO `content_type_fields` VALUES(3,'text','URL alias','a:2:{s:4:"size";s:2:"60";s:9:"maxlength";s:3:"128";}',1,1,'','path_alias',0,1,'Text','','text','',0);
DROP TABLE IF EXISTS `content_types`;
CREATE TABLE `content_types` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL UNIQUE , `name` VARCHAR(256), `description` TEXT, `machine_name` VARCHAR(256));
INSERT INTO `content_types` VALUES(1,'Stránka','Jednoduchý formulár s titulkom a obsahom','page');
DROP TABLE IF EXISTS `development`;
CREATE TABLE `development` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL , `constant` VARCHAR(128), `title` VARCHAR(128), `description` TEXT, `value` VARCHAR(256), `frm_name` TEXT);
INSERT INTO `development` VALUES(1,'CACHE_PAGES','FRM_DEV_CACHE_PAGES_TITLE','FRM_DEV_CACHE_PAGES_DESC','1','cache_pages');
INSERT INTO `development` VALUES(2,'CACHE_CSS','FRM_DEV_CACHE_CSS_TITLE','FRM_DEV_CACHE_CSS_DESC','1','cache_css');
INSERT INTO `development` VALUES(3,'CACHE_JS','FRM_DEV_CACHE_JS_TITLE','FRM_DEV_CACHE_JS_DESC','0','cache_js');
INSERT INTO `development` VALUES(4,'DEVELOPMENT','FRM_DEV_ENABLE_TITLE','FRM_DEV_ENABLE_DESC','1','dev_enable');
INSERT INTO `development` VALUES(5,'SQL_BROWSER','FRM_DEV_SQL_TRACKER_TITLE','FRM_DEV_SQL_TRACKER_DESC','0','sql_tracker');
DROP TABLE IF EXISTS `filter`;
CREATE TABLE `filter` (`uid` INTEGER, `content_type` VARCHAR(256), `category` VARCHAR(256), `language` VARCHAR(256));
DROP TABLE IF EXISTS `languages`;
CREATE TABLE `languages` (`langid` VARCHAR(256), `name` VARCHAR(256), `eng_machine_name` VARCHAR(256), `main_page_path` VARCHAR(256), `main_lang` TINYINT(1) DEFAULT '0', `active` TINYINT(1) DEFAULT '0', `system` TINYINT(1) DEFAULT '0');
INSERT INTO `languages` VALUES('sk','Slovenčina','slovak','hlavna-stranka',1,1,1);
INSERT INTO `languages` VALUES('en','English','english','welcome',0,1,0);
DROP TABLE IF EXISTS `menu_items`;
CREATE TABLE `menu_items` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL UNIQUE , `title` VARCHAR(256), `path` VARCHAR(256), `allowed` TINYINT(1) DEFAULT '0', `expanded` TINYINT(1) DEFAULT '0', `priority` INTEGER, `child_of` INTEGER DEFAULT '0', `menu_id` INTEGER, `name` VARCHAR(256) DEFAULT null, `image` VARCHAR(256) DEFAULT null, `content_id` INTEGER DEFAULT '0', `module` VARCHAR(256));
INSERT INTO `menu_items` VALUES(8,'System','admin/system',1,1,0,0,4,'System',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(9,'Obsah','admin/content',1,1,2,0,4,'Obsah',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(10,'Užívatelia','admin/users',1,1,3,0,4,'Užívatelia',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(11,'Nastavenie stránky','admin/pageSettings',1,0,0,8,4,'Nastavenie stránky',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(12,'Menu','admin/menus',1,0,1,8,4,'Menu',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(13,'Zoznam','admin/content/list',1,0,0,9,4,'Zoznam',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(14,'Typy obsahu','admin/contentTypes',1,0,1,9,4,'Typy obsahu',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(15,'Zoznam','admin/users/list',1,0,0,10,4,'Zoznam',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(16,'Pridať užívateľa','admin/users/add',1,0,1,10,4,'Pridať užívateľa',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(17,'Môj detajl','admin/users/detail',1,0,2,10,4,'Môj detajl',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(18,'Pridat obsah','admin/content/add',1,0,2,9,4,'Pridat obsah',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(65,'Oprávnenia','admin/permisions',1,0,4,0,4,'Oprávnenia','',0,NULL);
INSERT INTO `menu_items` VALUES(66,'Moduly','admin/modules',1,1,1,0,4,'Moduly','',0,NULL);
INSERT INTO `menu_items` VALUES(67,'Zoznam','admin/modules/list',1,0,0,66,4,'Zoznam','',0,NULL);
INSERT INTO `menu_items` VALUES(77,'Ponuky (Menu)','admin/menus',1,0,0,0,5,'Ponuky (Menu)',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(78,'Moduly','admin/modules',1,1,0,0,5,'Moduly','',0,NULL);
INSERT INTO `menu_items` VALUES(79,'Obsah','admin/content',1,1,0,0,5,'Obsah',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(80,'Môj detajl','admin/users/detail',1,0,0,0,5,'Môj detajl',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(83,'Zoznam','admin/content/list',1,0,0,79,5,'Zoznam',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(84,'Typy obsahu','admin/contentTypes',1,0,1,79,5,'Typy obsahu',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(85,'Pridať obsah','admin/content/add',1,0,2,79,5,'Pridať obsah',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(99,'Môj obsah','admin/content/list',1,0,0,0,6,'Môj obsah',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(100,'Pridať obsah','admin/content/add',1,0,0,0,6,'Pridať obsah',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(101,'Môj detajl','admin/users/detail',1,0,0,0,6,'Môj detajl',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(120,'Jazyky','admin/languages',1,0,3,8,4,'Jazyky',NULL,0,NULL);
INSERT INTO `menu_items` VALUES(134,'Hlavná stránka','hlavna-stranka',1,0,0,0,1,'Hlavná stránka','',1,'content');
INSERT INTO `menu_items` VALUES(190,'Texy','texy',1,0,0,0,1,'Texy','',2,'content');
DROP TABLE IF EXISTS `menus`;
CREATE TABLE `menus` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL UNIQUE , `name` VARCHAR(256), `machine_name` VARCHAR(256), `system` TINYINT(1), `only_admin` TINYINT(1) DEFAULT '0', `lang` VARCHAR(256) DEFAULT 'sk');
INSERT INTO `menus` VALUES(1,'Navigácia','navigation',1,0,'sk');
INSERT INTO `menus` VALUES(2,'Primárne menu','primary_menu',1,0,'none');
INSERT INTO `menus` VALUES(3,'Sekundárne menu','secondary_menu',1,0,'sk');
INSERT INTO `menus` VALUES(4,'Administrácia','administration',1,1,'none');
INSERT INTO `menus` VALUES(5,'Menu editora','editors_menu',1,1,'sk');
INSERT INTO `menus` VALUES(6,'Menu užívateľa','users_menu',1,1,'sk');
DROP TABLE IF EXISTS `modules`;
CREATE TABLE `modules` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT,`name` VARCHAR(256),`version` TEXT,`machine_name` VARCHAR(256),`installed` TINYINT(1), `description` TEXT, `standalone` TINYINT(1) DEFAULT '0', `content_extension` TINYINT(1) DEFAULT '0', `module_extension` VARCHAR(128), `application` TINYINT(1) DEFAULT '0');
INSERT INTO `modules` VALUES(1,'Kniha návštev','v1.00','guestbook',0,'Modul kniha návštev vytvorí návštevnú knihu. Po inštalácii sa v navigačnom a primárnom menu vytvorí odkaz Kniha návštev.',1,0,'0',0);
INSERT INTO `modules` VALUES(2,'Produkty','1.00','produkty',0,'Modul Produkty vytvorí Katalóg produktov. Prístup k nastaveniam nájdete v administračnom menu Moduly -> Produkty -> Nastavenia.',1,0,'0',0);
INSERT INTO `modules` VALUES(3,'Template','v1.00','template',0,'',0,0,'0',0);
INSERT INTO `modules` VALUES(4,'Novinky','v1.00','novinky',0,'Modul novinky slúži na zobrazovanie krátkych textových správ. Po inštalácii sa v administračnom menu zobrazí položka Novinky, kde môžete meniť nastavenia. Pred inštaláciou si prečítajte ReadMe.txt v adresáry app/modules/novinky.',1,0,'0',0);
INSERT INTO `modules` VALUES(5,'Kontaktný formulár','v1.00','kontakt',0,'Modul Kontaktný formulár umožnuje návševníkom vašej stránky odoslať správu na váš šemail priamo z vašej stránky.
Po inštalácii sa v administračnom menu -> moduly vytvorí odkaz Kontaktný formulár.',1,0,'0',0);
INSERT INTO `modules` VALUES(6,'Categories','v1.00','categories',0,'Modul umoznuje kategorizaciu obsahu.',1,0,'0',0);
INSERT INTO `modules` VALUES(7,'Web formulár','v1.00','webform',0,'Modul web formulár Vám umožnuje vytvoriť užívateľský formulár a návševníci vašej stránky cez neho môžu odoslať správu na váš email.
Po inštalácii sa v administračnom menu -> moduly vytvorí odkaz Web formulár.',1,0,'0',0);
INSERT INTO `modules` VALUES(9,'Texyla','v1.00','texyla',0,'jQuery WYSIWYM (What You See Is What You Mean) editor pre knižnicu TEXY. Možnosť nastaviť na všetky alebo konkrétne textarey. Vyžaduje inštaláciu jQuery UI.',0,0,'0',1);
INSERT INTO `modules` VALUES(12,'Simple SEO','v1.00','simpleseo',0,'Modul pridá ku kontentu keywords a description meta značky',0,1,'0',0);
DROP TABLE IF EXISTS `page`;
CREATE TABLE `page` (`id` INTEGER PRIMARY KEY NOT NULL ,`title` VARCHAR(256),`body` TEXT);
INSERT INTO `page` VALUES(1,'Blahoželáme','Ak čítate tento text, tak ste najpravdepodobnejšie úspešne nainštalovali CMS
(systém na správu obsahu) LitePAGE.
Systém je budovaný na prácu s databázou SQLite 3, ale nakoľko využíva PHP rozšírenie
PDO, ktoré je jednotné pre viacero druhov databáz. Systém je ľahko prekonfigurovateľný.
Toto však nie je cieľom. Ako názov LitePAGE naznačuje, tento CMS je určený
hlavne na vybudovanie webových prezentácií, ktoré nepotrebujú mohutné databázy,
a ich obsah je poväčšine statický. Systém LitePAGE ponúka rozhranie, ktoré má
zjednodušiť a hlavne urýchliť vybudovanie webovej prezentácie.
Na formátovanie textu v podstránkach slúži textový parser TEXY. Základný syntax
si môžete pozrieť \"tu\":[files/texy_zakladny_syntax.txt] a porovnajte si to
s preloženým dokumentom \"tu\":[texy_syntax]. Kompletný návod, ako používať TEXY
nájdete na \"oficiálnej stránke TEXY\":[http://texy.info/cs/syntax-podrobne].
Do administrácie stránky sa dostanete tak, že za hlavnú adresu Vašej stránky
napíšete slovko: //login//, alebo kliknete na znak © v pätičke stránky.
');
INSERT INTO `page` VALUES(2,'TEXY! je SEXY!','Základné formátovanie v TEXTY
#############################
TEXY je výborný nástroj na formátovanie textu na webových stránkach. Hlavnou devízou je to, že pisateľ
nepotrebuje ovládať značkovací jazyk HTML použivaný na webových stránkach, ale stačí mu písať jednoducho
formátovaný text, podobný tomu v príkladoch nižšie a TEXY sa postará o správny prevod do HTML.
**POZNÁMKA:** TEXY je jednosmerný nástroj, čiže nedokáže konvertovať HTML na TEXY formát, preto je vhodné
si vaše výtvory uchovávať v nejakom TXT súbore v znakovej sade UTF-8 a prípade úpravy obsahu stránky, len nahradíte celý obsah z TEXY súboru.
Toto je hlavný titulok
######################
Toto je podtitulok
******************
Toto by mal byť tretí titulok
=============================
A toto 4. titulok
-----------------
**Úprava Textu**
Toto je nejaký text a **toto je nejaký hrubý text**
//a to je text v kurzíve na novom riadku//
text zalomíme tak, že na začiatok riadku
dáme medzeru.
Nasledujúci text bude odsadený:
> Tento text je odsadený
> Text odsadíme tak, že na začiatku riadku dáme > a medzeru.
Citáciu označíme takto:
Hamlet povedal: >>Byť, či nebyť...<<
Čiary sa zobrazujú jednoducho:
-----
alebo
*****
Môžeš zobraziť aj zoznam:
- položka 1
- položka 2
- položka 3
alebo
1) položka 1
2) položka 2
3) položka 3
alebo vnorené zoznamy:
1) Položka jedna
- podpoložka 1
- podpoložka 2
2) Položka dva
- podpoložka 1
- podpoložka 2');
DROP TABLE IF EXISTS `page_settings`;
CREATE TABLE `page_settings` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL , `constant` VARCHAR(256), `title` VARCHAR(256), `description` TEXT, `value` VARCHAR(256), `frm_name` TEXT);
INSERT INTO `page_settings` VALUES(1,'LOGO','Logo','Názov súboru obrázku loga umiestnený v adresary images. Ked nechcete logo zobrazovať, zadajte prázdne políčko.','logo.png','logo');
INSERT INTO `page_settings` VALUES(2,'PAGE_TITLE','Hlavný titulok stránky','Titulok, ktorý sa bude zobrazovať záhlavý prehliadača.','Lite PAGE','title');
INSERT INTO `page_settings` VALUES(3,'MAIN_TEMPLATE','Hlavná šablóna','Šablóna s rozložením stránky, ktorá je umiestnená v adresáry /app/templates/','1-2-1-left-fix.tpl','template');
INSERT INTO `page_settings` VALUES(4,'PAGE_SLOGAN','Slogan stránky','Slogan stránky, ktorý sa bude zobrazovať v hlavičke stránky, jeho polohu, je možné meniť cez CSS. Ak si slogan neželáte, tak uložte políčko prázdne','systém na správu obsahu na databáze SQLite','slogan');
INSERT INTO `page_settings` VALUES(5,'HEADER_TITLE','Titulok záhlavia','Titulok zobrazený v hlavičke stránky. Ak nechcete titulok zobrazovať, uložte políčko prázdne.','Lite PAGE','header_title');
INSERT INTO `page_settings` VALUES(6,'FANCY_LOGIN_FORM','Prihlasovací fomulár vo FancyBoxe','Blok s prihlasovacím formulárom môžete pridať do stránky pomocou funkcie <?block::get(''login_form'')?>. Ak zvolíte túto variantu - zobrazovanie vo FancyBoxe, tak možete umiestniť blok kdekoľvek do stránky a vyvolať prihlasovací formulár po kliknutí na odkaz: http://vasa_stranka/#login-form.
Tag <b>a</b> musi obsahovat triedu <i>login-form</i>','1','fancy_login_form');
INSERT INTO `page_settings` VALUES(7,'META_KEYWORDS','Keywords','Kľúčové slová (SEO)','','meta_keywords');
INSERT INTO `page_settings` VALUES(8,'META_DESCRIPTION','Description','Popis stránky (SEO)','','meta_description');
INSERT INTO `page_settings` VALUES(9,'META_ROBOTS','Robots','Vyhľadávače (SEO)','index, follow','meta_robots');
INSERT INTO `page_settings` VALUES(10,'META_GOOGLE_SITE_VERIFICATION','Google Site Verification Code','Kontrolný kód Google','','meta_google_site_verification');
INSERT INTO `page_settings` VALUES(11,'META_GOOGLE_ANALYTICS','Google Analytics Code','Kód Google Analytics','','meta_google_analytics');
INSERT INTO `page_settings` VALUES(12,'META_AUTHOR','Author','Autor (META)','MBM ARTWORKS (info@mbmartworks.sk - www.mbmartworks.sk)','meta_author');
INSERT INTO `page_settings` VALUES(13,'META_COPYRIGHT','Copyright','Autorské práva (META)','MBM ARTWORKS, v.o.s.','meta_copyright');
INSERT INTO `page_settings` VALUES(14,'META_RATING','Rating','Rating','general','meta_rating');
DROP TABLE IF EXISTS `path_aliases`;
CREATE TABLE `path_aliases` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL , `path_alias` VARCHAR(256), `url` VARCHAR(256), `module` VARCHAR(256), `mod_id` INTEGER);
INSERT INTO `path_aliases` VALUES(8,'hlavna-stranka','content/show/1','content',1);
INSERT INTO `path_aliases` VALUES(24,'texy','content/show/2','content',2);
DROP TABLE IF EXISTS `permisions`;
CREATE TABLE `permisions` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL , `content` VARCHAR(256), `cont_mach_name` VARCHAR(256), `editor_add` TINYINT(1) DEFAULT 1, `editor_edit` TINYINT(1) DEFAULT 1, `editor_delete` TINYINT(1) DEFAULT '0', `editor_view` TINYINT(1) DEFAULT 1, `user_add` TINYINT(1) DEFAULT '0', `user_edit` TINYINT(1) DEFAULT '0', `user_delete` TINYINT(1) DEFAULT '0', `user_view` TINYINT(1) DEFAULT 1, `visitor_add` TINYINT(1) DEFAULT '0', `visitor_edit` TINYINT(1) DEFAULT '0', `visitor_delete` TINYINT(1) DEFAULT '0', `visitor_view` TINYINT(1) DEFAULT 1);
INSERT INTO `permisions` VALUES(1,'Užívatelia','users',0,0,0,1,0,0,0,0,0,0,0,0);
INSERT INTO `permisions` VALUES(2,'Typy obsahu','content_types',0,0,0,1,0,0,0,1,0,0,0,1);
INSERT INTO `permisions` VALUES(3,'Menu','menus',0,0,0,1,0,0,0,1,0,0,0,1);
INSERT INTO `permisions` VALUES(4,'Položky menu','menu_items',1,1,1,1,0,0,0,1,0,0,0,1);
INSERT INTO `permisions` VALUES(5,'Stránka','page',1,1,0,1,0,0,0,1,0,0,0,1);
INSERT INTO `permisions` VALUES(7,'Produkty','products',1,1,1,1,0,0,0,1,0,0,0,1);
INSERT INTO `permisions` VALUES(8,'Obsah','content',1,0,0,1,1,0,0,1,0,0,0,1);
INSERT INTO `permisions` VALUES(32,'Jazyky','languages',0,0,0,1,0,0,0,0,0,0,0,0);
DROP TABLE IF EXISTS `temp_content`;
CREATE TABLE temp_content(
id INTEGER,
content_type_id INTEGER,
content_type_name VARCHAR(256),
content_type_machine_name VARCHAR(256),
content_id INTEGER,
path_alias VARCHAR(256),
last_update DATETIME,
content_title VARCHAR(256),
uid INTEGER,
edit_uid INTEGER,
lang VARCHAR(2)
);
INSERT INTO `temp_content` VALUES(1,1,'Stránka','page',1,'hlavna-stranka','2010-08-24 13:47:30','Blahoželáme',0,1,'sk');
INSERT INTO `temp_content` VALUES(2,1,'Stránka','page',2,'texy','2010-11-27 13:07:39','TEXY! je SEXY!',0,1,'sk');
DROP TABLE IF EXISTS `test`;
CREATE TABLE `test` (`date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `t` INTEGER);
INSERT INTO `test` VALUES('2010-08-06 12:09:41',1);
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL UNIQUE , `user` VARCHAR(256), `password` VARCHAR(256), `role` VARCHAR(256), `name` VARCHAR(256), `surname` VARCHAR(256), `last_login` DATETIME, `session_id` VARCHAR(256));
INSERT INTO `users` VALUES(1,'admin','35ae32e31c965f718f3268fe48931eb2','admin','Branislav','Zvolenský','2011-02-15 18:40:32','d1eihq4bt7r3at1v4ci061a387');
INSERT INTO `users` VALUES(3,'editor','5aee9dbd2a188839105073571bee1b1f','editor','','','2010-10-24 20:27:23','XXX');
INSERT INTO `users` VALUES(4,'user','ee11cbb19052e40b07aac0ca060c23ee','user','','','2010-08-25 20:36:33','XXX');
DROP TABLE IF EXISTS `users_permisions`;
CREATE TABLE `users_permisions` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
`uid` INTEGER,
`name` varchar(256),
`machine_name` varchar(256),
`view` TINYINT(1) DEFAULT '0',
`add` TINYINT(1) DEFAULT '0',
`edit` TINYINT(1) DEFAULT '0',
`delete` TINYINT(1) DEFAULT '0'
);
| true |
3b711ef5dc01186c876716b2ab1202c0e5e4db8b | SQL | indrabasak/postgres-examples | /postgres-spring-jsonb/postgres-spring-jsonb-service/src/main/resources/db/create-db.sql | UTF-8 | 867 | 3.546875 | 4 | [] | no_license | DROP SCHEMA IF EXISTS example_jsonb CASCADE;
DROP ROLE IF EXISTS owner_example_jsonb;
CREATE ROLE owner_example_jsonb WITH
NOLOGIN
NOSUPERUSER
INHERIT
NOCREATEDB
NOCREATEROLE
NOREPLICATION;
GRANT owner_example_jsonb TO postgres;
CREATE SCHEMA example_jsonb AUTHORIZATION owner_example_jsonb;
GRANT ALL ON SCHEMA example_jsonb TO owner_example_jsonb;
CREATE TYPE example_jsonb.genre AS ENUM ('DRAMA', 'ROMANCE', 'GUIDE', 'TRAVEL');
ALTER TYPE example_jsonb.genre OWNER TO owner_example_jsonb;
CREATE TABLE example_jsonb.books
(
id uuid,
title text NOT NULL,
genre example.genre NOT NULL,
publisher text NOT NULL,
star bigint NOT NULL,
author jsonb NOT NULL DEFAULT '{}',
PRIMARY KEY (id),
CONSTRAINT books_check CHECK (star > 0 AND star <= 5));
ALTER TABLE example_jsonb.books OWNER to owner_example_jsonb;
| true |
45fe7ba178540594a3258871a25b2ae11daa09b7 | SQL | iwasingh/auxilium-db | /Project/sqls/create/24 assistance.sql | UTF-8 | 324 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE assistance (
maintainer_shift_id INTEGER,
ticket SERIAL PRIMARY KEY,
start_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL,
end_at TIMESTAMP(0) WITHOUT TIME ZONE,
FOREIGN KEY(maintainer_shift_id) REFERENCES maintainer(shift_id)
ON UPDATE CASCADE
ON DELETE SET NULL,
CHECK(end_at > start_at)
);
| true |
6c5f738b5a81d81e1d917e140b502fe8ad984a8b | SQL | mgambini75/iuniv-db | /View/api_frw_utenti.sql | UTF-8 | 685 | 2.640625 | 3 | [] | no_license | /* Formatted on 14/03/2016 11:45:35 (QP5 v5.287) */
CREATE OR REPLACE FORCE VIEW API_FRW_UTENTI
(
MID,
USER_ID,
PROFILE,
ANA_ID,
CARRIERA_ID,
CARRIERA,
NOME,
COGNOME,
MATRICOLA,
DESCRIZIONE,
NOTE,
DATA_INIZIO,
DATA_FINE,
URL_PHOTO,
FLG_BLOCK
)
AS
SELECT a.MID,
a.USER_ID,
a.PROFILE,
a.ANA_ID,
a.CARRIERA_ID,
a.CARRIERA,
a.NOME,
a.COGNOME,
a.MATRICOLA,
a.DESCRIZIONE,
a.NOTE,
a.DATA_INIZIO,
a.DATA_FINE,
a.URL_PHOTO,
0
FROM T_UTENTI A
WHERE 1 = 1 AND a.PROFILE <> 0 AND a.DISABLE_FLG = 0;
| true |
37a959c001b1d58a359bc162965f649c0d524019 | SQL | sellasaveup/GamificationAPI | /DB/gamification.sql | UTF-8 | 18,046 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 22, 2015 at 12:16 AM
-- Server version: 5.6.24
-- PHP Version: 5.5.24
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: `gamification`
--
-- --------------------------------------------------------
--
-- Table structure for table `SS_MA_BADGE`
--
CREATE TABLE IF NOT EXISTS `SS_MA_BADGE` (
`BADGE_ID` int(250) NOT NULL,
`BADGE_CODE` varchar(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`NAME` varchar(2000) NOT NULL,
`IMAGE` varchar(2000) DEFAULT NULL,
`STORY` varchar(5000) DEFAULT NULL,
`EXPIRY_DATE` date NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `SS_MA_BADGE`
--
INSERT INTO `SS_MA_BADGE` (`BADGE_ID`, `BADGE_CODE`, `GOAL_CODE`, `NAME`, `IMAGE`, `STORY`, `EXPIRY_DATE`, `DATE`) VALUES
(2, 'HYPE_NEW_BIE', 'HYPE_GOAL', 'Newbie ', 'newbie.jpg', 'Welcome! You have entered Hype Community, Experiencing money as a tool', '2015-12-31', '2015-08-22 01:08:49'),
(3, 'HYPE_SAVER', 'HYPE_GOAL', 'You have saved money for a goal by 25%', 'SAVER.JPG', 'You have saved 25% money for a goal ', '2015-12-31', '2015-08-22 01:08:49'),
(4, 'HYPE_SUPER_SAVER', 'HYPE_GOAL', 'Hype Super Saver', 'HYPE_SUPER_SAVER.JPG', 'You have saved 50% of Money for a goal', '2015-12-31', '2015-08-22 01:08:49'),
(5, 'HYPE_SUPER_SMART_SAVER', 'HYPE_GOAL', 'You are Super Smart Saver', 'HYPE_SUPER_SMART_SAVER.JPG', 'You have saved 75% for a goal', '2015-12-31', '2015-08-22 01:08:49'),
(6, 'HYPE_GOAL_SHARE_BUDDY', 'HYPE_GOAL', 'SOCIALIZER', 'SOCIALIZER.JPG', 'You have shared your Goal with a buddy\n', '2015-12-31', '2015-08-22 01:08:49'),
(7, 'HYPE_FELLOW_INFLUENCER', 'HYPE_GOAL', 'Received Comments and like', 'HYPE_FELLOW_INFLUENCER.JPG', 'You have received Comments and like from your buddy', '2015-12-31', '2015-08-22 01:08:49'),
(8, 'HYPE_GURU', 'HYPE GOAL', 'Complete a Goal', 'HYPE_GURU.jpg', 'You have completed a Goal', '2015-12-31', '2015-08-22 01:08:49'),
(9, 'HYPE_STAR_CONTRIBUTOR', 'HYPE_GOAL', 'Star Contributor', 'badge.jpg', 'Star Contributor', '2015-10-31', '2015-08-22 01:08:49');
-- --------------------------------------------------------
--
-- Table structure for table `SS_MA_CHALLENGE`
--
CREATE TABLE IF NOT EXISTS `SS_MA_CHALLENGE` (
`CHALLENGE_ID` int(250) NOT NULL,
`ACTION_CODE` varchar(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`STORY` varchar(5000) DEFAULT NULL,
`IMAGE` varchar(2000) DEFAULT NULL,
`POINTS` int(250) NOT NULL,
`OCCURRENCE` int(250) DEFAULT NULL,
`EXPIRY_DATE` date NOT NULL,
`BADGE_CODE` varchar(250) DEFAULT NULL,
`REWARD_CODE` varchar(250) DEFAULT NULL,
`STATUS` varchar(250) NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `SS_MA_CHALLENGE`
--
INSERT INTO `SS_MA_CHALLENGE` (`CHALLENGE_ID`, `ACTION_CODE`, `GOAL_CODE`, `STORY`, `IMAGE`, `POINTS`, `OCCURRENCE`, `EXPIRY_DATE`, `BADGE_CODE`, `REWARD_CODE`, `STATUS`, `DATE`) VALUES
(2, 'HYPE_APP_DOWLD', 'HYPE_GOAL', 'Download Hype App', 'hype_icon.png', 10, 1, '2015-12-31', 'HYPE_NEW_BIE', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(3, 'HYPE_CREATE_GOAL', 'HYPE_GOAL', 'You have created a Goal in Hype app', 'challenge.jpg', 10, NULL, '2015-12-31', 'HYPE_NEW_BIE', 'AMAZON_GIFT_VOUCHER', 'ACTIVE', '2015-08-22 01:15:15'),
(4, 'HYPE_CREATE_GOAL_MILESTONE', 'HYPE_GOAL', 'You have created Milestone for a Goal', 'challenge.jpg', 5, NULL, '2015-12-31', 'HYPE_CREATE_GOAL_MILESTONE', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(5, 'HYPE_GOAL_SAVE_MONEY_25', 'HYPE_GOAL', 'You have saved 25% money for your Hype Goal', 'challenge.jpg', 10, NULL, '2015-12-31', 'HYPE_SAVER', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(6, 'HYPE_GOAL_SAVE_MONEY_50', 'HYPE_GOAL', 'you have saved 50% money towards your Hype Goal', 'challenge', 10, NULL, '2015-12-31', 'HYPE_SUPER_SAVER', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(7, 'HYPE_GOAL_SAVE_MONEY_75', 'HYPE_GOAL', 'You have saved 75% money for your Hype Goal', 'challenge.jpg', 10, NULL, '2015-12-31', 'HYPE_SUPER_SMART_SAVER', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(8, 'HYPE_GOAL_SHARE_BUDDY', 'HYPE_GOAL', 'You have Shared you Goal with your buddy', 'challenge.jpg', 10, NULL, '2015-12-31', 'HYPE_GOAL_SHARE_BUDDY', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(9, 'HYPE_GOAL_LOCK', 'HYPE_GOAL', 'You have locked your Hype Goal', 'challenge.jpg', -30, NULL, '2015-12-31', NULL, NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(10, 'HYPE_GOAL_UNLOCK', 'HYPE_GOAL', 'You have unlocked your Hype Goal', 'challenge.jpg', 30, NULL, '2015-12-31', NULL, NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(11, 'HYPE_RECEIVE_COMMENTS', 'HYPE_GOAL', 'You have received Comments on your Hype goal', NULL, 3, NULL, '2015-12-31', 'HYPE_FELLOW_INFLUENCER', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(12, 'HYPE_RECEIVE_LIKE', 'HYPE_GOAL', 'You have received like for your Hype Goal ', 'challenge.jpg', 1, NULL, '2015-12-31', 'HYPE_FELLOW_INFLUENCER', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(13, 'HYPE_CONTRIBUTE_BUDDY', '', 'You have contributed for your friends Hype Goal', 'challenge.jpg', 10, NULL, '2015-12-31', 'HYPE_STAR_CONTRIBUTOR', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(14, 'HYPE_COMPLETE_GOAL', 'HYPE_GOAL', 'You have completed your Hype Goal', 'challenge.jpg', 10, NULL, '2016-01-31', 'HYPE_GURU', NULL, 'ACTIVE', '2015-08-22 01:15:15'),
(15, 'HYPE_CANCEL_GOAL', 'HYPE_GOAL', 'You have cancelled your Hype Goal ', 'Challenge.jpg', -20, NULL, '2015-12-31', NULL, NULL, 'ACTIVE', '2015-08-22 01:15:15');
-- --------------------------------------------------------
--
-- Table structure for table `SS_MA_GOAL`
--
CREATE TABLE IF NOT EXISTS `SS_MA_GOAL` (
`GOAL_ID` int(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`NAME` varchar(2000) NOT NULL,
`STORY` varchar(5000) DEFAULT NULL,
`EXPIRY_DATE` date NOT NULL,
`IMAGE` varchar(2000) DEFAULT NULL,
`USER_TYPE` varchar(250) NOT NULL,
`STATUS` varchar(250) NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `SS_MA_GOAL`
--
INSERT INTO `SS_MA_GOAL` (`GOAL_ID`, `GOAL_CODE`, `NAME`, `STORY`, `EXPIRY_DATE`, `IMAGE`, `USER_TYPE`, `STATUS`, `DATE`) VALUES
(3, 'HYPE_GOAL', 'Hype Goal', 'Create Hype Goals, Share Goal with your Buddy, accomplish your Goal', '2016-01-01', 'hype.jpg', 'CUSTOMER', 'ACTIVE', '2015-08-22 01:06:41');
-- --------------------------------------------------------
--
-- Table structure for table `SS_MA_LEVEL`
--
CREATE TABLE IF NOT EXISTS `SS_MA_LEVEL` (
`LEVEL_ID` int(250) NOT NULL,
`LEVEL_CODE` varchar(250) NOT NULL,
`GOAL_CODE` varchar(250) DEFAULT NULL,
`REWARD_CODE` varchar(250) DEFAULT NULL,
`BADGE_CODE` varchar(250) DEFAULT NULL,
`NAME` varchar(2000) NOT NULL,
`IMAGE` varchar(2000) DEFAULT NULL,
`STORY` varchar(5000) DEFAULT NULL,
`POINTS` int(250) NOT NULL,
`PRIORITY` int(250) NOT NULL,
`EXPIRY_DATE` date NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `SS_MA_LEVEL`
--
INSERT INTO `SS_MA_LEVEL` (`LEVEL_ID`, `LEVEL_CODE`, `GOAL_CODE`, `REWARD_CODE`, `BADGE_CODE`, `NAME`, `IMAGE`, `STORY`, `POINTS`, `PRIORITY`, `EXPIRY_DATE`, `DATE`) VALUES
(3, 'LEVEL1', 'HYPE_GOAL', 'AMAZON_GIFT_VOUCHER', 'BRONZE', 'reached 250 points', NULL, 'Congrats, you have reached 250 Points in achieving your financial goal using Hype Goal Program', 250, 1, '2015-08-31', '0000-00-00 00:00:00'),
(4, 'LEVEL2', 'HYPE_GOAL', 'AMAZON_GIFT_VOUCHER', 'SILVER', 'reached 500 points ', 'level.jpg', 'Congrats, you have reached 500 points in achieving your financial goal using Hype Goal Program', 500, 2, '2015-08-31', '0000-00-00 00:00:00'),
(5, 'LEVEL3', 'HYPE_GOAL', 'AMAZON_GIFT_VOUCHER', 'GOLD', 'reached 1000 points ', 'level.jpg', 'Congrats, you have reached 1000 points in achieving your financial goal using Hype Goal Program', 1000, 3, '2015-08-31', '0000-00-00 00:00:00'),
(6, 'LEVEL4', 'HYPE_GOAL', 'AMAZON_GIFT_VOUCHER', 'PLATINUM', 'reached 2500 points ', 'level.jpg', 'Congrats, you have reached 2500 points in achieving your financial goal using Hype Goal Program', 2500, 4, '2015-08-31', '0000-00-00 00:00:00'),
(7, 'LEVEL5', 'HYPE_GOAL', 'AMAZON_GIFT_VOUCHER', 'DIAMOND', 'reached >greater than 5000 points', 'level.jpg', 'Congrats, for reaching more than 5000 points in achieving your financial goals using Hype Goal Program', 5000, 5, '2015-08-31', '0000-00-00 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `SS_MA_REWARD`
--
CREATE TABLE IF NOT EXISTS `SS_MA_REWARD` (
`REWARD_ID` int(250) NOT NULL,
`REWARD_CODE` varchar(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`NAME` varchar(2000) NOT NULL,
`STORY` varchar(5000) DEFAULT NULL,
`IMAGE` varchar(2000) DEFAULT NULL,
`EXPIRY_DATE` date NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `SS_MA_REWARD`
--
INSERT INTO `SS_MA_REWARD` (`REWARD_ID`, `REWARD_CODE`, `GOAL_CODE`, `NAME`, `STORY`, `IMAGE`, `EXPIRY_DATE`, `DATE`) VALUES
(2, 'AMAZON_GIFT_VOUCHER', 'HYPE_GOAL', 'Amazon gift voucher', 'Amazon gift voucher worth 10Euro', 'AMAZON_GIFT_VOUCHER.jpg', '2015-12-31', '2015-08-22 01:09:37');
-- --------------------------------------------------------
--
-- Table structure for table `SS_MA_USER`
--
CREATE TABLE IF NOT EXISTS `SS_MA_USER` (
`USER_ID` int(250) NOT NULL,
`USER_CODE` varchar(250) NOT NULL,
`NAME` varchar(2000) NOT NULL,
`NICK_NAME` varchar(2000) DEFAULT NULL,
`IMAGE` varchar(2000) DEFAULT NULL,
`USER_TYPE` varchar(250) NOT NULL,
`STATUS` varchar(250) NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `SS_MA_USER`
--
INSERT INTO `SS_MA_USER` (`USER_ID`, `USER_CODE`, `NAME`, `NICK_NAME`, `IMAGE`, `USER_TYPE`, `STATUS`, `DATE`) VALUES
(13, 'GBS03146', 'Sujatha Balaji', 'Sujatha', 'sujatha.jpg', 'EMPLOYEE', 'ACTIVE', '2015-08-22 01:20:40');
-- --------------------------------------------------------
--
-- Table structure for table `SS_MA_USER_TYPE`
--
CREATE TABLE IF NOT EXISTS `SS_MA_USER_TYPE` (
`USER_TYPE_ID` int(250) NOT NULL,
`USER_TYPE_CODE` varchar(250) NOT NULL,
`STORY` varchar(5000) DEFAULT NULL,
`IMAGE` varchar(2000) DEFAULT NULL,
`STATUS` varchar(250) NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `SS_MA_USER_TYPE`
--
INSERT INTO `SS_MA_USER_TYPE` (`USER_TYPE_ID`, `USER_TYPE_CODE`, `STORY`, `IMAGE`, `STATUS`, `DATE`) VALUES
(2, 'CUSTOMER', 'CUSTOMER OF GBS', 'CUSTOMER.JPG', 'ACTIVE', '2015-08-22 01:03:28'),
(3, 'EMPLOYEE', 'EMPLOYEE OF GBS', 'EMPLOYEE.JPG', 'ACTIVE', '2015-08-22 01:03:28');
-- --------------------------------------------------------
--
-- Table structure for table `SS_TR_USER_ACTION`
--
CREATE TABLE IF NOT EXISTS `SS_TR_USER_ACTION` (
`TR_ID` int(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`USER_CODE` varchar(250) NOT NULL,
`ACTION_CODE` varchar(250) NOT NULL,
`POINTS` int(250) NOT NULL,
`STATUS` varchar(250) NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `SS_TR_USER_BADGE`
--
CREATE TABLE IF NOT EXISTS `SS_TR_USER_BADGE` (
`TR_ID` int(250) NOT NULL,
`BADGE_CODE` varchar(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`USER_CODE` varchar(250) NOT NULL,
`STATUS` varchar(250) NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `SS_TR_USER_GOAL_POINTS`
--
CREATE TABLE IF NOT EXISTS `SS_TR_USER_GOAL_POINTS` (
`TR_ID` int(250) NOT NULL,
`USER_CODE` varchar(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`TOTAL_POINTS` varchar(250) NOT NULL,
`REEDEMED_POINTS` varchar(250) NOT NULL,
`GLOBAL_BADGE_CODE` varchar(250) DEFAULT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `SS_TR_USER_LEVEL`
--
CREATE TABLE IF NOT EXISTS `SS_TR_USER_LEVEL` (
`TR_ID` int(250) NOT NULL,
`LEVEL_CODE` varchar(250) NOT NULL,
`USER_CODE` varchar(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`BADGE_CODE` varchar(250) NOT NULL,
`PRIORITY` int(250) NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `SS_TR_USER_REWARD`
--
CREATE TABLE IF NOT EXISTS `SS_TR_USER_REWARD` (
`TR_ID` int(250) NOT NULL,
`REWARD_CODE` varchar(250) NOT NULL,
`GOAL_CODE` varchar(250) NOT NULL,
`USER_CODE` varchar(250) NOT NULL,
`REDEEM_STATUS` varchar(250) NOT NULL,
`REDEEM_POINTS` int(250) NOT NULL,
`DATE` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `SS_MA_BADGE`
--
ALTER TABLE `SS_MA_BADGE`
ADD PRIMARY KEY (`BADGE_ID`),
ADD UNIQUE KEY `BADGE_CODE` (`BADGE_CODE`);
--
-- Indexes for table `SS_MA_CHALLENGE`
--
ALTER TABLE `SS_MA_CHALLENGE`
ADD PRIMARY KEY (`CHALLENGE_ID`),
ADD UNIQUE KEY `ACTION_CODE` (`ACTION_CODE`);
--
-- Indexes for table `SS_MA_GOAL`
--
ALTER TABLE `SS_MA_GOAL`
ADD PRIMARY KEY (`GOAL_ID`),
ADD UNIQUE KEY `GOAL_CODE` (`GOAL_CODE`),
ADD KEY `FK_GOAL_USER_TYPE` (`USER_TYPE`);
--
-- Indexes for table `SS_MA_LEVEL`
--
ALTER TABLE `SS_MA_LEVEL`
ADD PRIMARY KEY (`LEVEL_ID`),
ADD UNIQUE KEY `LEVEL_CODE` (`LEVEL_CODE`);
--
-- Indexes for table `SS_MA_REWARD`
--
ALTER TABLE `SS_MA_REWARD`
ADD PRIMARY KEY (`REWARD_ID`),
ADD UNIQUE KEY `REWARD_CODE` (`REWARD_CODE`);
--
-- Indexes for table `SS_MA_USER`
--
ALTER TABLE `SS_MA_USER`
ADD PRIMARY KEY (`USER_ID`),
ADD UNIQUE KEY `USER_CODE` (`USER_CODE`),
ADD KEY `FK_USER_TYPE` (`USER_TYPE`);
--
-- Indexes for table `SS_MA_USER_TYPE`
--
ALTER TABLE `SS_MA_USER_TYPE`
ADD PRIMARY KEY (`USER_TYPE_ID`),
ADD UNIQUE KEY `USER_TYPE_CODE` (`USER_TYPE_CODE`);
--
-- Indexes for table `SS_TR_USER_ACTION`
--
ALTER TABLE `SS_TR_USER_ACTION`
ADD PRIMARY KEY (`TR_ID`);
--
-- Indexes for table `SS_TR_USER_BADGE`
--
ALTER TABLE `SS_TR_USER_BADGE`
ADD PRIMARY KEY (`TR_ID`);
--
-- Indexes for table `SS_TR_USER_GOAL_POINTS`
--
ALTER TABLE `SS_TR_USER_GOAL_POINTS`
ADD PRIMARY KEY (`TR_ID`);
--
-- Indexes for table `SS_TR_USER_LEVEL`
--
ALTER TABLE `SS_TR_USER_LEVEL`
ADD PRIMARY KEY (`TR_ID`);
--
-- Indexes for table `SS_TR_USER_REWARD`
--
ALTER TABLE `SS_TR_USER_REWARD`
ADD PRIMARY KEY (`TR_ID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `SS_MA_BADGE`
--
ALTER TABLE `SS_MA_BADGE`
MODIFY `BADGE_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `SS_MA_CHALLENGE`
--
ALTER TABLE `SS_MA_CHALLENGE`
MODIFY `CHALLENGE_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `SS_MA_GOAL`
--
ALTER TABLE `SS_MA_GOAL`
MODIFY `GOAL_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `SS_MA_LEVEL`
--
ALTER TABLE `SS_MA_LEVEL`
MODIFY `LEVEL_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `SS_MA_REWARD`
--
ALTER TABLE `SS_MA_REWARD`
MODIFY `REWARD_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `SS_MA_USER`
--
ALTER TABLE `SS_MA_USER`
MODIFY `USER_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `SS_MA_USER_TYPE`
--
ALTER TABLE `SS_MA_USER_TYPE`
MODIFY `USER_TYPE_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `SS_TR_USER_ACTION`
--
ALTER TABLE `SS_TR_USER_ACTION`
MODIFY `TR_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `SS_TR_USER_BADGE`
--
ALTER TABLE `SS_TR_USER_BADGE`
MODIFY `TR_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `SS_TR_USER_GOAL_POINTS`
--
ALTER TABLE `SS_TR_USER_GOAL_POINTS`
MODIFY `TR_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `SS_TR_USER_LEVEL`
--
ALTER TABLE `SS_TR_USER_LEVEL`
MODIFY `TR_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `SS_TR_USER_REWARD`
--
ALTER TABLE `SS_TR_USER_REWARD`
MODIFY `TR_ID` int(250) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `SS_MA_GOAL`
--
ALTER TABLE `SS_MA_GOAL`
ADD CONSTRAINT `FK_GOAL_USER_TYPE` FOREIGN KEY (`USER_TYPE`) REFERENCES `SS_MA_USER_TYPE` (`USER_TYPE_CODE`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `SS_MA_USER`
--
ALTER TABLE `SS_MA_USER`
ADD CONSTRAINT `FK_USER_TYPE` FOREIGN KEY (`USER_TYPE`) REFERENCES `SS_MA_USER_TYPE` (`USER_TYPE_CODE`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!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 */;
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.