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
2fecc7321ee31f3b4ee39ea066eaec1f7d9d12e6
SQL
nsaman/ListSite
/src/main/resources/db/migration/V00006__DDL.sql
UTF-8
580
3.65625
4
[]
no_license
drop table vote; create table vote ( voteID int NOT NULL AUTO_INCREMENT, winnerThingID int NOT NULL, loserThingID int NOT NULL, comparatorID int NOT NULL, userID char(25) NOT NULL, PRIMARY KEY (voteID), CONSTRAINT FK_vote_1 FOREIGN KEY (comparatorID) REFERENCES comparator(comparatorID) ON DELETE CASCADE, CONSTRAINT FK_vote_2 FOREIGN KEY (winnerThingID) REFERENCES thing(thingID) ON DELETE CASCADE, CONSTRAINT FK_vote_3 FOREIGN KEY (loserThingID) REFERENCES thing(thingID) ON DELETE CASCADE, CONSTRAINT FK_vote_4 FOREIGN KEY (userID) REFERENCES user(userID) ON DELETE CASCADE );
true
078a0f57b54208138c46328c9afd19927fd0d6fe
SQL
sogis/gretljobs
/arp_richtplan_pub/arp_richtplan_pub_richtplankarte_ueberlagernder_punkt.sql
UTF-8
3,884
3.484375
3
[ "MIT" ]
permissive
WITH documents AS ( SELECT DISTINCT richtplankarte_dokument.t_id, richtplankarte_dokument.titel, richtplankarte_dokument.publiziertAb, richtplankarte_dokument.bemerkung, CASE WHEN position('/opt/sogis_pic/documents/ch.so.arp.richtplan/' IN richtplankarte_dokument.dateipfad) != 0 THEN 'https://geo.so.ch/docs/' || split_part(richtplankarte_dokument.dateipfad, '/documents/', 2) WHEN position('opt/sogis_pic/daten_aktuell/arp/Zonenplaene/Zonenplaene_pdf/' IN richtplankarte_dokument.dateipfad) != 0 THEN 'https://geo.so.ch/docs/ch.so.arp.zonenplaene/' || split_part(richtplankarte_dokument.dateipfad, '/Zonenplaene/', 2) WHEN position('G:\documents\' IN richtplankarte_dokument.dateipfad) != 0 THEN replace(richtplankarte_dokument.dateipfad, 'G:\documents\', 'https://geo.so.ch/docs/') END AS dokument, richtplankarte_ueberlagernder_punkt.t_id AS ueberlagernder_punkt_id FROM arp_richtplan_v1.richtplankarte_ueberlagernder_punkt_dokument LEFT JOIN arp_richtplan_v1.richtplankarte_dokument ON richtplankarte_dokument.t_id = richtplankarte_ueberlagernder_punkt_dokument.dokument RIGHT JOIN arp_richtplan_v1.richtplankarte_ueberlagernder_punkt ON richtplankarte_ueberlagernder_punkt_dokument.ueberlagernder_punkt = richtplankarte_ueberlagernder_punkt.t_id WHERE (titel, dateipfad) IS NOT NULL ), documents_json AS ( SELECT array_to_json( array_agg( row_to_json(( SELECT docs FROM ( SELECT t_id, titel, publiziertAb, bemerkung, dokument ) docs )) ) ) AS dokumente, ueberlagernder_punkt_id FROM documents GROUP BY ueberlagernder_punkt_id ), ueberlagernde_punkte_mit_documents AS ( SELECT richtplankarte_ueberlagernder_punkt.objektname, richtplankarte_ueberlagernder_punkt.abstimmungskategorie, richtplankarte_ueberlagernder_punkt.bedeutung, richtplankarte_ueberlagernder_punkt.planungsstand, documents_json.dokumente, richtplankarte_ueberlagernder_punkt.astatus, richtplankarte_ueberlagernder_punkt.objekttyp, richtplankarte_ueberlagernder_punkt.spezifikation, richtplankarte_ueberlagernder_punkt.geometrie FROM arp_richtplan_v1.richtplankarte_ueberlagernder_punkt LEFT JOIN documents_json ON richtplankarte_ueberlagernder_punkt.t_id = documents_json.ueberlagernder_punkt_id ) SELECT ueberlagernde_punkte_mit_documents.objektname, ueberlagernde_punkte_mit_documents.abstimmungskategorie, ueberlagernde_punkte_mit_documents.bedeutung, ueberlagernde_punkte_mit_documents.planungsstand, ueberlagernde_punkte_mit_documents.dokumente, ueberlagernde_punkte_mit_documents.astatus, ueberlagernde_punkte_mit_documents.objekttyp, ueberlagernde_punkte_mit_documents.spezifikation, ueberlagernde_punkte_mit_documents.geometrie, swissboundaries3d_hoheitsgebiet.hoheitsgebietsname AS gemeindename FROM ueberlagernde_punkte_mit_documents, agi_swissboundaries3d_pub.swissboundaries3d_hoheitsgebiet WHERE ST_DWithin(ueberlagernde_punkte_mit_documents.geometrie, swissboundaries3d_hoheitsgebiet.geometrie, 0) AND ST_Within(ueberlagernde_punkte_mit_documents.geometrie, swissboundaries3d_hoheitsgebiet.geometrie) AND ueberlagernde_punkte_mit_documents.planungsstand IN ('rechtsgueltig', 'in_Auflage')
true
2b3b83eade6f43908ec6c7f05ea83b1309c84fb0
SQL
mbougie/gibbs
/projects/lem/projects/main/sql/v3/v3_3/tract/main/v3_3_main.tract_nbrlist.sql
UTF-8
428
3.359375
3
[]
no_license
 CREATE TABLE v3_3_main.tract_nbrlist AS -- derive neighbors column----------------------------------------------------- SELECT a.src_geoid as geoid, string_agg(a.nbr_geoid, ', '::text) AS neighbor_list FROM v3_core.block_neighbors a WHERE a.length <> 0::double precision GROUP BY a.src_geoid; ---create index using geoid column CREATE INDEX v3_3_main_block_nbrlist_geoid_idx ON v3_3_main.block_nbrlist (geoid);
true
5a30fb1f79ddce75fbda53913cbf9947c9442ad5
SQL
jrothrock/sql_examples
/Subqueries/Subqueries.sql
UTF-8
2,522
3.984375
4
[]
no_license
/* Author: Jack Rothrock */ use world; # Step 1 select distinct population from city order by population desc limit 10; # Step 2 select min(population) from (select distinct population from city order by population desc limit 10) sq; ## This has to be done, as there are 11 rows returned, as the last one has a population with the same value select name as "city", population from city where population >= ( select min(population) from (select distinct population from city order by population desc limit 10) sq); # List the bottom 5 countries in Africa based on population # step 1 select name, max(population) from (select distinct name, population from country where continent = "Africa" order by population asc limit 5) sq; select name as "country", population from country where population <= (select max(population) from (select distinct name, population from country where continent = "Africa" order by population asc limit 5) sq) and continent = "Africa"; # list the bottom 3 regions in europe based on population # Step 1 select region, sum(population) from country where continent = "Europe" group by region order by sum(population) asc limit 3; # Step 2 (select max(sumpop) from (select region, sum(population) as sumpop from country where continent = "Europe" group by region order by sum(population) asc limit 3) sq); select region, sum(population) from country where continent = "Europe" group by region having sum(population) <= (select max(sumpop) from (select region, sum(population) as sumpop from country where continent = "Europe" group by region order by sum(population) asc limit 3) sq); # List the continents by highest population, then by regions with the highest population, then countries with highest population select lecont.continent, lereg.region, lecountry.name, lecont.average, lereg.average, lecountry.average from (select continent, avg(lifeexpectancy) average from country group by continent) lecont join (select continent, region, avg(lifeexpectancy) average from country group by continent, region) lereg on lecont.continent = lereg.continent join (select continent, region, name, avg(lifeexpectancy) average from country group by continent, region, name) lecountry on lereg.region = lecountry.region order by lecont.average desc, lereg.average desc, lecountry.average desc;
true
e5b373e792c546640fb2c4660b17d69236a398a9
SQL
ravinanitwal/Identifying-IT-Assets-in-a-Network
/info.sql
UTF-8
2,489
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 28, 2018 at 08:13 AM -- Server version: 10.1.32-MariaDB -- PHP Version: 7.2.5 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: `ongc` -- -- -------------------------------------------------------- -- -- Table structure for table `info` -- CREATE TABLE `info` ( `ip` text, `manufacturer` text, `hostname` text, `os` text, `processor` text, `ram` text, `videocard` text, `localdd` text, `mountedfile` text, `availuser` text, `printer` text, `ssn` text, `updown` text, `uid` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `info` -- INSERT INTO `info` (`ip`, `manufacturer`, `hostname`, `os`, `processor`, `ram`, `videocard`, `localdd`, `mountedfile`, `availuser`, `printer`, `ssn`, `updown`, `uid`) VALUES ('192.168.43.224', '\r\n\r\n', '\r\n\r\n', '\r\n\r\n', '\r\n\r\n', '\r\n\r\n', 'Not available', '\r\n\r\n', 'Not available', 'Not available', '\r\n\r\n', '\r\n\r\n', 'UP', 422), ('192.168.43.225', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'DOWN', 423), ('192.168.43.226', '\r\n\r\n', '\r\n\r\n', '\r\n\r\n', '\r\n\r\n', '\r\n\r\n', 'Not available', '\r\n\r\n', 'Not available', 'Not available', '\r\n\r\n', '\r\n\r\n', 'UP', 424), ('192.168.43.227', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'Not available', 'DOWN', 425); -- -- Indexes for dumped tables -- -- -- Indexes for table `info` -- ALTER TABLE `info` ADD PRIMARY KEY (`uid`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `info` -- ALTER TABLE `info` MODIFY `uid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=426; 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
9c71a9bb985a916bf910f1aa042f4af67cc0142d
SQL
knights198613/javatest
/testmybatis/src/main/sqlScript/SyUser.sql
UTF-8
715
2.765625
3
[]
no_license
CREATE TABLE sy_user ( id BIGINT(20) PRIMARY KEY NOT NULL COMMENT '主键自增' AUTO_INCREMENT, user_name VARCHAR(100) NOT NULL COMMENT '姓名', user_code VARCHAR(100) NOT NULL COMMENT '用户名', age SMALLINT(6), sex VARCHAR(10) COMMENT '1:男 2:女', email VARCHAR(100) COMMENT '电子邮箱', tel VARCHAR(30), degree SMALLINT(6), duty VARCHAR(100) COMMENT '职级', born_city VARCHAR(200) COMMENT '籍贯', pass_word VARCHAR(100) NOT NULL, create_time DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间', modify_time DATETIME NOT NULL, del_flag SMALLINT(6) COMMENT '0:删除 1:有效', modify_user VARCHAR(100) COMMENT '修改人' );
true
e0454fbe0856bf3ffc9d948d5786b121318f209b
SQL
akankshaladdha/DBMS
/banking_database.sql
UTF-8
3,171
4.125
4
[]
no_license
create database BANKING_ENTERPRISE; use BANKING_ENTERPRISE; create table Branch( branch_name varchar(30), branch_city varchar(10), assets real, PRIMARY KEY (branch_name)); insert into Branch values( 'SBI_Chamrajpet','Bangalore',50000), ("SBI_ResidencyRoad","Bangalore",10000), ("SBI_ShivajiRoad","Bonbay",20000), ("SBI_ParliamentRoad","Delhi",10000), ("SBI_Jantarmantar","Delhi",20000); select * from Branch; create table Bank_account( acc_no int, branch_name varchar(30), balance real, PRIMARY KEY (acc_no), FOREIGN KEY (branch_name) REFERENCES BRANCH(branch_name)); insert into Bank_account values( 1,"SBI_Chamrajpet",2000),(2,"SBI_ResidencyRoad",5000),(3,"SBI_ShivajiRoad",6000),(4,"SBI_ParliamentRoad",9000),(5,"SBI_Jantarmantar",8000),(6,"SBI_ShivajiRoad",4000),(8,"SBI_ResidencyRoad",4000),(9,"SBI_ParliamentRoad",3000),(10,"SBI_ResidencyRoad",5000),(11,"SBI_Jantarmantar",2000); select * from Bank_account; create table Bank_Customer( customername varchar(30), customerstreet varchar(30), customercity varchar(30), primary key (customername)); insert into Bank_Customer values("Avinash","Bull Temple Road","Bangalore"), ("Dinesh","Bannergatta Road","Bangalore"), ("Mohan","National College Road","Bangalore"), ("Nikil","Akbar Road","Delhi"), ("Ravi","Prithviraj Road","Delhi"); create table Depositor( customername varchar(30), acc_no int, PRIMARY KEY (customername,acc_no), FOREIGN KEY (customername) REFERENCES Bank_Customer (customername), FOREIGN KEY (acc_no) REFERENCES Bank_account(acc_no)); insert into Depositor values( "Avinash",1),("Dinesh",2),("Nikil",4),("Ravi",5),("Avinash",8),("Nikil",9),("Dinesh",10),("Nikil",11); select * from Depositor; create table Loan( loan_num int, branch_name varchar(30), amount real, PRIMARY KEY (loan_num), FOREIGN KEY (branch_name) REFERENCES Branch(branch_name)); insert into Loan values( 1,"SBI_Chamrajpet",1000),(2,"SBI_ResidencyRoad",2000),(3,"SBI_ShivajiRoad",3000),(4,"SBI_ParliamentRoad",4000),(5,"SBI_Jantarmantar",5000); select * from Loan; create table borrower( customername varchar(30), loan_num int, foreign key(customername) references Bank_Customer (customername), foreign key(loan_num) references Loan(loan_num)); insert into borrower values('Avinash',1), ('Dinesh',2), ('Nikil',3), ('Avinash', 4), ('Dinesh', 5); select C.customername from Bank_Customer C where exists ( select D.customername, count(D.customername) from Depositor D,Bank_account BA where D.acc_no = BA.acc_no AND C.customername = D.customername AND BA.branch_name='SBI_ResidencyRoad' group by D.customername having count(D.customername) >=2); select BC.customer_name from BankCustomer BC where not exists( select branch_name from Branch where branch_city = 'Delhi' and branch_name not in( select BA.branch_name from Depositer D, BankAccount BA where D.accno = BA.accno and BC.customer_name = D.customer_name) ); delete from Bank_account where branch_name in (select branch_name from Branch where branch_city='Bonbay'); select * from Bank_account;
true
388927adae2b6c0a27ccb254d00b142f3641d3bd
SQL
ianwebdeveloper/velky
/source/database/__velkydb__20121121.sql
UTF-8
1,194
3.078125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 21, 2012 at 02:57 PM -- Server version: 5.5.8 -- PHP Version: 5.3.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!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: `velkydb` -- -- -------------------------------------------------------- -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `u_id` int(11) NOT NULL AUTO_INCREMENT, `fname` varchar(75) DEFAULT NULL, `mname` varchar(75) DEFAULT NULL, `lname` varchar(75) DEFAULT NULL, `email` varchar(255) NOT NULL, `addr1` mediumtext, `addr2` mediumtext, `utype` enum('0','1','2') DEFAULT NULL COMMENT '0: admin, 1: cca, 2: reserved', `status` enum('0','1') DEFAULT NULL COMMENT '0: inactive, 1: otherwise', PRIMARY KEY (`u_id`), UNIQUE KEY `email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Dumping data for table `users` --
true
90b0ba54e2c725b923862f8f13f77b630eb49ad0
SQL
samjwu/SeQueL
/null.sql
UTF-8
267
2.9375
3
[]
no_license
--NULL Value /* syntax SELECT columnA, columnB, ... FROM table WHERE column IS NULL SELECT columnA, columnB, ... FROM table WHERE column IS NOT NULL */ SELECT ID, name, gender FROM table WHERE name IS NULL; SELECT ID, name, gender FROM table WHERE name IS NOT NULL;
true
e6ff2e22fb4cbe9d59b6bb502917e995e62a5be8
SQL
tberendes/gpmgv
/scripts/loadMetadata.sql
UTF-8
546
3.34375
3
[]
no_license
insert into event_meta_numeric select t.* from metadata_temp t where not exists (select * from event_meta_numeric p where p.event_num = t.event_num and p.metadata_id = t.metadata_id); -- don't need these data_type checks, metadata_temp only holds numeric data insert into event_meta_numeric select t.* from metadata_temp t, metadata_parameter i where t.metadata_id = i.metadata_id and i.data_type in ('INTEGER','FLOAT') and not exists (select * from event_meta_numeric p where p.event_num = t.event_num and p.metadata_id = t.metadata_id);
true
17d3269eb79e5c49e2bbc2d9708d289d4fa75a67
SQL
MohawkMEDIC/openizdc
/OpenIZ.Mobile.Core.Xamarin/Data/InitWarehouse.sql
UTF-8
971
3.65625
4
[ "CC-BY-3.0", "LGPL-2.1-only", "GPL-1.0-or-later", "OpenSSL", "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "MIT", "LicenseRef-scancode-openssl", "LicenseRef-scancode-ssleay-windows", "Apache-2.0", "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
CREATE TABLE IF NOT EXISTS dw_datamarts ( uuid blob(16) not null primary key, name varchar(64) not null unique, creation_time bigint not null, schema_id blob(16) not null ); CREATE UNIQUE INDEX IF NOT EXISTS dw_datamarts_name_idx ON dw_datamarts(name); CREATE TABLE IF NOT EXISTS dw_schemas ( uuid blob(16) not null primary key, name varchar(64) not null unique ); CREATE UNIQUE INDEX IF NOT EXISTS dw_schemas_name_idx ON dw_schemas(name); CREATE TABLE IF NOT EXISTS dw_st_query ( uuid blob(16) not null, schema_id blob(16) not null, name varchar(64) not null, constraint pk_dw_st_query primary key (uuid) ); CREATE UNIQUE INDEX IF NOT EXISTS dw_st_query_name_idx ON dw_st_query(schema_id,name); CREATE TABLE IF NOT EXISTS dw_properties ( uuid blob(16) not null primary key, cont_id blob(16) not null, name varchar(64) not null, type int not null, attr int not null ); CREATE INDEX IF NOT EXISTS dw_properties_cont_idx ON dw_properties(cont_id);
true
ad9d1fd7c7622823d39ce6657609c7a217c44c23
SQL
Jerry-KK/imooc-shiro
/shiro-test/src/main/resources/sql/sql.sql
UTF-8
524
2.9375
3
[]
no_license
create table test_user( id bigint auto_increment, name varchar(100), password varchar(100), PRIMARY key (id) ) insert into test_user(name,password) VALUES('lethe','123456') select password from test_user where name = 'lethe' CREATE TABLE test_user_role ( user_name VARCHAR(64), role_name VARCHAR(32), PRIMARY KEY(user_name,role_name) ); INSERT INTO test_user_role VALUES ('lethe','admin');
true
a6bddcad7ce4d5c6188667e9dccd343c2395d758
SQL
bea-ribas/RegisterStudent
/bin/DAO/Table.sql
UTF-8
167
2.875
3
[]
no_license
/* SQL used to create the Table Student */ CREATE TABLE Student (ID INT AUTO_INCREMENT PRIMARY KEY NOT NULL, Name VARCHAR(70), Email VARCHAR(70), Address VARCHAR(70));
true
6ec0f1892ba1d2194891fa3c191ed390a589260e
SQL
intan2819/bbisv2
/bbisv2.sql
UTF-8
11,511
3.109375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 20, 2020 at 01:42 PM -- Server version: 10.1.38-MariaDB -- PHP Version: 7.3.3 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: `bbisv2` -- -- -------------------------------------------------------- -- -- Table structure for table `bloodbag` -- CREATE TABLE `bloodbag` ( `id` int(11) NOT NULL, `productID` int(11) NOT NULL, `displayBloodbagID` varchar(10) DEFAULT NULL, `bloodType` varchar(5) NOT NULL, `donorID` int(11) NOT NULL, `retrievedDate` date NOT NULL, `expiryDate` date NOT NULL, `status` varchar(15) NOT NULL DEFAULT 'In Stock', `dateCreated` datetime NOT NULL, `lastEdited` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `bloodbag` -- INSERT INTO `bloodbag` (`id`, `productID`, `displayBloodbagID`, `bloodType`, `donorID`, `retrievedDate`, `expiryDate`, `status`, `dateCreated`, `lastEdited`) VALUES (1, 10, 'RBC1000001', 'A', 2, '2020-06-02', '2020-07-07', 'Discarded', '2020-06-02 01:56:16', '2020-06-02 01:56:16'), (2, 10, 'RBC1000002', 'B', 3, '2020-03-30', '2020-06-04', 'Discarded', '2020-06-04 10:33:41', '2020-06-07 19:04:15'), (3, 10, 'RBC1000003', 'O', 2, '2020-06-04', '2020-07-09', 'Discarded', '2020-06-04 12:11:58', '2020-06-04 12:11:58'), (4, 11, 'RBC1100004', 'B', 3, '2020-06-12', '2020-07-17', 'Transferred', '2020-06-12 09:06:39', '2020-06-12 09:06:39'), (5, 11, 'RBC1100005', 'B', 3, '2020-06-12', '2020-07-17', 'In Stock', '2020-06-12 09:07:04', '2020-06-12 09:07:04'); -- -------------------------------------------------------- -- -- Table structure for table `components` -- CREATE TABLE `components` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `shelfLife` int(11) NOT NULL, `prefix` varchar(3) NOT NULL, `dateCreated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `lastEdited` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `components` -- INSERT INTO `components` (`id`, `name`, `shelfLife`, `prefix`, `dateCreated`, `lastEdited`) VALUES (4, 'Red Blood Cell', 35, 'RBC', '2020-05-31 20:39:49', '2020-05-31 20:41:40'), (5, 'Plasma', 730, 'PLM', '2020-05-31 20:40:31', '2020-05-31 20:40:31'), (6, 'Platelet', 5, 'PLT', '2020-05-31 20:40:49', '2020-05-31 20:40:49'); -- -------------------------------------------------------- -- -- Table structure for table `donors` -- CREATE TABLE `donors` ( `id` int(11) NOT NULL, `name` varchar(300) NOT NULL, `icNumber` varchar(12) NOT NULL, `gender` varchar(10) NOT NULL, `birthDate` date NOT NULL, `bloodType` varchar(5) NOT NULL, `phoneNumber` varchar(15) NOT NULL, `emailAddress` varchar(255) NOT NULL, `dateRegistered` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `lastUpdated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `donors` -- INSERT INTO `donors` (`id`, `name`, `icNumber`, `gender`, `birthDate`, `bloodType`, `phoneNumber`, `emailAddress`, `dateRegistered`, `lastUpdated`) VALUES (2, 'Kim Yoohyeon', '970107143245', 'Female', '1997-01-07', 'O', '0192049259', 'yoohyeon97@dreamcatchercompany.co.kr', '2019-10-17 07:47:12', '2019-10-24 06:30:20'), (3, 'Choi Yuna', '971004085202', 'Female', '1997-10-04', 'B', '0132904590', 'yuju@sourcemusic.co.kr', '2019-10-24 05:33:53', '2019-10-24 05:33:53'), (4, 'Intan Nora Syahira Binti Nazri', '951209092119', 'Female', '1995-08-02', 'B', '0172125507', 'intan.norasyahira@outlook.com', '2020-06-16 00:52:50', '2020-06-16 00:55:33'); -- -------------------------------------------------------- -- -- Table structure for table `hospitals` -- CREATE TABLE `hospitals` ( `id` int(11) NOT NULL, `hospitalName` varchar(255) NOT NULL, `address` varchar(255) NOT NULL, `town` varchar(30) NOT NULL, `state` varchar(30) NOT NULL, `postcode` varchar(5) NOT NULL, `phoneNumber` varchar(15) NOT NULL, `fax` varchar(15) NOT NULL, `emailAddress` varchar(50) NOT NULL, `dateRegistered` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `lastUpdated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `hospitals` -- INSERT INTO `hospitals` (`id`, `hospitalName`, `address`, `town`, `state`, `postcode`, `phoneNumber`, `fax`, `emailAddress`, `dateRegistered`, `lastUpdated`) VALUES (2, 'Hospital Ampang', 'Jalan Mewah Utara', 'Ampang Park', 'W.P Kuala Lumpur', '68400', '03-42896000', '03-42954666', 'admin@hampg.moh.gov.my', '2019-08-25 17:24:36', '2019-08-25 17:24:56'); -- -------------------------------------------------------- -- -- Table structure for table `notifications` -- CREATE TABLE `notifications` ( `id` int(11) NOT NULL, `productID` int(11) NOT NULL, `typeAcount` int(11) NOT NULL DEFAULT '0', `typeBcount` int(11) NOT NULL DEFAULT '0', `typeOcount` int(11) NOT NULL DEFAULT '0', `typeABcount` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `notifications` -- INSERT INTO `notifications` (`id`, `productID`, `typeAcount`, `typeBcount`, `typeOcount`, `typeABcount`) VALUES (2, 10, 5, 5, 5, 5), (3, 11, 10, 5, 10, 5), (5, 13, 5, 5, 15, 5), (6, 14, 5, 5, 15, 5), (7, 15, 5, 5, 15, 5), (8, 16, 5, 5, 10, 5), (9, 17, 0, 0, 20, 0), (10, 18, 0, 0, 0, 0), (11, 19, 0, 0, 0, 0); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(11) NOT NULL, `product` varchar(255) NOT NULL, `componentID` int(11) NOT NULL, `dateCreated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `lastEdited` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `product`, `componentID`, `dateCreated`, `lastEdited`) VALUES (10, 'Whole Blood', 4, '2020-05-31 20:54:57', '2020-05-31 20:58:26'), (11, 'Packed Red Cell', 4, '2020-05-31 20:56:04', '2020-05-31 21:01:15'), (13, 'Buffy-Coat Poor Red Cell', 4, '2020-05-31 21:00:38', '2020-05-31 21:04:02'), (14, 'Filtered Red Cell', 4, '2020-05-31 21:04:17', '2020-05-31 21:04:43'), (15, 'Fresh Frozen Plasma', 5, '2020-05-31 21:05:17', '2020-05-31 21:05:34'), (16, 'Cryosupernatant', 5, '2020-05-31 21:05:49', '2020-05-31 21:06:07'), (17, 'Cryoprecipitate', 5, '2020-05-31 21:06:20', '2020-05-31 21:06:40'), (18, 'Random Platelet Concentrate', 6, '2020-05-31 21:06:57', '2020-05-31 21:06:57'), (19, 'Apheresis Platelet', 6, '2020-05-31 21:07:09', '2020-05-31 21:07:09'); -- -------------------------------------------------------- -- -- Table structure for table `transactions` -- CREATE TABLE `transactions` ( `id` int(11) NOT NULL, `displayTransactionID` varchar(6) NOT NULL, `userID` int(11) NOT NULL, `hospitalID` int(11) DEFAULT NULL, `bloodBagID` text NOT NULL, `transaction` varchar(255) NOT NULL, `remarks` varchar(355) DEFAULT NULL, `dateCreated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `transactions` -- INSERT INTO `transactions` (`id`, `displayTransactionID`, `userID`, `hospitalID`, `bloodBagID`, `transaction`, `remarks`, `dateCreated`) VALUES (1, 'T00001', 3, NULL, '[\"CPA1100007\"]', 'Discard Bloodbag', 'Wrong donor', '2020-04-09 00:06:35'), (2, 'T00002', 3, NULL, '[\"RBC600001\"]', 'Discard Bloodbag', 'Wrong info', '2020-04-09 00:07:31'), (3, 'T00003', 3, 2, '[\"PLT500008\",\"PLT500009\"]', 'Transfer Bloodbag', '', '2020-04-14 01:11:58'), (4, 'T00004', 3, NULL, '[\"RBC1000001\"]', 'Discard Bloodbag', 'Wrong info', '2020-06-04 12:11:08'), (5, 'T00005', 3, NULL, '[\"RBC1000003\"]', 'Discard Bloodbag', 'Wrong info', '2020-06-07 19:04:44'), (6, 'T00006', 3, NULL, '[\"RBC1000002\"]', 'Discard Bloodbag', 'Discard expired bloodbag', '2020-06-07 19:07:10'), (7, 'T00007', 3, 2, '[\"RBC1100004\"]', 'Transfer Bloodbag', '', '2020-06-12 09:08:44'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `username` varchar(30) NOT NULL, `name` varchar(255) NOT NULL, `icNumber` varchar(12) NOT NULL, `gender` varchar(6) NOT NULL, `phoneNumber` varchar(15) NOT NULL, `emailAddress` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `role` varchar(20) NOT NULL, `dateRegistered` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `lastUpdated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `name`, `icNumber`, `gender`, `phoneNumber`, `emailAddress`, `password`, `role`, `dateRegistered`, `lastUpdated`) VALUES (1, 'intan', 'Intan', '950510081995', 'Female', '0172125507', 'intan.norasyahira@abobloodcentre.com.my', 'admin', 'admin', '2019-07-05 21:43:35', '2020-05-29 22:13:13'), (2, 'yuju', 'Choi Yuna', '971004187281', 'Female', '0123456789', 'yuna_choi@abobloodcentre.com.my', 'yuju123', 'user', '2019-07-05 21:45:19', '2019-08-12 18:17:05'), (3, 'yoohyeon', 'Kim Yoohyeon', '970107172007', 'Female', '0142125507', 'yoohyeon_kim@abobloodcentre.com.my', 'yuju123', 'user', '2019-07-05 21:47:56', '2019-10-28 22:53:09'); -- -- Indexes for dumped tables -- -- -- Indexes for table `bloodbag` -- ALTER TABLE `bloodbag` ADD PRIMARY KEY (`id`); -- -- Indexes for table `components` -- ALTER TABLE `components` ADD PRIMARY KEY (`id`); -- -- Indexes for table `donors` -- ALTER TABLE `donors` ADD PRIMARY KEY (`id`); -- -- Indexes for table `hospitals` -- ALTER TABLE `hospitals` ADD PRIMARY KEY (`id`); -- -- Indexes for table `notifications` -- ALTER TABLE `notifications` ADD PRIMARY KEY (`id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- Indexes for table `transactions` -- ALTER TABLE `transactions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `bloodbag` -- ALTER TABLE `bloodbag` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `components` -- ALTER TABLE `components` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `donors` -- ALTER TABLE `donors` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `hospitals` -- ALTER TABLE `hospitals` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `notifications` -- ALTER TABLE `notifications` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `transactions` -- ALTER TABLE `transactions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` 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
fb728c0307b2bacecf843192f1b9a1cc89d35611
SQL
Sparta5/yanzhifang
/BackEnd/server/yzf.sql
UTF-8
623
2.8125
3
[]
no_license
#设置客户端连接服务器的编码 SET NAMES UTF8; #丢弃数据库如果存在 DROP DATABASE IF EXISTS yzf; #创建数据库,设置储存的编码 CREATE DATABASE yzf CHARSET=UTF8; #进入创建的数据库 USE yzf; #创建用户表user CREATE TABLE `user` ( `uid`INT PRIMARY KEY AUTO_INCREMENT, `uname` VARCHAR(16), `email` VARCHAR(26), `phone` TINYINT(11), `upwd` VARCHAR(16) -- `avatar` VARCHAR(50) NOT NULL DEFAULT `unamed.jpg` COMMENT `用头像` ); #插入数据 INSERT INTO user VALUES(NULL,'binbin','123@qq.com','18728307801','123456'); INSERT INTO user VALUES(NULL,'','','18728307801','123456');
true
3a3dc021a5ba22645470616747c0a5139d14cc43
SQL
insidenothing/coronavirus
/sql/install/coronavirus_sms.sql
UTF-8
345
2.890625
3
[ "MIT" ]
permissive
CREATE TABLE `coronavirus_sms` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sms_number` varchar(50) NOT NULL, `sms_status` varchar(50) NOT NULL DEFAULT 'new', `date_validated` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `sms_number` (`sms_number`) ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8
true
3dde98b51e61fdac5f64ea95019449d6f6d8b0b9
SQL
rotama/parkir_on
/parkir_online.sql
UTF-8
16,764
2.703125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jul 16, 2017 at 07:04 PM -- Server version: 10.1.8-MariaDB -- PHP Version: 5.6.14 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: `parkir_online` -- -- -------------------------------------------------------- -- -- Table structure for table `banks` -- CREATE TABLE `banks` ( `id` int(10) UNSIGNED NOT NULL, `no_rek` varchar(25) COLLATE utf8_unicode_ci NOT NULL, `atas_nama` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `nm_bank` varchar(25) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `banks` -- INSERT INTO `banks` (`id`, `no_rek`, `atas_nama`, `nm_bank`, `created_at`, `updated_at`) VALUES (1, '3247094843', 'Parkir Online', 'BCA', '2017-07-16 09:46:43', '2017-07-16 09:46:43'), (2, '3857594937', 'Parkir Online', 'BRI', '2017-07-16 09:46:43', '2017-07-16 09:46:43'), (3, '9585749404', 'Parkir Online', 'Danamon', '2017-07-16 09:46:43', '2017-07-16 09:46:43'), (4, '9474834950', 'Parkir Online', 'Mandiri', '2017-07-16 09:46:43', '2017-07-16 09:46:43'), (5, '9048473948', 'Parkir Online', 'Bank BJB', '2017-07-16 09:46:43', '2017-07-16 09:46:43'); -- -------------------------------------------------------- -- -- Table structure for table `bookings` -- CREATE TABLE `bookings` ( `id` int(10) UNSIGNED NOT NULL, `kode_trans` varchar(25) COLLATE utf8_unicode_ci NOT NULL, `tgl_booking` datetime NOT NULL, `parkir_id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `perawatan` varchar(5) COLLATE utf8_unicode_ci NOT NULL, `tgl_keluar` datetime NOT NULL, `status` varchar(25) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `bookings` -- INSERT INTO `bookings` (`id`, `kode_trans`, `tgl_booking`, `parkir_id`, `user_id`, `perawatan`, `tgl_keluar`, `status`, `created_at`, `updated_at`) VALUES (1, 'Trans-000001', '2017-07-14 05:00:00', 1, 2, 'Ya', '2017-07-16 18:00:00', 'Sudah Transfer', NULL, NULL), (2, 'Trans-000002', '2017-07-17 23:00:00', 7, 2, 'Ya', '2017-07-21 05:00:00', 'Sudah Transfer', NULL, NULL), (3, 'Trans-000003', '2017-07-12 12:00:00', 8, 2, 'Tidak', '2017-07-20 08:00:00', 'Sudah Transfer', NULL, NULL), (4, 'Trans-000004', '2017-07-09 04:00:00', 1, 2, 'Tidak', '2017-07-14 14:00:00', 'Keluar', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `bukti_trans` -- CREATE TABLE `bukti_trans` ( `id` int(10) UNSIGNED NOT NULL, `tgl_upload` datetime NOT NULL, `booking_id` int(10) UNSIGNED NOT NULL, `gambar` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `bukti_trans` -- INSERT INTO `bukti_trans` (`id`, `tgl_upload`, `booking_id`, `gambar`, `created_at`, `updated_at`) VALUES (1, '2017-07-16 04:47:55', 1, 'efe98495fbfc72dc6dba0c1458c42b88.png', NULL, NULL), (2, '2017-07-16 04:55:56', 2, 'a55111a6ff9d2ee0eb681877a694e38e.jpg', NULL, NULL), (3, '2017-07-16 04:57:17', 3, 'f7c7c0c5c7f1e45a22bbdbd11188b91c.jpg', NULL, NULL), (4, '2017-07-16 04:58:43', 4, '25e867e119680ca2934d38a31f7c523b.jpg', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `dendas` -- CREATE TABLE `dendas` ( `id` int(10) UNSIGNED NOT NULL, `harga` double UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `dendas` -- INSERT INTO `dendas` (`id`, `harga`, `created_at`, `updated_at`) VALUES (1, 5000, '2017-07-16 09:46:43', '2017-07-16 09:46:43'); -- -------------------------------------------------------- -- -- Table structure for table `keluars` -- CREATE TABLE `keluars` ( `id` int(10) UNSIGNED NOT NULL, `tgl_kel` datetime NOT NULL, `booking_id` int(10) UNSIGNED NOT NULL, `keterlambatan` int(11) NOT NULL, `denda` double NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `keluars` -- INSERT INTO `keluars` (`id`, `tgl_kel`, `booking_id`, `keterlambatan`, `denda`) VALUES (1, '2017-07-16 23:48:50', 1, 0, 0), (2, '2017-07-16 23:56:23', 2, 0, 0), (3, '2017-07-16 23:57:43', 3, 0, 0), (4, '2017-07-16 23:59:18', 4, 2, 15000); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (191, '2014_10_12_000000_create_users_table', 1), (192, '2014_10_12_100000_create_password_resets_table', 1), (193, '2017_06_07_061339_laratrust_setup_tables', 1), (194, '2017_06_07_063556_create_parking_table', 1), (195, '2017_06_07_063713_create_dend_table', 1), (196, '2017_06_07_063834_create_rawat_table', 1), (197, '2017_06_07_063943_create_book_table', 1), (198, '2017_06_15_121023_create_bukti_trans_table', 1), (199, '2017_06_18_053312_create_keluar_table', 1), (200, '2017_07_14_012457_create_banks_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `parkirs` -- CREATE TABLE `parkirs` ( `id` int(10) UNSIGNED NOT NULL, `slot` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `harga` double UNSIGNED NOT NULL, `posisi` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `status` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `parkirs` -- INSERT INTO `parkirs` (`id`, `slot`, `harga`, `posisi`, `status`, `created_at`, `updated_at`) VALUES (1, 'R01', 10000, 'Lantai 1', 'Available', '2017-07-16 09:46:41', '2017-07-16 09:46:41'), (2, 'R02', 10000, 'Lantai 1', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'), (3, 'R03', 10000, 'Lantai 1', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'), (4, 'R04', 15000, 'Lantai 2', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'), (5, 'R05', 15000, 'Lantai 2', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'), (6, 'R06', 15000, 'Lantai 2', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'), (7, 'R07', 20000, 'Lantai 3', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'), (8, 'R08', 20000, 'Lantai 3', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'), (9, 'R09', 20000, 'Lantai 3', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'), (10, 'R10', 20000, 'Lantai 3', 'Available', '2017-07-16 09:46:42', '2017-07-16 09:46:42'); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `perawatans` -- CREATE TABLE `perawatans` ( `id` int(10) UNSIGNED NOT NULL, `harga` double NOT NULL, `servis` text COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `perawatans` -- INSERT INTO `perawatans` (`id`, `harga`, `servis`, `created_at`, `updated_at`) VALUES (1, 10000, 'Cuci 1X sehari, Tune Up 1x sehari', '2017-07-16 09:46:43', '2017-07-16 09:46:43'); -- -------------------------------------------------------- -- -- Table structure for table `permissions` -- CREATE TABLE `permissions` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `display_name` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `permission_role` -- CREATE TABLE `permission_role` ( `permission_id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `display_name` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`id`, `name`, `display_name`, `description`, `created_at`, `updated_at`) VALUES (1, 'admin', 'Admin', NULL, '2017-07-16 09:46:40', '2017-07-16 09:46:40'), (2, 'member', 'Member', NULL, '2017-07-16 09:46:40', '2017-07-16 09:46:40'); -- -------------------------------------------------------- -- -- Table structure for table `role_user` -- CREATE TABLE `role_user` ( `user_id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `role_user` -- INSERT INTO `role_user` (`user_id`, `role_id`) VALUES (1, 1), (2, 2), (3, 2), (4, 2); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Admin', 'admin@gmail.com', '$2y$10$8u4MYgPNvJ04qVYYkErYN.gOVMcsv3VZNtZwfUzCbzy/AiMiEUbPe', NULL, '2017-07-16 09:46:40', '2017-07-16 09:46:40'), (2, 'Sample Member', 'member@gmail.com', '$2y$10$ZO94CzTxRHQ3XV2U2YTKOOTVy8Km/DaPGUnkF0U1VGQnYUkZndTMe', NULL, '2017-07-16 09:46:40', '2017-07-16 09:46:40'), (3, 'Saha', 'saha@gmail.com', '$2y$10$cCa2KCpgtmWLg.cct3xDMegnLe9Iqj19Em7AEpupSVrc4tsOcUVd6', NULL, '2017-07-16 09:46:41', '2017-07-16 09:46:41'), (4, 'Ronaldo', 'ronaldo@gmail.com', '$2y$10$1lcNfExYuvPVbikgL8ZulOdx6kRsUp5rMJI8Cnm4bhsr7ZsIxzcvq', NULL, '2017-07-16 09:46:41', '2017-07-16 09:46:41'); -- -- Indexes for dumped tables -- -- -- Indexes for table `banks` -- ALTER TABLE `banks` ADD PRIMARY KEY (`id`); -- -- Indexes for table `bookings` -- ALTER TABLE `bookings` ADD PRIMARY KEY (`id`), ADD KEY `bookings_parkir_id_index` (`parkir_id`), ADD KEY `bookings_user_id_index` (`user_id`); -- -- Indexes for table `bukti_trans` -- ALTER TABLE `bukti_trans` ADD PRIMARY KEY (`id`), ADD KEY `bukti_trans_booking_id_index` (`booking_id`); -- -- Indexes for table `dendas` -- ALTER TABLE `dendas` ADD PRIMARY KEY (`id`); -- -- Indexes for table `keluars` -- ALTER TABLE `keluars` ADD PRIMARY KEY (`id`), ADD KEY `keluars_booking_id_index` (`booking_id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `parkirs` -- ALTER TABLE `parkirs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `perawatans` -- ALTER TABLE `perawatans` ADD PRIMARY KEY (`id`); -- -- Indexes for table `permissions` -- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `permissions_name_unique` (`name`); -- -- Indexes for table `permission_role` -- ALTER TABLE `permission_role` ADD PRIMARY KEY (`permission_id`,`role_id`), ADD KEY `permission_role_role_id_foreign` (`role_id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `roles_name_unique` (`name`); -- -- Indexes for table `role_user` -- ALTER TABLE `role_user` ADD PRIMARY KEY (`user_id`,`role_id`), ADD KEY `role_user_role_id_foreign` (`role_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `banks` -- ALTER TABLE `banks` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `bookings` -- ALTER TABLE `bookings` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `bukti_trans` -- ALTER TABLE `bukti_trans` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `dendas` -- ALTER TABLE `dendas` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `keluars` -- ALTER TABLE `keluars` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=201; -- -- AUTO_INCREMENT for table `parkirs` -- ALTER TABLE `parkirs` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `perawatans` -- ALTER TABLE `perawatans` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `permissions` -- ALTER TABLE `permissions` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Constraints for dumped tables -- -- -- Constraints for table `bookings` -- ALTER TABLE `bookings` ADD CONSTRAINT `bookings_parkir_id_foreign` FOREIGN KEY (`parkir_id`) REFERENCES `parkirs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `bookings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `bukti_trans` -- ALTER TABLE `bukti_trans` ADD CONSTRAINT `bukti_trans_booking_id_foreign` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `keluars` -- ALTER TABLE `keluars` ADD CONSTRAINT `keluars_booking_id_foreign` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `permission_role` -- ALTER TABLE `permission_role` ADD CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `role_user` -- ALTER TABLE `role_user` ADD CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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
e4bdddff8c2b4c04c441d269b9e5e591c31afedd
SQL
hydego17/padi-back-go
/files/db.sql
UTF-8
618
3.296875
3
[]
no_license
CREATE TABLE public.users ( id serial NOT NULL, created_at timestamptz NOT NULL DEFAULT NOW(), updated_at timestamptz NOT NULL DEFAULT NOW(), deleted_at timestamptz NULL, username varchar(255) NOT NULL UNIQUE, password varchar(255) NOT NULL, CONSTRAINT predictions_pk PRIMARY KEY (id) ); CREATE TABLE public.predictions ( id serial NOT NULL, created_at timestamptz NOT NULL DEFAULT NOW(), updated_at timestamptz NOT NULL DEFAULT NOW(), deleted_at timestamptz NULL, user_id int NOT NULL, image_path varchar(255) NULL, prediction int NOT NULL, CONSTRAINT predictions_pk PRIMARY KEY (id) );
true
97a9d7a7bc4d3c34e0e4a2bb3376aeb04701de91
SQL
mdfazal/UdacityAzureDeveloper-Migrate-Tech-Conference-App-to-Azure
/data/modify_id_datatype.sql
UTF-8
318
3.046875
3
[]
no_license
CREATE SEQUENCE new_serial START 6 OWNED BY attendee.id; ALTER TABLE attendee ALTER COLUMN id SET DEFAULT nextval('new_serial'); select * from attendee CREATE SEQUENCE id_serial START 6 OWNED BY notification.id; ALTER TABLE notification ALTER COLUMN id SET DEFAULT nextval('id_serial'); select * from notification
true
8965ffa8378e55d402b6b262cc689beff47736c6
SQL
su222/hanaapp
/SQL_Script/운영데이터이관/사건마스타_사건디테일_사건특이사항.sql
UHC
6,085
3.59375
4
[]
no_license
-- -- Ǹ DROP TABLE TB_AC_AFFAIR_MST_TMP; CREATE TABLE TB_AC_AFFAIR_MST_TMP AS SELECT * FROM TB_AC_AFFAIR_MST; -- ǵ DROP TABLE TB_AC_AFFAIR_DTL_TMP; CREATE TABLE TB_AC_AFFAIR_DTL_TMP AS SELECT * FROM TB_AC_AFFAIR_DTL; -- Ư̻ DROP TABLE TB_AC_AFFNOTE_LST_TMP; CREATE TABLE TB_AC_AFFNOTE_LST_TMP AS SELECT * FROM TB_AC_AFFNOTE_LST; -- -- FK Ѵ. -- : FK_ DELETE FROM TB_AC_AFFNOTE_LST; DELETE FROM TB_AC_AFFAIR_DTL; DELETE FROM TB_AC_AFFAIR_MST; INSERT INTO TB_AC_AFFAIR_MST ( BRCH_ID, AFF_SEQ, TUB_SEQ, CHG_SEQ, TUB_NM, CHG_NM, TUB_TEL, TUB_FAX, HNA_CHG_USR, HNA_CHG_USR_NM, PRS_CHG_USR, DOC_CRT_USR, AFF_ST_DT, AFF_ED_DT, AFF_NO, AFF_GBN, CLT_NM, CLT_TEL, CLT_JMN, CLT_ADDR, CLT_ZIP, DOC_CARY, AFF_PRS_STS, CRT_USR, CRT_DT, EDT_USR, EDT_DT, CHG_PRS_NOTE, AFF_ETC_ED_DT, SMT_PLC, ADD_INF_GBN, BEF_CLT_NM, BEF_CLT_JMN, SIN_NM ) SELECT 'H10' AS BRCH_ID, "ڵ" AS AFF_SEQ, "޻ڵ" TUB_SEQ, (SELECT CHG_SEQ FROM TB_CC_TIEUPCHG_LST WHERE TUB_SEQ = "޻ڵ" AND CHG_NM = "޻Ǵ" ) CHG_SEQ, B.TUB_NM, "޻Ǵ" CHG_NM, TUB_TEL, TUB_FAX, HNA_CHG_USR, FC_CC_GET_USRNAME('H10', HNA_CHG_USR) AS HNA_CHG_USR_NM, "" PRS_CHG_USR, "" DOC_CRT_USR, SUBSTR("", 1,10) AFF_ST_DT, SUBSTR("", 1,10) AFF_ED_DT, NULL AFF_NO, -- ǹȣ DZ AFF_GBN, "̸" CLT_NM, "ȭȣ" CLT_TEL, "ֹεϹȣ" CLT_JMN, "ּ" CLT_ADDR, NULL CLT_ZIP, -- ȣ B.DOC_CARY, CASE WHEN û = '1' THEN '30' -- û WHEN "" IS NOT NULL THEN '30' -- û (Ȯ ʿ) WHEN "" IS NULL THEN '10' END AFF_PRS_STS , 'SYSTEM' CRT_USR, SYSDATE CRT_DT, 'SYSTEM' EDT_USR, SYSDATE EDT_DT, "೻" CHG_PRS_NOTE, NULL AFF_ETC_ED_DT, NULL SMT_PLC, -- ó NULL ADD_INF_GBN, NULL BEF_CLT_NM, NULL BEF_CLT_JMN, B.SIN_NM FROM Ƿڻ A, TB_CC_TIEUP_LST B WHERE "޻ڵ" = B.TUB_SEQ -- ǵ INSERT INTO TB_AC_AFFAIR_DTL ( BRCH_ID, AFF_SEQ, DTL_SEQ, GRP_CD, GRP_SEQ, REQ_SEQ, SORT_NO, REQ_BND_SEQ, REQ_BND_NM, REQ_BND_STS, REQ_DEB, REQ_BNK, REQ_CARD, BNK_NOTE, CARD_NOTE, BIZ_REQ_YN, REQ_PRT_YN, BND_SEQ_1, BND_NM_1, PRS_STS_1, BND_SEQ_2, BND_NM_2, PRS_STS_2, ISU_DEB, ISU_COC, ISU_BNK, ISU_CARD, ISU_CRDT, BNK_CHRG, AGC_CHRG, PRT_YN, CLOSE_YN, CRT_USR, CRT_DT, EDT_USR, EDT_DT, NOTE, PRS_NOTE_1, PRS_NOTE_2, ACP_MTD_1, ACP_MTD_2, NOTE2, REQ_PRS_NOTE, BNK_NOTE_TRM, BNK_NOTE_ETC, CARD_NOTE_TRM, CARD_NOTE_ETC ) SELECT 'H10' AS BRCH_ID, "ڵ" AS AFF_SEQ, "ڵ" DTL_SEQ, "ڵ" GRP_CD, RANK() OVER (PARTITION BY "ڵ" ORDER BY "ڵ" ) GRP_SEQ, "ڵ" REQ_SEQ, RANK() OVER (PARTITION BY "ڵ" ORDER BY "" ) SORT_NO, (SELECT MAX(BND_SEQ) FROM TB_CC_BOND_LST WHERE BND_NM = "Ƿäǻ" ) REQ_BND_SEQ, "Ƿäǻ" REQ_BND_NM, NVL( (SELECT DTL_CD FROM TB_CC_CODE_DTL WHERE MST_CD = 'AD03' AND DTL_NM = "" AND ROWNUM = 1 ), (SELECT DTL_CD FROM TB_CC_CODE_DTL WHERE MST_CD = 'AD03' AND DTL_NM = "" AND ROWNUM = 1 ) ) REQ_BND_STS, -- Ƿڻ° 1 NULL REQ_DEB, NULL REQ_BNK, NULL REQ_CARD, "ŷ" BNK_NOTE, "īŷ" CARD_NOTE, NULL BIZ_REQ_YN, NULL REQ_PRT_YN, (SELECT MAX(BND_SEQ) FROM TB_CC_BOND_LST WHERE BND_NM = "" ) BND_SEQ_1, "" BND_NM_1, (SELECT DTL_CD FROM TB_CC_CODE_DTL WHERE MST_CD = 'AD03' AND DTL_NM = "" AND ROWNUM = 1 ) PRS_STS_1, (SELECT MAX(BND_SEQ) FROM TB_CC_BOND_LST WHERE BND_NM = "" ) BND_SEQ_2, "" BND_NM_2, (SELECT DTL_CD FROM TB_CC_CODE_DTL WHERE MST_CD = 'AD03' AND DTL_NM = "" AND ROWNUM = 1 ) PRS_STS_2, DECODE("ä", '-1', 'Y', 'N') ISU_DEB, DECODE("", '-1', 'Y', 'N') ISU_COC, DECODE("ŷ", '-1', 'Y', 'N') ISU_BNK, DECODE("īŷ", '-1', 'Y', 'N') ISU_CARD, DECODE("ſȸ", '-1', 'Y', 'N') ISU_CRDT, TRUNC("") BNK_CHRG, TRUNC("") AGC_CHRG, DECODE("", '-1', 'Y', 'N') PRT_YN, 'Y' CLOSE_YN, 'SYSTEM' CRT_USR, SYSDATE CRT_DT, 'SYSTEM' EDT_USR, SYSDATE EDT_DT, "Ư̻" NOTE, "̹" PRS_NOTE_1, "" PRS_NOTE_2, NULL ACP_MTD_1, NULL ACP_MTD_2, NULL NOTE2, NULL REQ_PRS_NOTE, NULL BNK_NOTE_TRM, NULL BNK_NOTE_ETC, NULL CARD_NOTE_TRM, NULL CARD_NOTE_ETC FROM äǻ೻ WHERE "ڵ" IN (SELECT "ڵ" FROM Ƿڻ) --ORDER BY "ڵ" , "ڵ" -- Ư̻ INSERT INTO TB_AC_AFFNOTE_LST ( BRCH_ID, AFF_SEQ, PRS_DT, NOTE, CRT_USR, CRT_DT, EDT_USR, EDT_DT ) SELECT 'H10' AS BRCH_ID, "ڵ" AS AFF_SEQ, NVL(TO_DATE(SUBSTR(,1,9)), TRUNC(SYSDATE)) + 0.0001 * ROWNUM PRS_DT, ϳ NOTE, 'SYSTEM' CRT_USR, SYSDATE CRT_DT, 'SYSTEM' EDT_USR, SYSDATE EDT_DT FROM ǷڳƯ̻ WHERE ڵ IS NOT NULL -- û UPDATE TB_AC_AFFAIR_MST SET AFF_PRS_STS = '30' WHERE (AFF_SEQ) IN (SELECT ڵ FROM Ƿڻ WHERE IS NOT NULL AND NVL(û,0) = 0) S
true
05b59c890ce16dd7db6109f163190bc506eec0c8
SQL
taufik-kurahman/e-catalogue
/SQL/e_catalogue.sql
UTF-8
22,180
3.15625
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.7.7 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Sep 13, 2019 at 04:21 PM -- Server version: 10.1.30-MariaDB -- PHP Version: 7.2.2 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: `e_catalogue` -- -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id_category` int(11) NOT NULL, `category_name` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id_category`, `category_name`) VALUES (1, 'Menswear'), (2, 'Women\'s Clothing'), (3, 'Men\'s Accessories'), (4, 'Women\'s Accessories'); -- -------------------------------------------------------- -- -- Table structure for table `landing` -- CREATE TABLE `landing` ( `id` int(11) NOT NULL, `caption` varchar(15) NOT NULL, `slide_pict` varchar(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `landing` -- INSERT INTO `landing` (`id`, `caption`, `slide_pict`) VALUES (1, 'lorem ipsum', '1.jpg'), (2, 'dolor', '2.jpg'), (3, 'sit amet', '3.jpg'), (4, 'consectetur', '4.jpg'), (5, 'adipisicing', '5.jpg'), (6, 'elit', '6.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id_product` int(11) NOT NULL, `id_category` int(11) NOT NULL, `product_name` varchar(255) NOT NULL, `product_desc` text NOT NULL, `product_price` double NOT NULL, `product_pict` varchar(15) NOT NULL, `product_discount` float NOT NULL, `available` int(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id_product`, `id_category`, `product_name`, `product_desc`, `product_price`, `product_pict`, `product_discount`, `available`) VALUES (1, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '1.png', 20, 1), (2, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '2.png', 0, 0), (3, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '3.png', 0, 1), (4, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '4.png', 0, 1), (5, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '5.png', 15, 0), (6, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '6.png', 15, 1), (7, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '7.png', 15, 1), (8, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '8.png', 0, 1), (9, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '9.png', 0, 1), (10, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '10.png', 0, 1), (11, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '11.png', 0, 1), (12, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '12.png', 0, 1), (13, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '13.png', 0, 1), (14, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '14.png', 0, 1), (15, 1, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '15.png', 0, 1), (16, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '16.png', 0, 1), (17, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '17.png', 0, 1), (18, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '18.png', 0, 1), (19, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '19.png', 21, 1), (20, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '20.png', 0, 1), (21, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '21.png', 0, 0), (22, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '22.png', 0, 0), (23, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '23.png', 0, 1), (24, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '24.png', 0, 1), (25, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '25.png', 0, 1), (26, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '26.png', 12, 1), (27, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '27.png', 0, 1), (28, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '28.png', 0, 1), (29, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '29.png', 0, 1), (30, 2, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '30.png', 2.5, 1), (31, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '31.png', 2.5, 1), (32, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '32.png', 2.5, 1), (33, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '33.png', 0, 1), (34, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '34.png', 0, 1), (35, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '35.png', 0, 1), (36, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '36.png', 0, 1), (37, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '37.png', 0, 0), (38, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '38.png', 0, 0), (39, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '39.png', 0, 1), (40, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '40.png', 0, 1), (41, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '41.png', 0, 1), (42, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '42.png', 0, 1), (43, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '43.png', 0, 1), (44, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '44.png', 0, 1), (45, 3, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '45.png', 0, 1), (46, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '46.png', 5, 1), (47, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '47.png', 0, 1), (48, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '48.png', 0, 1), (49, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '49.png', 0, 1), (50, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '50.png', 11, 1), (51, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '51.png', 7.2, 1), (52, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '52.png', 0, 1), (53, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '53.png', 0, 1), (54, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '54.png', 2.5, 1), (55, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '55.png', 0, 1), (56, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'qwerty', 1000000, '56.jpg', 4.5, 1), (57, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '57.png', 4.5, 1), (58, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '58.png', 0, 0), (59, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis non magni, maxime doloribus quo, aliquam animi natus nemo, vitae voluptatem blanditiis voluptate saepe architecto quasi velit! Eius laboriosam impedit alias.', 1000000, '59.png', 0, 1), (60, 4, 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 'qwerty', 1000000, '60.png', 40, 1); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `email` varchar(128) NOT NULL, `password` varchar(256) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`email`, `password`) VALUES ('dev.sys.email@gmail.com', '$2y$10$ijSr.PFe6seR4glwymBfAeOMwp2LoDAp71I4JMmSPw8KByWKi7due'); -- -- Indexes for dumped tables -- -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id_category`); -- -- Indexes for table `landing` -- ALTER TABLE `landing` ADD PRIMARY KEY (`id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id_product`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id_category` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `landing` -- ALTER TABLE `landing` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id_product` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=69; 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
d3e19c1da6113a56c7c7a478ee35ed2ffd13bf2f
SQL
CSCfi/antero
/db_archive/sql_archive/92__dw_create_table_f_amk_talous_2_tase.sql
UTF-8
2,939
2.78125
3
[ "MIT" ]
permissive
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dw.f_amk_talous_2_tase') AND type in (N'U')) BEGIN CREATE TABLE dw.f_amk_talous_2_tase( id int IDENTITY(1,1) NOT NULL, d_amk_id int NOT NULL, tilikausi int NOT NULL, aineistotyyppi varchar(20) NULL, kehmenot bigint NULL, aineetoi bigint NULL, liikear bigint NULL, muupmeno bigint NULL, ahennakk bigint NULL, maavesi bigint NULL, rakennus bigint NULL, koneet bigint NULL, muuainh bigint NULL, ennakesk bigint NULL, osuuskon bigint NULL, saamikon bigint NULL, osuusoyy bigint NULL, saamioyy bigint NULL, muutosak bigint NULL, muutsaam bigint NULL, okrvarat bigint NULL, aineet bigint NULL, keskener bigint NULL, valmiit bigint NULL, muuvom bigint NULL, voennakk bigint NULL, pmyyntis bigint NULL, pskonser bigint NULL, psoyyrit bigint NULL, plainas bigint NULL, plveros bigint NULL, pmuuts bigint NULL, psiirtos bigint NULL, lmyyntis bigint NULL, lskonser bigint NULL, lsoyyrit bigint NULL, llainas bigint NULL, llveros bigint NULL, lmuuts bigint NULL, lsiirtos bigint NULL, raposuus bigint NULL, raposakk bigint NULL, muuarvop bigint NULL, rahatps bigint NULL, vastaava bigint NULL, osakepaa bigint NULL, arvonkr bigint NULL, kayvanar bigint NULL, okarahas bigint NULL, msirahas bigint NULL, vaprahas bigint NULL, edtilvo bigint NULL, tkvoitto bigint NULL, opoyht bigint NULL, tpskerty bigint NULL, elakvara bigint NULL, verovara bigint NULL, mpakvara bigint NULL, ppaaomal bigint NULL, pjvelkal bigint NULL, pvvelkal bigint NULL, plrahala bigint NULL, pelakel bigint NULL, psaadute bigint NULL, postovel bigint NULL, prveksel bigint NULL, pvkonser bigint NULL, pvoyyrit bigint NULL, plverove bigint NULL, pmuutvel bigint NULL, psiirtov bigint NULL, lpaaomal bigint NULL, ljvelkal bigint NULL, lvvelkal bigint NULL, llrahala bigint NULL, lelakel bigint NULL, lsaadute bigint NULL, lostovel bigint NULL, lrveksel bigint NULL, lvkonser bigint NULL, lvoyyrit bigint NULL, llverove bigint NULL, lmuutvel bigint NULL, lsiirtov bigint NULL, vastatta bigint NULL, okrsijyh bigint NULL, okrrahas bigint NULL, okrosakk bigint NULL, okrmuuap bigint NULL, okrrjaps bigint NULL, okrmuutv bigint NULL, kompperusalvm bigint NULL, saadalvkomp bigint NULL, alvsaavel bigint NULL, loadtime datetime NOT NULL, source varchar(100) NOT NULL, username varchar(30) NOT NULL ) END IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dw.DF__f_amk_tal__loadt__2645B050') AND type = 'D') BEGIN ALTER TABLE dw.f_amk_talous_2_tase ADD DEFAULT (getdate()) FOR loadtime END IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dw.DF__f_amk_tal__usern__2739D489') AND type = 'D') BEGIN ALTER TABLE dw.f_amk_talous_2_tase ADD DEFAULT (suser_sname()) FOR username END
true
39c93834b0520a424498e4ee165ac2e718b7b736
SQL
vinisdp/Banco-de-Dados
/povoamento.sql
UTF-8
52,671
2.796875
3
[]
no_license
SET SCHEMA 'cursos_ead'; --Inserção dos alunos no banco. INSERT INTO usuario VALUES ('caio.silva','caio1927','145.253.452-5','Caio Silva de Oliveira','22/07/1999','Aluno'); INSERT INTO usuario VALUES ('rodrigo.navarro','rn225521','275.256.896-5','Rodrigo Navarro da Silva','19/01/2000','Aluno'); INSERT INTO usuario VALUES ('amanda.morais','amp1927','345.521.759-6','Amanda Morais de Pedrozo','15/10/2002','Aluno'); --Inserção dos criadores no banco INSERT INTO usuario VALUES ('roger.melo','142562rml','723.852.451-9','Roger Melo de Lima','07/06/1990','Criador'); INSERT INTO usuario VALUES ('carlos.moreira','carlosneto1524','231.452.752-2','Carlos Moreira Neto','25/12/1995','Criador'); INSERT INTO usuario VALUES ('thiago.almeida','thx2231','755.382.411-9','Thiago de Almeida Prado','12/08/1994','Criador'); --Iserção dos telefones para os usuarios. INSERT INTO telefone VALUES ('caio.silva', '(14)99652-2125'); INSERT INTO telefone VALUES ('caio.silva', '(14)99862-5521'); INSERT INTO telefone VALUES ('rodrigo.navarro', '(22)98153-6260'); INSERT INTO telefone VALUES ('amanda.morais', '(67)98125-5561'); INSERT INTO telefone VALUES ('amanda.morais', '(67)99631-0555'); INSERT INTO telefone VALUES ('carlos.moreira', '(17)99535-3125'); INSERT INTO telefone VALUES ('thiago.almeida', '(11)99651-3098'); INSERT INTO telefone VALUES ('thiago.almeida', '(11)98131-3521'); INSERT INTO telefone VALUES ('thiago.almeida', '(11)3239-2270'); --Inserção dos certificados dos criadores INSERT INTO certificado VALUES ('thiago.almeida', 1, 'C:\Users\CursoEAD\Certificados\Certificado Programação Orientada a Objetos.pdf','Programação'); INSERT INTO certificado VALUES ('thiago.almeida', 2, 'C:\Users\CursoEAD\Certificados\Certificado Redes de Computadores.pdf', 'Tecnologia da Informação'); INSERT INTO certificado VALUES ('thiago.almeida', 3, 'C:\Users\CursoEAD\Certificados\Certificado Gestão de Projetos.pdf', 'Administração'); INSERT INTO certificado VALUES ('roger.melo', 1, 'C:\Users\CursoEAD\Certificados\Certificado Libras.pdf', 'Comunicação'); INSERT INTO certificado VALUES ('roger.melo', 2, 'C:\Users\CursoEAD\Certificados\Certificado Design Instrucional.pdf', 'Design'); INSERT INTO certificado VALUES ('carlos.moreira', 1, 'C:\Users\CursoEAD\Certificados\Certificado Gestão Escolar.pdf', 'Administração'); INSERT INTO certificado VALUES ('carlos.moreira', 2, 'C:\Users\CursoEAD\Certificados\Certificado Assistente Administrativo.pdf', 'Administração'); INSERT INTO certificado VALUES ('carlos.moreira', 3, 'C:\Users\CursoEAD\Certificados\Certificado Nova Legislação Trabalhista e Previdenciária.pdf', 'Direito'); --Iserção dos cursos INSERT INTO curso VALUES (1,'Redes de Computadores',75.90,'Pago','thiago.almeida', 'Ativo'); INSERT INTO curso VALUES (2,'Programação em Java',90.00,'Pago','thiago.almeida', 'Ativo'); INSERT INTO curso VALUES (3,'Programação em Python',89.99,'Pago','thiago.almeida','Ativo'); INSERT INTO curso VALUES (4,'Gestão de Projetos',120.60,'Pago','thiago.almeida', 'Inativo'); INSERT INTO curso VALUES (5,'Design de Produtos',130.20,'Pago','roger.melo', 'Inativo'); INSERT INTO curso VALUES (6,'Libra',0.00,'Gratuito','roger.melo','Inativo'); INSERT INTO curso VALUES (7,'Design Industrial',150.00,'Pago','roger.melo','Inativo'); INSERT INTO curso VALUES (8,'Artes para Website',120.90,'Pago','roger.melo','Inativo'); INSERT INTO curso VALUES (9,'Gestão Escolar',90.00,'Pago','carlos.moreira','Inativo'); INSERT INTO curso VALUES (10,'Gestão de Tempo',0.00,'Gratuito','carlos.moreira','Ativo'); INSERT INTO curso VALUES (11,'Legislação Trabalhista',190.00,'Pago','carlos.moreira','Inativo'); INSERT INTO curso VALUES (12,'Assistente Administrativo',50.00,'Pago','carlos.moreira','Inativo'); --Iserção da Area que o curso se enquadra. INSERT INTO area_atuante VALUES (1,1,'Tecnologia da Informação'); INSERT INTO area_atuante VALUES (2,1,'Tecnologia da Informação'); INSERT INTO area_atuante VALUES (2,2,'Programação'); INSERT INTO area_atuante VALUES (3,1,'Programação'); INSERT INTO area_atuante VALUES (3,2,'Tecnologia da Informação'); INSERT INTO area_atuante VALUES (4,1,'Administração'); INSERT INTO area_atuante VALUES (5,1,'Design'); INSERT INTO area_atuante VALUES (6,1,'Comunicação'); INSERT INTO area_atuante VALUES (7,1,'Design'); INSERT INTO area_atuante VALUES (8,1,'Design'); INSERT INTO area_atuante VALUES (9,1,'Administração'); INSERT INTO area_atuante VALUES (10,1,'Administração'); INSERT INTO area_atuante VALUES (11,1,'Direito'); INSERT INTO area_atuante VALUES (12,1,'Administração'); --Inserção modulo INSERT INTO modulo VALUES (1,'Iniciante','Modulo 1 de Redes de Computadores',6.0,1); INSERT INTO modulo VALUES (2,'Medio','Modulo 2 de Redes de Computadores',6.0,1,1); INSERT INTO modulo VALUES (3,'Avançado','Modulo 3 de Redes de Computadores',6.0,1,2); INSERT INTO modulo VALUES (4,'Iniciante','Modulo 1 Java',7.0,2); INSERT INTO modulo VALUES (5,'Medio','Modulo 2 Java',7.0,2,4); INSERT INTO modulo VALUES (6,'Avançado','Modulo 3 Java',7.0,2,5); INSERT INTO modulo VALUES (7,'Iniciante','Modulo 1 Python',8.0,3); INSERT INTO modulo VALUES (8,'Medio','Modulo 2 Python',7.0,3,7); INSERT INTO modulo VALUES (9,'Avançado','Modulo 3 Python',6.0,3,8); INSERT INTO modulo VALUES (10,'Iniciante','Modulo 1 Gestão de Projetos',8.0,4); INSERT INTO modulo VALUES (11,'Medio','Modulo 2 Gestão de Projetos',7.0,4,10); INSERT INTO modulo VALUES (12,'Iniciante','Modulo 1 Design de Produtos',8.0,5); INSERT INTO modulo VALUES (13,'Iniciante','Modulo 1 Libras',8.0,6); INSERT INTO modulo VALUES (14,'Medio','Modulo 2 Libras',7.0,6,13); INSERT INTO modulo VALUES (15,'Iniciante','Modulo 1 Design Industrial',7.0,7); INSERT INTO modulo VALUES (16,'Medio','Modulo 2 Design Industrial',7.0,7,15); INSERT INTO modulo VALUES (17,'Avançado','Modulo 3 Design Industrial',7.0,7,16); INSERT INTO modulo VALUES (18,'Iniciante','Modulo 1 Artes para Website',7.0,8); INSERT INTO modulo VALUES (19,'Medio','Modulo 2 Artes para Website',7.0,8,18); INSERT INTO modulo VALUES (20,'Avançado','Modulo 3 Artes para Website',7.0,8,19); INSERT INTO modulo VALUES (21,'Iniciante','Modulo 1 Gestão Escolar',7.0,9); INSERT INTO modulo VALUES (22,'Medio','Modulo 2 Gestão Escolar',7.0,9,20); INSERT INTO modulo VALUES (23,'Avançado','Modulo 3 Gestão Escolar',7.0,9,21); INSERT INTO modulo VALUES (24,'Iniciante','Modulo 1 Gestão de Tempo',7.0,10); INSERT INTO modulo VALUES (25,'Medio','Modulo 2 Gestão de Tempo',7.0,10,24); INSERT INTO modulo VALUES (26,'Avançado','Modulo 3 Gestão de Tempo',7.0,10,25); INSERT INTO modulo VALUES (27,'Iniciante','Modulo 1 Legislação Trabalhista',7.0,11); INSERT INTO modulo VALUES (28,'Medio','Modulo 2 Legislação Trabalhista',7.0,11,27); INSERT INTO modulo VALUES (29,'Avançado','Modulo 3 Legislação Trabalhista',7.0,11,28); INSERT INTO modulo VALUES (30,'Iniciante','Modulo 1 Assistente Administrativo',8.0,12); INSERT INTO modulo VALUES (31,'Medio','Modulo 2 Assistente Administrativo',7.0,12,30); INSERT INTO modulo VALUES (32,'Avançado','Modulo 3 Assistente Administrativo',7.0,12,31); --Inserção das Aulas INSERT INTO aula VALUES (1,'Aula 1 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (2,'Aula 2 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (3,'Aula 3 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (4,'Aula 4 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (5,'Aula 5 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (6,'Aula 6 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (7,'Aula 7 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (8,'Aula 8 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (9,'Aula 9 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (10,'Aula 10 - Modulo 1 Redes de Computadores',1); INSERT INTO aula VALUES (11,'Aula 1 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (12,'Aula 2 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (13,'Aula 3 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (14,'Aula 4 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (15,'Aula 5 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (16,'Aula 6 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (17,'Aula 7 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (18,'Aula 8 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (19,'Aula 9 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (20,'Aula 10 - Modulo 2 Redes de Computadores',2); INSERT INTO aula VALUES (21,'Aula 1 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (22,'Aula 2 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (23,'Aula 3 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (24,'Aula 4 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (25,'Aula 5 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (26,'Aula 6 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (27,'Aula 7 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (28,'Aula 8 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (29,'Aula 9 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (30,'Aula 10 - Modulo 3 Redes de Computadores',3); INSERT INTO aula VALUES (31,'Aula 1 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (32,'Aula 2 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (33,'Aula 3 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (34,'Aula 4 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (35,'Aula 5 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (36,'Aula 6 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (37,'Aula 7 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (38,'Aula 8 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (39,'Aula 9 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (40,'Aula 10 - Modulo 1 Programação JAVA',4); INSERT INTO aula VALUES (41,'Aula 1 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (42,'Aula 2 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (43,'Aula 3 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (44,'Aula 4 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (45,'Aula 5 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (46,'Aula 6 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (47,'Aula 7 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (48,'Aula 8 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (49,'Aula 9 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (50,'Aula 10 - Modulo 2 Programação JAVA',5); INSERT INTO aula VALUES (51,'Aula 1 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (52,'Aula 2 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (53,'Aula 3 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (54,'Aula 4 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (55,'Aula 5 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (56,'Aula 6 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (57,'Aula 7 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (58,'Aula 8 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (59,'Aula 9 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (60,'Aula 10 - Modulo 3 Programação JAVA',6); INSERT INTO aula VALUES (61,'Aula 1 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (62,'Aula 2 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (63,'Aula 3 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (64,'Aula 4 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (65,'Aula 5 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (66,'Aula 6 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (67,'Aula 7 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (68,'Aula 8 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (69,'Aula 9 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (70,'Aula 10 - Modulo 1 Programação Python',7); INSERT INTO aula VALUES (71,'Aula 1 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (72,'Aula 2 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (73,'Aula 3 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (74,'Aula 4 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (75,'Aula 5 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (76,'Aula 6 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (77,'Aula 7 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (78,'Aula 8 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (79,'Aula 9 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (80,'Aula 10 - Modulo 2 Programação Python',8); INSERT INTO aula VALUES (81,'Aula 1 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (82,'Aula 2 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (83,'Aula 3 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (84,'Aula 4 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (85,'Aula 5 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (86,'Aula 6 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (87,'Aula 7 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (88,'Aula 8 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (89,'Aula 9 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (90,'Aula 10 - Modulo 3 Programação Python',9); INSERT INTO aula VALUES (91,'Aula 1 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (92,'Aula 2 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (93,'Aula 3 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (94,'Aula 4 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (95,'Aula 5 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (96,'Aula 6 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (97,'Aula 7 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (98,'Aula 8 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (99,'Aula 9 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (100,'Aula 10 - Modulo 1 Gestão de Projetos',10); INSERT INTO aula VALUES (101,'Aula 1 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (102,'Aula 2 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (103,'Aula 3 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (104,'Aula 4 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (105,'Aula 5 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (106,'Aula 6 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (107,'Aula 7 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (108,'Aula 8 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (109,'Aula 9 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (110,'Aula 10 - Modulo 2 Gestão de Projetos',11); INSERT INTO aula VALUES (111,'Aula 1 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (112,'Aula 2 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (113,'Aula 3 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (114,'Aula 4 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (115,'Aula 5 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (116,'Aula 6 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (117,'Aula 7 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (118,'Aula 8 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (119,'Aula 9 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (120,'Aula 10 - Modulo 1 Design de Produtos',12); INSERT INTO aula VALUES (121,'Aula 1 - Modulo 1 Libras',13); INSERT INTO aula VALUES (122,'Aula 2 - Modulo 1 Libras',13); INSERT INTO aula VALUES (123,'Aula 3 - Modulo 1 Libras',13); INSERT INTO aula VALUES (124,'Aula 4 - Modulo 1 Libras',13); INSERT INTO aula VALUES (125,'Aula 5 - Modulo 1 Libras',13); INSERT INTO aula VALUES (126,'Aula 6 - Modulo 1 Libras',13); INSERT INTO aula VALUES (127,'Aula 7 - Modulo 1 Libras',13); INSERT INTO aula VALUES (128,'Aula 8 - Modulo 1 Libras',13); INSERT INTO aula VALUES (129,'Aula 9 - Modulo 1 Libras',13); INSERT INTO aula VALUES (130,'Aula 10 - Modulo 1 Libras',13); INSERT INTO aula VALUES (131,'Aula 1 - Modulo 2 Libras',14); INSERT INTO aula VALUES (132,'Aula 2 - Modulo 2 Libras',14); INSERT INTO aula VALUES (133,'Aula 3 - Modulo 2 Libras',14); INSERT INTO aula VALUES (134,'Aula 4 - Modulo 2 Libras',14); INSERT INTO aula VALUES (135,'Aula 5 - Modulo 2 Libras',14); INSERT INTO aula VALUES (136,'Aula 6 - Modulo 2 Libras',14); INSERT INTO aula VALUES (137,'Aula 7 - Modulo 2 Libras',14); INSERT INTO aula VALUES (138,'Aula 8 - Modulo 2 Libras',14); INSERT INTO aula VALUES (139,'Aula 9 - Modulo 2 Libras',14); INSERT INTO aula VALUES (140,'Aula 10 - Modulo 2 Libras',14); INSERT INTO aula VALUES (141,'Aula 1 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (142,'Aula 2 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (143,'Aula 3 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (144,'Aula 4 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (145,'Aula 5 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (146,'Aula 6 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (147,'Aula 7 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (148,'Aula 8 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (149,'Aula 9 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (150,'Aula 10 - Modulo 1 Design Industrial',15); INSERT INTO aula VALUES (151,'Aula 1 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (152,'Aula 2 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (153,'Aula 3 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (154,'Aula 4 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (155,'Aula 5 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (156,'Aula 6 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (157,'Aula 7 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (158,'Aula 8 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (159,'Aula 9 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (160,'Aula 10 - Modulo 2 Design Industrial',16); INSERT INTO aula VALUES (161,'Aula 1 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (162,'Aula 2 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (163,'Aula 3 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (164,'Aula 4 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (165,'Aula 5 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (166,'Aula 6 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (167,'Aula 7 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (168,'Aula 8 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (169,'Aula 9 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (170,'Aula 10 - Modulo 3 Design Industrial',17); INSERT INTO aula VALUES (171,'Aula 1 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (172,'Aula 2 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (173,'Aula 3 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (174,'Aula 4 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (175,'Aula 5 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (176,'Aula 6 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (177,'Aula 7 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (178,'Aula 8 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (179,'Aula 9 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (180,'Aula 10 - Modulo 1 Artes para Website',18); INSERT INTO aula VALUES (181,'Aula 1 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (182,'Aula 2 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (183,'Aula 3 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (184,'Aula 4 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (185,'Aula 5 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (186,'Aula 6 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (187,'Aula 7 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (188,'Aula 8 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (189,'Aula 9 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (190,'Aula 10 - Modulo 2 Artes para Website',19); INSERT INTO aula VALUES (191,'Aula 1 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (192,'Aula 2 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (193,'Aula 3 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (194,'Aula 4 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (195,'Aula 5 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (196,'Aula 6 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (197,'Aula 7 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (198,'Aula 8 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (199,'Aula 9 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (200,'Aula 10 - Modulo 3 Artes para Website',20); INSERT INTO aula VALUES (201,'Aula 1 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (202,'Aula 2 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (203,'Aula 3 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (204,'Aula 4 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (205,'Aula 5 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (206,'Aula 6 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (207,'Aula 7 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (208,'Aula 8 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (209,'Aula 9 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (210,'Aula 10 - Modulo 1 Gestão Escolar',21); INSERT INTO aula VALUES (211,'Aula 1 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (212,'Aula 2 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (213,'Aula 3 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (214,'Aula 4 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (215,'Aula 5 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (216,'Aula 6 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (217,'Aula 7 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (218,'Aula 8 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (219,'Aula 9 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (220,'Aula 10 - Modulo 2 Gestão Escolar',22); INSERT INTO aula VALUES (221,'Aula 1 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (222,'Aula 2 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (223,'Aula 3 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (224,'Aula 4 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (225,'Aula 5 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (226,'Aula 6 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (227,'Aula 7 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (228,'Aula 8 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (229,'Aula 9 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (230,'Aula 10 - Modulo 3 Gestão Escolar',23); INSERT INTO aula VALUES (231,'Aula 1 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (232,'Aula 2 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (233,'Aula 3 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (234,'Aula 4 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (235,'Aula 5 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (236,'Aula 6 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (237,'Aula 7 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (238,'Aula 8 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (239,'Aula 9 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (240,'Aula 10 - Modulo 1 Gestão de Tempo',24); INSERT INTO aula VALUES (241,'Aula 1 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (242,'Aula 2 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (243,'Aula 3 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (244,'Aula 4 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (245,'Aula 5 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (246,'Aula 6 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (247,'Aula 7 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (248,'Aula 8 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (249,'Aula 9 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (250,'Aula 10 - Modulo 2 Gestão de Tempo',25); INSERT INTO aula VALUES (251,'Aula 1 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (252,'Aula 2 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (253,'Aula 3 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (254,'Aula 4 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (255,'Aula 5 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (256,'Aula 6 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (257,'Aula 7 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (258,'Aula 8 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (259,'Aula 9 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (260,'Aula 10 - Modulo 3 Gestão de Tempo',26); INSERT INTO aula VALUES (261,'Aula 1 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (262,'Aula 2 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (263,'Aula 3 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (264,'Aula 4 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (265,'Aula 5 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (266,'Aula 6 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (267,'Aula 7 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (268,'Aula 8 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (269,'Aula 9 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (270,'Aula 10 - Modulo 1 Legislação Trabalhista',27); INSERT INTO aula VALUES (271,'Aula 1 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (272,'Aula 2 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (273,'Aula 3 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (274,'Aula 4 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (275,'Aula 5 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (276,'Aula 6 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (277,'Aula 7 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (278,'Aula 8 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (279,'Aula 9 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (280,'Aula 10 - Modulo 2 Legislação Trabalhista',28); INSERT INTO aula VALUES (281,'Aula 1 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (282,'Aula 2 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (283,'Aula 3 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (284,'Aula 4 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (285,'Aula 5 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (286,'Aula 6 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (287,'Aula 7 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (288,'Aula 8 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (289,'Aula 9 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (290,'Aula 10 - Modulo 3 Legislação Trabalhista',29); INSERT INTO aula VALUES (291,'Aula 1 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (292,'Aula 2 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (293,'Aula 3 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (294,'Aula 4 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (295,'Aula 5 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (296,'Aula 6 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (297,'Aula 7 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (298,'Aula 8 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (299,'Aula 9 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (300,'Aula 10 - Modulo 1 Assistente Administrativo',30); INSERT INTO aula VALUES (301,'Aula 1 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (302,'Aula 2 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (303,'Aula 3 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (304,'Aula 4 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (305,'Aula 5 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (306,'Aula 6 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (307,'Aula 7 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (308,'Aula 8 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (309,'Aula 9 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (310,'Aula 10 - Modulo 2 Assistente Administrativo',31); INSERT INTO aula VALUES (311,'Aula 1 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (312,'Aula 2 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (313,'Aula 3 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (314,'Aula 4 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (315,'Aula 5 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (316,'Aula 6 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (317,'Aula 7 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (318,'Aula 8 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (319,'Aula 9 - Modulo 3 Assistente Administrativo',32); INSERT INTO aula VALUES (320,'Aula 10 - Modulo 3 Assistente Administrativo',32); --Inserção dos arquivos de aulas INSERT INTO arquivo(codigo,descricao, link_acesso,cod_aula) VALUES (1,'Aula 1.','C:\Users\CursoEAD\Aulas\aula1redesmodulo1.mp4',1), (2,'Aula 2.','C:\Users\CursoEAD\Aulas\aula2redesmodulo1.mp4',2), (3,'Aula 3.','C:\Users\CursoEAD\Aulas\aula3redesmodulo1.mp4',3), (4,'Aula 4.','C:\Users\CursoEAD\Aulas\aula4redesmodulo1.mp4',4), (5,'Aula 5.','C:\Users\CursoEAD\Aulas\aula5redesmodulo1.mp4',5), (6,'Aula 6.','C:\Users\CursoEAD\Aulas\aula6redesmodulo1.mp4',6), (7,'Aula 7.','C:\Users\CursoEAD\Aulas\aula7redesmodulo1.mp4',7), (8,'Aula 8.','C:\Users\CursoEAD\Aulas\aula8redesmodulo1.mp4',8), (9,'Aula 9.','C:\Users\CursoEAD\Aulas\aula9redesmodulo1.mp4',9), (10,'Aula 10.','C:\Users\CursoEAD\Aulas\aula10redesmodulo1.mp4',10), (11,'Aula 1.','C:\Users\CursoEAD\Aulas\aula1redesmodulo2.mp4',11), (12,'Aula 2.','C:\Users\CursoEAD\Aulas\aula2redesmodulo2.mp4',12), (13,'Aula 3.','C:\Users\CursoEAD\Aulas\aula3redesmodulo2.mp4',13), (14,'Aula 4.','C:\Users\CursoEAD\Aulas\aula4redesmodulo2.mp4',14), (15,'Aula 5.','C:\Users\CursoEAD\Aulas\aula5redesmodulo2.mp4',15), (16,'Aula 6.','C:\Users\CursoEAD\Aulas\aula6redesmodulo2.mp4',16), (17,'Aula 7.','C:\Users\CursoEAD\Aulas\aula7redesmodulo2.mp4',17), (18,'Aula 8.','C:\Users\CursoEAD\Aulas\aula8redesmodulo2.mp4',18), (19,'Aula 9.','C:\Users\CursoEAD\Aulas\aula9redesmodulo2.mp4',19), (20,'Aula 10.','C:\Users\CursoEAD\Aulas\aula10redesmodulo2.mp4',20), (21,'Aula 1.','C:\Users\CursoEAD\Aulas\aula1javamodulo1.mp4',31), (22,'Aula 2.','C:\Users\CursoEAD\Aulas\aula2javamodulo1.mp4',32), (23,'Aula 3.','C:\Users\CursoEAD\Aulas\aula3javamodulo1.mp4',33), (24,'Aula 4.','C:\Users\CursoEAD\Aulas\aula4javamodulo1.mp4',34), (25,'Aula 5.','C:\Users\CursoEAD\Aulas\aula5javamodulo1.mp4',35), (26,'Aula 6.','C:\Users\CursoEAD\Aulas\aula6javamodulo1.mp4',36), (27,'Aula 7.','C:\Users\CursoEAD\Aulas\aula7javamodulo1.mp4',37), (28,'Aula 8.','C:\Users\CursoEAD\Aulas\aula8javamodulo1.mp4',38), (29,'Aula 9.','C:\Users\CursoEAD\Aulas\aula9javamodulo1.mp4',39), (30,'Aula 10.','C:\Users\CursoEAD\Aulas\aula10javamodulo1.mp4',40), (31,'Aula 1.','C:\Users\CursoEAD\Aulas\aula1javamodulo2.mp4',41), (32,'Aula 2.','C:\Users\CursoEAD\Aulas\aula2javamodulo2.mp4',42), (33,'Aula 3.','C:\Users\CursoEAD\Aulas\aula3javamodulo2.mp4',43), (34,'Aula 4.','C:\Users\CursoEAD\Aulas\aula4javamodulo2.mp4',44), (35,'Aula 5.','C:\Users\CursoEAD\Aulas\aula5javamodulo2.mp4',45), (36,'Aula 6.','C:\Users\CursoEAD\Aulas\aula6javamodulo2.mp4',46), (37,'Aula 7.','C:\Users\CursoEAD\Aulas\aula7javamodulo2.mp4',47), (38,'Aula 8.','C:\Users\CursoEAD\Aulas\aula8javamodulo2.mp4',48), (39,'Aula 9.','C:\Users\CursoEAD\Aulas\aula9javamodulo2.mp4',49), (40,'Aula 10.','C:\Users\CursoEAD\Aulas\aula10javamodulo2.mp4',50), (41,'Aula 1.','C:\Users\CursoEAD\Aulas\aula1pythonmodulo1.mp4',61), (42,'Aula 2.','C:\Users\CursoEAD\Aulas\aula2pythonmodulo1.mp4',62), (43,'Aula 3.','C:\Users\CursoEAD\Aulas\aula3pythonmodulo1.mp4',63), (44,'Aula 4.','C:\Users\CursoEAD\Aulas\aula4pythonmodulo1.mp4',64), (45,'Aula 5.','C:\Users\CursoEAD\Aulas\aula5pythonmodulo1.mp4',65), (46,'Aula 6.','C:\Users\CursoEAD\Aulas\aula6pythonmodulo1.mp4',66), (47,'Aula 7.','C:\Users\CursoEAD\Aulas\aula7pythonmodulo1.mp4',67), (48,'Aula 8.','C:\Users\CursoEAD\Aulas\aula8pythonmodulo1.mp4',68), (49,'Aula 9.','C:\Users\CursoEAD\Aulas\aula9pythonmodulo1.mp4',69), (50,'Aula 10.','C:\Users\CursoEAD\Aulas\aula10pythonmodulo1.mp4',70), (51,'Aula 1.','C:\Users\CursoEAD\Aulas\aula1tempomodulo1.mp4',231), (52,'Aula 2.','C:\Users\CursoEAD\Aulas\aula2tempomodulo1.mp4',232), (53,'Aula 3.','C:\Users\CursoEAD\Aulas\aula3tempomodulo1.mp4',233), (54,'Aula 4.','C:\Users\CursoEAD\Aulas\aula4tempomodulo1.mp4',234), (55,'Aula 5.','C:\Users\CursoEAD\Aulas\aula5tempomodulo1.mp4',235), (56,'Aula 6.','C:\Users\CursoEAD\Aulas\aula6tempomodulo1.mp4',236), (57,'Aula 7.','C:\Users\CursoEAD\Aulas\aula7tempomodulo1.mp4',237), (58,'Aula 8.','C:\Users\CursoEAD\Aulas\aula8tempomodulo1.mp4',238), (59,'Aula 9.','C:\Users\CursoEAD\Aulas\aula9tempomodulo1.mp4',239), (60,'Aula 10.','C:\Users\CursoEAD\Aulas\aula10tempomodulo1.mp4',240); --Inserção de Avaliação INSERT INTO avaliacao VALUES (1,'Avaliação 1- Modulo 1 Rede de Computadores',1); INSERT INTO avaliacao VALUES (2,'Avaliação 2- Modulo 1 Rede de Computadores',1); INSERT INTO avaliacao VALUES (3,'Avaliação 1- Modulo 2 Rede de Computadores',2); INSERT INTO avaliacao VALUES (4,'Avaliação 2- Modulo 2 Rede de Computadores',2); INSERT INTO avaliacao VALUES (5,'Avaliação 1- Modulo 3 Rede de Computadores',3); INSERT INTO avaliacao VALUES (6,'Avaliação 2- Modulo 3 Rede de Computadores',3); INSERT INTO avaliacao VALUES (7,'Avaliação 1- Modulo 1 Programação JAVA',4); INSERT INTO avaliacao VALUES (8,'Avaliação 2- Modulo 1 Programação JAVA',4); INSERT INTO avaliacao VALUES (9,'Avaliação 1- Modulo 2 Programação JAVA',5); INSERT INTO avaliacao VALUES (10,'Avaliação 2- Modulo 2 Programação JAVA',5); INSERT INTO avaliacao VALUES (11,'Avaliação 1- Modulo 3 Programação JAVA',6); INSERT INTO avaliacao VALUES (12,'Avaliação 1- Modulo 1 Programação Python',7); INSERT INTO avaliacao VALUES (13,'Avaliação 2- Modulo 1 Programação Python',7); INSERT INTO avaliacao VALUES (14,'Avaliação 1- Modulo 2 Programação Python',8); INSERT INTO avaliacao VALUES (15,'Avaliação 1- Modulo 3 Programação Python',9); INSERT INTO avaliacao VALUES (16,'Avaliação 1- Modulo 1 Gestão de Projetos',10); INSERT INTO avaliacao VALUES (17,'Avaliação 2- Modulo 1 Gestão de Projetos',10); INSERT INTO avaliacao VALUES (18,'Avaliação 1- Modulo 2 Gestão de Projetos',11); INSERT INTO avaliacao VALUES (19,'Avaliação 1- Modulo 1 Design de Produtos',12); INSERT INTO avaliacao VALUES (20,'Avaliação 2- Modulo 1 Design de Produtos',12); INSERT INTO avaliacao VALUES (21,'Avaliação 1- Modulo 1 Libras',13); INSERT INTO avaliacao VALUES (22,'Avaliação 1- Modulo 2 Libras',14); INSERT INTO avaliacao VALUES (23,'Avaliação 1- Modulo 1 Design Industrial',15); INSERT INTO avaliacao VALUES (24,'Avaliação 1- Modulo 2 Design Industrial',16); INSERT INTO avaliacao VALUES (25,'Avaliação 1- Modulo 3 Design Industrial',17); INSERT INTO avaliacao VALUES (26,'Avaliação 1- Modulo 1 Artes para Website',18); INSERT INTO avaliacao VALUES (27,'Avaliação 1- Modulo 2 Artes para Website',19); INSERT INTO avaliacao VALUES (28,'Avaliação 1- Modulo 3 Artes para Website',20); INSERT INTO avaliacao VALUES (29,'Avaliação 1- Modulo 1 Gestão Escolar',21); INSERT INTO avaliacao VALUES (30,'Avaliação 1- Modulo 2 Gestão Escolar',22); INSERT INTO avaliacao VALUES (31,'Avaliação 1- Modulo 3 Gestão Escolar',23); INSERT INTO avaliacao VALUES (32,'Avaliação 1- Modulo 1 Gestão de Tempo',24); INSERT INTO avaliacao VALUES (33,'Avaliação 1- Modulo 2 Gestão de Tempo',25); INSERT INTO avaliacao VALUES (34,'Avaliação 1- Modulo 3 Gestão de Tempo',26); INSERT INTO avaliacao VALUES (35,'Avaliação 1- Modulo 1 Legislação Trabalhista',27); INSERT INTO avaliacao VALUES (36,'Avaliação 1- Modulo 2 Legislação Trabalhista',28); INSERT INTO avaliacao VALUES (37,'Avaliação 1- Modulo 3 Legislação Trabalhista',29); INSERT INTO avaliacao VALUES (38,'Avaliação 1- Modulo 1 Assistente Administrativo',30); INSERT INTO avaliacao VALUES (39,'Avaliação 1- Modulo 2 Assistente Administrativo',31); INSERT INTO avaliacao VALUES (40,'Avaliação 1- Modulo 3 Assistente Administrativo',32); --Iserção de questões para as avaliações. INSERT INTO questao_avaliacao(codigo,cod_avaliacao, descricao) VALUES (1,1,'Defina rede de computadores.'), (2,1,'O que são redes broadcast e ponto-a-ponto?'), (3,1,'O que é um endereço IP? Dê um exemplo.'), (4,1,'O que é IPV4 e IPV6? Cite as principais diferenças entre IPV4 e IPV6.'), (1,2,'O que é IPV4 e IPV6? Cite as principais diferenças entre IPV4 e IPV6.'), (2,2,'UDP (user datagram protocol) e TCP (transmission control protocol) são protocolos da camada de transporte do modelo ISO/OSI.'), (1,3,'Assinale a alternativa que contenha apenas protocolo(s) que é (são) considerado(s) da camada de transporte do modelo TCP/IP:'), (2,3,'Com relação ao modelo de referência TCP/IP, marque a alternativa ERRADA:'), (1,4,'Um gateway normalmente é um computador que opera em todas as cinco camadas da arquitetura TCP/IP ou nas sete camadas do modelo OSI. Sobre o gateway, é correto afirmar que'), (2,4,'Tradicionalmente, são atribuídos quatro tipos de características a um fluxo: confiabilidade, atraso, jitter e largura de banda. Sobre tipos de serviço e QoS, é correto afirmar que jitter se refere'), (1,5,'Uma empresa que possui um intervalo de endereços IP entre 194.24.16.0 e 194.24.31.255 possui a seguinte quantidade de endereços:'), (2,5,'Segundo o modelo OSI, quando uma mensagem passa por nodos intermediários entre o emissor e receptor, permanecendo na mesma rede e com o mesmo protocolo, passa pelas seguintes camadas:'), (1,6,'Em uma rede que utiliza TCP/IP, quando um computador é conectado à rede pela primeira vez, utiliza-se o protocolo ARP para descobrir o seu endereço de Internet.'), (2,6,'O padrão Bluetooth inclui vários protocolos de operação agrupados em camadas estruturadas conforme o modelo de referência TCP/IP, o que garante a interoperabilidade desse padrão com os demais padrões de redes de computadores aderentes àquele modelo.'), (1,7,'Tendo em vista o suporte para orientação a objetos na linguagem JAVA, caso um objeto do tipo enumeração fosse criado, para liberar seu armazenamento na memória seria necessário:'), (2,7,'Assinale a opção que apresenta a extensão de um arquivo utilizado para distribuir uma coleção de arquivos JAR, JavaServer Pages, Java Servlets, classes Java, bibliotecas e outros recursos que, juntos, constituem um aplicativo da Web.'), (1,8,'Considerando a Linguagem de Programação Java (Versão 11), como é possível obter a referência (lambda) para um método de uma classe?'), (2,8,'No contexto de OO, considerando um Escopo de Classe na linguagem Java, assinale a alternativa correta.'), (1,9,'Com relação aos operadores bitwise do Java, considere os valores binários a = 00111100 b = 00001101 Os valores resultantes das operações a&b e a|b são, respectivamente'), (2,9,'O polimorfismo ocorre quando a mesma operação é construída em uma mesma classe ou quando o método da subclasse sobrepõe-se ao método da superclasse.'), (1,10,'A compilação de um programa JAVA para ambiente Windows gera um programa com extensão EXE, o qual é executado pelo sistema operacional.'), (2,10,'Quanto às linguagens de programação, assinale a alternativa que esteja tecnicamente incorreta.'), (1,11,'Considerando a arquitetura da linguagem de programação Java e o Java Development Kit (JDK) e o Java Runtime Environment (JRE), assinale a alternativa correta.'), (2,11,'Na plataforma Java SE 8, o coletor de lixo (garbage collector) somente libera o espaço ocupado pelo objeto A na memória quando'), (1,12,'Listas são coleções alteráveis de qualquer tipo de objeto — como, por exemplo, outras listas — capazes de gerar um efeito top-down sem limite de níveis.'), (2,12,'As tuplas, embora sejam semelhantes às listas, estão limitadas a, no máximo, cinco níveis.'), (1,13,'Leia as afirmativas a seguir: I. Python é uma linguagem de programação interpretada, de código-fonte aberto e disponível para vários sistemas operacionais. II. Hardware é o nome que se dá a toda parte lógica do computador, também chamado de programa. Marque a alternativa CORRETA:'), (2,13,'Na linguagem de programação Python, existem 3 estruturas para armazenar dados indexados. A estrutura cujos valores são imutáveis depois de sua criação é conhecida como'), (1,14,'Dos itens abaixo, aquele que é uma linguagem de programação:'), (2,14,'Qual comando do Python 3 que realiza para cada lista uma atribuição do elemento corrente à variável definida no comando e executa o bloco de código associado a essa variável disponível?'), (1,15,'Em Python 3, qual é o processo que é executado dentro da função e não na chamada?'), (2,15,'Em Python 3, o que é utilizado para interpolar string?'), (1,16,'Os processos de negócio podem ser classificados em três tipos. Sobre esses tipos, assinale a alternativa correta.'), (2,16,'O conceito “Esforço temporário empreendido para criar um produto, serviço ou resultado único” refere-se à'), (1,17,'Os processos classificam-se em primários, de apoio e gerenciais.'), (2,17,'A gestão por processos utiliza estrutura vertical, enquanto a gestão tradicional adota estruturas horizontais.'), (1,18,'A fase em que o produto é gradativamente elaborado corresponde ao ciclo de vida de um projeto denominado:'), (2,18,'Dentre os critérios de seleção de um projeto, o que indica se a ideia tem potencial de gerar negócios lucrativos para uma empresa é o critério:'), (1,19,'Para crescer e alcançar sucesso, uma organização geralmente lança no mercado um novo produto que deve ser sistematicamente desenvolvido para se avaliar as chances de alcançar sucesso. Quando se está no processo de previsão de vendas, ocorre o(a):'), (2,19,'O posicionamento de produtos implica'), (1,20,'As inovações de marketing envolvem a implementação de novos métodos de marketing, incluindo mudanças no design do produto e na embalagem, na promoção do produto e sua colocação no mercado e em métodos de estabelecimento de preços de bens e de serviços. Assim é correto afirmar que:'), (2,20,'Ao conjunto de elementos gráficos que compõe a personalidade visual de um nome, ideia, produto ou serviço, dá-se o nome de:'), (1,21,'(CONCURSO CRATO/2021) Qual afirmativa sobre a Libras é CORRETA? A Libras é'), (2,21,'(CONCURSO CRATO/2021) Com relação ao disposto na Lei nº 13.146/2015, analise as opções abaixo e assinale a alternativa INCORRETA:'), (1,22,'(CONCURSO CRATO/2021) Quando o tradutor e intérprete de Libras, ao atuar, ao mesmo tempo que recebe uma frase ou pensamento na língua fonte (Língua Portuguesa Oral) para passar para a língua alvo (Libras), o profissional está realizando uma interpretação:'), (2,22,'(CONCURSO CRATO/2021) De acordo os parâmetros linguísticos da Libras, assinale a alternativa que apresenta sinais com a mesma localização:'), (1,23,'Com referencia aos comandos do AutoCAD, é INCORRETO afirmar:'), (2,23,'A sequência CORRETA, de cima para baixo, é:'), (1,24,'Uma chapa metálica, em tamanho real, mede dois metros e sessenta centímetros (2,60 m) por um metro e setenta centímetros (1,70 m). Quando essa chapa for representada na escala 1:25 terá, respectivamente, qual das medidas abaixo depois de plotada no formato A4 em tamanho real?'), (2,24,'Utilizam-se cotas para fornecer as distâncias entre dois pontos, linhas ou planos, ou entre alguma combinação entre estes dois elementos. A colocação de cotas é normatizada pela ABNT através da norma NBR-10126. Com base nesta norma, é INCORRETO afirmar:'), (1,25,'Assinale a alternativa que representa uma linha não utilizada em desenho técnico.'), (2,25,'Assinale a alternativa referente a seguinte afirmativa: “É uma régua utilizada para apoiar o esquadro ou para traçar linhas paralelas quando apoiada na mesa de desenhos, possui em média 80 cm e normalmente é de madeira com detalhes em acrílico, sendo utilizada para desenho técnico”.'), (1,26,'Como é feito a vetorização da imagem?'), (2,26,'Quais cores são chamativas para um site de fast-food?'), (1,27,'Como devemos trabalhar a idealização com o cliente?'), (2,27,'Idealização e criação do projeto, esses dois processos dependem um do outro?'), (1,28,'No ambiente escolar, as funções executivas são primordiais para que o estudante possa ter sucesso em todas as etapas de sua educação. Sobre as funções executivas, é INCORRETO afirmar que:'), (2,28,'Lerner (2002) apresenta alguns desafios para transformar o ensino da leitura e da escrita na Escola. Sobre isso, marque a opção correta.'), (1,29,'A disciplina é uma prática social. As exigências de procedimento, regras e métodos de uma prática não se dissociam dos objetivos e conteúdos da mesma. Nesse sentido, disciplina escolar se identifica com:'), (2,29,'Qual é o documento norteador de todo trabalho escolar?'), (1,30,'Algumas características costumam marcar a identidade de escolas eficazes. Observe os itens abaixo e marque aquele que apresenta uma característica de uma escola dotada de qualidade.'), (2,30,'Assinale a alternativa incorreta. A Associação de Pais e Mestres pode exercer várias funções como: colaborar com a direção da escola para atingir os objetivos educacionais:'), (1,31,'Com relação ao cronograma, é correto afirmar que:'), (2,31,'O que você indica para quem não consegue se organizar?'), (1,32,'Como ser eficiente em gestão de tempo e pessoas?'), (2,32,'Como deixar de procrastinar?'), (1,33,'O que é a técnica pomodoro?'), (2,33,'Gestão do tempo é soft skill ou hard skill?'), (1,34,'Organizar reuniões é muito importante e ter o conhecimento dos compromissos de nossos superiores ajuda a ter agilidades para que compromissos não sejam perdidos. Este assunto refere-se a agenda de compromissos que deve conter em sua estrutura:'), (2,34,'O projeto é um empreendimento que faz parte, consciente ou inconscientemente, do dia a dia de qualquer organização. A visão da empresa influenciará sensivelmente no sucesso do projeto. Acerca desse tema, assinale a alternativa correta.'), (1,35,'A respeito das formas de invalidade do contrato de emprego, a doutrina e a jurisprudência prevalentes estabelecem que.'), (2,35,'Conforme a legislação trabalhista brasileira, o repouso semanal remunerado é:'), (1,36,'A CLT, legislação que rege as relações trabalhistas na iniciativa privada, regula, também, alguns cargos da Administração Pública. Assinale a opção que apresenta um cargo da Administração Pública regido pela CLT.'), (2,36,'Além de ser uma das formas de controle da atividade trabalhista no país, a RAIS é um meio de disponibilização de informações acerca do mercado de trabalho às entidades governamentais.'), (1,37,'Considerando o caso da empresa Alfa assinale, dentre as alternativas, aquela que atende plenamente à determinação dessas Leis.'), (2,37,'Além de ser uma das formas de controle da atividade trabalhista no país, a RAIS é um meio de disponibilização de informações acerca do mercado de trabalho às entidades governamentais.'), (1,38,'(Exatus - 2012 - Prefeitura de Diamante D´Oeste) Com relação a arquivos, é correto afirmar, EXCETO:'), (2,38,'(IDEA - 2009 - Prefeitura de Itupiranga) No que se refere à obediência às normas de conduta é correto afirmar que o funcionário'), (1,39,'Indique abaixo a alternativa que não se insere integralmente, no âmbito da Lei 13.105/15, entre as excepcionalidades à ordem preferencial cronológica de julgamento:'), (2,39,'Assinale a alternativa INCORRETA quanto à cooperação internacional:'), (1,40,'Concernente à multa por infração aos deveres processuais pelas partes e seus procuradores, assinale a alternativa INCORRETA:'), (2,40,'Analise as seguintes assertivas, nos termos do Código de Processo Civil, e assinale a alternativa INCORRETA. O juiz dirigirá o processo, incumbindo-lhe:'); --Inserção das compras. INSERT INTO curso_adquirido(username_aluno,cod_curso,forma_pagamento,data_compra, valor_compra) VALUES ('caio.silva',1,'Cartão','10/09/2019', (SELECT crs.valor from curso crs where crs.codigo = 1)), ('amanda.morais',2,'Boleto','30/09/2019',(SELECT crs.valor from curso crs where crs.codigo = 2)), ('rodrigo.navarro',2,'Cartão','20/10/2019',(SELECT crs.valor from curso crs where crs.codigo = 2)), ('rodrigo.navarro',10,'Boleto','20/10/2019',(SELECT crs.valor from curso crs where crs.codigo = 10)), ('rodrigo.navarro',1,'Boleto','20/10/2019',(SELECT crs.valor from curso crs where crs.codigo = 1)), ('amanda.morais',3,'Boleto','30/10/2019',(SELECT crs.valor from curso crs where crs.codigo = 3)); --Iserção das avaliações que foram feita pelos alunos INSERT INTO executa_avaliacao(username_aluno,cod_avaliacao,data_avaliacao,nota,horario) VALUES ('caio.silva',1,'20/09/2019',8.0,'10:20'), ('caio.silva',2,'05/10/2019',5.0,'11:40'), ('amanda.morais',7,'12/10/2019',9.0,'17:20'), ('caio.silva',2,'18/10/2019',8.0,'16:30'), ('amanda.morais',8,'20/10/2019',8.0,'12:14'), ('caio.silva',3,'25/10/2019',4.0,'17:20'), ('rodrigo.navarro',35,'30/10/2019',9.0,'22:10'); --Inserção aulas assistidas por aluno. INSERT INTO aula_assistida(username_aluno,cod_aula,data_primeiro_acesso) VALUES ('caio.silva',1,'10/09/2019'), ('caio.silva',2,'11/09/2019'), ('caio.silva',3,'12/09/2019'), ('caio.silva',4,'13/09/2019'), ('caio.silva',5,'14/09/2019'), ('caio.silva',6,'15/09/2019'), ('caio.silva',7,'16/09/2019'), ('caio.silva',8,'17/09/2019'), ('caio.silva',9,'18/09/2019'), ('caio.silva',10,'19/09/2019'), ('caio.silva',11,'20/09/2019'), ('caio.silva',12,'20/09/2019'), ('caio.silva',13,'25/09/2019'), ('caio.silva',14,'25/09/2019'), ('caio.silva',15,'30/09/2019'), ('caio.silva',16,'01/09/2019'), ('caio.silva',17,'02/09/2019'), ('caio.silva',18,'03/09/2019'), ('caio.silva',19,'04/09/2019'), ('caio.silva',20,'05/09/2019'), ('amanda.morais',31,'30/09/2019'), ('amanda.morais',32,'01/10/2019'), ('amanda.morais',33,'02/10/2019'), ('amanda.morais',34,'02/10/2019'), ('amanda.morais',35,'03/10/2019'), ('amanda.morais',36,'03/10/2019'), ('amanda.morais',37,'04/10/2019'), ('amanda.morais',38,'06/10/2019'), ('amanda.morais',39,'09/10/2019'), ('amanda.morais',40,'12/10/2019'), ('rodrigo.navarro',261,'21/10/2019'), ('rodrigo.navarro',262,'24/10/2019'), ('rodrigo.navarro',263,'24/10/2019'), ('rodrigo.navarro',264,'25/10/2019'), ('rodrigo.navarro',265,'30/10/2019'); --Updates --bloqueio de curso update curso set situacao = 'Inativo' where codigo = 3 and username_criador = 'thiago.almeida'; update curso set valor = 120.20 where codigo = 1 and username_criador = 'thiago.almeida'; --Execução de nova avaliação INSERT INTO executa_avaliacao(username_aluno,cod_avaliacao,data_avaliacao,nota,horario) VALUEs ('caio.silva',3,'31/10/2019',6.0,'14:30');
true
c2dbec3f3034179104edaad944ddaa0297f99024
SQL
Nabil-Chaouki/TDI205
/Base de données/S2 - Langage SQL/Pratique Langage SQL/zaid kalini/Tps/Les Requetes/Requête 52,53,54,55.sql
ISO-8859-1
559
3.453125
3
[]
no_license
Create Table Employ(Num int,Nom varchar(30),ville varchar(30),salaire float); insert into Employ values(1,'ilias','tanger',4000),(2,'omar','tanger',3000),(1,'oussama','tanger',5000); Select * From Employ where salaire =(select MAX(salaire) From Employ) ; Select * from Employ where salaire IN (Select MAX(salaire) as SalaireMax from Employ GROUP BY ville) ; Select * From Employ where salaire> ANY(Select MAX (salaire) from Employ GROUP BY ville) ; Select * From Employ where salaire< All(select MAX (salaire) from Employ GROUP BY ville) ;
true
fdd4e5777bc3e9feaeee8f91571dd560cda1475d
SQL
bookchigi/bookchi2
/BookChiGi/sql/discount.sql
UTF-8
660
3.828125
4
[]
no_license
drop sequence discount_seq; create sequence discount_seq start with 1 increment by 1 maxvalue 999999 nocycle; drop table bookchigi_discount; create table bookchigi_discount( discount_no number primary key, discount_name varchar2(60) not null, discount_content varchar2(60) default null, discount_target number not null, discount_price number check (discount_price>=0), discount_percent number default 0 check (discount_percent between 0 and 100), discount_start date not null, discount_end date not null, foreign key(discount_target) references bookchigi_book_info(book_isbn) ); select * from bookchigi_discount;
true
a84da9caf78c3bf91d7670fca4ee27aa78f85e65
SQL
ua-eas/ksd-kc5.2.1-foundation
/src/main/config/sql/log/Release_1_0_logs/s2s/procfunpacks/dw_get_eps_prop_cost_sharing.sql
UTF-8
761
3.234375
3
[]
no_license
/********************************************************************** This procedure selects all rows from OSP$EPS_PROP_COST_SHARING table by a given proposal_number and version_number. **********************************************************************/ create or replace procedure dw_get_eps_prop_cost_sharing ( AW_PROPOSAL_NUMBER IN OSP$EPS_PROP_COST_SHARING.PROPOSAL_NUMBER%TYPE, AW_VERSION_NUMBER IN OSP$EPS_PROP_COST_SHARING.VERSION_NUMBER%TYPE, cur_generic IN OUT result_sets.cur_generic) is begin open cur_generic for SELECT * FROM OSP$EPS_PROP_COST_SHARING WHERE PROPOSAL_NUMBER = AW_PROPOSAL_NUMBER AND VERSION_NUMBER = AW_VERSION_NUMBER order by FISCAL_YEAR asc; end; /
true
1af1fcd9e94908d5e4bee44d3a848fb0a07ff145
SQL
silence-do-good/stress-test-Postgres-and-MySQL
/dump/high/day15/select1222.sql
UTF-8
262
2.9375
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='WiFiAP' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['5011','6210','2202','4099','2059','5234','4202','6046','1412','3206'])
true
209dca6101ab86c059d1f4f28330ab59b076a6bd
SQL
anhstudios/swganh
/data/sql/galaxy/scripts/ignore_list.sql
UTF-8
1,389
2.9375
3
[ "MIT" ]
permissive
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 5.1.63-community - MySQL Community Server (GPL) -- Server OS: Win64 -- HeidiSQL version: 7.0.0.4053 -- Date/time: 2012-10-14 17:58:57 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!40014 SET FOREIGN_KEY_CHECKS=0 */; -- Dumping structure for table galaxy.ignore_list DROP TABLE IF EXISTS `ignore_list`; CREATE TABLE IF NOT EXISTS `ignore_list` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `player_id` bigint(20) DEFAULT NULL, `ignored_player_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), KEY `IDX_124ECE8C99E6F5DF` (`player_id`), KEY `IDX_124ECE8CD7A43A0C` (`ignored_player_id`), CONSTRAINT `FK_124ECE8C99E6F5DF` FOREIGN KEY (`player_id`) REFERENCES `player` (`id`), CONSTRAINT `FK_124ECE8CD7A43A0C` FOREIGN KEY (`ignored_player_id`) REFERENCES `player` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Dumping data for table galaxy.ignore_list: ~0 rows (approximately) /*!40000 ALTER TABLE `ignore_list` DISABLE KEYS */; /*!40000 ALTER TABLE `ignore_list` ENABLE KEYS */; /*!40014 SET FOREIGN_KEY_CHECKS=1 */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
true
9d5e9c35a0ddc360db6a646f12d4bb7d2f2fd1d4
SQL
toddwebnet/phpFTPDownload
/_db/ftp_util.sql
UTF-8
979
2.671875
3
[]
no_license
CREATE TABLE `ftp_queue` ( `queue_id` bigint(20) NOT NULL, `ftp_site_id` int(11) DEFAULT NULL, `ftp_info` text ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `ftp_site` ( `ftp_site_id` int(11) NOT NULL, `server` varchar(255) DEFAULT NULL, `username` varchar(255) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `ftp_path` varchar(255) DEFAULT NULL, `paths_to_ignore` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TABLE `ftp_queue` ADD PRIMARY KEY (`queue_id`); ALTER TABLE `ftp_site` ADD PRIMARY KEY (`ftp_site_id`); ALTER TABLE `ftp_queue` MODIFY `queue_id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT; ALTER TABLE `ftp_site` MODIFY `ftp_site_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT; INSERT INTO `ftp_site` (`server`, `username`, `password`, `ftp_path`, `paths_to_ignore`) VALUES ('server1', 'username', 'password', '/folder', '["\\/AdminLogs","\\/csv","\\/_vti_cnf","\\/Temp","\\/aspnet_client"]'),
true
5db61f770a6022aa5e2649263272546eeaaded9f
SQL
Adetiya21/vb2020
/database/db_vb2020.sql
UTF-8
14,409
3.046875
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jul 16, 2020 at 12:02 PM -- Server version: 10.1.38-MariaDB -- PHP Version: 7.3.3 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: `db_vb2020` -- -- -------------------------------------------------------- -- -- Table structure for table `tb_admin` -- CREATE TABLE `tb_admin` ( `id` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `username` varchar(25) NOT NULL, `password` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_admin` -- INSERT INTO `tb_admin` (`id`, `nama`, `username`, `password`) VALUES (1, 'Adetiya', '0', '$2y$10$PtOAi5f39PQLfy4ePdJqB.XiVq/xT1HMfR19/o/Gl5LV1.Ygx35Z6'); -- -------------------------------------------------------- -- -- Table structure for table `tb_anggota` -- CREATE TABLE `tb_anggota` ( `id` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `tmp_lahir` varchar(20) NOT NULL, `tgl_lahir` date NOT NULL, `jenkel` enum('Laki-Laki','Perempuan') NOT NULL, `alamat` text NOT NULL, `prestasi` text NOT NULL, `tinggi` int(11) NOT NULL, `berat` int(11) NOT NULL, `no_telp` varchar(13) NOT NULL, `email` varchar(50) NOT NULL, `posisi` enum('Server','Spiker / Smasher','Tosser / Set-Upper','Defender / Libero') NOT NULL, `motivasi` text NOT NULL, `password` varchar(255) NOT NULL, `gambar` varchar(255) DEFAULT NULL, `status` enum('Calon Anggota','Anggota') NOT NULL, `slug` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_anggota` -- INSERT INTO `tb_anggota` (`id`, `nama`, `tmp_lahir`, `tgl_lahir`, `jenkel`, `alamat`, `prestasi`, `tinggi`, `berat`, `no_telp`, `email`, `posisi`, `motivasi`, `password`, `gambar`, `status`, `slug`) VALUES (1, 'Putra', 'Pontianak', '1998-08-21', 'Laki-Laki', 'alamat', 'prestasi', 170, 65, '081234567890', 'email@email.com', 'Server', 'motivasi', '$2y$10$7VXeLyRJ1O.Vh0m0fxJ0/.EBL0Q3olevSiSHtb5RWyPkf/mdwB8oK', '397978f572f9fde5b925fdfdb0a7c003.jpg', 'Anggota', 'putra'), (2, 'Putri', 'Pontianak', '1998-08-21', 'Perempuan', 'alamat', 'prestasi', 170, 65, '081234567890', 'email1@email1.com', 'Spiker / Smasher', 'motivasi', '$2y$10$7VXeLyRJ1O.Vh0m0fxJ0/.EBL0Q3olevSiSHtb5RWyPkf/mdwB8oK', NULL, 'Calon Anggota', 'putri'), (8, 'dika', '1', '2020-07-12', 'Laki-Laki', '1', '1', 1, 1, '1', '1@1.com', 'Tosser / Set-Upper', '1', '$2y$10$7VXeLyRJ1O.Vh0m0fxJ0/.EBL0Q3olevSiSHtb5RWyPkf/mdwB8oK', NULL, 'Calon Anggota', 'dika'), (9, 'wira', '2', '2020-02-14', 'Perempuan', '2', '2', 2, 2, '2', '2@2.com', 'Tosser / Set-Upper', '2', '$2y$10$b0.Be5tdWIR3lSvSB.3xi.ARNXgLU46YLRLXmmVjjF9TXcengSPpe', 'cb22255f0628cd2971220cf70fe5c1e7.png', 'Calon Anggota', 'wira'), (10, 'Adetiya Burhasan Putra', '3', '2020-07-03', 'Perempuan', '3', '3', 3, 3, '3', '3@3.com', 'Defender / Libero', '3', '$2y$10$MZPQ38AtoZWf6D2jDGDTXeSuZfOvDzir5vzXV1Ykc2Wf2m/CU.bnu', 'b9bf6ab85a6c62b683ac689e33442433.jpg', 'Calon Anggota', 'adetiya-burhasan-putra'), (11, 'Anggota 32', '32', '2020-07-03', 'Perempuan', '32', '32', 32, 32, '32', '32@32.com', 'Server', '32', '$2y$10$PQMycLFDqHryLGkHTWPlsehfSCSU36aSkQfmkHCzK0voCFmb7j456', 'fdce948d5b0fd9b67eac87c5b8e76bff.png', 'Calon Anggota', 'anggota-32'), (12, '5', '5', '2020-07-15', 'Laki-Laki', '5', '5', 5, 5, '5', '5@5.com', 'Server', '5', '$2y$10$5rA1C5bEKHQftHkepkB8JOShhqz44ZBQPdjhs/dNOWPnX62/RSBqG', NULL, 'Calon Anggota', '5'); -- -------------------------------------------------------- -- -- Table structure for table `tb_club` -- CREATE TABLE `tb_club` ( `id` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `sejarah` text NOT NULL, `arti_logo` text NOT NULL, `gambar` varchar(255) DEFAULT NULL, `slug` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_club` -- INSERT INTO `tb_club` (`id`, `nama`, `sejarah`, `arti_logo`, `gambar`, `slug`) VALUES (1, 'TB VAS', '<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\r\n', '<p>Sed tamen tempor magna labore dolore dolor sint tempor duis magna elit veniam aliqua esse amet veniam enim export quid quid veniam aliqua eram noster malis nulla duis fugiat culpa esse aute nulla ipsum velit export irure minim illum fore. hello adet\r\n</p>', '2d316cb8bb7938605f598fd648e8c777.jpg', 'nama-club'); -- -------------------------------------------------------- -- -- Table structure for table `tb_jadwal_latihan` -- CREATE TABLE `tb_jadwal_latihan` ( `id` int(11) NOT NULL, `id_pelatih` int(11) NOT NULL, `hari` varchar(10) NOT NULL, `jam_mulai` time NOT NULL, `jam_selesai` time NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tb_jadwal_tes` -- CREATE TABLE `tb_jadwal_tes` ( `id` int(11) NOT NULL, `id_pelatih` int(11) NOT NULL, `tgl` date NOT NULL, `jam_mulai` time NOT NULL, `jam_selesai` time NOT NULL, `status` enum('Belum Selesai','Selesai') NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_jadwal_tes` -- INSERT INTO `tb_jadwal_tes` (`id`, `id_pelatih`, `tgl`, `jam_mulai`, `jam_selesai`, `status`) VALUES (6, 3, '2020-07-25', '15:00:00', '17:00:00', 'Belum Selesai'); -- -------------------------------------------------------- -- -- Table structure for table `tb_kontak` -- CREATE TABLE `tb_kontak` ( `id` int(11) NOT NULL, `alamat` text NOT NULL, `email` varchar(50) NOT NULL, `facebook` varchar(50) NOT NULL, `instagram` varchar(50) NOT NULL, `no_telp` varchar(13) NOT NULL, `tmp_latihan` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_kontak` -- INSERT INTO `tb_kontak` (`id`, `alamat`, `email`, `facebook`, `instagram`, `no_telp`, `tmp_latihan`) VALUES (1, 'Jalan cikarang', 'email@email.com', 'facebook', 'instagram', '081234567890', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.'); -- -------------------------------------------------------- -- -- Table structure for table `tb_pelatih` -- CREATE TABLE `tb_pelatih` ( `id` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `melatih` enum('Pria','Wanita') NOT NULL, `pengalaman` text NOT NULL, `email` varchar(50) NOT NULL, `no_telp` varchar(13) NOT NULL, `alamat` text NOT NULL, `password` varchar(255) NOT NULL, `gambar` varchar(255) DEFAULT NULL, `slug` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_pelatih` -- INSERT INTO `tb_pelatih` (`id`, `nama`, `melatih`, `pengalaman`, `email`, `no_telp`, `alamat`, `password`, `gambar`, `slug`) VALUES (3, 'Masrun', 'Pria', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'pelatih@pelatih.com', '08', 'Jalan', '$2y$10$KhCILWYtlRkOUDdP9c.UD.IRwhJYwhjXqSepTHHAEYHW/dE4QfV8O', 'gambar.jpg', 'andi-purnomo-spd'), (4, 'Andi Purnomo, S.Pd', 'Pria', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'pelatih1@pelatih.com', '08', 'Jalan', '$2y$10$KhCILWYtlRkOUDdP9c.UD.IRwhJYwhjXqSepTHHAEYHW/dE4QfV8O', 'gambar1.jpg', 'andi-purnomo-spd'), (5, 'Deny Firmansyah, S.Pd', 'Pria', ' Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', 'pelatih2@pelatih.com', '08', 'Jalan', '$2y$10$jzQIK5d5NU275H5N6i0MCeZKUCFs20PA1QT0Unm/PLnUHHsLUEvUC', 'gambar2.jpg', 'deny-firmansyah-spd'), (6, 'Sumantri, S.Pd', 'Wanita', ' Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', 'pelatih3@pelatih.com', '08', 'Jalan', '$2y$10$Ug8CO9u89a2DYA5h0bcsWe6sK5oB4DjIb6Gz3gIJmvMI25wKk4cUK', 'gambar3.jpg', 'sumantri-spd'); -- -------------------------------------------------------- -- -- Table structure for table `tb_pengumuman` -- CREATE TABLE `tb_pengumuman` ( `id` int(11) NOT NULL, `id_jadwal_tes` int(11) NOT NULL, `id_anggota` int(11) NOT NULL, `keterangan` enum('Belum Lulus','Lulus') NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tb_pengurus` -- CREATE TABLE `tb_pengurus` ( `id` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `posisi` enum('Pemilik Club','Penasehat','Ketua','Wakil Ketua','Pelatih Kepala','Bagian Umum','Sekretaris','Bendahara','Tim Pelatih') NOT NULL, `gambar` varchar(255) DEFAULT NULL, `slug` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_pengurus` -- INSERT INTO `tb_pengurus` (`id`, `nama`, `posisi`, `gambar`, `slug`) VALUES (3, 'Syahrul', 'Pemilik Club', '0d89d1bbf4b6925507a277ae99c9713e.png', ''), (4, 'Ahlpiance', 'Penasehat', NULL, ''), (5, 'Bagus Prastio, S.IP', 'Penasehat', NULL, ''), (6, 'Alif Syaifudin. H, S.Pd, M.SI', 'Ketua', NULL, ''), (7, 'Rustam', 'Wakil Ketua', NULL, ''), (8, 'Faisal Sigit, S.Pd', 'Sekretaris', NULL, ''), (9, 'Eko Sarjono, A.MA.Pd', 'Bendahara', NULL, ''), (10, 'Sabandi', 'Bagian Umum', NULL, ''), (11, 'Tonut', 'Bagian Umum', NULL, ''), (12, 'Bahwan', 'Bagian Umum', NULL, ''), (13, 'Sumardi', 'Bagian Umum', NULL, ''), (14, 'Masrun', 'Pelatih Kepala', NULL, ''), (15, 'Andi Purnomo, S.Pd', 'Tim Pelatih', NULL, ''), (16, 'Deny Firmansyah, S.Pd', 'Tim Pelatih', NULL, ''), (17, 'Sumantri, S.Pd', 'Tim Pelatih', NULL, ''); -- -------------------------------------------------------- -- -- Table structure for table `tb_prestasi` -- CREATE TABLE `tb_prestasi` ( `id` int(11) NOT NULL, `gambar` varchar(255) DEFAULT NULL, `tim` enum('Pria','Wanita') NOT NULL, `tgl` date NOT NULL, `hasil` varchar(100) NOT NULL, `keterangan` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_prestasi` -- INSERT INTO `tb_prestasi` (`id`, `gambar`, `tim`, `tgl`, `hasil`, `keterangan`) VALUES (3, 'b5299ca483a08fabfff4688125fa5641.png', 'Wanita', '2020-07-24', 'Juara 1', 'lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem '), (4, '842da091ab1de887d2d4b3ed48ac3883.png', 'Wanita', '2020-07-25', 'Juara 2', 'lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem '); -- -- Indexes for dumped tables -- -- -- Indexes for table `tb_admin` -- ALTER TABLE `tb_admin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_anggota` -- ALTER TABLE `tb_anggota` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_club` -- ALTER TABLE `tb_club` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_jadwal_latihan` -- ALTER TABLE `tb_jadwal_latihan` ADD PRIMARY KEY (`id`), ADD KEY `id_pelatih` (`id_pelatih`); -- -- Indexes for table `tb_jadwal_tes` -- ALTER TABLE `tb_jadwal_tes` ADD PRIMARY KEY (`id`), ADD KEY `id_pelatih` (`id_pelatih`); -- -- Indexes for table `tb_kontak` -- ALTER TABLE `tb_kontak` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_pelatih` -- ALTER TABLE `tb_pelatih` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_pengumuman` -- ALTER TABLE `tb_pengumuman` ADD PRIMARY KEY (`id`), ADD KEY `id_jadwal_tes` (`id_jadwal_tes`), ADD KEY `id_anggota` (`id_anggota`); -- -- Indexes for table `tb_pengurus` -- ALTER TABLE `tb_pengurus` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_prestasi` -- ALTER TABLE `tb_prestasi` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tb_admin` -- ALTER TABLE `tb_admin` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tb_anggota` -- ALTER TABLE `tb_anggota` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `tb_club` -- ALTER TABLE `tb_club` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tb_jadwal_latihan` -- ALTER TABLE `tb_jadwal_latihan` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tb_jadwal_tes` -- ALTER TABLE `tb_jadwal_tes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `tb_kontak` -- ALTER TABLE `tb_kontak` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tb_pelatih` -- ALTER TABLE `tb_pelatih` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `tb_pengumuman` -- ALTER TABLE `tb_pengumuman` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `tb_pengurus` -- ALTER TABLE `tb_pengurus` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT for table `tb_prestasi` -- ALTER TABLE `tb_prestasi` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Constraints for dumped tables -- -- -- Constraints for table `tb_jadwal_latihan` -- ALTER TABLE `tb_jadwal_latihan` ADD CONSTRAINT `tb_jadwal_latihan_ibfk_1` FOREIGN KEY (`id_pelatih`) REFERENCES `tb_pelatih` (`id`) ON DELETE CASCADE; -- -- Constraints for table `tb_jadwal_tes` -- ALTER TABLE `tb_jadwal_tes` ADD CONSTRAINT `tb_jadwal_tes_ibfk_1` FOREIGN KEY (`id_pelatih`) REFERENCES `tb_pelatih` (`id`) ON DELETE CASCADE; -- -- Constraints for table `tb_pengumuman` -- ALTER TABLE `tb_pengumuman` ADD CONSTRAINT `tb_pengumuman_ibfk_1` FOREIGN KEY (`id_anggota`) REFERENCES `tb_anggota` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `tb_pengumuman_ibfk_2` FOREIGN KEY (`id_jadwal_tes`) REFERENCES `tb_jadwal_tes` (`id`) ON DELETE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
4eba565ac78ca5c14959ba8bf51903ce37afc18b
SQL
UPietruschka/noorm
/test/basic/src/main/resources/sql/V_EMPLOYEE_SEARCH.sql
UTF-8
126
2.921875
3
[]
no_license
CREATE OR REPLACE VIEW v_employee_search AS SELECT e.*, j.job_title FROM employees e JOIN jobs j ON (e.job_id = j.job_id) /
true
3f4f7aeeae92acfd7d5686c61a3a6b9b3a4674de
SQL
ji4597056/springboot
/springboot.sql
UTF-8
2,164
3.484375
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50714 Source Host : localhost:3306 Source Database : springboot Target Server Type : MYSQL Target Server Version : 50714 File Encoding : 65001 Date: 2017-01-16 10:17:40 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for goods -- ---------------------------- DROP TABLE IF EXISTS `goods`; CREATE TABLE `goods` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(255) DEFAULT NULL, `product_name` varchar(255) DEFAULT NULL, `stock_num` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `idx_goods_id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for order_info -- ---------------------------- DROP TABLE IF EXISTS `order_info`; CREATE TABLE `order_info` ( `id` varchar(36) NOT NULL, `create_date` datetime DEFAULT NULL, `sales_num` int(11) DEFAULT NULL, `goods_id` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FKipij0c38nco0pm8fncctvbn29` (`goods_id`), KEY `FKtlpgba4g9kxg3t6s6bi5jw4v7` (`user_id`), CONSTRAINT `FKipij0c38nco0pm8fncctvbn29` FOREIGN KEY (`goods_id`) REFERENCES `goods` (`id`), CONSTRAINT `FKtlpgba4g9kxg3t6s6bi5jw4v7` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for person -- ---------------------------- DROP TABLE IF EXISTS `person`; CREATE TABLE `person` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `email` varchar(255) DEFAULT NULL, `nick_name` varchar(255) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `user_name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `idx_user_id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
true
7147815107148a8bb585357ac6688c5471570b2c
SQL
datexla/DATEXLA
/monitor/sql/initDB.sql
UTF-8
620
3.125
3
[]
no_license
-- user:root passwd:crash -- create a new dateabas DROP DATABASE IF EXISTS datexla_dcn; CREATE DATABASE datexla_dcn default character set=utf8; USE datexla_dcn; -- create a new table DROP TABLE IF EXISTS cluster_stats; CREATE TABLE cluster_stats( id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'auto increment id', node_id varchar(30) NOT NULL UNIQUE COMMENT 'node id', score double(8, 3) NOT NULL COMMENT 'score', cpu_score double(8, 3) NOT NULL COMMENT 'cpu score', mem_score double(8, 3) NOT NULL COMMENT 'memory score' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='docker stats';
true
8a3947e3b7bc28440cb5aa5961f107942237b6a5
SQL
lauraadalmolin/ds2
/1bi/lauraadalmolin/schema.sql
UTF-8
308
3.15625
3
[ "MIT" ]
permissive
CREATE TABLE alunos ( nome VARCHAR(60), cpf SERIAL PRIMARY KEY, ); CREATE TABLE atendimentos ( data_hora_inicio VARCHAR(40), data_hora_fim VARCHAR(40), duvidas VARCHAR(200), professor VARCHAR(60), cpf VARCHAR(20) REFERENCES contatos(cpf) ); DROP TABLE alunos; DROP TABLE atendimentos;
true
9f47959a151d82a56f60e9de410150b970330db5
SQL
rakibulalam9200/AKPoultryERP
/SCRIPT/Employee.sql
UTF-8
1,979
2.78125
3
[]
no_license
CREATE TABLE Employee( ComId varchar(20) not null default(''), AutoNo int IDENTITY(1,1), -------------------------------------------- EmpID varchar(50) not null default(''), --Personal Info EmpName varchar(100) not null default(''), FName varchar(100) not null default(''), MName varchar(100) not null default(''), Sex varchar(50) not null default(''), DOB datetime null, MStatus varchar(50) not null default(''), SpName varchar(100) not null default(''), EmgContact varchar(100) not null default(''), EmgPhone varchar(50) not null default(''), Phone varchar(50) not null default(''), NidNo varchar(50) not null default(''), --Address Info Division varchar(100) not null default(''), Zila varchar(100) not null default(''), Upzilla varchar(100) not null default(''), Uneon varchar(100) not null default(''), PreAddress varchar(200) not null default(''), PerAddress varchar(200) not null default(''), -- Company and Salary Info EmpGroup varchar(100) not null default(''), DesignationID varchar(50) not null default(''), SalaryUnit varchar(50) not null default(''), Salary money not null default(0), JoinDate datetime null, ConfirmDate datetime null, Ref varchar(100) not null default(''), PayType varchar(50) not null default(''), AcType varchar(50) not null default(''), AcNo varchar(50) not null default(''), SMS varchar(10) not null default('0'), AttnBonus varchar(10) not null default('0'), PF varchar(10) not null default('0'), PFPercent money not null default(0), OverTime varchar(10) not null default('0'), sts varchar(10) not null default('0'), Resign varchar(10) not null default('0'), ResignType varchar(50) not null default(''), ResDate datetime null, ResReason varchar(100) not null default(''), -------------------------------------------- ComName varchar(150) not null default(''), PcName varchar(50) not null default(''), UserCode varchar(50) not null default(''), EntryTime datetime not null default(GETDATE()), UserIP varchar(100) not null default(''), )
true
23c401c36b4aa51651005f808e3f06e04a4b2ea6
SQL
Kristian-Roopnarine/Voyage
/server/prisma/migrations/20210323094113_update_city_city_id/migration.sql
UTF-8
302
2.515625
3
[]
no_license
/* Warnings: - Changed the type of `city_id` on the `City` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required. */ -- AlterTable ALTER TABLE "City" DROP COLUMN "city_id", ADD COLUMN "city_id" INTEGER NOT NULL;
true
6a4942f9171a594d1e896ee3fbdcdf75da9849fe
SQL
johnbasa/sarisari
/sarisari.sql
UTF-8
2,601
3.21875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Nov 28, 2016 at 04:53 AM -- Server version: 10.1.13-MariaDB -- PHP Version: 5.5.35 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: `sarisari` -- -- -------------------------------------------------------- -- -- Table structure for table `items` -- CREATE TABLE `items` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `category` varchar(64) NOT NULL, `price` decimal(8,2) NOT NULL, `qty` int(11) NOT NULL, `description` text NOT NULL, `image` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `items` -- INSERT INTO `items` (`id`, `name`, `category`, `price`, `qty`, `description`, `image`) VALUES (1, 'Piatos', 'Chips', '20.00', 20, 'LOREM IPSUM', 'piatos.jpg'), (2, 'Chippy', 'Chips', '25.00', 20, 'LOREM IPSUM', 'chippy.jpg'), (3, 'Nova', 'Chips', '23.00', 20, 'LOREM IPSUM', 'nova.jpg'), (4, 'Tempura', 'Chips', '20.00', 20, 'LOREM IPSUM', 'tempura.jpg'), (5, 'Tomato Sauce', 'Condiments', '20.00', 10, 'LOREM IPSUM', 'tomatosauce.jpg'), (6, 'Toyo', 'Condiments', '10.00', 5, 'Toyo', 'toyo.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `username` varchar(64) NOT NULL, `password` varchar(255) NOT NULL, `role` varchar(32) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`, `role`) VALUES (1, 'admin', 'admin', 'administrator'), (2, 'user', 'userpass', 'user'); -- -- Indexes for dumped tables -- -- -- Indexes for table `items` -- ALTER TABLE `items` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `items` -- ALTER TABLE `items` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=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
c637009ffa0163caa3805e0cfd312467117ef113
SQL
IgzyyJere/php_XML
/paginacija/Simple Ajax Pagination With PHP/db/db_pagination.sql
UTF-8
2,505
2.984375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 02, 2017 at 05:04 AM -- Server version: 10.1.16-MariaDB -- PHP Version: 5.6.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 utf8mb4 */; -- -- Database: `db_pagination` -- -- -------------------------------------------------------- -- -- Table structure for table `page` -- CREATE TABLE `page` ( `book_id` int(11) NOT NULL, `title` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `page` -- INSERT INTO `page` (`book_id`, `title`) VALUES (1, 'A Darkling Plain'), (2, 'Death Be Not Proud'), (3, 'The Doors of Perception'), (4, 'Down to a Sunless Sea'), (5, 'Dying of the Light'), (6, 'East of Eden'), (7, 'Fame Is the Spur'), (8, 'A Fanatic Heart'), (9, 'The Far-Distant Oxus'), (10, 'A Farewell to Arms'), (11, 'Far From the Madding Crowd'), (12, 'Fear and Trembling'), (13, 'For a Breath I Tarry'), (14, 'For Whom the Bell Tolls'), (15, 'Frequent Hearses'), (16, 'From Here to Eternity'), (17, 'A Glass of Blessings'), (18, 'The Glory and the Dream'), (19, 'The Golden Apples of the Sun'), (20, 'The Golden Bowl'), (21, 'Gone with the Wind'), (22, 'The Grapes of Wrath'), (23, 'Great Work of Time'), (24, 'The Green Bay Tree'), (25, 'A Handful of Dust'), (26, 'Have His Carcase'), (27, 'The Heart Is a Lonely Hunter'), (28, 'His Dark Materials'), (29, 'The House of Mirth'), (30, 'I Know Why the Caged Bird Sings '), (31, 'I Know Why the Caged Bird Sings '), (32, 'I Sing the Body Electric'), (33, 'I Will Fear No Evil'), (34, 'In a Dry Season'), (35, 'In a Glass Darkly '), (36, 'In Death Ground'), (37, 'In Dubious Battle'), (38, 'An Instant in the Wind'), (39, 'It''s a Battlefield'), (40, 'Jacob Have I Loved '); -- -- Indexes for dumped tables -- -- -- Indexes for table `page` -- ALTER TABLE `page` ADD PRIMARY KEY (`book_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `page` -- ALTER TABLE `page` MODIFY `book_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41; /*!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
af95cc8043822492118740cddd290ba9a7f40f59
SQL
TylerM2112/personal-project
/db/create_order.sql
UTF-8
217
2.546875
3
[]
no_license
-- with rows as ( -- INSERT INTO orders -- (customer, products) -- VALUES ($1, $2) -- RETURNING id) -- SELECT id from rows; INSERT INTO orders (customer, products, gender, size, quantity) VALUES ($1, $2, $3, $4, $5);
true
349d538144ea621a4f8dec04901ff512d4b7b00a
SQL
bao-lq3488/DACNB_V20
/DACNB_V20/script/CreateTable.sql
UTF-8
639
2.8125
3
[]
no_license
CREATE TABLE SinhVien( IDSinhVien varchar2(10), TenSV varchar2(50), NgaySinh date, DiaChi varchar2(200), KhoaHoc varchar2(10), Lop varchar2(10), Nganh varchar(50) ) create table Khoa( IDKhoa varchar2(10), TenKhoa varchar2(50), IDMon varchar2(10), TruongKhoa varchar2(50) ) create table nganh( IDNganh varchar2(10), TenNganh varchar2(50), IDSinhVien VARCHAR2(10) ) create table Mon( IDMon varchar2(10), TenMon varchar2(50), IDSINHVIEN VARCHAR2(10), IDKhoa Varchar2(10) ) create table Diem( IDDiem varchar2(10), IDMon varchar2(10), DiemQT float, DiemHK float, DiemTB float ) commit;
true
c3ffb4fd6d0d48dc5472a8ab1d6741da78c9c9dd
SQL
CUBRID/cubrid-testcases
/sql/_02_user_authorization/_02_authorization/_001_grant/cases/1017.sql
UTF-8
696
3.296875
3
[ "BSD-3-Clause" ]
permissive
--+ holdcas on; --[er]Grant user privilege of select and update on superclass and subclass with keyword of except CALL login('dba','') ON CLASS db_user; CREATE CLASS DCL1 (id INTEGER); INSERT INTO DCL1(id) VALUES(1); CREATE CLASS DCL2 UNDER DCL1 (id INTEGER); INSERT INTO DCL2(id) VALUES(1); CREATE CLASS DCL3 UNDER DCL1 (id INTEGER); INSERT INTO DCL3(id) VALUES(1); CALL add_user('DCL_USER1','DCL1') ON CLASS db_user; GRANT UPDATE, SELECT ON ALL DCL1 (EXCEPT DCL2) TO DCL_USER1; CALL login('DCL_USER1','DCL1') ON CLASS db_user; UPDATE dba.DCL2 SET id=2 WHERE id=1; CALL login('dba','') ON CLASS db_user; CALL drop_user('DCL_USER1') ON CLASS db_user; DROP CLASS ALL DCL1; --+ holdcas off;
true
de5c1ea8f576c9c18b561dfc7f8700f3b23f9e10
SQL
Lallora/spring_course_02
/src/main/resources/schema.sql
UTF-8
1,071
3.921875
4
[]
no_license
DROP TABLE IF EXISTS genres CASCADE; DROP TABLE IF EXISTS users CASCADE; DROP TABLE IF EXISTS books CASCADE; DROP TABLE IF EXISTS book_comments CASCADE; DROP TABLE IF EXISTS authors CASCADE; DROP TABLE IF EXISTS books_authors CASCADE; CREATE TABLE genres( id SERIAL PRIMARY KEY, genre_name VARCHAR(255) UNIQUE ); CREATE TABLE users ( id SERIAL PRIMARY KEY , user_name VARCHAR(255) UNIQUE, password VARCHAR(255) NOT NULL, role VARCHAR(255) NOT NULL ); CREATE TABLE books( id SERIAL PRIMARY KEY , title VARCHAR(255), genre_id INTEGER REFERENCES genres(id) ); CREATE TABLE book_comments ( id SERIAL PRIMARY KEY , comment_text TEXT , comment_date TIMESTAMP , user_id INTEGER REFERENCES users(id) ON DELETE CASCADE , book_id INTEGER REFERENCES books(id) ON DELETE CASCADE ); CREATE TABLE authors( id SERIAL PRIMARY KEY, author_name VARCHAR(255) ); CREATE TABLE books_authors( authors_id INTEGER REFERENCES authors(id) ON DELETE CASCADE, books_id INTEGER REFERENCES books(id) ON DELETE CASCADE, PRIMARY KEY (authors_id, books_id) );
true
c02e61ccdd5d2b732bf99746250e90404ea99b9a
SQL
delphi1977/NewDicomPACS
/Database/oracle/constraints/asu.tcompanyotdel_prima_key.sql
UTF-8
241
2.84375
3
[]
no_license
ALTER TABLE ASU.TCOMPANY_OTDEL DROP CONSTRAINT TCOMPANYOTDEL_PRIMA_KEY / -- -- Non Foreign Key Constraints for Table TCOMPANY_OTDEL -- ALTER TABLE ASU.TCOMPANY_OTDEL ADD ( CONSTRAINT TCOMPANYOTDEL_PRIMA_KEY PRIMARY KEY (FK_ID)) /
true
ddc225cd3e6b53512f76c53614241b6878f65b6b
SQL
sunyujia21/Project_Rock
/hrbcgj/7.28更新版/hrbcgj/baseapp/com/cloud/unit/sql/unit.sql
UTF-8
435
3.65625
4
[]
no_license
--建表语句,此仅为参考,开发人员可根据需要自行修改脚本 create table UNIT ( ID varchar(36) primary key, WEBURL VARCHAR(50), PICURL VARCHAR(50) ); --创建索引 create index UNIT_WEBURL on UNIT (WEBURL); create index UNIT_PICURL on UNIT (PICURL); --创建注释 comment on column UNIT.ID is '主键'; comment on column UNIT.WEBURL is '网站的连接'; comment on column UNIT.PICURL is '图片的连接';
true
dd4984e8cc42b955c854477208b80aeee6ecaf99
SQL
SQLauto/scripts-sql
/exemplo-func3a7c3a3o-stats_date-estatc3adsticas-desatualizadas-sql.sql
UTF-8
143
2.703125
3
[]
no_license
SELECT name AS stats_name, STATS_DATE(object_id, stats_id) AS statistics_update_date FROM sys.stats order by statistics_update_date Desc
true
32679d590987b3563739e6c3364c7ef1f1064949
SQL
erda-project/erda
/.erda/ai-proxy/migrations/ai-proxy/20230808-providers.sql
UTF-8
1,463
3.1875
3
[ "Apache-2.0" ]
permissive
CREATE TABLE `ai_proxy_providers` ( `id` CHAR(36) NOT NULL COMMENT 'primary key', `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted_at` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00' COMMENT '删除时间, 1970-01-01 00:00:00 表示未删除', `name` VARCHAR(128) NOT NULL DEFAULT '' COMMENT 'AI 供应商名称: azure, openai, tongyi, ...', `instance_id` VARCHAR(512) NOT NULL DEFAULT '' COMMENT 'AI 服务实例 id', `host` VARCHAR(128) NOT NULL DEFAULT '' COMMENT 'AI 服务域名', `scheme` VARCHAR(16) NOT NULL DEFAULT 'https' COMMENT 'AI 服务', `description` VARCHAR(1024) NOT NULL DEFAULT '' COMMENT 'AI 供应商描述', `doc_site` VARCHAR(512) NOT NULL DEFAULT '' COMMENT 'AI 供应商网站地址或文档地址', `aes_key` CHAR(16) NOT NULL DEFAULT '' COMMENT 'AES 对称算法种子 Key', `api_key` VARCHAR(512) NOT NULL DEFAULT '' COMMENT 'AES 对称算法加密后的 api_key', `metadata` LONGTEXT NOT NULL COMMENT 'AI 服务实例其他元信息', PRIMARY KEY (`id`), INDEX `idx_instance_id` (`instance_id`), INDEX `idx_name_instance_id` (`name`, `instance_id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT 'ai 供应商服务实例';
true
bd80a59f861c04b548699707fee01730135b03dc
SQL
ondras/kucharka
/cookbook.sql
UTF-8
2,936
3.515625
4
[]
no_license
-- -- Struktura tabulky `amount` -- CREATE TABLE IF NOT EXISTS `amount` ( `id_ingredient` int(11) NOT NULL default '0', `id_recipe` int(11) NOT NULL default '0', `amount` varchar(100) collate utf8_czech_ci default NULL, KEY `id_surovina` (`id_ingredient`), KEY `id_recept` (`id_recipe`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -------------------------------------------------------- -- -- Struktura tabulky `ingredient` -- CREATE TABLE IF NOT EXISTS `ingredient` ( `id` int(11) NOT NULL auto_increment, `name` varchar(100) collate utf8_czech_ci default NULL, `id_category` int(11) NOT NULL default '0', `description` text collate utf8_czech_ci, PRIMARY KEY (`id`), KEY `id_typ` (`id_category`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci PACK_KEYS=0 AUTO_INCREMENT=281 ; -- -------------------------------------------------------- -- -- Struktura tabulky `ingredient_category` -- CREATE TABLE IF NOT EXISTS `ingredient_category` ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) collate utf8_czech_ci default NULL, `order` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=18 ; -- -------------------------------------------------------- -- -- Struktura tabulky `recipe` -- CREATE TABLE IF NOT EXISTS `recipe` ( `id` int(11) NOT NULL auto_increment, `name` varchar(100) collate utf8_czech_ci default NULL, `id_type` int(11) NOT NULL default '0', `time` int(11) default '0', `amount` varchar(64) collate utf8_czech_ci default NULL, `text` text character set utf8, `remark` text collate utf8_czech_ci, `hot_tip` tinyint(4) NOT NULL default '0', `id_user` int(11) NOT NULL, `ts` timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `id_druh` (`id_type`), KEY `id_user` (`id_user`), KEY `ts` (`ts`), KEY `hot_tip` (`hot_tip`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=282 ; -- -------------------------------------------------------- -- -- Struktura tabulky `type` -- CREATE TABLE IF NOT EXISTS `type` ( `id` int(11) NOT NULL auto_increment, `name` varchar(64) collate utf8_czech_ci default NULL, `order` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `poradi` (`order`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci PACK_KEYS=0 AUTO_INCREMENT=30 ; -- -------------------------------------------------------- -- -- Struktura tabulky `user` -- CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL auto_increment, `pwd` char(40) collate utf8_czech_ci default NULL, `name` varchar(128) collate utf8_czech_ci default NULL, `mail` varchar(128) collate utf8_czech_ci default NULL, `super` tinyint(4) NOT NULL default '0', PRIMARY KEY (`id`), KEY `mail` (`mail`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=18 ;
true
3328afad9cbb0ab69a41aff0b797ebb00fdeb633
SQL
rtpj26/mirasoltiresupply
/mirasoltiresupply (7).sql
UTF-8
20,467
3.109375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Sep 15, 2016 at 09:53 PM -- Server version: 10.1.13-MariaDB -- PHP Version: 7.0.6 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: `mirasoltiresupply` -- CREATE DATABASE IF NOT EXISTS `mirasoltiresupply` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `mirasoltiresupply`; -- -------------------------------------------------------- -- -- Table structure for table `battery` -- DROP TABLE IF EXISTS `battery`; CREATE TABLE `battery` ( `BATTERY_ID` int(11) NOT NULL, `PRODUCT_ID` int(11) NOT NULL, `BATTERY_TYPE` varchar(255) NOT NULL, `BATTERY_DESCRIPTION` varchar(255) NOT NULL, `BATTERY_PLATES` int(11) NOT NULL, `BATTERY_IMAGE_FNAME` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `battery` -- INSERT INTO `battery` (`BATTERY_ID`, `PRODUCT_ID`, `BATTERY_TYPE`, `BATTERY_DESCRIPTION`, `BATTERY_PLATES`, `BATTERY_IMAGE_FNAME`) VALUES (1, 10, '1', 'Motolite Excel', 11, 'Excel.jpg'), (2, 11, '2', 'Motolite Gold', 2, 'Gold.jpg'), (3, 12, '3', 'Motolite LM-Enforcer', 2, 'lm-enforcer.png'), (4, 13, '6', 'Motolite Truckmaster', 2, 'motolite-truckmaster.png'), (5, 14, '2', 'Motolite Super Premium', 2, 'super-premium.png'); -- -------------------------------------------------------- -- -- Table structure for table `cheque` -- DROP TABLE IF EXISTS `cheque`; CREATE TABLE `cheque` ( `CHEQUE_ID` int(11) NOT NULL, `TRANSACTION_ID` int(11) NOT NULL, `CHEQUE_BANK` varchar(255) NOT NULL, `CHEQUE_NUMBER` varchar(255) NOT NULL, `CHEQUE_DATE_RECEIVED` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `CHEQUE_AMOUNT` decimal(8,2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `cheque` -- INSERT INTO `cheque` (`CHEQUE_ID`, `TRANSACTION_ID`, `CHEQUE_BANK`, `CHEQUE_NUMBER`, `CHEQUE_DATE_RECEIVED`, `CHEQUE_AMOUNT`) VALUES (1, 0, '111', '1111', '2016-09-12 17:29:40', '111.00'); -- -------------------------------------------------------- -- -- Table structure for table `cod` -- DROP TABLE IF EXISTS `cod`; CREATE TABLE `cod` ( `COD_ID` int(11) NOT NULL, `TRANSACTION_ID` int(11) NOT NULL, `COD_CAREOF` varchar(255) NOT NULL, `COD_STATUS` int(11) NOT NULL, `COD_DATE_RECEIVED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `COD_DATE_ISSUED` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `comment` -- DROP TABLE IF EXISTS `comment`; CREATE TABLE `comment` ( `COMMENT_ID` int(11) NOT NULL, `COMMENT_NAME` varchar(255) NOT NULL, `COMMENT_EMAIL` varchar(255) NOT NULL, `COMMENT_MESSAGE` longtext NOT NULL, `COMMENT_CONTACT_NUM` int(11) NOT NULL, `COMMENT_STATUS` int(11) NOT NULL DEFAULT '1' COMMENT '1=UNREAD | 2= READ' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `comment` -- INSERT INTO `comment` (`COMMENT_ID`, `COMMENT_NAME`, `COMMENT_EMAIL`, `COMMENT_MESSAGE`, `COMMENT_CONTACT_NUM`, `COMMENT_STATUS`) VALUES (1, 'TEST', 'TEST@TEST.COM', 'TRDSTSDSAF', 2147483647, 2), (2, '123', '123@13.123', '123123', 13, 2); -- -------------------------------------------------------- -- -- Table structure for table `credit_card` -- DROP TABLE IF EXISTS `credit_card`; CREATE TABLE `credit_card` ( `CC_ID` int(11) NOT NULL, `TRANSACTION_ID` int(11) NOT NULL, `CC_DATE_RECEIVED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `CC_CARD_NO` int(11) NOT NULL, `CC_NAME_IN_CARD` varchar(255) NOT NULL, `CC_EXPIRATION_MONTH` int(11) NOT NULL, `CC_EXPIRATION_YEAR` int(11) NOT NULL, `CC_SECURITY_CODE` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `credit_card` -- INSERT INTO `credit_card` (`CC_ID`, `TRANSACTION_ID`, `CC_DATE_RECEIVED`, `CC_CARD_NO`, `CC_NAME_IN_CARD`, `CC_EXPIRATION_MONTH`, `CC_EXPIRATION_YEAR`, `CC_SECURITY_CODE`) VALUES (1, 0, '2016-09-11 19:33:25', 1, '1', 1, 2016, '123'), (2, 0, '2016-09-11 19:50:39', 123, '123', 11, 1231, '123'), (3, 0, '2016-09-11 20:10:23', 1, '1', 1, 2016, '123'), (4, 0, '2016-09-12 07:23:21', 1111, '1111', 11, 1111, '1111'), (5, 0, '2016-09-12 07:25:37', 11111, '111', 11, 1111, '1111'), (6, 0, '2016-09-12 07:26:32', 1111, '111', 11, 1111, '1111'), (7, 0, '2016-09-12 07:28:25', 11111, '1111', 11, 1111, '1111'), (8, 0, '2016-09-12 07:29:30', 11111, '11111', 11, 1111, '1111'), (9, 0, '2016-09-12 07:44:36', 11111, '111', 1111, 1111, '11111'), (10, 0, '2016-09-12 09:48:58', 2147483647, '2222222', 11, 1111, '111111111'), (11, 0, '2016-09-12 10:16:26', 11111, '222222', 11, 1111, '1111111'), (12, 0, '2016-09-15 06:24:19', 2131231, '123123123', 11, 2312, '12321312'), (13, 0, '2016-09-15 06:25:27', 123, '123', 11, 1111, '123'), (14, 0, '2016-09-15 06:26:32', 123213, '123123', 11, 1111, '123213'), (15, 0, '2016-09-15 06:38:20', 123123, '123123', 11, 2222, '123123'), (16, 0, '2016-09-15 06:40:14', 123, '123', 11, 1233, '13'), (17, 0, '2016-09-15 07:24:16', 123123, '123123', 12, 1223, '123123'), (18, 0, '2016-09-15 08:01:20', 1111, '1111', 11, 11, '1111'), (19, 0, '2016-09-15 08:02:38', 121212, '112122', 11, 1111, '2122'), (20, 0, '2016-09-15 08:02:41', 121212, '112122', 11, 1111, '2122'), (21, 0, '2016-09-15 08:09:57', 111111, '1111111', 11, 1111, '1111'), (22, 0, '2016-09-15 08:14:56', 123123123, '21313', 111, 123123, '1312321'), (23, 0, '2016-09-15 09:18:38', 1232213, '13321', 11, 1232, '123123'), (24, 0, '2016-09-15 09:42:56', 123123213, '1232133', 11, 1123, '1231232132'), (25, 0, '2016-09-15 09:43:35', 8098908, 'ugsuidyuwqy', 3, 2019, '90990'), (26, 0, '2016-09-15 09:45:51', 0, '123123', 11, 1111, '123213'), (27, 0, '2016-09-15 09:45:52', 98098098, 'Jon Jan', 8, 2019, '0909'), (28, 0, '2016-09-15 10:13:31', 908098097, 'Jon Jan', 9, 2019, '2939'), (29, 0, '2016-09-15 17:12:43', 123123, '123123', 11, 1231, '123123'); -- -------------------------------------------------------- -- -- Table structure for table `product` -- DROP TABLE IF EXISTS `product`; CREATE TABLE `product` ( `PRODUCT_ID` int(11) NOT NULL, `PRODUCT_TYPE` int(11) NOT NULL COMMENT '1=TIRE | 2=WHEEL | 3=BATTERY', `PRODUCT_COST_PER_UNIT` double(18,2) NOT NULL, `PRODUCT_STOCK` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product` -- INSERT INTO `product` (`PRODUCT_ID`, `PRODUCT_TYPE`, `PRODUCT_COST_PER_UNIT`, `PRODUCT_STOCK`) VALUES (1, 1, 6314.01, 10), (2, 1, 6799.70, 10), (3, 1, 5528.97, 10), (4, 1, 6309.34, 10), (5, 1, 5457.24, 10), (6, 1, 5497.00, 10), (7, 1, 5564.10, 10), (8, 1, 6276.12, 10), (9, 1, 7820.95, 10), (10, 3, 5625.29, 10), (11, 3, 7014.38, 10), (12, 3, 6792.07, 10), (13, 3, 7068.61, 10), (14, 3, 7916.84, 10), (15, 2, 8357.01, 10), (16, 2, 6980.30, 10), (17, 2, 8336.89, 10), (18, 2, 7226.18, 10), (19, 2, 8063.90, 10), (20, 2, 7546.03, 10), (21, 2, 8534.45, 10), (22, 2, 8056.48, 10), (23, 2, 8893.03, 10), (24, 2, 9572.56, 10), (25, 2, 8552.47, 10); -- -------------------------------------------------------- -- -- Table structure for table `rescue` -- DROP TABLE IF EXISTS `rescue`; CREATE TABLE `rescue` ( `RESCUE_ID` int(11) NOT NULL, `TRANSACTION_ID` int(11) NOT NULL, `RESCUE_NAME` varchar(255) NOT NULL, `RESCUE_CSR_NO` int(11) NOT NULL, `RESCUE_DATE` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `RESCUE_X_COORDINATE` double(8,8) NOT NULL, `RESCUE_Y_COORDINATE` double(8,8) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `temp_transaction_detail` -- DROP TABLE IF EXISTS `temp_transaction_detail`; CREATE TABLE `temp_transaction_detail` ( `TEMP_ID` int(11) NOT NULL, `TRANSACTION_ID` int(11) NOT NULL, `PRODUCT_ID` int(11) NOT NULL, `TD_QTY` int(11) NOT NULL, `TD_TOTAL` double(8,2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tire` -- DROP TABLE IF EXISTS `tire`; CREATE TABLE `tire` ( `TIRE_ID` int(11) NOT NULL, `PRODUCT_ID` int(11) NOT NULL, `TIRE_RIM` varchar(255) NOT NULL, `TIRE_SIZE` varchar(255) NOT NULL, `TIRE_LI_SS` varchar(255) NOT NULL, `TIRE_BRAND` varchar(255) NOT NULL, `TIRE_DESIGN` varchar(255) NOT NULL, `TIRE_NAME` varchar(255) NOT NULL, `TIRE_IMAGE_FNAME` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tire` -- INSERT INTO `tire` (`TIRE_ID`, `PRODUCT_ID`, `TIRE_RIM`, `TIRE_SIZE`, `TIRE_LI_SS`, `TIRE_BRAND`, `TIRE_DESIGN`, `TIRE_NAME`, `TIRE_IMAGE_FNAME`) VALUES (1, 1, '60R15C', '185', '94/92T', 'Coopertires', 'DISCOVERER HT/3', '', 'Discoverer HT3.png'), (2, 2, '65R15C', '205', '102/100T', 'Coopertires', 'DISCOVERER HT/T3', '', 'Discoverer MS.png'), (3, 3, '75R15', 'P205', '97S', 'Coopertires', 'DISCOVERER H/T', '', 'Discoverer ATP.png'), (4, 4, '75R15', 'P215', '100S', 'Coopertires', 'DISCOVERER A/T', '', 'Discoverer ATW.png'), (5, 5, '70R15', '225', '100T', 'Coopertires', 'DISCOVERER A/T3', '', 'Discoverer AT3.png'), (6, 6, '70R15', 'P225', '100A', 'Coopertires', 'DISCOVERER H/T', '', 'Discoverer ST.png'), (7, 7, 'T5R15', 'P225', '102S', 'Coopertires', 'DISCOVERER H/T', '', 'Discoverer STT PRO.png'), (8, 8, '70R15', 'P235', '102S', 'Coopertires', 'DISCOVERER H/T', '', 'Discoverer RTX.png'), (9, 9, 'T5R15XL', '235', '109T', 'Coopertires', 'DISCOVERER H/T', '', 'Discoverer MTP.png'); -- -------------------------------------------------------- -- -- Table structure for table `transaction` -- DROP TABLE IF EXISTS `transaction`; CREATE TABLE `transaction` ( `TRANSACTION_ID` int(11) NOT NULL, `USER_ID` int(11) NOT NULL, `TRANSACTION_TYPE` int(11) NOT NULL, `TEANSACTION_DATE` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `TRANSCTION_MOP` int(11) NOT NULL, `TRANSACTION_STATUS` int(11) NOT NULL COMMENT '1=PENDING| 2=DONE', `TRANSACTION_MOP_ID` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `transaction` -- INSERT INTO `transaction` (`TRANSACTION_ID`, `USER_ID`, `TRANSACTION_TYPE`, `TEANSACTION_DATE`, `TRANSCTION_MOP`, `TRANSACTION_STATUS`, `TRANSACTION_MOP_ID`) VALUES (1, 1, 1, '2016-09-12 07:28:29', 1, 1, 0), (2, 1, 1, '2016-09-12 07:29:35', 1, 1, 0), (3, 1, 1, '2016-09-12 07:43:38', 3, 1, 0), (4, 1, 1, '2016-09-12 07:44:39', 1, 1, 0), (5, 1, 1, '2016-09-12 09:49:08', 1, 1, 0), (6, 3, 1, '2016-09-12 10:16:35', 1, 1, 0), (7, 1, 1, '2016-09-15 06:26:36', 1, 1, 14), (8, 1, 1, '2016-09-15 06:38:24', 1, 1, 15), (9, 1, 1, '2016-09-15 06:40:18', 1, 1, 16), (10, 1, 1, '2016-09-15 07:24:20', 1, 1, 17), (11, 1, 1, '2016-09-15 08:02:46', 1, 1, 20), (12, 1, 1, '2016-09-15 08:10:04', 1, 1, 21), (13, 1, 1, '2016-09-15 08:15:01', 1, 1, 22), (14, 1, 1, '2016-09-15 09:18:44', 1, 1, 23), (15, 1, 1, '2016-09-15 09:43:44', 1, 1, 24), (16, 1, 1, '2016-09-15 09:46:01', 1, 1, 26), (17, 5, 1, '2016-09-15 09:46:03', 1, 1, 27), (18, 5, 1, '2016-09-15 10:13:55', 1, 1, 28), (19, 1, 1, '2016-09-15 17:12:48', 1, 1, 29); -- -------------------------------------------------------- -- -- Table structure for table `transaction_detail` -- DROP TABLE IF EXISTS `transaction_detail`; CREATE TABLE `transaction_detail` ( `TD_ID` int(11) NOT NULL, `TRANSACTION_ID` int(11) NOT NULL, `PRODUCT_ID` int(11) NOT NULL, `TD_QTY` int(11) NOT NULL, `TD_TOTAL` double(18,2) NOT NULL, `TD_DESCRIPTION` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `transaction_detail` -- INSERT INTO `transaction_detail` (`TD_ID`, `TRANSACTION_ID`, `PRODUCT_ID`, `TD_QTY`, `TD_TOTAL`, `TD_DESCRIPTION`) VALUES (1, 2, 16, 1, 6980.30, ''), (2, 2, 18, 1, 7226.18, ''), (3, 2, 24, 1, 9572.56, ''), (4, 2, 22, 1, 8056.48, ''), (5, 3, 16, 1, 6980.30, ''), (6, 3, 18, 1, 7226.18, ''), (7, 3, 24, 1, 9572.56, ''), (8, 3, 22, 1, 8056.48, ''), (9, 4, 15, 1, 8357.01, ''), (10, 4, 6, 1, 5497007.00, ''), (11, 5, 6, 1, 5497007.00, ''), (12, 5, 14, 1, 7916.84, ''), (13, 6, 1, 1, 6314.01, ''), (14, 0, 1, 1, 6314.01, ''), (15, 0, 2, 1, 6799.70, ''), (16, 0, 1, 1, 6314.01, ''), (17, 7, 19, 1, 8063.90, ''), (18, 8, 1, 1, 6314.01, ''), (19, 9, 1, 1, 6314.01, ''), (20, 10, 1, 1, 6314.01, ''), (21, 11, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (22, 12, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (23, 12, 2, 1, 6799.70, 'Coopertires 205/65R15C DISCOVERER HT/T3'), (24, 12, 3, 1, 5528.97, 'Coopertires P205/75R15 DISCOVERER H/T'), (25, 12, 19, 1, 8063.90, '8 Black Full Machine Wheels'), (26, 12, 11, 1, 7014.38, 'Motolite Gold'), (27, 12, 13, 1, 7068.61, 'Motolite Truckmaster'), (28, 13, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (29, 13, 2, 1, 6799.70, 'Coopertires 205/65R15C DISCOVERER HT/T3'), (30, 14, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (31, 14, 2, 1, 6799.70, 'Coopertires 205/65R15C DISCOVERER HT/T3'), (32, 0, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (33, 15, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (34, 15, 2, 1, 6799.70, 'Coopertires 205/65R15C DISCOVERER HT/T3'), (35, 15, 3, 1, 5528.97, 'Coopertires P205/75R15 DISCOVERER H/T'), (36, 15, 4, 1, 6309.34, 'Coopertires P215/75R15 DISCOVERER A/T'), (37, 16, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (38, 16, 2, 1, 6799.70, 'Coopertires 205/65R15C DISCOVERER HT/T3'), (39, 16, 3, 1, 5528.97, 'Coopertires P205/75R15 DISCOVERER H/T'), (40, 16, 10, 1, 5625.29, 'Motolite Excel'), (41, 16, 11, 1, 7014.38, 'Motolite Gold'), (42, 16, 12, 1, 6792.07, 'Motolite LM-Enforcer'), (43, 17, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (44, 18, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'), (45, 18, 17, 1, 8336.89, '8 Black Full Machine Wheels'), (46, 19, 1, 1, 6314.01, 'Coopertires 185/60R15C DISCOVERER HT/3'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `USER_ID` int(11) NOT NULL, `USER_FNAME` varchar(255) NOT NULL, `USER_LNAME` varchar(255) NOT NULL, `USER_M_INITIAL` char(1) NOT NULL, `USER_EMAIL` varchar(255) NOT NULL, `USER_PASSWORD` varchar(255) NOT NULL, `USER_ADDRESS` text NOT NULL, `USER_GENDER` int(11) NOT NULL, `USER_CONTACT_NO` varchar(255) NOT NULL, `USER_TYPE_ID` int(11) NOT NULL COMMENT '0-admin | 1-sec | 2- user | 3 -guest', `USER_DELIVERY_NAME` varchar(255) NOT NULL, `USER_DELIVERY_DETAIL` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`USER_ID`, `USER_FNAME`, `USER_LNAME`, `USER_M_INITIAL`, `USER_EMAIL`, `USER_PASSWORD`, `USER_ADDRESS`, `USER_GENDER`, `USER_CONTACT_NO`, `USER_TYPE_ID`, `USER_DELIVERY_NAME`, `USER_DELIVERY_DETAIL`) VALUES (1, 'TEST', 'TEST', '', 'TEST@TEST.COM', 'TEST', '', 0, 'TEST', 2, '', ''), (2, 'ciara', 'mirasol', '', 'ceeyawah@gmail.com', 'tQUISO', '', 0, '4320871', 2, '', ''), (3, 'Nash', 'Mori', '', 'nashmori@ymail.com', 'Haha1234', '', 0, '09173125621', 2, '', ''), (4, 'ADMIN', 'ADMIN', 'A', 'admin@admin.com', 'ADMIN', 'ADMIN ADDRESS', 1, '123456789', 0, '', ''), (5, 'Jon', 'Jan', '', 'jon@gmail.com', '12345', '', 0, '9808908', 2, '', ''); -- -------------------------------------------------------- -- -- Table structure for table `wheel` -- DROP TABLE IF EXISTS `wheel`; CREATE TABLE `wheel` ( `WHEEL_ID` int(11) NOT NULL, `PRODUCT_ID` int(11) NOT NULL, `WHEEL_RIM` varchar(255) NOT NULL, `WHEEL_BRAND` varchar(255) NOT NULL, `WHEEL_COLOR` varchar(255) NOT NULL, `WHEEL_HOLES` int(11) NOT NULL, `WHEEL_IMAGE_FNAME` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `wheel` -- INSERT INTO `wheel` (`WHEEL_ID`, `PRODUCT_ID`, `WHEEL_RIM`, `WHEEL_BRAND`, `WHEEL_COLOR`, `WHEEL_HOLES`, `WHEEL_IMAGE_FNAME`) VALUES (1, 15, '', 'Wheel Master', 'Black Finish Matt', 11, 'wmc.jpg'), (2, 16, '', 'Wheel Master', 'Black Full Machine', 11, 'wmc.jpg'), (3, 17, '', 'Wheel Master', 'Black Full Machine', 8, 'wmc.jpg'), (4, 18, '', 'Wheel Master', 'Black Full Machine', 8, 'WMC 6973 Black Full Machine and MAtt Black = Batch1.jpg'), (5, 19, '', 'Wheel Master', 'Black Full Machine', 8, 'WMC 6973 Black Full Machine and MAtt Black = Batch1.jpg'), (6, 20, '', 'Wheel Master', 'Chrome', 8, 'WMC 517 Chrome = Batch2.jpg'), (7, 21, '', 'Wheel Master', 'Chrome', 8, 'WMC 553 Chrome = Batch2.jpg'), (8, 22, '', 'Wheel Master', 'Chrome', 8, 'WMC 612 Chrome = Batch2.jpg'), (9, 23, '', 'Wheel Master', 'Full Silver', 8, 'WMC 8006 Full Silver = Batch2.jpg'), (10, 24, '', 'Wheel Master', 'Full Silver', 8, 'WMC 8006 Full Silver = Batch2.jpg'), (11, 25, '', 'Wheel Master', 'Full Silver', 8, 'WMC 8006 Full Silver = Batch2.jpg'); -- -- Indexes for dumped tables -- -- -- Indexes for table `battery` -- ALTER TABLE `battery` ADD PRIMARY KEY (`BATTERY_ID`); -- -- Indexes for table `cheque` -- ALTER TABLE `cheque` ADD PRIMARY KEY (`CHEQUE_ID`); -- -- Indexes for table `cod` -- ALTER TABLE `cod` ADD PRIMARY KEY (`COD_ID`); -- -- Indexes for table `comment` -- ALTER TABLE `comment` ADD PRIMARY KEY (`COMMENT_ID`); -- -- Indexes for table `credit_card` -- ALTER TABLE `credit_card` ADD PRIMARY KEY (`CC_ID`); -- -- Indexes for table `product` -- ALTER TABLE `product` ADD PRIMARY KEY (`PRODUCT_ID`); -- -- Indexes for table `rescue` -- ALTER TABLE `rescue` ADD PRIMARY KEY (`RESCUE_ID`); -- -- Indexes for table `temp_transaction_detail` -- ALTER TABLE `temp_transaction_detail` ADD PRIMARY KEY (`TEMP_ID`); -- -- Indexes for table `tire` -- ALTER TABLE `tire` ADD PRIMARY KEY (`TIRE_ID`); -- -- Indexes for table `transaction` -- ALTER TABLE `transaction` ADD PRIMARY KEY (`TRANSACTION_ID`); -- -- Indexes for table `transaction_detail` -- ALTER TABLE `transaction_detail` ADD PRIMARY KEY (`TD_ID`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`USER_ID`); -- -- Indexes for table `wheel` -- ALTER TABLE `wheel` ADD PRIMARY KEY (`WHEEL_ID`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `battery` -- ALTER TABLE `battery` MODIFY `BATTERY_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `cheque` -- ALTER TABLE `cheque` MODIFY `CHEQUE_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `cod` -- ALTER TABLE `cod` MODIFY `COD_ID` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `comment` -- ALTER TABLE `comment` MODIFY `COMMENT_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `credit_card` -- ALTER TABLE `credit_card` MODIFY `CC_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30; -- -- AUTO_INCREMENT for table `product` -- ALTER TABLE `product` MODIFY `PRODUCT_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT for table `rescue` -- ALTER TABLE `rescue` MODIFY `RESCUE_ID` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `temp_transaction_detail` -- ALTER TABLE `temp_transaction_detail` MODIFY `TEMP_ID` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tire` -- ALTER TABLE `tire` MODIFY `TIRE_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `transaction` -- ALTER TABLE `transaction` MODIFY `TRANSACTION_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `transaction_detail` -- ALTER TABLE `transaction_detail` MODIFY `TD_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `USER_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `wheel` -- ALTER TABLE `wheel` MODIFY `WHEEL_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; /*!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
26ee9dd9de5c37f29757c15e1e1cd11490276b2c
SQL
silence-do-good/stress-test-Postgres-and-MySQL
/dump/high/day23/select2002.sql
UTF-8
191
2.78125
3
[]
no_license
SELECT timeStamp, temperature FROM ThermometerObservation WHERE timestamp>'2017-11-22T20:02:00Z' AND timestamp<'2017-11-23T20:02:00Z' AND SENSOR_ID='3db916d7_2525_4ab2_b560_6d1c60ab4ada'
true
99f12dbe3c86f712dd8810902721b31a5cfc195e
SQL
avb1003/MinesBattle
/sql/create_user.sql
UTF-8
1,351
2.625
3
[]
no_license
set @User = 'SomeUser'; set @Pass = 'SomePassword'; set @Database = 'SomeDatabase'; set @Host = 'localhost'; set @s=CONCAT("CREATE USER '",@User, "'@'",@Host,"' IDENTIFIED BY '",@Pass,"'"); PREPARE stmt FROM @s; EXECUTE stmt; set @s=CONCAT("GRANT SELECT (", "Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,", "Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,", "File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,", "Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,", "Execute_priv, Repl_slave_priv, Repl_client_priv", ") ON mysql.user TO '",@User,"'@'",@Host,"'"); PREPARE stmt FROM @s; EXECUTE stmt; set @s=CONCAT("GRANT SELECT ON mysql.db TO '",@User,"'@'",@Host,"'"); PREPARE stmt FROM @s; EXECUTE stmt; set @s=CONCAT("GRANT SELECT ON mysql.host TO '",@User,"'@'",@Host,"'"); PREPARE stmt FROM @s; EXECUTE stmt; set @s=CONCAT("GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)", "ON mysql.tables_priv TO '",@User,"'@'",@Host,"'"); PREPARE stmt FROM @s; EXECUTE stmt; SET @s=CONCAT("CREATE DATABASE ",@Database); PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET @s=CONCAT("GRANT ALL ON ",@Database,".* TO '",@User,"'@'",@Host,"'"); PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
true
609fe6d783c24e2da93696710d6030983672f7c7
SQL
giakhang94/ezbank
/customer_changebanksql.sql
UTF-8
2,092
3.03125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Máy chủ: 127.0.0.1 -- Thời gian đã tạo: Th9 20, 2021 lúc 09:55 AM -- Phiên bản máy phục vụ: 10.4.17-MariaDB -- Phiên bản PHP: 7.3.27 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Cơ sở dữ liệu: `banktree` -- -- -------------------------------------------------------- -- -- Cấu trúc bảng cho bảng `daohan` -- CREATE TABLE `daohan` ( `id` int(11) NOT NULL, `currentBank` text NOT NULL, `hoTen` varchar(150) NOT NULL, `CL` double NOT NULL, `CMND` text NOT NULL, `sdt` text NOT NULL, `TSTC` text NOT NULL, `giatriTTSTC` double NOT NULL, `targetBank` text NOT NULL, `incom` double NOT NULL, `hoKhau` text NOT NULL, `CIC` text NOT NULL, `phapLy` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Đang đổ dữ liệu cho bảng `daohan` -- INSERT INTO `daohan` (`id`, `currentBank`, `hoTen`, `CL`, `CMND`, `sdt`, `TSTC`, `giatriTTSTC`, `targetBank`, `incom`, `hoKhau`, `CIC`, `phapLy`) VALUES (1, 'ACB', 'test', 50, '1', '0025', 'abc', 222, 'VCB', 55, 'abc', 't', 'ok'), (2, 'VCB', 'Testo', 10, '056456', '090328', 'HVH', 200, 'BIDV', 22, '', 'Tốt (không có nợ chú ý, không nợ xấu, không quá hạn thẻ)', 'Độc thân'); -- -- Chỉ mục cho các bảng đã đổ -- -- -- Chỉ mục cho bảng `daohan` -- ALTER TABLE `daohan` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT cho các bảng đã đổ -- -- -- AUTO_INCREMENT cho bảng `daohan` -- ALTER TABLE `daohan` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
efde62b6da338675c628e75c57bc34175f0678e2
SQL
dvasilakis81/fullstack-contract-app
/server/Postgre/Backup/test_sql_scripts.sql
UTF-8
1,208
3.796875
4
[]
no_license
SELECT *, (SELECT COUNT(*) AS "Total" FROM "Ordering"."Contract"), (SELECT json_agg(Account) FROM (SELECT acct."Number",acct."Start",acct."End",acct."AmountPure", acct."AmountFpa", acct."AmountTotal" FROM "Ordering"."Account" as acct WHERE c."Id" = acct."ContractId" ORDER BY acct."Number") Account) AS CreatedAccounts, (SELECT json_agg(ContractType) FROM (SELECT * FROM "Ordering"."ContractType" as ct WHERE c."ContractTypeId" = ct."ContractTypeId") ContractType) AS ContractType, (SELECT json_agg(Direction) FROM (SELECT * FROM "Ordering"."Direction" as dir WHERE c."DirectionId" = dir."DirectionId") Direction) AS Direction, (SELECT json_agg(Department) FROM (SELECT * FROM "Ordering"."Department" as dep WHERE c."DepartmentId" = dep."DepartmentId") Department) AS Department, (SELECT json_agg(ContractUsers) FROM (SELECT * FROM "Ordering"."ContractUsers" as cus WHERE c."Id" = cus."ContractId") ContractUsers) AS ContractUsers FROM "Ordering"."Contract" as c WHERE (c."OwnerId"=4 OR c."AllUsers"=true OR c."OwnerId" IN (SELECT cus."UserId" FROM "Ordering"."ContractUsers" as cus WHERE cus."ContractId"=c."Id") ) ORDER BY c."DateCreated" DESC OFFSET 0 LIMIT 10
true
559cabb668053aca9f1f9c739d7330a419a66f33
SQL
Abhay2021/flash-sales-site
/mvc.sql
UTF-8
5,461
2.875
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 04, 2019 at 03:56 PM -- Server version: 10.1.38-MariaDB -- PHP Version: 7.3.4 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: `mvc` -- -- -------------------------------------------------------- -- -- Table structure for table `deals` -- CREATE TABLE `deals` ( `id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `description` text NOT NULL, `price` float NOT NULL, `discounted_price` float NOT NULL, `quantity` int(11) NOT NULL, `remaining_quantity` int(11) DEFAULT NULL, `publish_date` date NOT NULL, `image` varchar(255) NOT NULL, `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `publish` tinyint(1) DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `deals` -- INSERT INTO `deals` (`id`, `title`, `description`, `price`, `discounted_price`, `quantity`, `remaining_quantity`, `publish_date`, `image`, `added_date`, `publish`) VALUES (1, 'deal today', 'deals awesome', 200, 150, 5, 3, '2019-07-27', 'Penguins.jpg', '2019-08-03 07:06:38', 1), (2, 'super', 'super sale', 350, 250, 3, 0, '2019-08-03', 'Tulips.jpg', '2019-08-03 07:07:23', 1), (3, 'dfvcx', 'v', 250, 150, 11, 9, '2019-08-01', 'Desert.jpg', '2019-08-03 07:07:10', 1); -- -------------------------------------------------------- -- -- Table structure for table `login_attempts` -- CREATE TABLE `login_attempts` ( `id` int(11) NOT NULL, `ip` varchar(20) NOT NULL, `login_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `login_attempts` -- INSERT INTO `login_attempts` (`id`, `ip`, `login_time`) VALUES (1, '127.0.0.1', '2019-08-04 13:25:41'), (2, '127.0.0.1', '2019-08-04 13:25:58'), (3, '127.0.0.1', '2019-08-04 13:26:07'), (4, '127.0.0.1', '2019-08-04 13:26:15'), (5, '127.0.0.1', '2019-08-04 13:26:35'), (6, '127.0.0.1', '2019-08-04 13:29:02'), (7, '127.0.0.1', '2019-08-04 13:36:18'), (8, '127.0.0.1', '2019-08-04 13:52:56'), (9, '127.0.0.1', '2019-08-04 13:53:05'); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `deals_id` int(11) NOT NULL, `quantity` int(11) NOT NULL DEFAULT '1', `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`id`, `user_id`, `deals_id`, `quantity`, `added_date`, `status`) VALUES (1, 2, 1, 1, '2019-07-29 18:21:50', 1), (2, 3, 1, 1, '2019-07-30 04:03:17', 1), (3, 3, 2, 1, '2019-07-30 04:34:49', 1), (4, 2, 2, 1, '2019-07-30 12:53:15', 1), (5, 2, 3, 1, '2019-08-01 07:04:07', 1), (6, 6, 1, 1, '2019-08-03 07:06:21', 1), (7, 6, 3, 1, '2019-08-03 07:06:56', 1), (8, 6, 2, 1, '2019-08-03 07:07:23', 1); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `username` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `image` varchar(255) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '1', `admin` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `email`, `password`, `image`, `active`, `admin`) VALUES (2, 'abhay', 'abhay@gmail.com', '827ccb0eea8a706c4c34a16891f84e7b', NULL, 1, 0), (3, 'vikram', 'vikram@gmail.com', '827ccb0eea8a706c4c34a16891f84e7b', NULL, 1, 0), (4, 'shankar', 'shankar@gmail.com', '827ccb0eea8a706c4c34a16891f84e7b', NULL, 1, 0), (5, 'admin', 'admin@gmail.com', '$2y$10$RbQL1ue43SzvZ3xbbT0YUeaNeyrkvWmtoU3dv4GkzNM8ntzo9D4gi', 'Penguins.jpg', 1, 1), (6, 'smith', 'smith@yahoo.com', '$2y$10$dH4A2N3W83C1gEzKzMfAiuuNul9qRa7z6u/ZxwN7gLAGKK4cCfgJe', 'Tulips.jpg', 1, 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `deals` -- ALTER TABLE `deals` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `publish_date` (`publish_date`); -- -- Indexes for table `login_attempts` -- ALTER TABLE `login_attempts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `username` (`username`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `deals` -- ALTER TABLE `deals` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `login_attempts` -- ALTER TABLE `login_attempts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; 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
b66d3a955ed4ba22ec2e2b9184604ade7f3bc98a
SQL
lundih/SalonServicesDatabase
/QueryTotalTransactionAmount.sql
UTF-8
131
2.625
3
[]
no_license
/* Query to calculate the total amount from transcations */ SELECT SUM(amount) as "Total Amount" FROM styles_studio.TRANSACTION;
true
1b4447d34f48a3777e418a62ae56d06ced8bf33a
SQL
small-rose/distributed-transaction
/boot-hmily-tcc/sql/hmily.sql
UTF-8
5,222
3.359375
3
[ "MIT" ]
permissive
/* Navicat MySQL Data Transfer Source Server : LocalHost Source Server Version : 50731 Source Host : localhost:3306 Source Database : hmily Target Server Type : MYSQL Target Server Version : 50731 File Encoding : 65001 Date: 2020-11-15 15:24:50 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for hmily_lock -- ---------------------------- DROP TABLE IF EXISTS `hmily_lock`; CREATE TABLE `hmily_lock` ( `lock_id` bigint(20) NOT NULL COMMENT '主键id', `trans_id` bigint(20) NOT NULL COMMENT '全局事务id', `participant_id` bigint(20) NOT NULL COMMENT 'hmily参与者id', `resource_id` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资源id', `target_table_name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '锁定目标表名', `target_table_pk` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '锁定表主键', `create_time` datetime NOT NULL COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`lock_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='hmily全局lock表'; -- ---------------------------- -- Records of hmily_lock -- ---------------------------- -- ---------------------------- -- Table structure for hmily_participant_undo -- ---------------------------- DROP TABLE IF EXISTS `hmily_participant_undo`; CREATE TABLE `hmily_participant_undo` ( `undo_id` bigint(20) NOT NULL COMMENT '主键id', `participant_id` bigint(20) NOT NULL COMMENT '参与者id', `trans_id` bigint(20) NOT NULL COMMENT '全局事务id', `resource_id` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资源id,tac模式下为jdbc url', `undo_invocation` longblob NOT NULL COMMENT '回滚调用点', `status` tinyint(4) NOT NULL COMMENT '状态', `create_time` datetime NOT NULL COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`undo_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='hmily事务参与者undo记录,用在AC模式'; -- ---------------------------- -- Records of hmily_participant_undo -- ---------------------------- -- ---------------------------- -- Table structure for hmily_transaction_global -- ---------------------------- DROP TABLE IF EXISTS `hmily_transaction_global`; CREATE TABLE `hmily_transaction_global` ( `trans_id` bigint(20) NOT NULL COMMENT '全局事务id', `app_name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '应用名称', `status` tinyint(4) NOT NULL COMMENT '事务状态', `trans_type` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '事务模式', `retry` int(11) NOT NULL DEFAULT '0' COMMENT '重试次数', `version` int(11) NOT NULL COMMENT '版本号', `create_time` datetime NOT NULL COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`trans_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='hmily事务表(发起者)'; -- ---------------------------- -- Records of hmily_transaction_global -- ---------------------------- -- ---------------------------- -- Table structure for hmily_transaction_participant -- ---------------------------- DROP TABLE IF EXISTS `hmily_transaction_participant`; CREATE TABLE `hmily_transaction_participant` ( `participant_id` bigint(20) NOT NULL COMMENT '参与者事务id', `participant_ref_id` bigint(20) DEFAULT NULL COMMENT '参与者关联id且套调用时候会存在', `trans_id` bigint(20) NOT NULL COMMENT '全局事务id', `trans_type` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '事务类型', `status` tinyint(4) NOT NULL COMMENT '分支事务状态', `app_name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '应用名称', `role` tinyint(4) NOT NULL COMMENT '事务角色', `retry` int(11) NOT NULL DEFAULT '0' COMMENT '重试次数', `target_class` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '接口名称', `target_method` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '接口方法名称', `confirm_method` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'confirm方法名称', `cancel_method` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'cancel方法名称', `confirm_invocation` longblob COMMENT 'confirm调用点', `cancel_invocation` longblob COMMENT 'cancel调用点', `version` int(11) NOT NULL DEFAULT '0', `create_time` datetime NOT NULL COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`participant_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='hmily事务参与者'; -- ---------------------------- -- Records of hmily_transaction_participant -- ----------------------------
true
30ff88f0cafac9d94541b3fc703085a43d3da09c
SQL
smwright/FTC-PAM
/database/views/mission_unit_plane_asset_status.sql
UTF-8
802
3.203125
3
[]
no_license
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`localhost` SQL SECURITY DEFINER VIEW `mission_unit_plane_asset_status` AS SELECT `report`.`deployed_unit_id` AS `depl_unit_id`, `report`.`mission_id` AS `mission_id`, COUNT(`report`.`id`) AS `sorties`, SUM((`report`.`pilot_status` = 0)) AS `pilot_ok`, SUM((`report`.`pilot_status` = 1)) AS `pilot_wounded`, SUM((`report`.`pilot_status` = 2)) AS `pilot_pow`, SUM((`report`.`pilot_status` = 3)) AS `pilot_kia`, SUM((`report`.`asset_status` = 0)) AS `asset_ok`, SUM((`report`.`asset_status` = 1)) AS `asset_damaged`, SUM((`report`.`asset_status` = 2)) AS `asset_lost` FROM `report` GROUP BY `report`.`deployed_unit_id` , `report`.`mission_id`
true
18a6438bcb08ff37d2f91931a9d19c4e270a5fe4
SQL
MattDavid86/cheqbox
/SQLStorage/getCompanyDetails.sql
UTF-8
667
3.203125
3
[ "MIT" ]
permissive
-- -------------------------------------------------------------------------------- -- Routine DDL -- Note: comments before and after the routine body will not be stored by the server -- -------------------------------------------------------------------------------- DELIMITER $$ CREATE PROCEDURE `getCompanyDetails`( in_companyUID VARCHAR(45) ) BEGIN SELECT companyUID, companyName, website, phone, contactFName, contactLName, userUID, email, aboutUs, companyLogo, addressOne, addressTwo, city, province, country, postalCode, termsConditions FROM cm01_company WHERE companyUID = in_companyUID AND dateDeleted IS NULL; END
true
9416d9f202e2e54826e94aa256c6fbd2f42df9be
SQL
lect-ad/sushi_delivery
/data_for_analysis_queries.sql
UTF-8
16,567
4.125
4
[]
no_license
USE sushi_delivery; -- --------------------- -- Делаем выборку клиентов по возрасту (только из тех, кто возраст указал) -- --------------------- SELECT customers.id AS customerID, CONCAT(customers.Firstname, ' ', IFNULL(customers.Lastname, '==Lastname Not Provided==')) AS fullname, ROUND(DATEDIFF(NOW(), BirthDate) / 365.25, 0) AS age, CASE WHEN ROUND(DATEDIFF(NOW(), BirthDate) / 365.25, 0) BETWEEN 0 AND 35 THEN 'Young_people' WHEN ROUND(DATEDIFF(NOW(), BirthDate) / 365.25, 0) BETWEEN 36 AND 60 THEN 'Average_age' ELSE 'Seniors' END AS age_category FROM customers WHERE BirthDate IS NOT NULL ORDER BY age; -- --------------------- -- Выбираем клиентов, у которых больше и меньше всего ВЫПОЛНЕННЫХ заказов -- (больше 13 и меньше 5) -- --------------------- SELECT IF(COUNT(orders.id) > 13, 'more than 13 orders', 'less than 5 orders') AS ordersgroup, customers.id AS customerID, CONCAT(customers.Firstname, ' ', IFNULL(customers.Lastname, '==Lastname Not Provided==')) AS fullname, IFNULL(email, '==Email Not Provided==') AS email, phone, COUNT(orders.id) AS total_orders_fulfilled FROM customers INNER JOIN orders ON customers.id = orders.customer WHERE orders.deliveryaddress IS NOT NULL GROUP BY customers.id HAVING total_orders_fulfilled NOT BETWEEN 5 AND 13 ORDER BY total_orders_fulfilled DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Ищем несоответствия фактического типа платежа указанному при заказе -- и клиентов, у кого таких случаев 3 и более -- -------------------------------- SELECT orders.customer AS customerID, CONCAT(customers.Firstname, ' ', IFNULL(customers.Lastname, '==Lastname Not Provided==')) AS fullname, customers.phone, COUNT(orders.PayMethFact) AS payment_mismatches FROM orders INNER JOIN customers ON orders.Customer = customers.id WHERE orders.PayMethPlan != orders.PayMethFact GROUP BY orders.customer HAVING payment_mismatches > 2 ORDER BY payment_mismatches DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Выясняем, кто из любителей суши является хасководом и к какой возрастной группе он/она относится -- -------------------------------- SELECT customers.id AS customerID, CONCAT(customers.Firstname, ' ', IFNULL(customers.Lastname, '==Lastname Not Provided==')) AS fullname_of_husky_owner, IFNULL(email, '==Email Not Provided==') AS email, phone, CASE WHEN ROUND(DATEDIFF(NOW(), BirthDate) / 365.25, 0) BETWEEN 0 AND 35 THEN 'Young_husky_owner' WHEN ROUND(DATEDIFF(NOW(), BirthDate) / 365.25, 0) BETWEEN 36 AND 60 THEN 'Mature_husky_owner' WHEN ROUND(DATEDIFF(NOW(), BirthDate) / 365.25, 0) > 60 THEN 'Senior_husky_owner' ELSE '==Age_not_Provided==' END AS age_category FROM customers INNER JOIN huskyownershipdict ON huskyownershipdict.id = customers.IsHuskyOwner WHERE huskyownershipdict.HuskyOwnership = 'YES' ORDER BY DATEDIFF(NOW(), BirthDate); -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Выясняем, что наиболее популярно в заказах у хасководов -- -------------------------------- SELECT assortment.Item, COUNT(assortment.Item) AS ordered_times FROM customers INNER JOIN huskyownershipdict ON huskyownershipdict.id = customers.IsHuskyOwner INNER JOIN orders ON orders.customer = customers.id INNER JOIN goodsinorder ON goodsinorder.ForOrder = orders.id INNER JOIN assortment ON assortment.id = goodsinorder.AssortmentID WHERE huskyownershipdict.HuskyOwnership = 'YES' AND orders.DeliveryAddress IS NOT NULL GROUP BY assortment.Item ORDER BY ordered_times DESC; -- И сколько по количеству они заказывают в сравнении с нехасятниками SELECT IF(huskyownershipdict.HuskyOwnership = 'YES', 'Husky_owners', 'Not_husky_owners') AS husky_ownership, SUM(assortment.Price) AS total_orders_price, COUNT(DISTINCT (orders.id)) AS number_of_orders, ROUND(SUM(assortment.Weight) / COUNT(DISTINCT (orders.id)), 1) AS avg_weight_per_order, ROUND(SUM(assortment.Price) / COUNT(DISTINCT (orders.id)), 2) AS avg_price_per_order FROM customers INNER JOIN huskyownershipdict ON huskyownershipdict.id = customers.IsHuskyOwner INNER JOIN orders ON orders.customer = customers.id INNER JOIN goodsinorder ON goodsinorder.ForOrder = orders.id INNER JOIN assortment ON assortment.id = goodsinorder.AssortmentID WHERE orders.DeliveryAddress IS NOT NULL GROUP BY husky_ownership; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Ищем районы, в которых больше и меньше всех заказов -- -------------------------------- SELECT citydistrictsdict.district, COUNT(orders.DeliveryAddress) AS total_orders FROM orders INNER JOIN deliveryaddresses ON orders.DeliveryAddress = deliveryaddresses.id INNER JOIN citydistrictsdict ON deliveryaddresses.CityDistrict = citydistrictsdict.district GROUP BY district ORDER BY total_orders DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------- -- Ищем, какие товары в каких районах города более популярны -- -------------------------- SELECT citydistrictsdict.district, assortment.item, COUNT(goodsinorder.fororder) AS total_orders_of_item_in_district FROM assortment INNER JOIN goodsinorder ON assortment.id = goodsinorder.AssortmentID INNER JOIN orders ON goodsinorder.fororder = orders.id INNER JOIN deliveryaddresses ON orders.deliveryaddress = deliveryaddresses.id INNER JOIN citydistrictsdict ON deliveryaddresses.citydistrict = citydistrictsdict.district GROUP BY citydistrictsdict.district , assortment.item ORDER BY district , total_orders_of_item_in_district DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Ищем самые "денежные" районы по общей и средней сумме заказов в них -- -------------------------------- SELECT district, SUM(cost_of_order) AS total_district_orders_cost, ROUND(AVG(cost_of_order), 2) AS avg_district_orders_cost FROM (SELECT goodsinorder.ForOrder, citydistrictsdict.district, SUM(assortment.price) AS cost_of_order FROM goodsinorder JOIN assortment ON goodsinorder.AssortmentID = assortment.id JOIN orders ON orders.id = goodsinorder.ForOrder JOIN deliveryaddresses ON deliveryaddresses.id = orders.DeliveryAddress JOIN citydistrictsdict ON citydistrictsdict.district = deliveryaddresses.CityDistrict GROUP BY ForOrder) AS sum_per_order GROUP BY district ORDER BY total_district_orders_cost DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Выясняем динамику кол-ва заказов по месяцам -- -------------------------------- SELECT MONTH(StartTime) AS month_num, MONTHNAME(StartTime) AS month, COUNT(orders.id) AS number_of_orders FROM orders INNER JOIN deliverysessions ON orders.DeliverySession = deliverysessions.id GROUP BY month ORDER BY month_num; -- -------------------------------- -- По дням недели -- -------------------------------- SELECT DAYNAME(StartTime) AS day_of_week, COUNT(orders.id) AS number_of_orders FROM orders INNER JOIN deliverysessions ON orders.DeliverySession = deliverysessions.id GROUP BY day_of_week ORDER BY DAYOFWEEK(StartTime); -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- ищем самый (не)популярный метод заказа -- -------------------------------- SELECT orders.orderedvia AS order_method, COUNT(orders.id) AS total_orders FROM orders GROUP BY order_method ORDER BY total_orders DESC; -- ... и оплаты SELECT PayMethFact AS pay_method, COUNT(orders.id) AS total_orders FROM orders WHERE PayMethFact IS NOT NULL GROUP BY pay_method ORDER BY total_orders DESC; -- -------------------------------- -- Выясняем, кто из курьеров доставил больше заказов и отработал -- больше смен (в т.ч. "пустых, без заказов") -- -------------------------------- SELECT couriers.id AS courier_id, CONCAT(FirstName, ' ', LastName) AS courier_fullname, COUNT(DISTINCT (couriersshifts.id)) AS total_shifts_worked, COUNT(orders.DeliveryAddress) AS total_orders_delivered FROM couriers INNER JOIN couriersshifts ON couriers.id = couriersshifts.Courier LEFT JOIN deliverysessions ON couriersshifts.id = deliverysessions.CouriersShift LEFT JOIN orders ON deliverysessions.id = orders.DeliverySession GROUP BY couriers.id ORDER BY total_orders_delivered DESC , total_shifts_worked DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Выясняем, какие курьеры в каких районах сколько заказов выполнили -- -------------------------------- SELECT couriers.id, CONCAT(couriers.FirstName, ' ', couriers.LastName) AS couriers_fullname, CityDistrict, COUNT(orders.DeliveryAddress) AS total_deliveries_in_district FROM couriers INNER JOIN couriersshifts ON couriers.id = couriersshifts.Courier INNER JOIN deliverysessions ON couriersshifts.id = deliverysessions.CouriersShift INNER JOIN orders ON deliverysessions.id = orders.DeliverySession INNER JOIN deliveryaddresses ON orders.DeliveryAddress = deliveryaddresses.id GROUP BY couriers_fullname , CityDistrict ORDER BY couriers.id , total_deliveries_in_district DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Выясняем, из каких ресторанов в какие районы города сколько заказов доставили -- -------------------------------- SELECT CONCAT(restaurantsdict.RestaurantAddr, ' ', restaurantsdict.CityDistrict, ' district') AS Restaurant_and_its_district, deliveryaddresses.CityDistrict AS delivery_district, COUNT(orders.DeliveryAddress) AS total_orders_in_district FROM restaurantsdict INNER JOIN deliverysessions ON restaurantsdict.id = deliverysessions.Restaurant INNER JOIN orders ON deliverysessions.id = orders.DeliverySession INNER JOIN deliveryaddresses ON orders.DeliveryAddress = deliveryaddresses.id GROUP BY Restaurant_and_its_district , delivery_district ORDER BY Restaurant_and_its_district , total_orders_in_district DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Выясняем общее количество выполненных и отмененных заказов -- -------------------------------- SELECT COUNT(orders.DeliveryAddress) AS total_orders_fulfilled, COUNT(orders.id) - COUNT(orders.DeliveryAddress) AS total_orders_canceled FROM orders; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Выясняем время, прошедшее до отмены заказов от их размещения -- -------------------------------- SELECT canceled.Order AS order_id, TIMEDIFF(canceltime, placetime) AS time_passed_before_cancelling FROM (SELECT orderstatushist.Status, orderstatushist.Time AS placetime, orderstatushist.Order FROM orderstatushist INNER JOIN orders ON orderstatushist.order = orders.id INNER JOIN statusdict ON orderstatushist.Status = statusdict.id WHERE statusdict.status = 'Placed') AS placed INNER JOIN (SELECT orderstatushist.Status, orderstatushist.Time AS canceltime, orderstatushist.Order FROM orderstatushist INNER JOIN orders ON orderstatushist.order = orders.id INNER JOIN statusdict ON orderstatushist.Status = statusdict.id WHERE statusdict.status = 'Canceled') AS canceled ON canceled.Order = placed.Order ORDER BY time_passed_before_cancelling DESC; -- -------------------------------- -- И делаем выборку времени, затрачиваемого от размещения заказа до его доставки -- -------------------------------- SELECT fulfilled.Order AS order_id, TIMEDIFF(delivered, placetime) AS delivery_time FROM (SELECT orderstatushist.Status, orderstatushist.Time AS placetime, orderstatushist.Order FROM orderstatushist INNER JOIN orders ON orderstatushist.order = orders.id INNER JOIN statusdict ON orderstatushist.Status = statusdict.id WHERE statusdict.status = 'Placed') AS placed INNER JOIN (SELECT orderstatushist.Status, orderstatushist.Time AS delivered, orderstatushist.Order FROM orderstatushist INNER JOIN orders ON orderstatushist.order = orders.id INNER JOIN statusdict ON orderstatushist.Status = statusdict.id WHERE statusdict.status = 'Fulfilled') AS fulfilled ON fulfilled.Order = placed.Order ORDER BY delivery_time DESC; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Выясняем неоптимальные сессии доставки с т.зр. логистики. -- Принимаем в качестве условия 3 и более районов или -- расстояние более 25 км или -- продолжительности сессии доставки более 1 часа 50 мин -- -------------------------------- SELECT deliverysessions.id AS session_id, StartTime, IF(HOUR(StartTime) BETWEEN 7 AND 22, 'Day', 'Night') AS time_of_day, TIMEDIFF(EndTime, StartTime) AS session_duration, TotalDistance, COUNT(DISTINCT (deliveryaddresses.CityDistrict)) AS number_of_districts_in_session FROM deliverysessions INNER JOIN orders ON deliverysessions.id = orders.DeliverySession INNER JOIN deliveryaddresses ON deliveryaddresses.id = orders.DeliveryAddress GROUP BY deliverysessions.id HAVING number_of_districts_in_session > 2 OR TotalDistance > 25 OR session_duration > '01:50:00'; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------------------------- -- Делаем выборку транспорта по пробегу и сменам -- -------------------------------- SELECT transport.id AS transport_id, CONCAT(transporttypes.Type, ' with Reg/Inv # ', transport.Regnum) AS vehicle, COUNT(DISTINCT (couriersshifts.id)) AS total_shifts_used, SUM(TotalDistance) AS total_kilometrage FROM couriersshifts INNER JOIN transport ON transport.id = couriersshifts.TransportUsed INNER JOIN transporttypes ON transporttypes.id = transport.Type LEFT JOIN deliverysessions ON couriersshifts.id = deliverysessions.CouriersShift GROUP BY transport.id ORDER BY total_kilometrage DESC , total_shifts_used DESC;
true
cfe5744f95b277b1f1597ccb935c784542973773
SQL
LucaContri/dataanalysis
/SFReportEngine/resources/oppLineItem.trigger.sql
UTF-8
387
3
3
[]
no_license
use salesforce; create trigger oppLineItemUpdate before insert on salesforce.opportunity for each row begin update salesforce.opportunitylineitem oli set oli.IsDeleted = 0 where oli.OpportunityId = new.id; update salesforce.sf_tables sft set sft.LastSyncDate = least(sft.LastSyncDate, new.LastModifiedDate) where sft.TableName = 'OpportnityLineItem' and sft.Id=320; end;
true
b2aae0fa9032da25c2aa650e81f2296396190f7e
SQL
dvrpc/CityTranstiPlan_FY20
/2_assign_loads_to_links_RR.sql
UTF-8
3,624
4.25
4
[]
no_license
--this is script 2 for RR, which should actually be run after the RR script labeled #3 --this script assigns loads to model links in sql --BEFORE RUNNING THIS -- run 3_fill_in_fromto_RR to enable this join CREATE TABLE loaded_rail_links AS( WITH tblA AS( SELECT l.*, p.portion FROM lineroutes_linkseq l INNER JOIN lrid_portions p ON l.lrid = p.lrid ) SELECT a.*, r.loads::BIGINT, (r.loads::BIGINT*a.portion) AS load_portion FROM regionalrail_loads_fromto r RIGHT JOIN tblA a ON a.fromto::BIGINT = r.fromto AND a.linename = r.linename WHERE a.lrname LIKE 'sepr%' ORDER BY linename, lrid, lrseq ); COMMIT; --this get's wonky on the trunk lines in/towards the city --see what it looks like if I just apply what I have without doing the loads drop down (py script) --Assumption: ridership distributed across line routes by number of vehicle journeys --Assumption: if more than one stop is on a link (sometimes up to 6), the load is averaged - it is usually very similar ---AFTER PYTHON --summarize and join to geometries to view --line level results -----NOT VERY USEFUL FOR RAIL CREATE TABLE loaded_rail_links_linelevel AS( WITH tblA AS( SELECT no, CONCAT(CAST(fromnodeno AS text), CAST(tonodeno AS text)) AS fromto, r_no, CONCAT(CAST("r_fromno~1" AS text), CAST(r_tonodeno AS text)) AS r_fromto, geom FROM "2015base_link" ), tblB AS( SELECT lrid, tsys, linename, direction, stopsserved, numvehjour, fromto, COUNT(fromto) AS times_used, SUM(CAST(load_portion AS numeric)) AS total_load FROM loaded_rail_links WHERE tsys = 'RR' GROUP BY lrid, tsys, linename, direction, stopsserved, numvehjour, fromto ), tblC AS( SELECT b.*, a.geom, aa.geom AS geom2 FROM tblB b LEFT JOIN tblA a ON b.fromto = a.fromto LEFT JOIN tblA aa ON b.fromto = aa.r_fromto ) SELECT lrid, tsys, linename, direction, stopsserved, numvehjour, fromto, times_used, ROUND(total_load, 0), CASE WHEN geom IS NULL THEN geom2 ELSE geom END AS geometry FROM tblC); COMMIT; --aggregate further (and loose line level attributes) for segment level totals CREATE TABLE loaded_rail_links_segmentlevel AS( WITH tblA AS( SELECT no, CONCAT(CAST(fromnodeno AS text), CAST(tonodeno AS text)) AS fromto, r_no, CONCAT(CAST("r_fromno~1" AS text), CAST(r_tonodeno AS text)) AS r_fromto, geom FROM "2015base_link" ), tblB AS( SELECT fromto, COUNT(fromto) AS times_used, SUM(CAST(load_portion AS numeric)) AS total_load FROM loaded_rail_links WHERE tsys = 'RR' GROUP BY fromto ), tblC AS( SELECT b.*, a.geom, aa.geom AS geom2 FROM tblB b LEFT JOIN tblA a ON b.fromto = a.fromto LEFT JOIN tblA aa ON b.fromto = aa.r_fromto ) SELECT fromto, times_used, ROUND(total_load,0), CASE WHEN geom IS NULL THEN geom2 ELSE geom END AS geometry FROM tblC); COMMIT;
true
f77db07bc688e11b9027c091b2e714cab7141adc
SQL
imooreva/sql-brainbusters
/brainbuster_6.sql
UTF-8
372
4.125
4
[]
no_license
#Last rental date for each customer SELECT concat(c.first_name, ' ', c.last_name) as "Full Name", max(r.rental_date) as "Last Rental" FROM customer c, rental r WHERE c.customer_id = r.customer_id GROUP BY c.customer_id ; #Revenue by month SELECT left(p.payment_date, 7) as Month, sum(p.amount) as Monthly_Revenue FROM payment p GROUP BY 1 ;
true
2f3e38e4ef19f2e6b9a85b63da592ab0eff26131
SQL
zongzhiliu/trial_matching
/scripts/disease/master_patient.sql
UTF-8
2,405
3.953125
4
[]
no_license
/*** Requires: crit_attribute_used _master_sheet, _crit_attribute_logic Results: trial_patient_match */ -- match adjusted with i/e and then mandatory drop table if exists _ie_match cascade; create table _ie_match as select trial_id, person_id, attribute_id , (inclusion is not null) as ie , nvl(inclusion, exclusion) as ie_value , attribute_match , mandatory , case when ie then attribute_match else not attribute_match end as match_adjusted , nvl(match_adjusted, not mandatory) as match_imputed from _master_sheet ; /* select * from _ie_match order by person_id, trial_id, attribute_id limit 100; */ -- collase the ie_match to levels of logic drop table if exists _crit_l1 cascade; create temporary table _crit_l1 as with _crit_l2 as ( select trial_id, person_id, logic_l1, logic_l2 , bool_and(match_imputed) l2_match from _ie_match join _crit_attribute_logic using (attribute_id) group by trial_id, person_id, logic_l1, logic_l2 ) select trial_id, person_id, logic_l1 , bool_or(l2_match) l1_match from _crit_l2 group by trial_id, person_id, logic_l1 ; /* select distinct l1_match from _crit_l1; */ --summary of leaf nodes drop table if exists _leaf_summary; create table _leaf_summary as select attribute_id, trial_id , sum(match_imputed::int) patients from _ie_match group by trial_id, attribute_id ; -- summary of logic_l1 matches drop table if exists v_logic_l1_summary; create table v_logic_l1_summary as with tp as ( select trial_id, count(distinct person_id) total_patients from _crit_l1 group by trial_id ) select logic_l1, trial_id , sum(l1_match::int) patients , patients/total_patients::float as perc_matched from _crit_l1 join tp using (trial_id) group by trial_id, logic_l1, total_patients ; /* select count(*), count(distinct logic_l1), count(distinct trial_id) from v_logic_l1_summary; -- different trial using a variety number of logic1s */ drop table if exists trial_patient_match cascade; create table trial_patient_match as select trial_id, person_id , bool_and(l1_match) patient_match from _crit_l1 group by trial_id, person_id ; drop view if exists v_trial_patient_count cascade; drop view if exists v_trial_patient_count; create view v_trial_patient_count as select trial_id , sum(patient_match::int) patients from trial_patient_match group by trial_id order by patients desc ; /* select * from v_trial_patient_count; */
true
e5bcd0184cacd800fcc43d1734ae239133777fb5
SQL
erezrubinstein/aa
/retail_queries/matching/store_closings_by_long_lat.sql
UTF-8
3,153
4.125
4
[]
no_license
--store closing by long/lat --matching full scale select s0.company_id, c.name, count(distinct s0.id) cntClosedStores from retaildb_test_june2011.dbo.stores s0 with (nolock) inner join retaildb_test_june2011.dbo.addresses a0 with (nolock) on a0.store_id = s0.id inner join retaildb_test_june2011.dbo.companies c with (nolock) on c.id = s0.company_id where not exists ( select 1 from retaildb_test_server.dbo.stores s1 with (nolock) inner join retaildb_test_server.dbo.addresses a1 with (nolock) on a1.store_id = s1.id where s1.company_id = s0.company_id and a1.longitude = a0.longitude and a1.latitude = a0.latitude ) group by s0.company_id, c.name with rollup order by s0.company_id, c.name --17007 total --by long/lat select s0.company_id , c.name , s0.id as store_id , a0.street_number , a0.street , a0.municipality , a0.governing_district , a0.postal_area , s0.opened_on , s0.phone_number , a0.longitude , a0.latitude from retaildb_test_june2011.dbo.stores s0 with (nolock) inner join retaildb_test_june2011.dbo.addresses a0 with (nolock) on a0.store_id = s0.id inner join retaildb_test_june2011.dbo.companies c with (nolock) on c.id = s0.company_id where not exists ( select 1 from retaildb_test_server.dbo.stores s1 with (nolock) inner join retaildb_test_server.dbo.addresses a1 with (nolock) on a1.store_id = s1.id where s1.company_id = s0.company_id and a1.longitude = a0.longitude and a1.latitude = a0.latitude ) --17007 total --round to 4 decimal places --by long/lat rounded to 4 decimal places select s0.company_id , c.name , s0.id as store_id , a0.street_number , a0.street , a0.municipality , a0.governing_district , a0.postal_area , s0.opened_on , s0.phone_number , a0.longitude , a0.latitude from retaildb_test_june2011.dbo.stores s0 with (nolock) inner join retaildb_test_june2011.dbo.addresses a0 with (nolock) on a0.store_id = s0.id inner join retaildb_test_june2011.dbo.companies c with (nolock) on c.id = s0.company_id where not exists ( select 1 from retaildb_test_server.dbo.stores s1 with (nolock) inner join retaildb_test_server.dbo.addresses a1 with (nolock) on a1.store_id = s1.id where s1.company_id = s0.company_id and round(a1.longitude,4) = round(a0.longitude,4) and round(a1.latitude,4) = round(a0.latitude,4) ) --7853 total select s0.company_id , c.name , s0.id as store_id , a0.street_number , a0.street , a0.municipality , a0.governing_district , a0.postal_area , s0.opened_on , s0.phone_number , a0.longitude , a0.latitude , a0.fulladdress , a1.longitude , a1.latitude , a1.fulladdress from retaildb_test_june2011.dbo.stores s0 with (nolock) inner join retaildb_test_june2011.dbo.addresses_vw a0 with (nolock) on a0.store_id = s0.id inner join retaildb_test_june2011.dbo.companies c with (nolock) on c.id = s0.company_id inner join retaildb_test_server.dbo.stores s1 with (nolock) on s1.company_id = s0.company_id inner join retaildb_test_server.dbo.addresses_vw a1 with (nolock) on a1.store_id = s1.id where a1.postal_area = a0.postal_area and round(a1.longitude,4) <> round(a0.longitude,4) and round(a1.latitude,4) <> round(a0.latitude,4)
true
d4e1cf726bff9c9350a168ad273bd013aeb15e73
SQL
SimaAlaverdyan/php-form
/logindb (1).sql
UTF-8
3,881
3.0625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 28, 2020 at 09:14 AM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `logindb` -- -- -------------------------------------------------------- -- -- Table structure for table `comments` -- CREATE TABLE `comments` ( `id` int(100) NOT NULL, `post_id` int(100) NOT NULL, `user_id` int(100) NOT NULL, `comment` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `comments` -- INSERT INTO `comments` (`id`, `post_id`, `user_id`, `comment`) VALUES (77, 9, 30, 'hi'), (78, 10, 30, 'cool!'), (79, 10, 30, 'nice'), (80, 8, 31, 'happy'), (81, 8, 32, 'happy birthday!'), (82, 8, 30, ':D'); -- -------------------------------------------------------- -- -- Table structure for table `posts` -- CREATE TABLE `posts` ( `id` int(10) NOT NULL, `user_id` int(10) NOT NULL, `title` text NOT NULL, `content` varchar(500) NOT NULL, `date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `posts` -- INSERT INTO `posts` (`id`, `user_id`, `title`, `content`, `date`) VALUES (8, 33, 'Congratulations', 'Happy Birthday!', '2020-10-07'), (9, 27, 'Hello World!', 'Hi guyzz!', '2020-10-07'), (10, 32, 'mood', 'feeling great', '2020-10-07'), (11, 30, 'Welcome', 'Hey, how are u?', '2020-10-07'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) NOT NULL, `name` text NOT NULL, `surname` text NOT NULL, `email` text NOT NULL, `password` text NOT NULL, `date` date NOT NULL, `phone` text NOT NULL, `message` varchar(60) NOT NULL, `gender` text NOT NULL, `image` text NOT NULL DEFAULT 'avatar.png' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `surname`, `email`, `password`, `date`, `phone`, `message`, `gender`, `image`) VALUES (27, 'John', 'Smith', 'john@gmail.com', '527bd5b5d689e2c32ae974c6229ff785', '2020-08-03', '55646494', 'macho', 'male', 'av1.jpg'), (30, 'Dean', 'Winchester', 'dean@gmail.com', '48767461cb09465362c687ae0c44753b', '2020-09-06', '25252525', 'supernatural', 'male', 'av3.jpg'), (31, 'Anna', 'Frank', 'anna@gmail.com', 'a70f9e38ff015afaa9ab0aacabee2e13', '2020-08-16', '91919191', '', 'female', 'avatar.png'), (32, 'Jane', 'Eyre', 'jane@gmail.com', '5844a15e76563fedd11840fd6f40ea7b', '2020-09-12', '88448844', 'hhh', 'female', 'av5.png'), (33, 'Jack', 'Brown', 'jack@gmail.com', '4ff9fc6e4e5d5f590c4f2134a8cc96d1', '2020-07-26', '48574821', 'hello world', 'male', 'av4.jpg'); -- -- Indexes for dumped tables -- -- -- Indexes for table `comments` -- ALTER TABLE `comments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `posts` -- ALTER TABLE `posts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `comments` -- ALTER TABLE `comments` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=83; -- -- AUTO_INCREMENT for table `posts` -- ALTER TABLE `posts` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34; 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
d14f0bc3413a3fc543ff4108881de1d0d0765281
SQL
maihao1997/shop
/database/assignment2.sql
UTF-8
17,124
3.21875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 11, 2018 at 08:55 PM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.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: `assignment2` -- -- -------------------------------------------------------- -- -- Table structure for table `category` -- CREATE TABLE `category` ( `id` int(11) NOT NULL, `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `category` -- INSERT INTO `category` (`id`, `name`) VALUES (1, 'women'), (2, 'men'), (3, 'bag'), (4, 'shoes'), (5, 'watches'); -- -------------------------------------------------------- -- -- Table structure for table `coupons` -- CREATE TABLE `coupons` ( `id` int(11) NOT NULL, `content` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `percent` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `coupons` -- INSERT INTO `coupons` (`id`, `content`, `percent`) VALUES (1, 'VNVODICH', 100); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `transaction_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `user_id` int(11) NOT NULL, `total_cost` float NOT NULL, `status` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`transaction_id`, `user_id`, `total_cost`, `status`, `created`) VALUES ('87d4205e3a88759064642518c9124451', 5, 425.79, 'Pending', '2018-12-11 19:29:45'); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(11) NOT NULL, `name` varchar(512) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `price` decimal(10,2) NOT NULL, `kind` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `created` datetime NOT NULL, `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='products that can be added to cart'; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `name`, `description`, `price`, `kind`, `created`, `modified`) VALUES (1, 'Lightweight Jacket', 'Nulla eget sem vitae eros pharetra viverra. Nam vitae luctus ligula. Mauris consequat ornare feugiat.', '58.79', '1', '2018-12-04 15:36:18', '2018-12-04 15:36:18'), (27, 'San Antonio Spurs Kawhi Leonard #2 \nAdidas Black T-Shirt', '&lt;p&gt;Kawhi Leonard San Antonio Spurs T shirt, made by Adidas the official on court producers of NBA apparel and jerseys.&lt;/p&gt;\r\n&lt;p&gt;Leonard and 2 are printed on the back in authentic font.&lt;/p&gt;\r\n&lt;ul&gt;\r\n&lt;li&gt;Basic Print&lt;/li&gt;\r\n&lt;li&gt;Officially licensed NBA Product&lt;/li&gt;\r\n&lt;li&gt;NBA Hologram Sticker&lt;/li&gt;\r\n&lt;li&gt;Mens Sizing&lt;/li&gt;\r\n&lt;li&gt;100% Cotton&lt;/li&gt;\r\n&lt;li&gt;Adidas &quot;Go To Tee&quot;&lt;/li&gt;\r\n&lt;/ul&gt;', '99.99', '2', '2016-10-28 20:49:40', '2016-10-28 05:49:40'), (28, 'LaMarcus Aldridge San Antonio Spurs NBA Adidas Player Black T-Shirt', '&lt;p&gt;Looks like a jersey, wears like a tee -- this 100% cotton Adidas NBA player name and number t-shirt sports screen prints of your favorite player\'s name and number, plus team graphics on the chest.&lt;/p&gt;\r\n&lt;p&gt;Officially licensed by the NBA.&lt;/p&gt;', '49.99', '3', '2016-10-28 20:52:43', '2016-10-28 05:52:43'), (29, 'Tim Duncan San Antonio Spurs Jersey Name and Number T-Shirt', '&lt;p&gt;Cheer on Tim Duncan and the Spurs as they begin their road to repeating as NBA champions.&lt;/p&gt;\r\n&lt;p&gt;Show your support for Duncan and the San Antonio Spurs in your very own black Spurs Name and Number Tee.&lt;/p&gt;', '39.99', '4', '2016-10-28 20:56:23', '2016-10-28 05:56:23'), (30, 'Women\'s Customized San Antonio Spurs Black Replica Basketball Jersey', '&lt;p&gt;San Antonio Spurs Custom Jerseys with any name and number.&lt;/p&gt;\r\n&lt;p&gt;Choose the style and size.&lt;/p&gt;\r\n&lt;p&gt;There\'s no better way to prove your loyalty than to make this jersey your own.&lt;/p&gt;', '45.99', '5', '2016-10-28 20:58:02', '2016-10-28 05:58:02'), (31, 'Klay Thompson Golden State Warriors Jersey Name and Number T-Shirt', '&lt;p&gt;It\'s Splash Time!&lt;/p&gt;\r\n&lt;p&gt;Make sure to show your support for the second half of the splash bros and get your very own Warriors Name and Number Tee.&lt;/p&gt;', '29.99', '1', '2016-10-28 20:59:20', '2016-10-28 05:59:20'), (32, 'Stephen Curry Golden State Warriors #30 NBA Youth Climalite Player T-Shirt Blue', '&lt;p&gt;Featuring your favorite player\'s name and number on back with team logo at front, this Climalite polyester t-shirt provides the ultimate display of pride for a die-hard fan!&lt;/p&gt;', '29.99', '1', '2016-10-28 21:03:19', '2016-10-28 06:03:19'), (33, 'Adidas Men\'s NBA Golden State Warriors-Kevin Durant #35-Mesh Logo T-Shirt', '&lt;p&gt;Show off how excited you are to welcome Kevin Durant to you Golden State Warriors with this Mesh Logo Tee from adidas.&lt;/p&gt;\r\n&lt;p&gt;It features cool graphics made from jersey like mesh and has KD\'s name and number on the back.&lt;/p&gt;\r\n&lt;p&gt;A great look, whether you\'re at the game, or a friends house watching the new look Warriors.&lt;/p&gt;', '29.99', '1', '2016-10-28 21:05:30', '2016-10-28 06:05:30'), (34, 'Klay Thompson Golden State Warriors Charcoal Chinese New Year Name and Number T-shirt', '&lt;p&gt;Cheer on Klay all the way to the NBA Finals in style with this unique Chinese New Year Jersey Name and Number t-shirt by adidas.&lt;/p&gt;', '29.99', '2', '2016-10-28 21:06:34', '2016-10-28 06:06:34'), (35, 'Kevin Durant #35 Women\'s Replica Name and Number Short Sleeve', '&lt;p&gt;Let everyone know who you will be cheering for this season in the adidas U Series high density name &amp;amp; number tee.&lt;/p&gt;\r\n&lt;p&gt;Adidas is the official outfitter of the NBA and this tee is the authentic take down name &amp;amp; number tee of your MVP.&lt;/p&gt;\r\n&lt;p&gt;A high density screen print on a soft cotton tee is a must have for every true NBA fan.&lt;/p&gt;', '32.24', '2', '2016-10-28 21:08:05', '2016-10-28 06:08:05'), (36, 'LeBron James Men\'s Navy Cleveland Cavaliers adidas Swingman Jersey', '&lt;p&gt;Prove you are the #1 LeBron James fan with this Swingman jersey from adidas!&amp;nbsp;&lt;/p&gt;\r\n&lt;p&gt;This Swingman is the ultimate Cleveland Cavaliers jersey. Whether it\'s going to the game, spending time with your friends or anything in-between - this jersey does it all.&amp;nbsp;&lt;/p&gt;\r\n&lt;p&gt;The Swingman includes adidas Climacool &amp;reg; performance mesh fabrication and one layer twill wordmark, name &amp;amp; number applications.&amp;nbsp;&lt;/p&gt;\r\n&lt;p&gt;The NBA Swingman jersey - the most authentic Swingman ever made.&lt;/p&gt;', '109.93', '2', '2016-10-28 21:08:52', '2016-10-28 06:08:52'), (37, 'NBA Cleveland Cavaliers Kyrie Irving #2 Men\'s Replica Jersey', '&lt;p&gt;Detailed to look like a real NBA jersey and priced to make you cheer!&lt;/p&gt;\r\n&lt;p&gt;This quality NBA Adidas Replica Revolution Jersey features screen printed team graphic, screen printed player name and number on the front and back, tagless collar, and embroidered Adidas and NBA logo\'s on the front.&lt;/p&gt;\r\n&lt;p&gt;This new style Adidas replica jersey is made of breathable, easy-care 100% polyester with Clima Cool fabrication. Officially licensed by the NBA.&lt;/p&gt;', '46.99', '2', '2016-10-28 21:09:44', '2016-10-28 06:09:44'), (38, 'Kevin Love Cleveland Cavaliers #0 NBA Youth Road Jersey Wine', '&lt;p&gt;Detailed to look like a real NBA jersey, sized for a youth, and priced to make you cheer!&lt;/p&gt;\r\n&lt;p&gt;This quality NBA Adidas Replica Jersey features screen printed team graphic, screen printed player name and number on the front and back, tagless collar, and embroidered Adidas and NBA logo\'s on the front.&lt;/p&gt;\r\n&lt;p&gt;Perfect for your child or for gift giving. Made of breathable, easy-care 100% polyester with Clima Cool fabrication. Officially licensed by the NBA.', '29.99', '3', '2016-10-28 21:46:06', '2016-10-28 06:46:06'), (40, 'For Mens San Antonio Spurs Kawhi Leonard #2 Cream White Christmas Day Swingman Basketball Jersey', '&lt;p&gt;This is 100% mesh polyester breathable and quick-dry jersey.&lt;/p&gt;\r\n&lt;p&gt;Player name and number graphics deliver classic style. priced to make you cheer.&lt;/p&gt;\r\n&lt;p&gt;It will be the best gift for you or your friend and family.&lt;/p&gt;', '32.00', '3', '2016-11-02 20:15:38', '2016-11-02 05:15:38'); -- -------------------------------------------------------- -- -- Table structure for table `product_images` -- CREATE TABLE `product_images` ( `id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `name` varchar(512) COLLATE utf8_unicode_ci NOT NULL, `created` datetime NOT NULL, `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='image files related to a product'; -- -- Dumping data for table `product_images` -- INSERT INTO `product_images` (`id`, `product_id`, `name`, `created`, `modified`) VALUES (105, 1, 'product-detail-01.jpg', '2018-12-05 10:38:00', '2018-12-04 15:38:41'), (106, 1, 'product-detail-02.jpg', '2018-12-04 15:39:12', '2018-12-04 15:39:12'), (107, 1, 'product-detail-03.jpg', '2018-12-04 15:39:36', '2018-12-04 15:39:36'), (83, 30, 'p41.jpg', '2016-10-28 20:58:02', '2016-10-28 05:58:02'), (82, 29, 'p32.jpg', '2016-10-28 20:56:23', '2016-10-28 05:56:23'), (81, 29, 'p31.jpg', '2016-10-28 20:56:23', '2016-10-28 05:56:23'), (80, 28, 'p22.jpg', '2016-10-28 20:52:43', '2016-10-28 05:52:43'), (79, 28, 'p21.jpg', '2016-10-28 20:52:43', '2016-10-28 05:52:43'), (77, 27, 'p11.jpg', '2016-10-28 20:49:40', '2016-10-28 05:49:40'), (78, 27, 'p12.jpg', '2016-10-28 20:49:40', '2016-10-28 05:49:40'), (84, 31, 'p51.jpg', '2016-10-28 20:59:20', '2016-10-28 05:59:20'), (85, 31, 'p52.jpg', '2016-10-28 20:59:20', '2016-10-28 05:59:20'), (86, 32, 'p61.jpg', '2016-10-28 21:03:19', '2016-10-28 06:03:19'), (87, 32, 'p62.jpg', '2016-10-28 21:03:19', '2016-10-28 06:03:19'), (89, 33, 'p71.jpg', '2016-10-28 21:05:30', '2016-10-28 06:05:30'), (90, 33, 'p72.jpg', '2016-10-28 21:05:30', '2016-10-28 06:05:30'), (91, 34, 'p81.jpg', '2016-10-28 21:06:34', '2016-10-28 06:06:34'), (92, 34, 'p82.jpg', '2016-10-28 21:06:34', '2016-10-28 06:06:34'), (93, 34, 'p83.jpg', '2016-10-28 21:06:34', '2016-10-28 06:06:34'), (94, 35, 'p91.jpg', '2016-10-28 21:08:05', '2016-10-28 06:08:05'), (95, 35, 'p92.jpg', '2016-10-28 21:08:05', '2016-10-28 06:08:05'), (96, 36, 'p101.jpg', '2016-10-28 21:08:52', '2016-10-28 06:08:52'), (97, 36, 'p102.jpg', '2016-10-28 21:08:52', '2016-10-28 06:08:52'), (98, 36, 'p103.jpg', '2016-10-28 21:08:52', '2016-10-28 06:08:52'), (99, 37, 'p111.jpg', '2016-10-28 21:09:44', '2016-10-28 06:09:44'), (100, 37, 'p112.jpg', '2016-10-28 21:09:44', '2016-10-28 06:09:44'), (101, 37, 'p113.jpg', '2016-10-28 21:09:44', '2016-10-28 06:09:44'), (102, 38, 'p121.jpg', '2016-10-28 21:46:06', '2016-10-28 06:46:06'), (103, 38, 'p122.jpg', '2016-10-28 21:46:06', '2016-10-28 06:46:06'), (104, 40, 'p131.jpg', '2016-11-02 20:15:38', '2016-11-02 05:15:38'), (51, 14, 'gardman-r687-4-tier-mini-greenhouse-1.jpg', '0000-00-00 00:00:00', '2015-03-19 01:45:42'), (52, 14, 'gardman-r687-4-tier-mini-greenhouse-2.jpg', '0000-00-00 00:00:00', '2015-03-19 01:45:42'), (53, 15, 'spalding-nba-street-basketball-1.jpg', '0000-00-00 00:00:00', '2015-03-19 01:48:34'), (54, 16, 'bandai-hobby-thousand-sunny-model-ship-one-piece-grand-ship-collection-1.jpg', '0000-00-00 00:00:00', '2015-03-19 02:02:25'), (55, 16, 'bandai-hobby-thousand-sunny-model-ship-one-piece-grand-ship-collection-2.jpg', '0000-00-00 00:00:00', '2015-03-19 02:02:25'), (56, 16, 'bandai-hobby-thousand-sunny-model-ship-one-piece-grand-ship-collection-3.jpg', '0000-00-00 00:00:00', '2015-03-19 02:02:25'), (57, 16, 'bandai-hobby-thousand-sunny-model-ship-one-piece-grand-ship-collection-4.jpg', '0000-00-00 00:00:00', '2015-03-19 02:02:25'), (59, 17, 'bandai-tamashii-nations-nami-new-world-ver-one-piece-figuartszero-bandai-tamashii-nations-2.jpg', '0000-00-00 00:00:00', '2015-03-19 02:07:20'), (73, 17, '29097235540_b2fefed80d_k.jpg', '2016-09-17 22:01:17', '2016-09-17 07:01:17'), (74, 25, '14194449_1363884933625826_1306807357_n.jpg', '2016-09-18 01:03:15', '2016-09-17 10:03:15'), (61, 17, 'bandai-tamashii-nations-nami-new-world-ver-one-piece-figuartszero-bandai-tamashii-nations-4.jpg', '0000-00-00 00:00:00', '2015-03-19 02:07:20'), (71, 17, 'bandai-tamashii-nations-nami-new-world-ver-one-piece-figuartszero-bandai-tamashii-nations-5.jpg', '2016-08-17 15:53:17', '2016-08-17 00:53:17'), (67, 19, 'products.jpg', '0000-00-00 00:00:00', '2015-03-25 20:29:34'), (69, 20, 'tp-link-mr3420-2.jpg', '2016-08-08 14:12:59', '2016-08-07 23:12:59'), (70, 21, 'd-link-universal-modem.jpg', '2016-08-08 14:24:19', '2016-08-07 23:24:19'), (75, 25, '29097235540_b2fefed80d_k.jpg', '2016-09-18 01:03:15', '2016-09-17 10:03:15'), (76, 20, 'aaa.png', '2016-10-13 16:31:58', '2016-10-13 01:31:58'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `userName` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `forgot_pass_identity` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `firstName` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `lastName` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `type` int(11) DEFAULT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `userName`, `password`, `email`, `forgot_pass_identity`, `firstName`, `lastName`, `type`, `modified`) VALUES (5, 'root', '25d55ad283aa400af464c76d713c07ad', 'root@gmail.com', '', 'Nguyens', 'Công Phuong1', 2, '2018-12-11 20:41:49'), (6, 'toan', 'e10adc3949ba59abbe56e057f20f883e', 'toanbku@gmail.com', 'fb7a2fbae3c9d598cb2e905ffdbb5096', 'Nguyễn Phương', 'Vương', 1, '2018-12-11 19:23:15'), (14, 'aaa', 'e10adc3949ba59abbe56e057f20f883e', 'aa@gmail.com', '', 'Ho', 'Quang Toan', 1, '0000-00-00 00:00:00'), (18, 'phuongvuong', 'e10adc3949ba59abbe56e057f20f883e', 'phuongvuong@gmail.com', '', 'Phuong', 'Vuong', 1, '0000-00-00 00:00:00'), (19, 'vana', 'e10adc3949ba59abbe56e057f20f883e', 'asssa@gmail.com', '', 'Nguyễn Văn', 'Toàn1', 1, '2018-12-11 19:20:03'), (20, 'hcmut', 'e10adc3949ba59abbe56e057f20f883e', '1613594@hcmut.edu.vn', '0fc2388693f5b78b6baa1c7bf55d502a', 'Quang', 'Toan', 1, '2018-12-11 18:19:08'), (21, 'viethung', 'e10adc3949ba59abbe56e057f20f883e', 'viethungcse@gmail.com', '', 'Nguyen', 'Viet Hung', 1, '0000-00-00 00:00:00'), (22, 'thib', '827ccb0eea8a706c4c34a16891f84e7b', 'tranthib@gmail.com', '', 'Tran', 'Thi B', 1, '0000-00-00 00:00:00'), (23, 'thic', 'e10adc3949ba59abbe56e057f20f883e', 'thic@gmail.com', '', 'Phan Thi', 'CC', 1, '0000-00-00 00:00:00'); -- -- Indexes for dumped tables -- -- -- Indexes for table `category` -- ALTER TABLE `category` ADD PRIMARY KEY (`id`); -- -- Indexes for table `coupons` -- ALTER TABLE `coupons` ADD PRIMARY KEY (`id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`transaction_id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_images` -- ALTER TABLE `product_images` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `userName` (`userName`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `category` -- ALTER TABLE `category` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `coupons` -- ALTER TABLE `coupons` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42; -- -- AUTO_INCREMENT for table `product_images` -- ALTER TABLE `product_images` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=108; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; 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
c4f1d487f4abad36a263f32fb25661bae8fc17be
SQL
Aarchi-Ayoub/Gestion-d-assurance
/assurance.sql
UTF-8
12,311
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1 -- Généré le : sam. 20 juin 2020 à 15:14 -- Version du serveur : 10.4.11-MariaDB -- Version de PHP : 7.2.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de données : `assurance` -- -- -------------------------------------------------------- -- -- Structure de la table `comment` -- CREATE TABLE `comment` ( `idCmt` int(11) NOT NULL, `idClt` int(11) NOT NULL, `idOfr` int(11) NOT NULL, `cmt` text NOT NULL, `activate` int(11) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `comment` -- INSERT INTO `comment` (`idCmt`, `idClt`, `idOfr`, `cmt`, `activate`) VALUES (3, 19, 3, 'test comment 2', 1), (5, 30, 6, 'nklbnklbklbn', 0); -- -------------------------------------------------------- -- -- Structure de la table `form` -- CREATE TABLE `form` ( `idFrm` int(11) NOT NULL, `idAsr` int(11) NOT NULL, `idClt` int(11) NOT NULL, `idRes` int(11) NOT NULL, `debut` date NOT NULL, `fin` date NOT NULL, `paye` float NOT NULL, `reste` float NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `form` -- INSERT INTO `form` (`idFrm`, `idAsr`, `idClt`, `idRes`, `debut`, `fin`, `paye`, `reste`) VALUES (13, 2, 19, 8, '0000-00-00', '0000-00-00', 1700, 100), (14, 4, 19, 8, '0000-00-00', '0000-00-00', 1000, 100), (15, 2, 30, 1, '0000-00-00', '0000-00-00', 1200, 80); -- -------------------------------------------------------- -- -- Structure de la table `formlog` -- CREATE TABLE `formlog` ( `idL` int(11) NOT NULL, `idF` int(11) NOT NULL, `nature` varchar(50) NOT NULL, `etages` int(11) NOT NULL, `surrface` int(11) NOT NULL, `pieces` int(11) NOT NULL, `annexe` varchar(50) NOT NULL, `securite` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `formloi` -- CREATE TABLE `formloi` ( `idLoi` int(11) NOT NULL, `idF` int(11) NOT NULL, `activite` varchar(50) NOT NULL, `club` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `formloi` -- INSERT INTO `formloi` (`idLoi`, `idF`, `activite`, `club`) VALUES (2, 13, 'Saut parachute', 'FAR'); -- -------------------------------------------------------- -- -- Structure de la table `forms` -- CREATE TABLE `forms` ( `idS` int(11) NOT NULL, `idF` int(11) NOT NULL, `RIB` varchar(50) NOT NULL, `caisse` varchar(50) NOT NULL, `naissance` date NOT NULL, `nss` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `formv` -- CREATE TABLE `formv` ( `idV` int(11) NOT NULL, `idF` int(11) NOT NULL, `categorie` varchar(50) NOT NULL, `usage` varchar(50) NOT NULL, `km` int(11) NOT NULL, `marque` varchar(50) NOT NULL, `model` varchar(50) NOT NULL, `annee` int(11) NOT NULL, `matricule` varchar(50) NOT NULL, `permis` varchar(50) NOT NULL, `vitesse` int(11) NOT NULL, `cheveaux` int(11) NOT NULL, `Carbirant` varchar(40) NOT NULL, `carteGris` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `formv` -- INSERT INTO `formv` (`idV`, `idF`, `categorie`, `usage`, `km`, `marque`, `model`, `annee`, `matricule`, `permis`, `vitesse`, `cheveaux`, `Carbirant`, `carteGris`) VALUES (2, 13, 'Auto', 'Profesionnel', 500, 'Mercedes', 'E-350', 2015, '6500A1', 'A12345', 6, 50, 'Diesel', 'A12345'), (3, 15, 'Auto', 'Personnel', 240000, 'Volkswagen', 'Passat ', 2010, '6500A1', 'A12345', 6, 30, 'diesel', 'A12345'); -- -------------------------------------------------------- -- -- Structure de la table `insurance` -- CREATE TABLE `insurance` ( `idAsr` int(11) NOT NULL, `Nom` varchar(50) CHARACTER SET utf8 NOT NULL, `Image` varchar(150) CHARACTER SET utf8 NOT NULL, `Description` text CHARACTER SET utf8 NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Déchargement des données de la table `insurance` -- INSERT INTO `insurance` (`idAsr`, `Nom`, `Image`, `Description`) VALUES (1, 'Home', 'assur-logement.jpg', 'Do you own or rent? Discover our home insurance and protect your home, according to your needs and your budget.'), (2, 'Vechil', 'assur-auto.png', 'Insurance which guarantees you full cover in the event of a claim, while respecting your budget.'), (3, 'Helath', 'assur-santé.png', 'Your health capital and that of your family are precious and deserve the best international medical plan.'), (4, 'Hobbies', 'assur-loisir.jpg', 'The purpose of our insurance is to guarantee policyholders lifetime coverage for expenses incurred following hospitalization following an illness or accident. With Health Plus coverage, you and your loved ones are supported in the event of hospitalization in Morocco or abroad.\r\n\r\nWith the Liability guarantee, exercise your hobby in peace. The guarantee covers the financial consequences of all damage caused in the exercise of your leisure and engaging your responsibility.\r\n'); -- -------------------------------------------------------- -- -- Structure de la table `offer` -- CREATE TABLE `offer` ( `idOfr` int(11) NOT NULL, `idAsr` int(11) NOT NULL, `description` text NOT NULL, `tarif` float NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `offer` -- INSERT INTO `offer` (`idOfr`, `idAsr`, `description`, `tarif`) VALUES (1, 2, 'Tous risque', 1700), (3, 4, 'Chasse', 1500), (4, 1, 'Vol', 1200), (5, 3, 'Corona', 1500), (6, 2, 'Vol', 1000), (7, 2, ' n', 1500), (8, 4, 'Dive', 700), (12, 4, 'ARM', 2020), (18, 3, 'BIP', 2016), (20, 3, 'BIP', 2016), (21, 4, 'ARM', 2020), (22, 3, 'DEV', 20000); -- -------------------------------------------------------- -- -- Structure de la table `user` -- CREATE TABLE `user` ( `idUser` int(11) NOT NULL, `Nom` varchar(25) NOT NULL, `Prenom` varchar(25) NOT NULL, `Email` varchar(50) NOT NULL, `Tel` varchar(10) DEFAULT NULL, `Adresse` text NOT NULL, `Password` varchar(25) NOT NULL, `Avatar` varchar(50) NOT NULL, `GroupID` int(1) NOT NULL DEFAULT 0, `Activate` int(1) NOT NULL DEFAULT 0, `Added` date NOT NULL, `Updated` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `user` -- INSERT INTO `user` (`idUser`, `Nom`, `Prenom`, `Email`, `Tel`, `Adresse`, `Password`, `Avatar`, `GroupID`, `Activate`, `Added`, `Updated`) VALUES (1, 'Aarchi', 'Ayoub', 'ayoubaa084@gmail.com', '0609019455', 'Hay Salam Bloc 22 N°670 SALE-11000', '12415212', 'Aarchi-Ayoub-2_download.png', 1, 1, '2020-05-27', '2020-05-29'), (8, 'Boujnane', 'Zineb', 'boujnanezineb@gmail.com', '0600000001', 'Petit prince salé', '2014/2015', 'Boujnane-Zineb-259277_192105.jpg', 2, 1, '2020-05-29', '2020-05-30'), (18, 'Boujir', 'Tarik', 'ta.rik@bjr.com', '0600000011', 'Meknes', 'Boujir@Tarik', '', 0, 1, '2020-06-03', '0000-00-00'), (19, 'Aarchi', 'Jamal', 'jamalaar@gmail.com', '0661606179', '1 ere BIP Maamoura SALE', 'Aarchi@Jamal', '', 0, 1, '2020-06-03', '0000-00-00'), (28, 'Boujir', 'Anass', 'anas@bjr.com', NULL, '', 'rbt_mkns', '', 0, 0, '2020-06-16', '2020-06-16'), (29, 'Boujir', 'Salma', 'slm@bjr.fr', NULL, '', 'EMI', '', 0, 0, '2020-06-16', '2020-06-16'), (30, 'Boujir', 'Ibrahim', 'ibr@bjr.com', '0600000111', 'Kenitra', 'kenitra', 'Boujir-Ibrahim-352957_profil-linkedin-300x300.jpg', 0, 0, '2020-06-16', '2020-06-16'), (31, 'Khaidar', 'Chaimaa', 'khaidar.ch@gmail.com', '0101100100', 'CasaBlanca', 'Khaidar@Chaimaa', '', 0, 1, '2020-06-20', '0000-00-00'); -- -- Index pour les tables déchargées -- -- -- Index pour la table `comment` -- ALTER TABLE `comment` ADD PRIMARY KEY (`idCmt`), ADD KEY `idClt` (`idClt`), ADD KEY `idOfr` (`idOfr`); -- -- Index pour la table `form` -- ALTER TABLE `form` ADD PRIMARY KEY (`idFrm`), ADD KEY `fk_clt` (`idClt`), ADD KEY `fk_res` (`idRes`), ADD KEY `fk_asr` (`idAsr`); -- -- Index pour la table `formlog` -- ALTER TABLE `formlog` ADD PRIMARY KEY (`idL`), ADD KEY `formlog_ibfk_1` (`idF`); -- -- Index pour la table `formloi` -- ALTER TABLE `formloi` ADD PRIMARY KEY (`idLoi`), ADD KEY `formloi_ibfk_1` (`idF`); -- -- Index pour la table `forms` -- ALTER TABLE `forms` ADD PRIMARY KEY (`idS`), ADD KEY `forms_ibfk_1` (`idF`); -- -- Index pour la table `formv` -- ALTER TABLE `formv` ADD PRIMARY KEY (`idV`), ADD KEY `formv_ibfk_1` (`idF`); -- -- Index pour la table `insurance` -- ALTER TABLE `insurance` ADD PRIMARY KEY (`idAsr`); -- -- Index pour la table `offer` -- ALTER TABLE `offer` ADD PRIMARY KEY (`idOfr`), ADD KEY `fk_ins` (`idAsr`); -- -- Index pour la table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`idUser`), ADD UNIQUE KEY `u_email` (`Email`), ADD UNIQUE KEY `u_tel` (`Tel`); -- -- AUTO_INCREMENT pour les tables déchargées -- -- -- AUTO_INCREMENT pour la table `comment` -- ALTER TABLE `comment` MODIFY `idCmt` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT pour la table `form` -- ALTER TABLE `form` MODIFY `idFrm` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT pour la table `formlog` -- ALTER TABLE `formlog` MODIFY `idL` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT pour la table `formloi` -- ALTER TABLE `formloi` MODIFY `idLoi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT pour la table `forms` -- ALTER TABLE `forms` MODIFY `idS` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT pour la table `formv` -- ALTER TABLE `formv` MODIFY `idV` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT pour la table `insurance` -- ALTER TABLE `insurance` MODIFY `idAsr` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT pour la table `offer` -- ALTER TABLE `offer` MODIFY `idOfr` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; -- -- AUTO_INCREMENT pour la table `user` -- ALTER TABLE `user` MODIFY `idUser` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32; -- -- Contraintes pour les tables déchargées -- -- -- Contraintes pour la table `comment` -- ALTER TABLE `comment` ADD CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`idClt`) REFERENCES `user` (`idUser`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `comment_ibfk_2` FOREIGN KEY (`idOfr`) REFERENCES `offer` (`idOfr`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `form` -- ALTER TABLE `form` ADD CONSTRAINT `fk_asr` FOREIGN KEY (`idAsr`) REFERENCES `insurance` (`idAsr`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_clt` FOREIGN KEY (`idClt`) REFERENCES `user` (`idUser`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_res` FOREIGN KEY (`idRes`) REFERENCES `user` (`idUser`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `formlog` -- ALTER TABLE `formlog` ADD CONSTRAINT `formlog_ibfk_1` FOREIGN KEY (`idF`) REFERENCES `form` (`idFrm`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `formloi` -- ALTER TABLE `formloi` ADD CONSTRAINT `formloi_ibfk_1` FOREIGN KEY (`idF`) REFERENCES `form` (`idFrm`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `forms` -- ALTER TABLE `forms` ADD CONSTRAINT `forms_ibfk_1` FOREIGN KEY (`idF`) REFERENCES `form` (`idFrm`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `formv` -- ALTER TABLE `formv` ADD CONSTRAINT `formv_ibfk_1` FOREIGN KEY (`idF`) REFERENCES `form` (`idFrm`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `offer` -- ALTER TABLE `offer` ADD CONSTRAINT `fk_ins` FOREIGN KEY (`idAsr`) REFERENCES `insurance` (`idAsr`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
5eae329c65180408148be1dd5d7f0f4c46570ffd
SQL
pabbloacevedog/store
/bd/store_bd.sql
UTF-8
4,410
3.140625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.6 -- https://www.phpmyadmin.net/ -- -- Servidor: localhost -- Tiempo de generación: 15-06-2018 a las 23:51:28 -- Versión del servidor: 5.7.17-log -- Versión de PHP: 5.6.30 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 */; -- -- Base de datos: `store_bd` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `carrusel` -- CREATE TABLE `carrusel` ( `id_imagen` int(11) NOT NULL, `nombre` varchar(500) NOT NULL, `ruta` varchar(5000) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `categoria` -- CREATE TABLE `categoria` ( `id_categoria` int(11) NOT NULL, `nombre` varchar(50) NOT NULL, `descripcion` varchar(500) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `categoria` -- INSERT INTO `categoria` (`id_categoria`, `nombre`, `descripcion`) VALUES (1, 'usuario', 'usuario basico, es el usuario principal, puede crear perfiles y subir sus datos personales'), (2, 'empresa', 'usuario que vende productos'), (3, 'administrador', 'usuario con todos los permisos que administra toda la pagina '); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `producto` -- CREATE TABLE `producto` ( `id_producto` int(11) NOT NULL, `nombre` varchar(500) NOT NULL, `descripcion` varchar(5000) NOT NULL, `precio` int(11) NOT NULL, `cantidad` int(11) NOT NULL, `id_categoria` int(11) NOT NULL, `imagen` varchar(200) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `user` -- CREATE TABLE `user` ( `id_user` int(20) NOT NULL, `usuario` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `id_tipo_perfil` int(11) NOT NULL, `foto_perfil` varchar(255) DEFAULT NULL, `verificado` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `user` -- INSERT INTO `user` (`id_user`, `usuario`, `email`, `password`, `id_tipo_perfil`, `foto_perfil`, `verificado`) VALUES (1, 'pag', 'pagdev@gmail.com', '$2b$10$vx1EG6hjTSbLm/NgjgsmGeR8gw71YXUQ8YHP12PP0AwtEYkoSbpTK', 1, '../../../static/generico.jpg', 0), (4, 'usuario1', 'usuario1@gmail.com', '$2b$10$2pQbh.vyBr4MryGY2uTga.cKppF.4qOD1hM1RTFPwbLqMrAbW8scK', 1, NULL, 0), (5, 'user', 'user@gmail.com', '$2b$10$Bp9AtA2h/6jaOybqnhgd6.8eF6uyn8SbL/3QwaNa9LPtjFGLKFjXG', 1, NULL, 0), (6, 'usuario3', 'usuario3@gmail.com', '$2b$10$4nhoHfUbZC5qg0so2B6i0ucHkceHe7IOv0jmcVL.yJEhxOXmTVNt.', 2, NULL, 0), (7, 'usuario4', 'usuario4@gmail.com', '$2b$10$zHrcAFFm1qXjCzJKie24COAcoNGJ4N3aQuHxfA2E4TKi9Wucmcghq', 2, NULL, 0), (8, 'usuario5', 'usuario5@gmail.com', '$2b$10$BS3EmfKHFs.BpIVT/G3/D.Y7bTYyMSWfj3lt.BdHqiq113tLVaRB.', 2, NULL, 0), (9, 'usuario6', 'usuario6@gmail.com', '$2b$10$L1zOdkfNxALK6Wkw7OG8juWixIVoZL8Vmv.UHdp0PgG8TEWZskrly', 2, NULL, 0), (10, 'usuarioP', 'usuarioP@gmail.com', '$2b$10$kYk1O0WppkEJiAeaGCAXWelYkcYh6rU3tWgUvQ8NSnNuEeoSBGWWO', 1, '../../../static/generico.jpg', 0), (11, 'prueba1', 'prueba1@gmail.com', '$2b$10$x/sGvzhfWFf6NesCiFoOqOmzHV3O3yT.lRvanIKKLVNEsi3B1hXrC', 2, '../../../static/generico.jpg', 0), (12, 'prueba2', 'prueba2@gmail.com', '$2b$10$Suq2KcWe0tIgrLVK/fw8pOXn8jz8mkokHl3vPQXTihtEFwJptzx9O', 1, '../../../static/generico.jpg', 0), (13, 'prueba3', 'prueba3@gmail.com', '$2b$10$rlp.IYkqqy8AbRO/a1CM1etqgbTkDIHJxNCKDV84nkFRaZVvS/KV2', 1, '../../../static/generico.jpg', 0); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `carrusel` -- ALTER TABLE `carrusel` ADD PRIMARY KEY (`id_imagen`); -- -- Indices de la tabla `categoria` -- ALTER TABLE `categoria` ADD PRIMARY KEY (`id_categoria`); -- -- Indices de la tabla `producto` -- ALTER TABLE `producto` ADD PRIMARY KEY (`id_producto`); -- -- Indices de la tabla `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id_user`), ADD KEY `perfil_user` (`id_tipo_perfil`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `carrusel` -- ALTER TABLE `carrusel` MODIFY `id_imagen` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `producto` -- ALTER TABLE `producto` MODIFY `id_producto` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `user` -- ALTER TABLE `user` MODIFY `id_user` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; /*!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
80bab3d7084a2e6f5a051d898cbc667fc930c649
SQL
EsdyTech/Student_Result_Grading
/database/resultgrading.sql
UTF-8
15,667
3.15625
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3308 -- Generation Time: Nov 20, 2020 at 10:28 AM -- Server version: 5.7.31 -- PHP Version: 7.3.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `resultgrading` -- -- -------------------------------------------------------- -- -- Table structure for table `tbladmin` -- DROP TABLE IF EXISTS `tbladmin`; CREATE TABLE IF NOT EXISTS `tbladmin` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `firstName` varchar(255) NOT NULL, `lastName` varchar(255) NOT NULL, `otherName` varchar(255) NOT NULL, `emailAddress` varchar(255) NOT NULL, `phoneNo` varchar(20) NOT NULL, `password` varchar(255) NOT NULL, `staffId` varchar(255) NOT NULL, `adminTypeId` int(20) NOT NULL, `isAssigned` int(10) NOT NULL, `isPasswordChanged` int(10) NOT NULL, `dateCreated` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbladmin` -- INSERT INTO `tbladmin` (`Id`, `firstName`, `lastName`, `otherName`, `emailAddress`, `phoneNo`, `password`, `staffId`, `adminTypeId`, `isAssigned`, `isPasswordChanged`, `dateCreated`) VALUES (1, 'Admin', 'Admin', 'Admin', 'admin@gmail.com', '09000088899', 'admin', 'STAF000001', 1, 1, 0, ''); -- -------------------------------------------------------- -- -- Table structure for table `tbladmintype` -- DROP TABLE IF EXISTS `tbladmintype`; CREATE TABLE IF NOT EXISTS `tbladmintype` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `adminTypeName` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbladmintype` -- INSERT INTO `tbladmintype` (`Id`, `adminTypeName`) VALUES (1, 'Super Administrator'), (2, 'Administrator'); -- -------------------------------------------------------- -- -- Table structure for table `tblcgparesult` -- DROP TABLE IF EXISTS `tblcgparesult`; CREATE TABLE IF NOT EXISTS `tblcgparesult` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `matricNo` varchar(50) NOT NULL, `cgpa` varchar(50) NOT NULL, `classOfDiploma` varchar(50) NOT NULL, `dateAdded` varchar(50) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblcgparesult` -- INSERT INTO `tblcgparesult` (`Id`, `matricNo`, `cgpa`, `classOfDiploma`, `dateAdded`) VALUES (5, 'NCSF/15/0002', '2.67', 'Lower Credit', '2020-09-23'), (4, 'NCSF/15/0001', '3.23', 'Upper Credit', '2020-09-23'); -- -------------------------------------------------------- -- -- Table structure for table `tblcourse` -- DROP TABLE IF EXISTS `tblcourse`; CREATE TABLE IF NOT EXISTS `tblcourse` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `courseTitle` varchar(255) NOT NULL, `courseCode` varchar(255) NOT NULL, `courseUnit` int(10) NOT NULL, `facultyId` varchar(255) NOT NULL, `departmentId` varchar(255) NOT NULL, `levelId` varchar(10) NOT NULL, `semesterId` varchar(20) NOT NULL, `dateAdded` varchar(50) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=50 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblcourse` -- INSERT INTO `tblcourse` (`Id`, `courseTitle`, `courseCode`, `courseUnit`, `facultyId`, `departmentId`, `levelId`, `semesterId`, `dateAdded`) VALUES (29, 'Introduction to Computing', 'COM111', 3, '1', '1', '1', '1', '2020-09-21'), (30, 'Introduction to Programming', 'COM113', 3, '1', '1', '1', '1', '2020-09-21'), (31, 'Introduction to Digital Electronics', 'COM112', 3, '1', '1', '1', '1', '2020-09-21'), (32, 'Business Mathematics', 'BAM111', 3, '3', '3', '1', '1', '2020-09-21'), (33, 'Taxation', 'BAM112', 2, '3', '3', '1', '1', '2020-09-21'), (34, 'Descriptive Statistics 1', 'STA111', 2, '1', '1', '1', '1', '2020-09-22'), (35, 'Elementary Probability theory', 'STA112', 2, '1', '1', '1', '1', '2020-09-22'), (36, 'Logic and Linear Algebra', 'MTH111', 2, '1', '1', '1', '1', '2020-09-22'), (37, 'Trigonometry and Analytical Geometry', 'MTH112', 2, '1', '1', '1', '1', '2020-09-22'), (38, 'Technical English 1', 'OTM101', 2, '1', '1', '1', '1', '2020-09-22'), (39, 'Citizenship Education 1', 'GNS111', 2, '1', '1', '1', '1', '2020-09-22'), (40, 'Use of Library', 'GNS117', 1, '1', '1', '1', '1', '2020-09-22'), (41, 'Scientific Prog Using OOJava', 'COM121', 3, '1', '1', '1', '2', '2020-09-23'), (42, 'Intro to Internet', 'COM122', 3, '1', '1', '1', '2', '2020-09-23'), (43, 'Computer Application Packages 1', 'COM123', 3, '1', '1', '1', '2', '2020-09-23'), (44, 'Data Structures and Algorithms', 'COM124', 3, '1', '1', '1', '2', '2020-09-23'), (45, 'Introduction to System Analysis', 'COM125', 3, '1', '1', '1', '2', '2020-09-23'), (46, 'PC Upgrade and maintainance ', 'COM126', 2, '1', '1', '1', '2', '2020-09-23'), (47, 'Citizenship Education II', 'GNS128', 2, '1', '1', '1', '2', '2020-09-23'), (48, 'Technical English II', 'OTM201', 2, '1', '1', '1', '2', '2020-09-23'); -- -------------------------------------------------------- -- -- Table structure for table `tbldepartment` -- DROP TABLE IF EXISTS `tbldepartment`; CREATE TABLE IF NOT EXISTS `tbldepartment` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `departmentName` varchar(255) NOT NULL, `facultyId` int(20) NOT NULL, `dateCreated` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbldepartment` -- INSERT INTO `tbldepartment` (`Id`, `departmentName`, `facultyId`, `dateCreated`) VALUES (1, 'Computer Science', 1, ''), (2, 'Mechanical Engineering', 2, ''), (3, 'Business Administration', 3, '2020-06-22'), (4, 'Public Administration', 3, '2020-06-22'), (5, 'Accounting', 3, '2020-06-24'), (6, 'Science Laboratory Technology', 1, '2020-06-24'); -- -------------------------------------------------------- -- -- Table structure for table `tblfaculty` -- DROP TABLE IF EXISTS `tblfaculty`; CREATE TABLE IF NOT EXISTS `tblfaculty` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `facultyName` varchar(255) NOT NULL, `dateCreated` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tblfaculty` -- INSERT INTO `tblfaculty` (`Id`, `facultyName`, `dateCreated`) VALUES (1, 'Pure and Applied Science', ''), (2, 'Engineering', ''), (3, 'Business and Management Studies', '2020-06-22'); -- -------------------------------------------------------- -- -- Table structure for table `tblfinalresult` -- DROP TABLE IF EXISTS `tblfinalresult`; CREATE TABLE IF NOT EXISTS `tblfinalresult` ( `Id` int(10) NOT NULL AUTO_INCREMENT, `matricNo` varchar(50) NOT NULL, `levelId` varchar(10) NOT NULL, `semesterId` varchar(10) NOT NULL, `sessionId` varchar(10) NOT NULL, `totalCourseUnit` varchar(10) NOT NULL, `totalScoreGradePoint` varchar(10) NOT NULL, `gpa` varchar(255) NOT NULL, `classOfDiploma` varchar(50) NOT NULL, `dateAdded` varchar(25) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblfinalresult` -- INSERT INTO `tblfinalresult` (`Id`, `matricNo`, `levelId`, `semesterId`, `sessionId`, `totalCourseUnit`, `totalScoreGradePoint`, `gpa`, `classOfDiploma`, `dateAdded`) VALUES (13, 'NCSF/15/0001', '1', '1', '1', '22', '64.5', '2.93', 'Lower Credit', '2020-09-22'), (14, 'NCSF/15/0001', '1', '2', '1', '21', '74.5', '3.55', 'Distinction', '2020-09-23'), (15, 'NCSF/15/0002', '1', '1', '1', '22', '58.75', '2.67', 'Lower Credit', '2020-09-23'); -- -------------------------------------------------------- -- -- Table structure for table `tbllevel` -- DROP TABLE IF EXISTS `tbllevel`; CREATE TABLE IF NOT EXISTS `tbllevel` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `levelName` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbllevel` -- INSERT INTO `tbllevel` (`Id`, `levelName`) VALUES (1, 'ND1\r\n'), (2, 'ND2'), (3, 'HND1'), (4, 'HND2'); -- -------------------------------------------------------- -- -- Table structure for table `tblresult` -- DROP TABLE IF EXISTS `tblresult`; CREATE TABLE IF NOT EXISTS `tblresult` ( `Id` int(10) NOT NULL AUTO_INCREMENT, `matricNo` varchar(50) NOT NULL, `levelId` varchar(10) NOT NULL, `semesterId` varchar(10) NOT NULL, `sessionId` varchar(10) NOT NULL, `courseCode` varchar(50) NOT NULL, `courseUnit` varchar(50) NOT NULL, `score` varchar(50) NOT NULL, `scoreGradePoint` varchar(50) NOT NULL, `scoreLetterGrade` varchar(10) NOT NULL, `totalScoreGradePoint` varchar(50) NOT NULL, `dateAdded` varchar(50) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=169 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblresult` -- INSERT INTO `tblresult` (`Id`, `matricNo`, `levelId`, `semesterId`, `sessionId`, `courseCode`, `courseUnit`, `score`, `scoreGradePoint`, `scoreLetterGrade`, `totalScoreGradePoint`, `dateAdded`) VALUES (160, 'NCSF/15/0002', '1', '1', '1', 'COM113', '3', '78', '4', 'AA', '12', '2020-09-23'), (159, 'NCSF/15/0002', '1', '1', '1', 'COM111', '3', '22', '0', 'F', '0', '2020-09-23'), (158, 'NCSF/15/0001', '1', '2', '1', 'OTM201', '2', '72', '3.5', 'A', '7', '2020-09-23'), (157, 'NCSF/15/0001', '1', '2', '1', 'GNS128', '2', '56', '2.75', 'BC', '5.5', '2020-09-23'), (156, 'NCSF/15/0001', '1', '2', '1', 'COM126', '2', '75', '4', 'AA', '8', '2020-09-23'), (155, 'NCSF/15/0001', '1', '2', '1', 'COM125', '3', '81', '4', 'AA', '12', '2020-09-23'), (154, 'NCSF/15/0001', '1', '2', '1', 'COM124', '3', '84', '4', 'AA', '12', '2020-09-23'), (153, 'NCSF/15/0001', '1', '2', '1', 'COM123', '3', '88', '4', 'AA', '12', '2020-09-23'), (152, 'NCSF/15/0001', '1', '2', '1', 'COM122', '3', '68', '3.25', 'AB', '9.75', '2020-09-23'), (151, 'NCSF/15/0001', '1', '2', '1', 'COM121', '3', '55', '2.75', 'BC', '8.25', '2020-09-23'), (150, 'NCSF/15/0001', '1', '1', '1', 'GNS117', '1', '43', '2', 'D', '2', '2020-09-22'), (149, 'NCSF/15/0001', '1', '1', '1', 'GNS111', '2', '40', '2', 'D', '4', '2020-09-22'), (148, 'NCSF/15/0001', '1', '1', '1', 'OTM101', '2', '60', '3', 'B', '6', '2020-09-22'), (147, 'NCSF/15/0001', '1', '1', '1', 'MTH112', '2', '59', '2.75', 'BC', '5.5', '2020-09-22'), (146, 'NCSF/15/0001', '1', '1', '1', 'MTH111', '2', '68', '3.25', 'AB', '6.5', '2020-09-22'), (145, 'NCSF/15/0001', '1', '1', '1', 'STA112', '2', '70', '3.5', 'A', '7', '2020-09-22'), (141, 'NCSF/15/0001', '1', '1', '1', 'COM111', '3', '89', '4', 'AA', '12', '2020-09-22'), (142, 'NCSF/15/0001', '1', '1', '1', 'COM113', '3', '46', '2.25', 'CD', '6.75', '2020-09-22'), (143, 'NCSF/15/0001', '1', '1', '1', 'COM112', '3', '68', '3.25', 'AB', '9.75', '2020-09-22'), (144, 'NCSF/15/0001', '1', '1', '1', 'STA111', '2', '54', '2.5', 'C', '5', '2020-09-22'), (161, 'NCSF/15/0002', '1', '1', '1', 'COM112', '3', '77', '4', 'AA', '12', '2020-09-23'), (162, 'NCSF/15/0002', '1', '1', '1', 'STA111', '2', '65', '3.25', 'AB', '6.5', '2020-09-23'), (163, 'NCSF/15/0002', '1', '1', '1', 'STA112', '2', '52', '2.5', 'C', '5', '2020-09-23'), (164, 'NCSF/15/0002', '1', '1', '1', 'MTH111', '2', '21', '0', 'F', '0', '2020-09-23'), (165, 'NCSF/15/0002', '1', '1', '1', 'MTH112', '2', '98', '4', 'AA', '8', '2020-09-23'), (166, 'NCSF/15/0002', '1', '1', '1', 'OTM101', '2', '78', '4', 'AA', '8', '2020-09-23'), (167, 'NCSF/15/0002', '1', '1', '1', 'GNS111', '2', '44', '2', 'D', '4', '2020-09-23'), (168, 'NCSF/15/0002', '1', '1', '1', 'GNS117', '1', '67', '3.25', 'AB', '3.25', '2020-09-23'); -- -------------------------------------------------------- -- -- Table structure for table `tblsemester` -- DROP TABLE IF EXISTS `tblsemester`; CREATE TABLE IF NOT EXISTS `tblsemester` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `semesterName` varchar(20) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblsemester` -- INSERT INTO `tblsemester` (`Id`, `semesterName`) VALUES (1, 'First'), (2, 'Second'); -- -------------------------------------------------------- -- -- Table structure for table `tblsession` -- DROP TABLE IF EXISTS `tblsession`; CREATE TABLE IF NOT EXISTS `tblsession` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `sessionName` varchar(30) NOT NULL, `isActive` int(5) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblsession` -- INSERT INTO `tblsession` (`Id`, `sessionName`, `isActive`) VALUES (1, '2019/2020', 1), (2, '2020/2021', 0), (3, '2021/2022', 0), (5, '2022/2023', 0); -- -------------------------------------------------------- -- -- Table structure for table `tblstaff` -- DROP TABLE IF EXISTS `tblstaff`; CREATE TABLE IF NOT EXISTS `tblstaff` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `firstName` varchar(255) NOT NULL, `lastName` varchar(255) NOT NULL, `otherName` varchar(255) NOT NULL, `emailAddress` varchar(255) NOT NULL, `phoneNo` varchar(20) NOT NULL, `password` varchar(255) NOT NULL, `staffId` varchar(255) NOT NULL, `isAssigned` int(10) NOT NULL, `isPasswordChanged` int(10) NOT NULL, `dateCreated` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tblstaff` -- INSERT INTO `tblstaff` (`Id`, `firstName`, `lastName`, `otherName`, `emailAddress`, `phoneNo`, `password`, `staffId`, `isAssigned`, `isPasswordChanged`, `dateCreated`) VALUES (3, 'Bamidele', 'Bayo', 'olakunle', 'Bamidele@gmail.com', '07065903222', '12345', 'STF001111', 1, 0, '2020-06-21'), (4, 'busola', 'keji', 'busayo', 'KemisolAde@gmail.com', '09073930022', '12345', 'STF002', 1, 0, '2020-06-21'), (14, 'Samuel', 'Samuel', 'John', 'SamuelJohn@yahoo.com', '09087654321', '12345', 'STF0032', 1, 0, '2020-09-14'); -- -------------------------------------------------------- -- -- Table structure for table `tblstudent` -- DROP TABLE IF EXISTS `tblstudent`; CREATE TABLE IF NOT EXISTS `tblstudent` ( `Id` int(20) NOT NULL AUTO_INCREMENT, `firstName` varchar(255) NOT NULL, `lastName` varchar(255) NOT NULL, `otherName` varchar(255) NOT NULL, `matricNo` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `levelId` int(10) NOT NULL, `facultyId` int(10) NOT NULL, `departmentId` int(10) NOT NULL, `sessionId` int(10) NOT NULL, `dateCreated` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tblstudent` -- INSERT INTO `tblstudent` (`Id`, `firstName`, `lastName`, `otherName`, `matricNo`, `password`, `levelId`, `facultyId`, `departmentId`, `sessionId`, `dateCreated`) VALUES (8, 'Tunde', 'Okediran', 'Salau', 'NCSF/15/0001', '12345', 1, 1, 1, 1, '2020-09-21'), (9, 'Kemi', 'Olunluyo', 'Fakorede', 'NCSF/15/0002', '12345', 1, 1, 1, 1, '2020-09-21'), (10, 'Bashir', 'Kola', 'Wole', 'NCSF/15/0003', '12345', 1, 1, 1, 1, '2020-09-21'), (12, 'Adebayo', 'Adewale', 'Afolayan', 'NBAF/15/0005', '12345', 1, 3, 3, 1, '2020-09-21'), (14, 'Saheed', 'kehinde', 'Ade', 'NBAF/15/0003', '12345', 1, 3, 3, 1, '2020-09-21'), (15, 'Muhammad', 'Adamu', 'Kabir', 'NCSF/15/0008', '12345', 2, 3, 3, 1, '2020-09-25'); 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
87bb64b99b1ea3b58140dffc2cb7ab8f779ac342
SQL
jinmukeji/jiujiantang-services
/service/mysqldb/db-migrations/jinmu-db-v2-migration-009.sql
UTF-8
448
3.296875
3
[]
no_license
-- 初始化 device_organization_binding 数据 SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; SET @now = NOW(); INSERT INTO `device_organization_binding` ( `device_id`, `organization_id`, `created_at`, `updated_at` ) SELECT D.device_id, O.organization_id, @now, @now FROM jinmu_mac AS M INNER JOIN device AS D ON CONV( M.mac, 16, 10 ) = D.mac INNER JOIN organization AS O ON O.legacy_account = M.account; SET FOREIGN_KEY_CHECKS = 1;
true
aa4eaf2cde5b94dc28e69ff0454b01f534ebc509
SQL
777shipra/SQL_FOR_DATA_ANALYSIS
/basics/FOREIGN_KEY.sql
UTF-8
579
3.8125
4
[]
no_license
CREATE TABLE SALES ( PURCHASE_NUMBER INT , DATE_OF_PURCHASE DATE, CUSTOMER_ID INT, ITEM_CODE VARCHAR(10), PRIMARY KEY (CUSTOMER_ID) #ADDIND FOREIGN KEY #FOREIGN KEY (CUSTOMER_ID) references CUSTOMERS(CUSTOMER_ID) ON DELETE CASCADE ); #FOREIGN KEY CAN ALSO BE ADDED TO AN EXISITING TABLE #ALTER TABLE SALES #ADD FOREIGN KEY (CUSTOMER_ID) REFRENCES CUSTOMERS(CUSTOMER_ID) ON DELETE CASCADE ALTER TABLE SALES ADD UNIQUE KEY (ITEM_CODE); #DROPPING UNIQUE KEY ALTER TABLE SALES DROP INDEX ITEM_CODE; #DON'T USE PARENTHESIS WHILE DROPPING UNIQUE KEY
true
e0b722468a4568196575ca81b964647364340100
SQL
4nn4bel/adexdb
/storeprocedure/editUserOthersInterest.sql
UTF-8
4,055
3.34375
3
[]
no_license
DELIMITER // DROP PROCEDURE IF EXISTS editUserOthersInterest// CREATE PROCEDURE editUserOthersInterest(pUID int, pnumberOfCategory int, pOthers int) BEGIN Declare error_message varchar(20) default "something is wrong"; declare ta int default 2; declare tb int default 2; declare ea int default 2; declare eb int default 2; declare bta int default 2; declare btb int default 2; declare bea int default 2; declare beb int default 2; if (pnumberOfCategory = 1 and pOthers = 1) then Select count(*) into ta from user_interest where user_id = pUID and category = 'Trip' and sub_category = 'Others'; end if; if (ta = 0) then insert into user_interest_log (user_id, `action`, category, sub_category) values (pUID,'add', 'Trip', 'Others'); insert into user_interest (user_id, category, sub_category) values (pUID,'Trip', 'Others'); end if; if (pnumberOfCategory = 1 and pOthers = 0) then Select count(*) into tb from user_interest where user_id = pUID and category = 'Trip' and sub_category = 'Others'; end if; if (tb = 1) then insert into user_interest_log (user_id, `action`, category, sub_category) values (pUID,'remove', 'Trip', 'Others'); delete from user_interest where user_id = pUID and category = 'Trip' and sub_category = 'Others'; end if; if (pnumberOfCategory = 2 and pOthers = 1) then Select count(*) into ea from user_interest where user_id = pUID and category = 'Equipment' and sub_category = 'Others'; end if; if (ea = 0) then insert into user_interest_log (user_id, `action`, category, sub_category) values (pUID,'add', 'Equipment', 'Others'); insert into user_interest (user_id, category, sub_category) values (pUID,'Equipment', 'Others'); end if; if (pnumberOfCategory = 2 and pOthers = 0) then Select count(*) into eb from user_interest where user_id = pUID and sub_category = 'Others'; end if; if (eb = 1) then insert into user_interest_log (user_id, `action`, category, sub_category) values (pUID,'remove', 'Equipment', 'Others'); delete from user_interest where user_id = pUID and category = 'Equipment' and sub_category = 'Others'; end if; if (pnumberOfCategory = 3 and pOthers = 1) then Select count(*) into bta from user_interest where user_id = pUID and category = 'Trip' and sub_category = 'Others'; select count(*) into bea from user_interest where user_id = pUID and category = 'Equipment' and sub_category ='Others'; end if; if (bta = 0) then insert into user_interest_log (user_id, `action`, category, sub_category) values (pUID,'add', 'Trip', 'Others'); insert into user_interest (user_id, category, sub_category) values (pUID,'Trip', 'Others'); end if; if (bea = 0) then insert into user_interest_log (user_id, `action`, category, sub_category) values (pUID,'add', 'Equipment', 'Others'); insert into user_interest (user_id, category, sub_category) values (pUID,'Equipment', 'Others'); end if; if(pnumberOfCategory = 3 and pOthers = 0) then Select count(*) into btb from user_interest where user_id = pUID and category = 'Trip' and sub_category = 'Others'; select count(*) into beb from user_interest where user_id = pUID and category = 'Equipment' and sub_category ='Others'; end if; if (btb = 1) then insert into user_interest_log (user_id, `action`, category, sub_category) values (pUID,'remove', 'Trip', 'Others'); delete from user_interest where user_id = pUID and category = 'Trip' and sub_category = 'Others'; end if; if (beb = 1) then insert into user_interest_log (user_id, `action`, category, sub_category) values (pUID,'remove', 'Equipment', 'Others'); delete from user_interest where user_id = pUID and category = 'Equipment' and sub_category = 'Others'; end if; END // DELIMITER ;
true
523b5d94240fc5aab758dfbf5d3759f603cef442
SQL
martapalleiro/lab-mysql-select
/your-code/Lab_mysql_select.sql
UTF-8
1,454
4.3125
4
[]
no_license
USE `publications`; SELECT * FROM publishers; #CHALLENGE 1 SELECT a. au_id AS 'AUTHOR ID', b. au_lname AS 'LAST NAME', b. au_fname AS 'FIRST NAME', c. title AS 'TITLE', d. pub_name AS 'PUBLISHER' FROM `titleauthor` a INNER JOIN `authors` b ON a. au_id = b. au_id INNER JOIN titles c ON a. title_id = c. title_id INNER JOIN publishers d ON c. `pub_id` = d. `pub_id`; #CHALLENGE 2 SELECT a. au_id AS 'AUTHOR ID', b. au_lname AS 'LAST NAME', b. au_fname AS 'FIRST NAME', d. pub_name AS 'PUBLISHER', COUNT(c. title) AS 'TITLE COUNT' FROM `titleauthor` a INNER JOIN `authors` b ON a. au_id = b. au_id INNER JOIN titles c ON a. title_id = c. title_id INNER JOIN publishers d ON c. `pub_id` = d. `pub_id` GROUP BY a. au_id, b. au_lname, b. au_fname, d. pub_name ORDER BY COUNT(c. title) DESC; #CHALLENGE 3 SELECT a. au_id AS 'AUTHOR ID', b. au_lname AS 'LAST NAME', b. au_fname AS 'FIRST NAME', COUNT(c. title) AS 'TOTAL' FROM `titleauthor` a INNER JOIN `authors` b ON a. au_id = b. au_id INNER JOIN titles c ON a. title_id = c. title_id GROUP BY a. au_id, b. au_lname, b. au_fname ORDER BY COUNT(c. title) DESC LIMIT 3; #CHALLENGE 4 SELECT b. au_id AS 'AUTHOR ID', b. au_lname AS 'LAST NAME', b. au_fname AS 'FIRST NAME', COUNT(c. title) AS 'TOTAL' FROM AUTHORS B LEFT JOIN `titleauthor` a ON a. au_id = b. au_id LEFT JOIN titles c ON a. title_id = c. title_id GROUP BY b. au_id, b. au_lname, b. au_fname ORDER BY COUNT(c. title) DESC;
true
545d75701922dd2a89388fc6e23edcfdb01ea23a
SQL
gregorwolf/bookshop-demo
/tests/app/BooksAuthorsAssignment.sql
UTF-8
3,568
3.375
3
[]
no_license
-- SQLite -- Query generated by @sap/cds: 4.4.6 -- resulting in Error: SQLITE_ERROR: no such column: a.ASSOC_Book_BusinessValidFrom SELECT a.BusinessValidFrom AS "a_BusinessValidFrom", a.BusinessValidTo AS "a_BusinessValidTo", a.Role AS "a_Role", a.ASSOC_Book_ID AS "a_ASSOC_Book_ID", a.ASSOC_Author_ID AS "a_ASSOC_Author_ID", b.createdAt AS "b_createdAt", b.modifiedAt AS "b_modifiedAt", b.ID AS "b_ID", b.BusinessValidFrom AS "b_BusinessValidFrom", b.BusinessValidTo AS "b_BusinessValidTo", b.title AS "b_title", b.descr AS "b_descr", b.stock AS "b_stock", b.price AS "b_price", b.semanticURLtoPublisher AS "b_semanticURLtoPublisher", b.weight AS "b_weight", b.height AS "b_height", b.width AS "b_width", b.visible AS "b_visible", b.releaseDate AS "b_releaseDate", b.readingTime AS "b_readingTime", b.currency_code AS "b_currency_code", c.createdAt AS "c_createdAt", c.modifiedAt AS "c_modifiedAt", c.ID AS "c_ID", c.BusinessValidFrom AS "c_BusinessValidFrom", c.BusinessValidTo AS "c_BusinessValidTo", c.name AS "c_name", c.dateOfBirth AS "c_dateOfBirth", c.dateOfDeath AS "c_dateOfDeath", c.placeOfBirth AS "c_placeOfBirth", c.placeOfDeath AS "c_placeOfDeath", c.alive AS "c_alive", c.country_code AS "c_country_code" FROM localized_CatalogService_BooksAuthorsAssignment a LEFT JOIN localized_CatalogService_Books b ON ( b.ID = a.ASSOC_Book_ID AND b.BusinessValidFrom = a.ASSOC_Book_BusinessValidFrom AND b.BusinessValidTo = a.ASSOC_Book_BusinessValidTo ) LEFT JOIN localized_CatalogService_Authors c ON ( c.ID = a.ASSOC_Author_ID AND c.BusinessValidFrom = a.ASSOC_Author_BusinessValidFrom AND c.BusinessValidTo = a.ASSOC_Author_BusinessValidTo ) ORDER BY a.BusinessValidFrom COLLATE NOCASE ASC, a.BusinessValidTo COLLATE NOCASE ASC, a.Role COLLATE NOCASE ASC, a.ASSOC_Book_ID COLLATE NOCASE ASC, a.ASSOC_Author_ID COLLATE NOCASE ASC LIMIT 100 --- Adjusted to avoid the error SELECT a.BusinessValidFrom AS "a_BusinessValidFrom", a.BusinessValidTo AS "a_BusinessValidTo", a.Role AS "a_Role", a.ASSOC_Book_ID AS "a_ASSOC_Book_ID", a.ASSOC_Author_ID AS "a_ASSOC_Author_ID", b.createdAt AS "b_createdAt", b.modifiedAt AS "b_modifiedAt", b.ID AS "b_ID", b.BusinessValidFrom AS "b_BusinessValidFrom", b.BusinessValidTo AS "b_BusinessValidTo", b.title AS "b_title", b.descr AS "b_descr", b.stock AS "b_stock", b.price AS "b_price", b.semanticURLtoPublisher AS "b_semanticURLtoPublisher", b.weight AS "b_weight", b.height AS "b_height", b.width AS "b_width", b.visible AS "b_visible", b.releaseDate AS "b_releaseDate", b.readingTime AS "b_readingTime", b.currency_code AS "b_currency_code", c.createdAt AS "c_createdAt", c.modifiedAt AS "c_modifiedAt", c.ID AS "c_ID", c.BusinessValidFrom AS "c_BusinessValidFrom", c.BusinessValidTo AS "c_BusinessValidTo", c.name AS "c_name", c.dateOfBirth AS "c_dateOfBirth", c.dateOfDeath AS "c_dateOfDeath", c.placeOfBirth AS "c_placeOfBirth", c.placeOfDeath AS "c_placeOfDeath", c.alive AS "c_alive", c.country_code AS "c_country_code" FROM localized_CatalogService_BooksAuthorsAssignment a LEFT JOIN localized_CatalogService_Books b ON ( b.ID = a.ASSOC_Book_ID ) LEFT JOIN localized_CatalogService_Authors c ON ( c.ID = a.ASSOC_Author_ID ) ORDER BY a.BusinessValidFrom COLLATE NOCASE ASC, a.BusinessValidTo COLLATE NOCASE ASC, a.Role COLLATE NOCASE ASC, a.ASSOC_Book_ID COLLATE NOCASE ASC, a.ASSOC_Author_ID COLLATE NOCASE ASC LIMIT 100
true
84d93dafad9bebf399457db2eaae29c52526400b
SQL
el1031/LeetCode-Problems
/620_Not_Boring_Movies.sql
UTF-8
144
3.078125
3
[]
no_license
SELECT ID, MOVIE, DESCRIPTION, RATING FROM CINEMA WHERE DECODE(MOD(ID, 2), 0, 0, 1) = 1 AND DESCRIPTION <> 'boring' ORDER BY RATING DESC;
true
18ec10021f638155d433facbc4eed6f0052d76fc
SQL
DragoonX/BilgeAdamTumOdevler
/Odev9_StoredProcedures2/SQLQuery1.sql
UTF-8
303
2.796875
3
[]
no_license
--CREATE PROCEDURE TOPLAM --@X1 INT, --@X2 INT --AS --BEGIN -- SELECT (@X1 + @X2) AS TOPLAM --END EXEC TOPLAM 12,41 --CREATE PROCEDURE GOSTER --@Y1 INT, @Y2 INT --AS --BEGIN -- SELECT (@Y1+@Y2) AS TOPLAM, @Y1,@Y2 --END EXEC GOSTER 25,54 WITH RESULT SETS((TOPLAM int, Y1 int, Y2 int))
true
976d1f3b9ceb29191e86d803c5a9b246132ff3f6
SQL
hmarf/sample_LayerArchitecture
/mysql/docker/mysql/initdb.d/ddl.sql
UTF-8
489
3.109375
3
[]
no_license
CREATE SCHEMA IF NOT EXISTS `sampleDB` DEFAULT CHARACTER SET utf8 ; USE `sampleDB` ; -- ----------------------------------------------------- -- Table `dojo_api`.`user` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sampleDB`.`user` ( `user_id` VARCHAR(128) NOT NULL COMMENT 'ユーザID', `name` VARCHAR(64) NOT NULL COMMENT 'ユーザ名', `createdAt` datetime DEFAULT NULL, PRIMARY KEY (`user_id`)) ENGINE = InnoDB COMMENT = 'ユーザ';
true
46b741daaa022841a33708efc172ecf77db89689
SQL
Hai624826424/qr_code_register_ci
/sql/mydb20180607_110100.sql
UTF-8
3,795
3.3125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 07, 2018 at 06:01 AM -- Server version: 10.1.32-MariaDB -- PHP Version: 7.2.5 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: `mydb` -- -- -------------------------------------------------------- -- -- Table structure for table `house` -- CREATE TABLE `house` ( `id` int(11) NOT NULL, `name` varchar(255) CHARACTER SET utf8 NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `house` -- INSERT INTO `house` (`id`, `name`) VALUES (1, 'Khách sạn Hương Biển'), (2, 'Huong Dong Resort'), (3, 'Cua Tung Beach'), (4, 'Cua Viet Hotel'); -- -------------------------------------------------------- -- -- Table structure for table `item_info` -- CREATE TABLE `item_info` ( `item_id` int(11) NOT NULL, `name` varchar(255) CHARACTER SET utf8 NOT NULL, `value` varchar(255) CHARACTER SET utf8 NOT NULL, `type` varchar(255) CHARACTER SET utf8 NOT NULL, `room_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `item_info` -- INSERT INTO `item_info` (`item_id`, `name`, `value`, `type`, `room_id`) VALUES (127, 'Khách sạn Hương Biển _ Room 101', 'http://www.siberiancms.com', '1', 3); -- -------------------------------------------------------- -- -- Table structure for table `room` -- CREATE TABLE `room` ( `id` int(11) NOT NULL, `name` varchar(255) CHARACTER SET utf8 NOT NULL, `house_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `room` -- INSERT INTO `room` (`id`, `name`, `house_id`) VALUES (7, 'Family VIP', 1), (12, 'Fly', 1), (14, 'Light of night', 1), (18, 'Phòng Cát', 3), (17, 'Phòng Gió ', 3), (22, 'Phòng đôi 1', 4), (23, 'Phòng đôi heo', 4), (19, 'Phòng đơn 1', 4), (20, 'Phòng đơn 2', 4), (3, 'Room 101', 1), (5, 'Room 102', 1), (6, 'Room VIP 1', 1), (11, 'Single Lady', 1), (15, 'Tĩnh', 1), (9, 'Tình nhân 201', 1), (10, 'Tình nhân gardent', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `house` -- ALTER TABLE `house` ADD PRIMARY KEY (`id`); -- -- Indexes for table `item_info` -- ALTER TABLE `item_info` ADD PRIMARY KEY (`item_id`), ADD UNIQUE KEY `value` (`value`), ADD KEY `door_attach` (`room_id`); -- -- Indexes for table `room` -- ALTER TABLE `room` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `name` (`name`,`house_id`), ADD KEY `parent_house` (`house_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `house` -- ALTER TABLE `house` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `item_info` -- ALTER TABLE `item_info` MODIFY `item_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=128; -- -- AUTO_INCREMENT for table `room` -- ALTER TABLE `room` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- Constraints for dumped tables -- -- -- Constraints for table `item_info` -- ALTER TABLE `item_info` ADD CONSTRAINT `door_attach` FOREIGN KEY (`room_id`) REFERENCES `room` (`id`); -- -- Constraints for table `room` -- ALTER TABLE `room` ADD CONSTRAINT `parent_house` FOREIGN KEY (`house_id`) REFERENCES `house` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
40afb626a6995168f8c00e65d14ca320fd21c36c
SQL
Cflore16/RuntimeTerrors
/SqlScripts/TblAccount.sql
UTF-8
1,352
4.03125
4
[]
no_license
USE runtime ; DROP TABLE IF EXISTS `Account` ; CREATE TABLE runtime.Account( -- AccountId INT AUTO_INCREMENT NOT NULL, EmployeeId VARCHAR(15) NOT NULL UNIQUE, AcctPassword VARCHAR(255) NOT NULL, FirstName VARCHAR(60) NOT NULL, LastName VARCHAR(60) NOT NULL, Email VARCHAR(60) NOT NULL, AcctCreateDt DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, -- AccountRequestId INT, AdminFlag CHAR(1), -- Used to tell if account is admin DisableFlag CHAR(1), -- Used to tell if account is disabled by admin DisableCount INT NOT NULL DEFAULT 0, -- Used to tell admin how many times account has been disabled. CONSTRAINT Pk_Account PRIMARY KEY (EmployeeId), -- CONSTRAINT Fk_Account FOREIGN KEY Fk_Account_AccountRequest (AccountRequestId) REFERENCES AccountRequest(AccountRequestId) -- ON DELETE SET NULL, CONSTRAINT Ck_Account_AdminFlag CHECK (AdminFlag IN ('X')), CONSTRAINT Ck_Account_DisableFlag CHECK (DisableFlag IN ('X')), CONSTRAINT Ck_Account_DisableCount CHECK (DisableCount >=0) ) ; INSERT INTO runtime.Account (EmployeeId, AcctPassword, FirstName, LastName, Email) SELECT EmployeeId, AcctPassword, FirstName, LastName, Email FROM runtime.AccountRequest WHERE AccountApproval = 'A' ; UPDATE runtime.Account SET AdminFlag = 'X' WHERE EmployeeId = '1003' ; SELECT * FROM runtime.Account ;
true
39a00001997aa8173dd3ad81019e6298aecedf33
SQL
vamaq/async_db_playground
/db/schemas/create_core.sql
UTF-8
595
3.140625
3
[]
no_license
CREATE SCHEMA core; -- Creates the new schema -------------------------------------- -- Set new Schema as default on new connection. DO $do$ DECLARE search_path VARCHAR; current_database VARCHAR := current_database(); BEGIN SELECT array_to_string(ARRAY( SELECT DISTINCT trim(unnest(string_to_array(current_setting('search_path')||',core', ','))) ),',') INTO search_path; EXECUTE 'ALTER DATABASE '||current_database||' SET search_path TO '||search_path; END $do$; -------------------------------------- -- Set the new schema as default for this connection. SET SCHEMA 'core';
true
1d3e253be9c7e619fe50987dc4f858306aa19ed7
SQL
Froilant/itntsolutions
/Proyectos Tomcat/demo/WEB-INF/action/security/login/check-passdate.sql
UTF-8
157
2.78125
3
[]
no_license
select last_change from ${schema}s_passlog p, ${schema}s_user u where p.user_id = u.user_id and u.userlogin = ${fld:userlogin} order by last_change DESC
true
cc332e2a13a675fe272efcaf2ec5fe234518a5cd
SQL
MarcinBury92/SQL
/MySQL - The_book_rental/Database_query.sql
UTF-8
4,154
4.09375
4
[]
no_license
-- 1.Zestawienie książek, które nie zostały nigdy wypożyczone SELECT nazwa FROM ksiazki LEFT JOIN wypozyczenia ON ksiazki.id = wypozyczenia.ksiazka_id WHERE wypozyczenia.ksiazka_id IS NULL; -- 2. Zestawienie książek, które zostały wypożyczone SELECT ksiazki.id, nazwa FROM ksiazki INNER JOIN wypozyczenia ON ksiazki.id = wypozyczenia.ksiazka_id GROUP BY nazwa ORDER BY ksiazki.id; -- 3.Zestawienie czytelników, którzy posiadają aktualnie wypożyczoną książkę, nie dokonali jej zwrócenia. SELECT czytelnicy.id, imie, nazwisko FROM czytelnicy LEFT JOIN wypozyczenia ON czytelnicy.id = wypozyczenia.czytelnik_id WHERE Data_zwrotu IS NULL GROUP BY czytelnicy.id ORDER BY czytelnicy.id; -- 4.. Kategorie wraz z ilością książek przypisanych do danej kategorii. SELECT kategorie.nazwa, COUNT(*) AS ilosc FROM kategorie LEFT JOIN ksiazki ON kategorie.id = ksiazki.kategoria_id GROUP BY kategorie.nazwa ORDER BY kategorie.id; -- 5. Pierwszych pięciu czytelników, którzy posiadają największą ilość wypożyczeń. SELECT czytelnicy.id, czytelnicy.imie, czytelnicy.nazwisko, COUNT(*) AS ilosc_wypozyczen FROM czytelnicy LEFT JOIN wypozyczenia ON czytelnicy.id = wypozyczenia.czytelnik_id GROUP BY czytelnicy.id ORDER BY ilosc_wypozyczen DESC LIMIT 5; -- 6. Czytelnicy wraz z sumą nałożonych na nich kar. Interesują nas tylko Ci, którzy posiadają więcej niż 1 karę, Ci o najwyższej sumie kar mają być wyświetlani jako pierwsi. SELECT czytelnicy.id, czytelnicy.imie, czytelnicy.nazwisko, SUM(kary.kwota) AS naleznosc FROM czytelnicy LEFT JOIN wypozyczenia ON czytelnicy.id = wypozyczenia.czytelnik_id INNER JOIN kary ON kary.wypozyczenie_id = wypozyczenia.id GROUP BY czytelnicy.id ORDER BY naleznosc DESC; -- 7. Z jakiego typu kar posiadamy największe wpływy, wyświetl nazwę kary wraz z sumą kwot. SELECT nazwa, SUM(kary.kwota) AS suma_kar, COUNT(*) AS ilosc_kar FROM typy_kar LEFT JOIN kary ON typy_kar.id = kary.typ_kary_id GROUP BY typy_kar.id; -- 8. Czytelnicy w jakim wieku posiadają największą ilość wypożyczeń? Zwróć wiek wraz z ilością wypożyczeń. SELECT czytelnicy.id, czytelnicy.imie, czytelnicy.nazwisko, czytelnicy.data_urodzenia, COUNT(*) AS ilosc_wyp_ksiazek FROM czytelnicy LEFT JOIN wypozyczenia ON czytelnicy.id = wypozyczenia.czytelnik_id GROUP BY czytelnicy.id ORDER BY ilosc_wyp_ksiazek DESC , data_urodzenia; -- 9. Która płeć wypożycza większą ilość książek oraz jakie ma to odniesienie do wysokości naliczonych kar. Zwróć płeć, ilość wypożyczeń oraz sumę naliczonych kar. SELECT czytelnicy.plec, COUNT(*) AS ilosc_wypozyczen, SUM(kary.kwota) AS suma_kar FROM czytelnicy LEFT JOIN wypozyczenia ON wypozyczenia.czytelnik_id = czytelnicy.id LEFT JOIN kary ON kary.wypozyczenie_id = wypozyczenia.id GROUP BY plec; -- 10. Wyświetl książki, którym zostało mniej niż tydzień do planowej daty ich zwrotu. Założenie: dzisiejsza data to ‘2018-04-20’ SELECT ksiazki.nazwa, wypozyczenia.Planowana_data_zwrotu, DATEDIFF('2018-04-20', wypozyczenia.Planowana_data_zwrotu) AS dni_do_zwrotu FROM ksiazki LEFT JOIN wypozyczenia ON wypozyczenia.ksiazka_id = ksiazki.id WHERE DATEDIFF('2018-04-20', wypozyczenia.Planowana_data_zwrotu) < 7 AND DATEDIFF('2018-04-20', wypozyczenia.Planowana_data_zwrotu) > - 7; -- 11.Wyświetl książki, które nie zostały zwrócone w terminie oraz nie zostały dla nich jeszcze naliczone kary z tytułu owego przekroczenia. SELECT ksiazki.id, ksiazki.nazwa, wypozyczenia.id FROM ksiazki INNER JOIN wypozyczenia ON wypozyczenia.ksiazka_id = ksiazki.id LEFT JOIN kary ON kary.wypozyczenie_id = wypozyczenia.id WHERE wypozyczenia.Data_zwrotu > wypozyczenia.Planowana_data_zwrotu OR wypozyczenia.Data_zwrotu IS NULL AND kary.id IS NULL;
true
9851f213c6d6cbabf7afdaa51a6c77978d60f2f2
SQL
youknow933/test
/dawara/src/main/webapp/WEB-INF/doc/dbms/auth-urlauth/old/test.sql
UHC
7,157
4.40625
4
[]
no_license
/**********************************/ /* Table Name: */ /**********************************/ 1. ̺ - ̺ - ں ο CREATE TABLE AUTH( AUTH_NO NUMBER(10) NOT NULL PRIMARY KEY, AUTH_INFO VARCHAR2(100) NOT NULL ); COMMENT ON TABLE AUTH is ''; COMMENT ON COLUMN AUTH.AUTH_NO is ' ȣ'; COMMENT ON COLUMN AUTH.AUTH_INFO is ' '; 2. - INSERT INTO auth(AUTH_NO, AUTH_INFO) VALUES((select nvl(max(auth_no), 0) + 1 as auth_no from auth), ''); INSERT INTO auth(AUTH_NO, AUTH_INFO) VALUES((select nvl(max(auth_no), 0) + 1 as auth_no from auth), ' '); INSERT INTO auth(AUTH_NO, AUTH_INFO) VALUES((select nvl(max(auth_no), 0) + 1 as auth_no from auth), 'Ϲ ȸ'); INSERT INTO auth(AUTH_NO, AUTH_INFO) VALUES((select nvl(max(auth_no), 0) + 1 as auth_no from auth), ' ȸ'); INSERT INTO auth(AUTH_NO, AUTH_INFO) VALUES((select nvl(max(auth_no), 0) + 1 as auth_no from auth), ' Ʈ'); INSERT INTO auth(AUTH_NO, AUTH_INFO) VALUES((select nvl(max(auth_no), 0) + 1 as auth_no from auth), 'Ż ȸ'); 3. - SELECT AUTH_NO, AUTH_INFO FROM auth ORDER BY AUTH_NO; AUTH_NO AUTH_INFO ------- --------- 1 2 3 Ϲ ȸ 4 ȸ 5 Ʈ 6 Ż ȸ 4. ȸ - ȣ '3' ȸ SELECT AUTH_NO, AUTH_INFO FROM auth WHERE AUTH_NO = '3'; AUTH_NO AUTH_INFO ------- --------- 3 Ϲ ȸ 5. - ȣ '5' ' ȸ' UPDATE auth SET auth_info = ' ȸ' WHERE auth_no = '5'; SELECT auth_no, auth_info FROM auth WHERE auth_no = '5'; AUTH_NO AUTH_INFO ------- --------- 5 ȸ 6. - ȣ '5' DELETE FROM auth WHERE auth_no = '5'; SELECT auth_no, auth_info FROM auth WHERE auth_no = '5'; AUTH_NO AUTH_INFO ------- --------- /**********************************/ /* Table Name: Ѻ URL */ /**********************************/ 1. ̺ - Ѻ URL ̺ - ο Ѻ URL ּ CREATE TABLE urlauth( urlauth_no NUMBER(10) NOT NULL PRIMARY KEY, urlauth_address VARCHAR2(200) NOT NULL, auth_no NUMBER(10) NOT NULL, FOREIGN KEY (auth_no) REFERENCES AUTH (auth_no) ); COMMENT ON TABLE urlauth is 'Ѻ URL'; COMMENT ON COLUMN urlauth.urlauth_no is 'Ѻ URL ȣ'; COMMENT ON COLUMN urlauth.urlauth_address is 'Ѻ URL ּ'; COMMENT ON COLUMN urlauth.auth_no is ' ȣ'; 2. - Ѻ URL INSERT INTO urlauth(urlauth_no, urlauth_address, auth_no) VALUES((select nvl(max(urlauth_no), 0) + 1 as urlauth_no from urlauth), '', '1'); INSERT INTO urlauth(urlauth_no, urlauth_address, auth_no) VALUES((select nvl(max(urlauth_no), 0) + 1 as urlauth_no from urlauth), 'īװ', '1'); 3. - Ѻ URL SELECT urlauth_no, urlauth_address, auth_no FROM urlauth ORDER BY urlauth_no; URLAUTH_NO URLAUTH_ADDRESS AUTH_NO ---------- --------------- ------- 1 1 2 īװ 1 4. ȸ - Ѻ URL ȣ '2' Ѻ URL Ѻ URL ȸ SELECT urlauth_no, urlauth_address, auth_no FROM urlauth WHERE urlauth_no = '2'; URLAUTH_NO URLAUTH_ADDRESS AUTH_NO ---------- --------------- ------- 2 īװ 1 5. - Ѻ URL ȣ '2' Ѻ URL ּҸ '' UPDATE urlauth SET urlauth_address = '' WHERE urlauth_no = '2'; SELECT urlauth_no, urlauth_address, auth_no FROM urlauth WHERE urlauth_no = '2'; URLAUTH_NO URLAUTH_ADDRESS AUTH_NO ---------- --------------- ------- 2 1 6. - Ѻ URL ȣ '2' Ѻ URL DELETE FROM urlauth WHERE urlauth_no = '2'; SELECT urlauth_no, urlauth_address, auth_no FROM urlauth WHERE urlauth_no = '2'; URLAUTH_NO URLAUTH_ADDRESS AUTH_NO ---------- --------------- ------- /**********************************/ /* Table Name: ּ */ /**********************************/ 1. ̺ - ּ CREATE TABLE url( url_no NUMBER(10) NOT NULL PRIMARY KEY, url_address VARCHAR2(200) NOT NULL, urlauth_no NUMBER(10) NOT NULL, FOREIGN KEY (urlauth_no) REFERENCES URLAUTH (urlauth_no) ); COMMENT ON TABLE urlauth is ' ּ'; COMMENT ON COLUMN url.url_no is ' ּ ȣ'; COMMENT ON COLUMN url.url_address is ' ּ '; COMMENT ON COLUMN url.auth_no is ' ȣ'; 2. - Ѻ URL INSERT INTO url(url_no, url_address, auth_no) VALUES((select nvl(max(url_no), 0) + 1 as url_no from url), 'index.jsp', '1'); 3. - Ѻ URL SELECT urlauth_no, urlauth_address, auth_no FROM urlauth ORDER BY urlauth_no; URLAUTH_NO URLAUTH_ADDRESS AUTH_NO ---------- --------------- ------- 1 1 2 īװ 1 4. ȸ - Ѻ URL ȣ '2' Ѻ URL Ѻ URL ȸ SELECT urlauth_no, urlauth_address, auth_no FROM urlauth WHERE urlauth_no = '2'; URLAUTH_NO URLAUTH_ADDRESS AUTH_NO ---------- --------------- ------- 2 īװ 1 5. - Ѻ URL ȣ '2' Ѻ URL ּҸ '' UPDATE urlauth SET urlauth_address = '' WHERE urlauth_no = '2'; SELECT urlauth_no, urlauth_address, auth_no FROM urlauth WHERE urlauth_no = '2'; URLAUTH_NO URLAUTH_ADDRESS AUTH_NO ---------- --------------- ------- 2 1 6. - Ѻ URL ȣ '2' Ѻ URL DELETE FROM url WHERE url_no = '2'; SELECT url_no, url_address, auth_no FROM url WHERE url_no = '2'; URLAUTH_NO URLAUTH_ADDRESS AUTH_NO ---------- --------------- -------
true
b2355f6d553f97f4024120f5686d25a7cbfe8554
SQL
JoeyZhan/SQL-notes
/SQL-source-1/数据库与表结构/表关系-多对多关系的实现.sql
GB18030
1,013
4.125
4
[]
no_license
--ϵ --Զϵʵ --ԶϵҪ½һʾ --, ñ'course_arrange'ʾ 'classAndgrade''teacher''course'֮ĶԶϵ Create table classAndgrade ( cag_id int constraint pk_cag_id primary key, cag_name nvarchar(10) unique not null, cag_numb int not null ) Create table teacher ( tea_id int constraint pk_tea_id primary key, tea_name nvarchar(10) unique not null, tea_sex nvarchar(1) check(tea_sex = '' or tea_sex = 'Ů') not null, tea_address nvarchar(20) not null, ) Create table course ( c_id int constraint pk_c_id primary key, c_name nvarchar(10) unique not null, ) Create table course_arrange ( tea_id int constraint fk_tea_id foreign key references teacher(tea_id) not null, cag_id int constraint fk_cag_id foreign key references classAndgrade(cag_id) not null, c_id int constraint fk_c_id foreign key references course(c_id) not null, constraint pk_tea_cag_c primary key (tea_id, cag_id, c_id) )
true
a7c6eef94bf5ba8a1251f1f5f54b9a6b68015af5
SQL
raoparag/omega
/modules/core/db/init/mysql/20.create-db.sql
UTF-8
3,338
3.359375
3
[]
no_license
-- begin OMEGA_ORGANISATION alter table OMEGA_ORGANISATION add constraint FK_OMEGA_ORGANISATION_COUNTRY foreign key (COUNTRY_ID) references OMEGA_COUNTRY(ID)^ alter table OMEGA_ORGANISATION add constraint FK_OMEGA_ORGANISATION_INDUSTRY foreign key (INDUSTRY_ID) references OMEGA_INDUSTRY(ID)^ create index IDX_OMEGA_ORGANISATION_COUNTRY on OMEGA_ORGANISATION (COUNTRY_ID)^ create index IDX_OMEGA_ORGANISATION_INDUSTRY on OMEGA_ORGANISATION (INDUSTRY_ID)^ -- end OMEGA_ORGANISATION -- begin OMEGA_BOOKING_ITEM alter table OMEGA_BOOKING_ITEM add constraint FK_OMEGA_BOOKING_ITEM_SHOW_TIMING foreign key (SHOW_TIMING_ID) references OMEGA_SHOW_TIMING(ID)^ alter table OMEGA_BOOKING_ITEM add constraint FK_OMEGA_BOOKING_ITEM_TICKET_CATEGORY foreign key (TICKET_CATEGORY_ID) references OMEGA_TICKET_CATEGORY(ID)^ alter table OMEGA_BOOKING_ITEM add constraint FK_OMEGA_BOOKING_ITEM_PAYMENT_CATEGORY foreign key (PAYMENT_CATEGORY_ID) references OMEGA_PAYMENT_CATEGORY(ID)^ alter table OMEGA_BOOKING_ITEM add constraint FK_OMEGA_BOOKING_ITEM_BOOKING foreign key (BOOKING_ID) references OMEGA_BOOKING(ID)^ create index IDX_OMEGA_BOOKING_ITEM_SHOW_TIMING on OMEGA_BOOKING_ITEM (SHOW_TIMING_ID)^ create index IDX_OMEGA_BOOKING_ITEM_TICKET_CATEGORY on OMEGA_BOOKING_ITEM (TICKET_CATEGORY_ID)^ create index IDX_OMEGA_BOOKING_ITEM_PAYMENT_CATEGORY on OMEGA_BOOKING_ITEM (PAYMENT_CATEGORY_ID)^ create index IDX_OMEGA_BOOKING_ITEM_BOOKING on OMEGA_BOOKING_ITEM (BOOKING_ID)^ -- end OMEGA_BOOKING_ITEM -- begin OMEGA_SHOW alter table OMEGA_SHOW add constraint FK_OMEGA_SHOW_SHOW_VENUE foreign key (SHOW_VENUE_ID) references OMEGA_SHOW_VENUE(ID)^ create index IDX_OMEGA_SHOW_SHOW_VENUE on OMEGA_SHOW (SHOW_VENUE_ID)^ -- end OMEGA_SHOW -- begin OMEGA_BOOKING alter table OMEGA_BOOKING add constraint FK_OMEGA_BOOKING_ORGANISATION foreign key (ORGANISATION_ID) references OMEGA_ORGANISATION(ID)^ alter table OMEGA_BOOKING add constraint FK_OMEGA_BOOKING_SHOW foreign key (SHOW_ID) references OMEGA_SHOW(ID)^ alter table OMEGA_BOOKING add constraint FK_OMEGA_BOOKING_SRT_CONTACT foreign key (SRT_CONTACT_ID) references OMEGA_CONTACT(ID)^ alter table OMEGA_BOOKING add constraint FK_OMEGA_BOOKING_ORG_CONTACT foreign key (ORG_CONTACT_ID) references OMEGA_CONTACT(ID)^ create index IDX_OMEGA_BOOKING_ORGANISATION on OMEGA_BOOKING (ORGANISATION_ID)^ create index IDX_OMEGA_BOOKING_SHOW on OMEGA_BOOKING (SHOW_ID)^ create index IDX_OMEGA_BOOKING_SRT_CONTACT on OMEGA_BOOKING (SRT_CONTACT_ID)^ create index IDX_OMEGA_BOOKING_ORG_CONTACT on OMEGA_BOOKING (ORG_CONTACT_ID)^ -- end OMEGA_BOOKING -- begin OMEGA_SHOW_TIMING alter table OMEGA_SHOW_TIMING add constraint FK_OMEGA_SHOW_TIMING_SHOW foreign key (SHOW_ID) references OMEGA_SHOW(ID)^ create index IDX_OMEGA_SHOW_TIMING_SHOW on OMEGA_SHOW_TIMING (SHOW_ID)^ -- end OMEGA_SHOW_TIMING -- begin OMEGA_TICKET_CATEGORY alter table OMEGA_TICKET_CATEGORY add constraint FK_OMEGA_TICKET_CATEGORY_SHOW foreign key (SHOW_ID) references OMEGA_SHOW(ID)^ create index IDX_OMEGA_TICKET_CATEGORY_SHOW on OMEGA_TICKET_CATEGORY (SHOW_ID)^ -- end OMEGA_TICKET_CATEGORY -- begin OMEGA_CONTACT alter table OMEGA_CONTACT add constraint FK_OMEGA_CONTACT_ORGANISATION foreign key (ORGANISATION_ID) references OMEGA_ORGANISATION(ID)^ create index IDX_OMEGA_CONTACT_ORGANISATION on OMEGA_CONTACT (ORGANISATION_ID)^ -- end OMEGA_CONTACT
true
1ae920fcc07d91352dd0e06519ef2d323c2de71e
SQL
Daniel100110/Floweb
/db/bd_to_mysql.sql
UTF-8
2,163
3.15625
3
[]
no_license
create database Floweb; use Floweb; create table acceso( no_acceso int primary key not null AUTO_INCREMENT, tipo_acceso varchar(35), status_acceso varchar(50) not null ); create table cuenta( correo_cuenta varchar(60) primary key not null, contra_cuenta varchar(55) not null, no_acceso int not null, saldo_cuenta float not null, status_cuenta varchar(50) not null, foreign key (no_acceso) references acceso(no_acceso) ); create table datosPersonales( correo_cuenta varchar(60) not null, nom_persona varchar(60) not null, tel_persona varchar(13) not null, dir1_persona varchar(100) not null, dir2_persona varchar(100) not null, estado_persona varchar(100) not null, ciudad_persona varchar(100) not null, cp_persona int not null, foreign key (correo_cuenta) references cuenta(correo_cuenta) ); create table producto( no_producto int primary key not null AUTO_INCREMENT, nom_producto varchar(50) not null, cantidad_producto int not null, precio_producto float not null, foto_producto varchar(100) not null, status_producto varchar(50) not null ); create table carrito( correo_cuenta varchar(60), no_producto int not null, cantidad int not null, precio float not null, status_carrito varchar(50) not null, foreign key (correo_cuenta) references cuenta(correo_cuenta), foreign key (no_producto) references producto(no_producto) ); create table pedido( no_pedido int primary key not null AUTO_INCREMENT, correo_cuenta varchar(60), lista_productos varchar(100), subtotal_pedido float not null, iva_pedido float not null, total_pedido float not null, nom_persona varchar(60) not null, tel_persona varchar(13) not null, dir1_persona varchar(100) not null, dir2_persona varchar(100) not null, estado_persona varchar(100) not null, ciudad_persona int not null, cp_persona int not null, foreign key (correo_cuenta) references cuenta(correo_cuenta) ); create table cupones( codigo_cupon varchar(16) primary key not null, status_cupon varchar(20) );
true
2112e7a83538f8ac35b981fff2d4289ab240f3cf
SQL
rposhala/Data-Models-n-Query-Languages
/textbook/quiz/q10.sql
UTF-8
497
4.3125
4
[]
no_license
WITH emp_sal_date AS ( SELECT employees.emp_no , salary , hire_date FROM employees INNER JOIN salaries ON employees.emp_no = salaries.emp_no WHERE birth_date like '1965%' AND to_date = '9999-01-01' ) SELECT e1.emp_no AS h_empno , e1.salary AS h_salary , e1.hire_date AS h_date , e2.emp_no AS l_empno , e2.salary AS l_salary , e2.hire_date AS l_date FROM emp_sal_date e1 , emp_sal_date e2 WHERE e1.hire_date > e2.hire_date AND e1.salary > e2.salary ORDER BY e1.emp_no , e2.emp_no;
true
f6dd1195769b3fae8f2e83128f6262cfbfa0c6d0
SQL
denius72/Projeto
/algunsinserts.sql
UTF-8
1,056
2.765625
3
[]
no_license
INSERT INTO Pessoa (Nome, DataNascimento, RG, idEmissorRG, CPF, Sexo, NomePai, NomeMae, Passaporte, NaturalidadeID) VALUES ('John huepador','2017-06-15','123457',1,'4568122','analo','Jesus','Irineu',0,1); SELECT idPessoa FROM Pessoa WHERE Pessoa.CPF = 4568122; SELECT * FROM Pessoa; SELECT * FROM Usuario; INSERT INTO EmissorRG (SSP) VALUES ('SC'); SELECT * FROM EmissorRG; INSERT INTO Pais (NomePais, SiglaPais) VALUES ('Estados Unidos do Sul','EU'); SELECT * FROM Pais; INSERT INTO Estado (NomeEstado, SiglaEstado, Pais_idPais) VALUES ('Estado Norte','QJ',1); INSERT INTO Cidade (NomeCidade, Estado_idEstado) VALUES ('azerbaijão',1); SELECT * from TipoTelefone; INSERT INTO TipoTelefone (TipoTelefone) VALUES ('Celular'); INSERT INTO Tipo (TipoEndereco) VALUES ('Residencial'); CALL InsertPessoaContaAtomico('John huepador','2017-06-15','123457',1,'4568122','analo','Jesus','Irineu',0,1,'Drogas','marcinha','johnpiadasruinsltd@gmail.com','1234darthvaderéumviado',1,'Rua caralhinhos voadores','321','Chinelândia',1,1); SELECT * FROM ViewPessoaDados WHERE Nome = "John huepador";
true
4ec83e58a4161093c44637bcf441adcfa5736a1e
SQL
silence-do-good/stress-test-Postgres-and-MySQL
/dump/high/day15/select1336.sql
UTF-8
239
2.515625
3
[]
no_license
SELECT timeStamp, clientid FROM WiFiAPObservation WHERE timestamp>'2017-11-14T13:36:00Z' AND timestamp<'2017-11-15T13:36:00Z' AND SENSOR_ID=ANY(array['3141_clwb_1300','3146_clwa_6029','3144_clwa_4065','3141_clwa_1423','3144_clwa_4231'])
true
58c4b6ca58539c81f04cb75ccfdc9cc79250ac0c
SQL
DianaAguayoUnlam/TPWeb-2
/logintp (1).sql
UTF-8
19,568
2.90625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 20-07-2019 a las 07:11:38 -- Versión del servidor: 5.7.25-log -- Versión de PHP: 7.3.2 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: `logintp` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `categoria` -- CREATE TABLE `categoria` ( `id` int(11) NOT NULL, `nombre` varchar(80) COLLATE utf8_spanish_ci NOT NULL, `visitas` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `categoria` -- INSERT INTO `categoria` (`id`, `nombre`, `visitas`) VALUES (1, 'Servicios', 1), (2, 'Inmuebles', 23), (3, 'Vehiculos', 11), (4, 'Productos y otros', 341); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `comentarios` -- CREATE TABLE `comentarios` ( `id` int(11) NOT NULL, `texto` varchar(300) COLLATE utf8_spanish_ci NOT NULL, `idUsuario` int(11) NOT NULL, `nombreUsuario` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `idProducto` int(11) NOT NULL, `idVendedor` int(11) NOT NULL, `idChat` int(11) NOT NULL, `fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `comentarios` -- INSERT INTO `comentarios` (`id`, `texto`, `idUsuario`, `nombreUsuario`, `idProducto`, `idVendedor`, `idChat`, `fecha`) VALUES (11, 'Mensaje privado', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (13, 'Me alegro por ti', 1, 'Ejemplo', 1, 1, 1, '2019-07-16 00:50:15'), (14, '¿Has recibido el item?', 1, 'Ejemplo', 1, 1, 1, '2019-07-16 00:50:15'), (15, 'Hola', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (16, '¿Estas?', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (17, '¿Estas?', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (18, 'Que tal?', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (19, 'Que tal?', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (22, 'Buenaas', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (23, 'ey', 1, 'Ejemplo', 1, 1, 1, '2019-07-16 00:50:15'), (24, 'Si', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (25, 'a', 6, 'Ivan', 1, 1, 1, '2019-07-16 00:50:15'), (27, 'Hola como hacemos ?', 21, 'Dominio', 1, 1, 2, '2019-07-16 00:50:15'), (28, 'Ivan, has recibido el producto?', 1, 'Ejemplo', 1, 1, 1, '2019-07-16 00:50:15'), (30, 'Hola, nos encontramos en Capital?', 1, 'Ejemplo', 1, 1, 2, '2019-07-16 00:50:15'), (31, 'Si, estoy de Acuerdo.', 21, 'Dominio', 1, 1, 2, '2019-07-16 00:50:15'), (32, 'Hola me ves ?', 25, 'Ale', 3, 3, 0, '2019-07-16 00:50:15'), (33, 'Viendo', 3, 'Nico', 3, 3, 0, '2019-07-16 00:53:30'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `compra` -- CREATE TABLE `compra` ( `id` int(11) NOT NULL, `idUsuario` int(11) NOT NULL, `idProducto` int(11) NOT NULL, `cantidad` int(11) NOT NULL, `costo` int(11) NOT NULL, `fecha` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `vendedor` varchar(100) COLLATE utf8_spanish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `compra` -- INSERT INTO `compra` (`id`, `idUsuario`, `idProducto`, `cantidad`, `costo`, `fecha`, `vendedor`) VALUES (19, 6, 1, 1, 1200, '2019-07-16 17:29:48', ''), (20, 6, 3, 1, 700, '2019-07-16 17:29:48', ''), (21, 6, 46, 1, 2520000, '2019-07-16 17:29:48', ''), (26, 21, 1, 1, 1200, '2019-07-16 17:29:48', ''), (31, 1, 1, 1, 1200, '2019-07-16 17:30:31', 'Ejemplo'), (32, 100, 1, 1, 1200, '2019-07-20 01:25:54', 'Ejemplo'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `imgprincipal` -- CREATE TABLE `imgprincipal` ( `id` int(11) NOT NULL, `idProducto` int(11) NOT NULL, `nombre` varchar(100) COLLATE utf8_spanish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `imgprincipal` -- INSERT INTO `imgprincipal` (`id`, `idProducto`, `nombre`) VALUES (1, 61, 'imagen2.jpg'), (3, 1, 'zm01.jpg'), (4, 2, 'adidaszz.jpg'), (5, 43, 'pinup.jpg'), (6, 44, 'b.jpg'), (7, 45, 'd.jpg'), (8, 46, 'dpto2.jpg'), (9, 3, '15940444_1318220971550973_7681097437073195512_n.jpg '), (10, 62, 'imagen2.jpg'), (11, 63, 'img_lights.jpg'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `imgproducto` -- CREATE TABLE `imgproducto` ( `id` int(11) NOT NULL, `idProducto` int(11) NOT NULL, `nombre` varchar(100) COLLATE utf8_spanish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `imgproducto` -- INSERT INTO `imgproducto` (`id`, `idProducto`, `nombre`) VALUES (1, 61, 'unlam.jpg'), (2, 61, 'imagen2.jpg'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pais` -- CREATE TABLE `pais` ( `id` int(11) NOT NULL, `nombre` varchar(100) COLLATE utf8_spanish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `pais` -- INSERT INTO `pais` (`id`, `nombre`) VALUES (1, 'Argentina'), (2, 'Brasil'), (3, 'Bolivia'), (4, 'Chile'), (5, 'Colombia'), (6, 'Ecuador'), (1, 'Argentina'), (2, 'Brasil'), (3, 'Bolivia'), (4, 'Chile'), (5, 'Colombia'), (6, 'Ecuador'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `porcentaje` -- CREATE TABLE `porcentaje` ( `id` int(11) NOT NULL, `valor` double DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `porcentaje` -- INSERT INTO `porcentaje` (`id`, `valor`) VALUES (1, 0.4); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pregunta` -- CREATE TABLE `pregunta` ( `id` int(11) NOT NULL, `texto` varchar(600) COLLATE utf8_spanish_ci NOT NULL, `idComprador` int(11) NOT NULL, `idVendedor` int(11) NOT NULL, `idProducto` int(11) NOT NULL, `fecha` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `pregunta` -- INSERT INTO `pregunta` (`id`, `texto`, `idComprador`, `idVendedor`, `idProducto`, `fecha`) VALUES (1, 'Hola estas?', 0, 1, 1, '2019-07-16 17:33:47'), (2, 'ffd', 100, 1, 1, '2019-07-20 01:26:31'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `producto` -- CREATE TABLE `producto` ( `id` int(11) NOT NULL, `nombre` varchar(200) COLLATE utf8_spanish_ci NOT NULL, `estado` varchar(60) COLLATE utf8_spanish_ci NOT NULL, `precio` double NOT NULL, `formasdepago` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `envio` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `marca` varchar(70) COLLATE utf8_spanish_ci NOT NULL, `stock` int(11) NOT NULL, `genero` varchar(60) COLLATE utf8_spanish_ci NOT NULL, `categoria` varchar(110) COLLATE utf8_spanish_ci NOT NULL, `palabrasClaves` varchar(110) COLLATE utf8_spanish_ci NOT NULL, `descripcion` varchar(600) COLLATE utf8_spanish_ci NOT NULL, `visitas` int(11) NOT NULL, `idUsuario` int(11) NOT NULL, `latitud` varchar(120) COLLATE utf8_spanish_ci NOT NULL, `longitud` varchar(120) COLLATE utf8_spanish_ci NOT NULL, `ventas` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `producto` -- INSERT INTO `producto` (`id`, `nombre`, `estado`, `precio`, `formasdepago`, `envio`, `marca`, `stock`, `genero`, `categoria`, `palabrasClaves`, `descripcion`, `visitas`, `idUsuario`, `latitud`, `longitud`, `ventas`) VALUES (1, 'Zapatillas Modernas', 'Nuevo', 1200, 'Efectivo', 'Gratis', 'Nike', 9, 'Hombre', 'Productos y otros', 'palabra\nclave', 'descrip', 1, 1, '', '', 205), (2, 'Zapatillas Adidas', 'Usado', 1400, 'Efectivo', 'Gratis', 'Adidas', 1200, 'Hombre', 'Productos y otros', 'palabra\nclave', 'Zapatillas Adidas usadas pero impecables', 1, 3, '', '', 20), (3, 'Promociono Ojotas', 'Usado', 700, '', 'Domicilio con Cargo', 'Torres', 1198, 'Unisex', 'Productos y otros', 'palabra\nclave', 'Soy una descripcion ', 1, 3, '', '', 6), (43, 'Vestido marinero PinUp', 'Nuevo', 3200, 'Transferencia Bancaria', 'Gratis', 'BrillaDark', 20, 'Mujer', 'Productos y otros', 'Vestido pinup', 'Hermoso vestido', 1, 7, '', '', 9), (44, 'Remeras para colegios', 'Nuevo', 300, 'Efectivo', 'Domicilio con cargo', 'Suavicer', 2000, 'Infantil', 'Productos y otros', 'Remeras Dibujos Colegios', 'Remeras para colegios primarios', 1, 2, '', '', 3), (45, 'Toyota Corola', 'Usado', 430000, 'Tarjeta', 'Entrega en local', 'Toyota', 1, 'Unisex', 'Vehiculos', 'Auto Usado Toyota', 'Auto Usado Toyota', 1, 2, '', '', 15), (46, 'Depto. 2 ambientes', 'Usado', 2520000, 'Tarjeta', 'Entrega en local', 'Inmuebles Alfredo', 1, 'Unisex', 'Inmuebles', 'departamento', 'Departamento 2 ambientes capital', 1, 2, '', '', 28), (61, 'Cuadros de Arte', 'Nuevo', 2000, 'Mercado de Pago', 'Gratis', 'Torres', 200, 'Unisex', 'Productos y otros', '', 'Realizo cuadres de arte de todo tipo', 1, 6, '', '', 30), (62, 'Cuadros', 'Nuevo', 10000, 'Mercado de Pago', 'Entrega en local', 'Cornelio ', 1, 'Unisex', 'Productos y otros', '', '', 1, 6, '-34.6163127', '-58.42878189999999', 40), (63, 'Ver', 'Nuevo', 1234, 'Mercado de Pago', 'Domicilio con cargo', 'visa', 12, 'Mujer', 'Vehiculos', 'Colres calros', 'Hola', 1, 6, '-34.6097408', '-58.366280399999994', 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `productocarrito` -- CREATE TABLE `productocarrito` ( `id` int(11) NOT NULL, `idUsuario` int(11) NOT NULL, `idProducto` int(11) NOT NULL, `cantidad` int(11) NOT NULL, `vendedor` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `productocarrito` -- INSERT INTO `productocarrito` (`id`, `idUsuario`, `idProducto`, `cantidad`, `vendedor`) VALUES (1, 2, 44, 1, 0), (2, 2, 46, 1, 0), (4, 2, 45, 1, 0), (5, 2, 1, 1, 0), (21, 21, 1, 1, 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `respuesta` -- CREATE TABLE `respuesta` ( `id` int(11) NOT NULL, `idUsuario` int(11) NOT NULL, `texto` varchar(600) COLLATE utf8_spanish_ci NOT NULL, `idPregunta` int(11) NOT NULL, `fecha` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `respuesta` -- INSERT INTO `respuesta` (`id`, `idUsuario`, `texto`, `idPregunta`, `fecha`) VALUES (1, 100, 'jhk', 2, '2019-07-20 01:26:42'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tipouser` -- CREATE TABLE `tipouser` ( `id` int(11) NOT NULL, `tipo` varchar(50) COLLATE utf8_spanish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `tipouser` -- INSERT INTO `tipouser` (`id`, `tipo`) VALUES (1, 'Usuario Top'), (2, 'Usuario Medio Pelo'), (3, 'Usuario Pa tras'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `transaccion` -- CREATE TABLE `transaccion` ( `id` int(11) NOT NULL, `idPorcentaje` int(11) DEFAULT NULL, `idUsuario` int(11) DEFAULT NULL, `total` double DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `transaccion` -- INSERT INTO `transaccion` (`id`, `idPorcentaje`, `idUsuario`, `total`) VALUES (1, 1, 7, 105.5), (2, 1, 3, 12880), (3, 1, 5, 0), (4, 1, 5, 0), (7, 1, 1, 97440), (9, 1, 100, 0), (10, 1, 99, 0), (11, 1, 25, 0), (12, 1, 89, 0), (13, 1, 99, 0), (14, 1, 100, 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuario` -- CREATE TABLE `usuario` ( `id` int(11) NOT NULL, `email` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `password` varchar(20) COLLATE utf8_spanish_ci NOT NULL, `Nombre` varchar(20) COLLATE utf8_spanish_ci NOT NULL, `estado` varchar(200) COLLATE utf8_spanish_ci NOT NULL, `pais` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `latitud` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `longitud` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `rol` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `idTipoUser` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `usuario` -- INSERT INTO `usuario` (`id`, `email`, `password`, `Nombre`, `estado`, `pais`, `latitud`, `longitud`, `rol`, `idTipoUser`) VALUES (1, 'ejemplo1@gmail.com', '1234', 'Ejemplo', 'ok', '', '0', '0', 'usuario', 3), (2, 'Nicolas@gmail.com', '1234', 'Nicolas', 'ok', '', '0', '0', 'usuario', 0), (3, 'Nicolas7@gmail.com', '1234', 'Nico', 'ok', '', '0', '0', 'usuario', 3), (4, 'Viendo@gmail.com', '1234', 'Viendo', 'ok', '', '0', '0', 'usuario', 0), (5, 'Gustavo@gmail.com', '1234', 'Gustavo', 'ok', '', '0', '0', 'usuario', 0), (6, 'Ivan@hotmail.com', '1234', 'Ivan', 'ok', '', '0', '0', 'administrador', 0), (7, 'user@gmail.com', '12', 'Usuario', 'ok', '', '0', '0', 'usuario', 0), (8, 'Roberto@hotmail.com', '12', 'Roberto', 'ok', '', '0', '0', 'usuario', 0), (9, 'UserNew@gmail.com', '1234', 'UsuarioNuevo', 'ok', '', '0', '0', 'usuario', 0), (10, 'Esteban@gmail.com', '12345', 'Esteban', 'ok', '', '0', '0', 'usuario', 0), (11, 'Ismael@gmail.com', '145', 'Ismael', 'ok', '', '0', '0', 'usuario', 0), (12, 'Diegote@gmail.com', '1234', 'Diego', 'ok', '', '0', '0', 'usuario', 0), (13, 'Maicol@gmail.com', '1234', 'Maicol', 'ok', '', '0', '0', 'usuario', 0), (14, 'Luis@gmail.com', 'abcd', 'Luis', 'Bloqueado', '', '0', '0', 'usuario', 0), (15, 'ejemplo5@gmail.com', '123', 'ejemplo5', 'ok', 'Colombia', '0', '0', 'usuario', 0), (16, 'ejemplo6@gmail.com', '123', 'ejemplo6', 'ok', 'Bolivia', '0', '0', 'usuario', 0), (21, 'Domi@gmail.com', '1234', 'Dominio', 'ok', 'Argentina', '-34.717815099999996', '-58.4841618', 'administrador', 0), (25, 'Ale@gmail.com', '1234', 'Ale', 'ok', 'Argentina', '-34.7177995', '-58.4841682', 'usuario', 0), (88, 'l@gmail.com', '4444', 'j', 'h', '665', '6', '6', '6', 0), (89, 'a@gmail.com', '1', 's', 'ok', 'Argentina', 'Null', 'Usuario nego la solicitud de Geolocalizacion.', 'usuario', 3), (99, 'b@gmail.com', '1111', 'a', 'ok', 'Argentina', 'Null', 'Usuario nego la solicitud de Geolocalizacion.', 'usuario', 3), (100, 'c@gmail.com', '2222', 'c', 'ok', 'Argentina', 'Null', 'Usuario nego la solicitud de Geolocalizacion.', 'usuario', 3); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `valoracion` -- CREATE TABLE `valoracion` ( `id` int(11) NOT NULL, `comentario` varchar(600) COLLATE utf8_spanish_ci DEFAULT NULL, `puntaje` int(11) NOT NULL, `idUsuario` int(11) DEFAULT NULL, `idVendedor` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `valoracion` -- INSERT INTO `valoracion` (`id`, `comentario`, `puntaje`, `idUsuario`, `idVendedor`) VALUES (1, 'muy amable', 5, 6, 2), (2, 'tuve un problema con la compra y me lo soluciono rapidamente', 4, 3, 2), (3, 'genial', 5, 10, 2), (4, 's', 3, 100, 1); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `categoria` -- ALTER TABLE `categoria` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `comentarios` -- ALTER TABLE `comentarios` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `compra` -- ALTER TABLE `compra` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `imgprincipal` -- ALTER TABLE `imgprincipal` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `imgproducto` -- ALTER TABLE `imgproducto` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `porcentaje` -- ALTER TABLE `porcentaje` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `pregunta` -- ALTER TABLE `pregunta` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `producto` -- ALTER TABLE `producto` ADD PRIMARY KEY (`id`); ALTER TABLE `producto` ADD FULLTEXT KEY `nombre` (`nombre`,`estado`,`marca`,`genero`,`palabrasClaves`,`descripcion`,`envio`); -- -- Indices de la tabla `productocarrito` -- ALTER TABLE `productocarrito` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `respuesta` -- ALTER TABLE `respuesta` ADD PRIMARY KEY (`id`), ADD KEY `idPregunta` (`idPregunta`); -- -- Indices de la tabla `tipouser` -- ALTER TABLE `tipouser` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `transaccion` -- ALTER TABLE `transaccion` ADD PRIMARY KEY (`id`), ADD KEY `idPorcentaje` (`idPorcentaje`); -- -- Indices de la tabla `usuario` -- ALTER TABLE `usuario` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `valoracion` -- ALTER TABLE `valoracion` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `categoria` -- ALTER TABLE `categoria` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT de la tabla `comentarios` -- ALTER TABLE `comentarios` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34; -- -- AUTO_INCREMENT de la tabla `compra` -- ALTER TABLE `compra` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33; -- -- AUTO_INCREMENT de la tabla `imgprincipal` -- ALTER TABLE `imgprincipal` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT de la tabla `imgproducto` -- ALTER TABLE `imgproducto` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `porcentaje` -- ALTER TABLE `porcentaje` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `pregunta` -- ALTER TABLE `pregunta` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `producto` -- ALTER TABLE `producto` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65; -- -- AUTO_INCREMENT de la tabla `productocarrito` -- ALTER TABLE `productocarrito` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT de la tabla `respuesta` -- ALTER TABLE `respuesta` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `transaccion` -- ALTER TABLE `transaccion` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT de la tabla `usuario` -- ALTER TABLE `usuario` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101; -- -- AUTO_INCREMENT de la tabla `valoracion` -- ALTER TABLE `valoracion` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `respuesta` -- ALTER TABLE `respuesta` ADD CONSTRAINT `respuesta_ibfk_2` FOREIGN KEY (`idPregunta`) REFERENCES `pregunta` (`id`); -- -- Filtros para la tabla `transaccion` -- ALTER TABLE `transaccion` ADD CONSTRAINT `transaccion_ibfk_1` FOREIGN KEY (`idPorcentaje`) REFERENCES `porcentaje` (`id`); 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
d4dd9b4383e4cfa5a03f464ca4865aec6f09e692
SQL
tom-186/MySQLqueries
/creare_db_da_query.sql
UTF-8
1,623
3.546875
4
[]
no_license
use master; create database revisioni_dispositivi; use revisioni_dispositivi create table aziende ( id int identity(1,1) not null, ragione_sociale varchar(50) null, cap nvarchar(5) null, citta nvarchar (50) null, indirizzo nvarchar(50) null, email nvarchar (50) not null unique, primary key clustered (id asc) ) create table dispositivi ( id int identity(1,1) not null, id_azienda int not null, nome nvarchar(50), data_acquisto date not null, scheda_tecnica text, periodicita_manutenzione int not null, dismesso bit, primary key clustered (id asc) ) create table revisori ( id int identity(1,1) not null, nome nvarchar(50), cognome nvarchar(50), cap nvarchar(5) null, citta nvarchar (50) null, indirizzo nvarchar(50) null, email nvarchar (50) not null unique, telefono nvarchar(50) null, partita_iva nvarchar(50) null, primary key clustered (id asc) ) create table revisioni ( id int identity(1,1) not null, id_dispositivo int not null, id_revisore int not null, data_revisione date not null, note text, esito_revisione bit not null, primary key clustered (id asc) ) use revisioni_dispositivi ALTER TABLE dispositivi ADD CONSTRAINT FK_dispositivi_aziende FOREIGN KEY (id_azienda) REFERENCES aziende (id) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE revisioni ADD CONSTRAINT FK_revisioni_dispositivi FOREIGN KEY (id_dispositivo) REFERENCES dispositivi (id) ON DELETE CASCADE ON UPDATE CASCADE ALTER TABLE revisioni ADD CONSTRAINT FK_revisioni_revisore FOREIGN KEY (id_revisore) REFERENCES revisori (id) ON DELETE CASCADE ON UPDATE CASCADE
true
a4a4abac69dae1a84bce9fb18b0eccaf19d80c63
SQL
fcomanah/clv-old
/mysql/clv-adminer.sql
UTF-8
5,902
3.625
4
[]
no_license
-- Adminer 3.7.1 MySQL dump SET NAMES utf8; SET foreign_key_checks = 0; SET time_zone = '-03:00'; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; DELIMITER ;; DROP PROCEDURE IF EXISTS `add_to_cart`;; CREATE PROCEDURE `add_to_cart`(IN `uid` char(32), IN `pid` mediumint, IN `qty` mediumint) BEGIN DECLARE cid INT; DECLARE s INT; DECLARE q INT; SELECT id_ INTO cid FROM car WHERE user_session_id=uid AND id_prd=pid; IF cid > 0 THEN SELECT stq INTO s FROM prd WHERE id_=pid; SELECT qtd INTO q FROM car WHERE id_=cid; IF (q+qty) < s THEN UPDATE car SET qtd=qtd+qty, dtm=NOW() WHERE id_=cid; ELSE UPDATE car SET qtd=s, dtm=NOW() WHERE id_=cid; END IF; ELSE INSERT INTO car (user_session_id, id_prd, qtd) VALUES (uid, pid, qty); END IF; END;; DROP PROCEDURE IF EXISTS `get_ctg`;; CREATE PROCEDURE `get_ctg`(IN `id` tinyint) SELECT * FROM ctg WHERE id_=id;; DROP PROCEDURE IF EXISTS `get_prd`;; CREATE PROCEDURE `get_prd`(IN `pid` mediumint(8) unsigned) SELECT * FROM prd WHERE id_=pid;; DROP PROCEDURE IF EXISTS `get_usr`;; CREATE PROCEDURE `get_usr`(IN `uid` int(10) unsigned) SELECT * FROM usr WHERE id_=uid;; DROP PROCEDURE IF EXISTS `ls_cart`;; CREATE PROCEDURE `ls_cart`(uid CHAR(32)) BEGIN SELECT * FROM car WHERE user_session_id=uid; END;; DROP PROCEDURE IF EXISTS `ls_ctg`;; CREATE PROCEDURE `ls_ctg`() BEGIN SELECT * FROM ctg WHERE id_ > 1 ORDER by nme; END;; DROP PROCEDURE IF EXISTS `ls_ctg_flh`;; CREATE PROCEDURE `ls_ctg_flh`(IN `id` tinyint(3)) BEGIN SELECT * FROM ctg WHERE id_ IN ( SELECT id_ctg_flh FROM mnu WHERE id_ctg_pai = id); END;; DROP PROCEDURE IF EXISTS `ls_ctg_pai`;; CREATE PROCEDURE `ls_ctg_pai`(IN `id` tinyint(3)) BEGIN SELECT * FROM ctg WHERE id_ IN ( SELECT id_ctg_pai FROM mnu WHERE id_ctg_flh = id AND id_ctg_pai > 1); END;; DROP PROCEDURE IF EXISTS `ls_prd`;; CREATE PROCEDURE `ls_prd`() BEGIN SELECT * FROM prd ORDER by nme; END;; DROP PROCEDURE IF EXISTS `ls_prd_from_ctg`;; CREATE PROCEDURE `ls_prd_from_ctg`(IN `id` tinyint(3)) BEGIN SELECT * FROM prd WHERE id_ctg=id ORDER by nme; END;; DROP PROCEDURE IF EXISTS `ls_trs`;; CREATE PROCEDURE `ls_trs`() BEGIN SELECT * FROM trs ORDER by id_trs DESC; END;; DROP PROCEDURE IF EXISTS `ls_usr`;; CREATE PROCEDURE `ls_usr`() BEGIN SELECT * FROM usr ORDER by nme; END;; DROP PROCEDURE IF EXISTS `remove_from_cart`;; CREATE PROCEDURE `remove_from_cart`(IN `cid` mediumint, IN `qty` mediumint) BEGIN DECLARE q INT; UPDATE car SET qtd=qtd-qty, dtm=NOW() WHERE id_=cid; SELECT qtd INTO q FROM car WHERE id_=cid; IF q <= 0 THEN DELETE FROM car WHERE id_=cid; END IF; END;; DROP PROCEDURE IF EXISTS `remove_from_stq`;; CREATE PROCEDURE `remove_from_stq`(IN `qtd` mediumint(8) unsigned, IN `pid` mediumint(8) unsigned) UPDATE prd SET stq=stq-qtd WHERE id_=pid;; DELIMITER ; DROP TABLE IF EXISTS `car`; CREATE TABLE `car` ( `id_` int(10) unsigned NOT NULL AUTO_INCREMENT, `qtd` smallint(5) unsigned NOT NULL, `user_session_id` char(32) COLLATE utf8_unicode_ci NOT NULL, `id_prd` mediumint(8) unsigned NOT NULL, `dtc` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `dtm` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id_`), KEY `car_ibfk_1` (`id_prd`), KEY `user_session_id` (`user_session_id`), CONSTRAINT `car_ibfk_1` FOREIGN KEY (`id_prd`) REFERENCES `prd` (`id_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `ctg`; CREATE TABLE `ctg` ( `id_` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, `nme` varchar(60) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id_`), UNIQUE KEY `nme` (`nme`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `mnu`; CREATE TABLE `mnu` ( `id_ctg_flh` tinyint(3) unsigned NOT NULL, `id_ctg_pai` tinyint(3) unsigned NOT NULL, UNIQUE KEY `id_ctg_flh` (`id_ctg_flh`), UNIQUE KEY `id_flh_pai` (`id_ctg_flh`,`id_ctg_pai`), KEY `mnu_ibfk_1` (`id_ctg_flh`), KEY `mnu_ibfk_2` (`id_ctg_pai`), CONSTRAINT `mnu_ibfk_1` FOREIGN KEY (`id_ctg_flh`) REFERENCES `ctg` (`id_`), CONSTRAINT `mnu_ibfk_2` FOREIGN KEY (`id_ctg_pai`) REFERENCES `ctg` (`id_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `prd`; CREATE TABLE `prd` ( `id_` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `nme` varchar(60) COLLATE utf8_unicode_ci NOT NULL, `prc` decimal(10,2) unsigned NOT NULL, `dsc` tinytext COLLATE utf8_unicode_ci, `img` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `stq` mediumint(8) unsigned NOT NULL DEFAULT '0', `dtc` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `id_ctg` tinyint(3) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id_`), KEY `prd_ibfk_1` (`id_ctg`), CONSTRAINT `prd_ibfk_1` FOREIGN KEY (`id_ctg`) REFERENCES `ctg` (`id_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `trs`; CREATE TABLE `trs` ( `id_` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, `id_trs` int(100) unsigned NOT NULL, `status` enum('Em andamento','Não foi feito pagamento','Cancelada','Aguardando pagamento','Aprovada','Encaminhando envio','Concluída') COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id_`), UNIQUE KEY `id_trs` (`id_trs`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `usr`; CREATE TABLE `usr` ( `id_` int(10) unsigned NOT NULL AUTO_INCREMENT, `type` enum('member','admin') NOT NULL, `nme` varchar(30) NOT NULL, `email` varchar(80) NOT NULL, `pass` varbinary(32) DEFAULT NULL, `first_name` varchar(20) NOT NULL, `last_name` varchar(40) NOT NULL, `date_expires` date NOT NULL, `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id_`), UNIQUE KEY `nme` (`nme`), UNIQUE KEY `email` (`email`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- 2013-08-14 19:43:27
true
132b7b73944db8a178db0fb3914558f6972e0894
SQL
ckcoyle/topspin-wordpress
/sql/topspin_items_images.sql
UTF-8
354
2.578125
3
[]
no_license
CREATE TABLE IF NOT EXISTS `<?php echo $wpdb->prefix;?>topspin_items_images` ( `id` int(11) NOT NULL AUTO_INCREMENT, `item_id` int(11) NOT NULL, `source_url` text NOT NULL, `small_url` text NOT NULL, `medium_url` text NOT NULL, `large_url` text NOT NULL, PRIMARY KEY (`id`), KEY `item_id` (`item_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
true
a0ceccd78b887a9b503608cc46ca9ff59db492c5
SQL
yeonju01/bigdata
/02_DBMS/DBMS_src/DBMS_MySQL_Test.sql
UTF-8
3,641
4.3125
4
[]
no_license
-- 1. 사번, 이름, 급여를 출력 select pno, pname, pay from personal; -- 2. 급여가 2000~5000 사이 모든 직원의 모든 필드 select * from personal where pay between 2000 and 5000; -- 3. 부서번호가 10또는 20인 사원의 사번, 이름, 부서번호 select pno, pname, dno from personal where dno in(10,20); -- 4. 보너스가 null인 사원의 사번, 이름, 급여 급여 큰 순정렬 select pno, pname, pay from personal where bonus is null order by pay desc; -- 5. 사번, 이름, 부서번호, 급여. 부서코드 순 정렬 같으면 PAY 큰순 select pno, pname, dno, pay from personal order by dno, pay desc; -- 6. 사번, 이름, 부서명 select pno, pname, dname from division d, personal p where d.dno=p.dno; -- 7. 사번, 이름, 상사이름 select w.pno, w.pname worker, m.pname manager from personal w, personal m where w.manager=m.pno; -- 8. 사번, 이름, 상사이름(상사가 없는 사람도 출력) select w.pno, w.pname worker, m.pname manager from personal m right outer join personal w on w.manager=m.pno; -- 8-1 사번, 이름, 상사이름(상사가 없는 사람은 상사없음이라고 대신 출력) select w.pno, w.pname worker, ifnull(m.pname,'상사없음') manager from personal m right outer join personal w on w.manager=m.pno; -- 9. 이름이 s로 시작하는 사원 이름 select pname from personal where pname like 'S%'; select pname from personal where substr(pname,1,1)='S'; select pname from personal where instr(pname,'s')=1; -- 10. 사번, 이름, 급여, 부서명, 상사이름 select w.pno, w.pname worker, w.pay, dname, m.pname manager from personal w, personal m, division d where d.dno=w.dno and w.manager=m.pno; -- 11. 부서코드, 급여합계, 최대급여 select dno, sum(pay) sumpay, max(pay) maxpay from personal group by dno; -- 12. 부서명, 급여평균, 인원수 select dname, avg(pay), count(*) from personal p, division d where p.dno=d.dno group by dname; select dname, avg(pay), count(p.pno) from personal p right outer join division d on p.dno=d.dno group by dname; -- 40번부서 포함 -- 13. 부서코드, 급여합계, 인원수 인원수가 4명 이상인 부서만 출력 select dno, sum(pay), count(*) from personal group by dno having count(*)>=4; -- 14. 사번, 이름, 급여 회사에서 제일 급여를 많이 받는 사람 select pno, pname, pay from personal where pay = (select max(pay) from personal); -- 15. 회사 평균보다 급여를 많이 받는 사람 이름, 급여, 부서번호 select pname, pay, dno from personal where pay > (select avg(pay) from personal); -- 16. 15번에 부서명을 추가하고 부서명순 정열 같으면 급여 큰순 select pname, pay, p.dno, dname from personal p, division d where d.dno=p.dno and pay > (select avg(pay) from personal) order by dname, pay desc; -- 17. 자신이 속한 부서의 평균보다 많인 받는 사람의 이름, 금여, 부서번호, 반올림한 해당부서평균 select pname, pay, dno, round((select avg(pay) from personal where p.dno=dno),0) avgsal from personal p where pay > (select avg(pay) from personal where p.dno=dno); -- 18. 입사가 가장 빠른 사람의 이름, 급여, 부서명 select pname, pay, dname from personal p, division d where d.dno=p.dno and startdate = (select min(startdate) from personal); -- 19. 이름, 급여, 해당부서평균 select pname, pay, (select avg(pay) from personal where p.dno=dno) from personal p; -- 20. 이름, 급여, 부서명, 해당부서평균 select pname, pay, dname, (select avg(pay) from personal where p.dno=dno) from personal p, division d where p.dno=d.dno;
true
623734ec937712ab00716982a3af2755898b24e1
SQL
ehn94/DB_course
/Assignment 4/Twitter.sql
UTF-8
708
3.53125
4
[]
no_license
CREATE TABLE tweets ( id BIGINT PRIMARY KEY, date DATE, hour TIME, message VARCHAR, favs BIGINT, rts BIGINT, picture VARCHAR, lang VARCHAR, url VARCHAR, listed BIGINT, CONSTRAINT uname FOREIGN KEY (uname) REFERENCES users(uname), CONSTRAINT location FOREIGN KEY (locationId) REFERENCES locations(locationId) ); CREATE TABLE users( uname VARCHAR PRIMARY KEY, nickname VARCHAR, bio VARCHAR, followers BIGINT, following BIGINT ); CREATE TABLE locations( locationId BIGINT PRIMARY KEY, latitude DOUBLE PRECISION, longitude DOUBLE PRECISION, CONSTRAINT country FOREIGN KEY (countryId) REFERENCES countries(countryId) ); CREATE TABLE countries ( countryId BIGINT PRIMARY KEY, country VARCHAR place VARCHAR );
true
d8fd8734d57208726338ff64f0d3bad6cd52f163
SQL
FrancescoPennacchia/BasiDiDati
/Risorse/SQL/CreazioneDB.sql
UTF-8
10,688
3.375
3
[]
no_license
DROP DATABASE IF EXISTS anhandforhumanityDB; CREATE SCHEMA IF NOT EXISTS anhandforhumanityDB; USE anhandforhumanityDB; -- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- $$$$$$\ $$\ $$$$$$$$\ $$\ $$\ $$\ -- $$ __$$\ \__| \__$$ __| $$ | $$ |$$ | -- $$ / \__| $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$$$\ $$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$ | $$$$$$\ $$$$$$$\ $$$$$$\ $$ |$$ | $$$$$$\ -- $$ | $$ __$$\ $$ __$$\ \____$$\ \____$$ |$$ |$$ __$$\ $$ __$$\ $$ __$$\ $$ | \____$$\ $$ __$$\ $$ __$$\ $$ |$$ |$$ __$$\ -- $$ | $$ | \__|$$$$$$$$ | $$$$$$$ | $$$$ _/ $$ |$$ / $$ |$$ | $$ |$$$$$$$$ | $$ | $$$$$$$ |$$ | $$ |$$$$$$$$ |$$ |$$ |$$$$$$$$ | -- $$ | $$\ $$ | $$ ____|$$ __$$ | $$ _/ $$ |$$ | $$ |$$ | $$ |$$ ____| $$ |$$ __$$ |$$ | $$ |$$ ____|$$ |$$ |$$ ____| -- \$$$$$$ |$$ | \$$$$$$$\ \$$$$$$$ |$$$$$$$$\ $$ |\$$$$$$ |$$ | $$ |\$$$$$$$\ $$ |\$$$$$$$ |$$$$$$$ |\$$$$$$$\ $$ |$$ |\$$$$$$$\ -- \______/ \__| \_______| \_______|\________|\__| \______/ \__| \__| \_______| \__| \_______|\_______/ \_______|\__|\__| \_______| -- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'NAZIONI' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Nazioni ( id INT NOT NULL AUTO_INCREMENT, nazione VARCHAR(45) NOT NULL, UNIQUE(id, nazione), PRIMARY KEY (id) ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'COLLABORATORI' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Collaboratori ( cod VARCHAR(20) NOT NULL, UNIQUE(cod), PRIMARY KEY (cod) ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'Personale' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Personale ( cod VARCHAR(20) NOT NULL, nome VARCHAR(30) NOT NULL, cognome VARCHAR(35) NOT NULL, dataNascita DATE NOT NULL, luogoNascita VARCHAR(20) NOT NULL, nDocumento VARCHAR(15) NOT NULL, idNazione INT NOT NULL, provincia VARCHAR(30) NULL, citta VARCHAR(20) NOT NULL, CAP VARCHAR(10) NULL, via VARCHAR(30) NULL, nCivico INT NULL, telefono VARCHAR(15) NULL, email VARCHAR(40) NULL, pass VARCHAR(20) NULL, descrizioneQualifiche VARCHAR(140) NULL, ruolo VARCHAR(60) NULL, stipendioNominale FLOAT NULL, UNIQUE(cod, nDocumento), PRIMARY KEY (cod), FOREIGN KEY (idNazione) REFERENCES Nazioni(id) ON DELETE NO ACTION ON UPDATE CASCADE ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'SEDI' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Sedi ( id INT NOT NULL AUTO_INCREMENT, nome VARCHAR(30) NOT NULL, idNazione INT NOT NULL, provincia VARCHAR(30) NOT NULL, citta VARCHAR(20) NOT NULL, CAP VARCHAR(10) NULL, via VARCHAR(30) NOT NULL, nCivico INT NULL, telefono VARCHAR(15) NULL, email VARCHAR(40) NULL, UNIQUE(id), PRIMARY KEY (id), FOREIGN KEY (idNazione) REFERENCES Nazioni(id) ON DELETE NO ACTION ON UPDATE CASCADE ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'MANSIONI' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Mansioni ( id INT NOT NULL AUTO_INCREMENT, descrizione VARCHAR(200) NOT NULL, dataInizio DATE NOT NULL, dataFine DATE NULL, idNazione INT NOT NULL, provincia VARCHAR(30) NULL, citta VARCHAR(20) NULL, CAP VARCHAR(10) NULL, via VARCHAR(30) NULL, nCivico INT NULL, UNIQUE(id), PRIMARY KEY (id), FOREIGN KEY (idNazione) REFERENCES Nazioni(id) ON DELETE NO ACTION ON UPDATE CASCADE ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'MovimentiBancari' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS MovimentiBancari ( id INT NOT NULL AUTO_INCREMENT, descrizione VARCHAR(200) NOT NULL, giorno DATE NOT NULL, momento TIME NOT NULL, importo FLOAT NOT NULL, codTesoriere VARCHAR(20) NULL, codCollaboratore VARCHAR(20) NULL, UNIQUE(id), PRIMARY KEY (id), FOREIGN KEY (codCollaboratore) REFERENCES Collaboratori(cod) ON DELETE NO ACTION ON UPDATE CASCADE, FOREIGN KEY (codTesoriere) REFERENCES Personale(cod) ON DELETE NO ACTION ON UPDATE CASCADE ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'DITTE ESTERNE' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS DitteEsterne ( cod VARCHAR(20) NOT NULL, ragioneSociale VARCHAR(30) NOT NULL, descrizione VARCHAR(100) NULL, sitoWeb VARCHAR(30) NULL, telefono VARCHAR(15) NULL, email VARCHAR(40) NULL, UNIQUE(cod, ragioneSociale), PRIMARY KEY (cod) ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'PARTNER' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Partner ( cod VARCHAR(20) NOT NULL, nome VARCHAR(45) NOT NULL, descrizione VARCHAR(100) NULL, sitoWeb VARCHAR(30) NULL, telefono VARCHAR(15) NULL, email VARCHAR(40) NULL, UNIQUE(cod), PRIMARY KEY (cod) ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'CIVILI' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Civili ( cod VARCHAR(20) NOT NULL, nome VARCHAR(30) NOT NULL, cognome VARCHAR(35) NOT NULL, dataNascita DATE NOT NULL, luogoNascita VARCHAR(20) NOT NULL, nDocumento VARCHAR(15) NULL, idNazione INT NOT NULL, provincia VARCHAR(30) NULL, citta VARCHAR(20) NULL, CAP VARCHAR(10) NULL, via VARCHAR(30) NULL, nCivico INT NULL, telefono VARCHAR(15) NOT NULL, email VARCHAR(40) NULL, titoloDiStudo VARCHAR(45) NULL, pass VARCHAR(30) NULL, UNIQUE(cod, nDocumento), PRIMARY KEY (cod), FOREIGN KEY (idNazione) REFERENCES Nazioni(id) ON DELETE NO ACTION ON UPDATE CASCADE ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'COLLABORA' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Collabora ( codCollaboratore VARCHAR(20) NOT NULL, idMansione INT NOT NULL, descrizione VARCHAR(500), PRIMARY KEY (codCollaboratore, idMansione), FOREIGN KEY (codCollaboratore) REFERENCES Collaboratori(cod) ON DELETE NO ACTION ON UPDATE CASCADE, FOREIGN KEY (idMansione) REFERENCES Mansioni(id) ON DELETE NO ACTION ON UPDATE CASCADE ); -- ----------------------------------------------------- -- Table 'OrganizzazioneUmanitaria'.'IMPIEGATO' -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Impiegato ( codPersonale VARCHAR(20) NOT NULL, idSede INT NOT NULL, trasferta TINYINT(1) NOT NULL, dataInizio DATE NOT NULL, dataFine DATE NULL, PRIMARY KEY (codPersonale, idSede, dataInizio), FOREIGN KEY (codPersonale) REFERENCES Personale(cod) ON DELETE NO ACTION ON UPDATE CASCADE, FOREIGN KEY (idSede) REFERENCES Sedi(id) ON DELETE NO ACTION ON UPDATE CASCADE ); -- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- $$\ $$\ -- $$ | \__| -- $$$$$$\ $$$$$$\ $$\ $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$$\ -- \_$$ _| $$ __$$\ $$ |$$ __$$\ $$ __$$\ $$ __$$\ $$ __$$\ $$ _____| -- $$ | $$ | \__|$$ |$$ / $$ |$$ / $$ |$$$$$$$$ |$$ | \__|\$$$$$$\ -- $$ |$$\ $$ | $$ |$$ | $$ |$$ | $$ |$$ ____|$$ | \____$$\ -- \$$$$ |$$ | $$ |\$$$$$$$ |\$$$$$$$ |\$$$$$$$\ $$ | $$$$$$$ | -- \____/ \__| \__| \____$$ | \____$$ | \_______|\__| \_______/ -- $$\ $$ |$$\ $$ | -- \$$$$$$ |\$$$$$$ | -- \______/ \______/ -- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- ----------------------------------------------------- -- Trigger Personale -- ----------------------------------------------------- delimiter | CREATE TRIGGER cod_personale BEFORE INSERT ON Personale FOR EACH ROW BEGIN INSERT INTO Collaboratori SET Collaboratori.cod = NEW.cod; END| -- ----------------------------------------------------- -- Trigger Ditte -- ----------------------------------------------------- delimiter | CREATE TRIGGER cod_ditta BEFORE INSERT ON DitteEsterne FOR EACH ROW BEGIN INSERT INTO Collaboratori SET Collaboratori.cod = NEW.cod; END| -- ----------------------------------------------------- -- Trigger Partner -- ----------------------------------------------------- delimiter | CREATE TRIGGER cod_partner BEFORE INSERT ON Partner FOR EACH ROW BEGIN INSERT INTO Collaboratori SET Collaboratori.cod = NEW.cod; END| -- ----------------------------------------------------- -- Trigger Civili -- ----------------------------------------------------- delimiter | CREATE TRIGGER cod_civile BEFORE INSERT ON Civili FOR EACH ROW BEGIN INSERT INTO Collaboratori SET Collaboratori.cod = NEW.cod; END| -- ----------------------------------------------------- -- Trigger inserimento movimento -- ----------------------------------------------------- delimiter | CREATE TRIGGER inserimento_movimento BEFORE INSERT ON MovimentiBancari FOR EACH ROW BEGIN IF (SELECT ruolo FROM Personale WHERE cod = new.codTesoriere) <> "tesoriere" THEN signal sqlstate '45000'; ELSE IF (NEW.giorno = '0000-00-00') THEN SET NEW.giorno = current_date; END IF; IF (NEW.momento = '00:00:00') THEN SET NEW.momento = current_time; END IF; END IF; END|
true
b9688c5d37d03bfd57329d871ee795ca4c17b2a9
SQL
chongzi/aaa
/存储过程/tg_count_day_income.sql
UTF-8
4,447
3.890625
4
[]
no_license
label:BEGIN ########################### 修正数据 ###################################### DECLARE curr_date int DEFAULT 0; DECLARE appId int DEFAULT 0; SET curr_date = mydate; set appId = myAppId; #传入日期,应用,广告id if curr_date=0 then select '没有选择日期'; LEAVE label; # 退出存储过程 END if; if appId=0 then select '没有选择应用id'; LEAVE label; # 退出存储过程 END if; ################################################################################################# #今天日期 SET @today = from_unixtime(unix_timestamp(now()), "%Y%m%d"); if curr_date<20200111 then set @s_ad_click_log = 's_ad_click_log_20200110'; set @s_ad_show_log = 's_ad_show_log_20200110'; elseif curr_date<@today then set @s_ad_click_log = CONCAT('s_ad_click_log_',curr_date); set @s_ad_show_log = CONCAT('s_ad_show_log_',curr_date); else set @s_ad_click_log = 's_ad_click_log'; set @s_ad_show_log = 's_ad_show_log'; end if; #如果表不存在,则走默认 if !(SELECT COUNT(*) FROM information_schema.`TABLES` WHERE TABLE_NAME=@s_ad_click_log) then set @s_ad_click_log = 's_ad_click_log'; end if; if !(SELECT COUNT(*) FROM information_schema.`TABLES` WHERE TABLE_NAME=@s_ad_show_log) then set @s_ad_show_log = 's_ad_show_log'; end if; #LEAVE label; # 退出存储过程 ################################################################################################# #创建临时表 CREATE TABLE IF NOT EXISTS s_tmp_date ( id INT(11) NOT NULL AUTO_INCREMENT, date INT(11) NOT NULL DEFAULT 0 COMMENT '日期', plan_id INT(11) NOT NULL DEFAULT 0 COMMENT '投放计划ID', app_id INT(11) NOT NULL DEFAULT 0 COMMENT '应用编号', agent_pid INT(11) NOT NULL DEFAULT 0 COMMENT '一级渠道ID', agent_id INT(11) NOT NULL DEFAULT 0 COMMENT '二级渠道ID', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='临时数据表(天)'; #清空临时表数据 truncate TABLE s_tmp_date; #向临时表中插入数据 insert into s_tmp_date(id,date,plan_id,app_id,agent_pid,agent_id) select (@i:=@i+1)pm,a.* from ( select add_date,plan_id,app_id,agent_pid,agent_id from s_user_login_log where add_date=curr_date and app_id=appId group by plan_id,app_id,agent_pid,agent_id ) as a,(select @i:=0)t; #插入缺失数据 insert into s_tg_count_day (date,plan_id,app_id,agent_pid,agent_id) select date,plan_id,app_id,agent_pid,agent_id from s_tmp_date where id not in ( select b.id from ( select date,plan_id,app_id,agent_pid,agent_id from s_tg_count_day where date=curr_date and app_id=appId group by plan_id,app_id,agent_pid,agent_id ) as a inner join ( select * from s_tmp_date )as b on a.date=b.date and a.plan_id=b.plan_id and a.app_id=b.app_id and a.agent_pid=b.agent_pid and a.agent_id=b.agent_id ); #当天广告总收入 update s_tg_count_day as a inner join( select date,plan_id,app_id,agent_pid,agent_id,sum(income) as money from s_ad_income where date=curr_date and app_id=appId group by plan_id,app_id,agent_pid,agent_id ) as b on a.date=b.date and a.plan_id=b.plan_id and a.app_id=b.app_id and a.agent_pid=b.agent_pid and a.agent_id=b.agent_id set a.ad_income=b.money where a.date=curr_date and a.app_id=appId; #当天注册的用户产生的收入 set @sqlstr = concat(" update s_tg_count_day as c inner join ( select a.date,a.plan_id,a.app_id,a.agent_pid,a.agent_id, round(a.money/a.num*b.new_click_num,2) as money from ( select date,plan_id,app_id,agent_pid,agent_id,sum(income) as money,sum(ad_click_num) as num from s_ad_income where date=",curr_date," and app_id=",appId," group by plan_id,app_id,agent_pid,agent_id )as a inner join ( select add_date,plan_id,app_id,agent_pid,agent_id,count(1) as new_click_num from ",@s_ad_click_log," where add_date=",curr_date," and user_reg_date=",curr_date," and app_id=",appId," group by plan_id,app_id,agent_pid,agent_id) as b on a.date=b.add_date and a.plan_id=b.plan_id and a.app_id=b.app_id and a.agent_pid=b.agent_pid and a.agent_id=b.agent_id )as d on c.date=d.date and c.plan_id=d.plan_id and c.app_id=d.app_id and c.agent_pid=d.agent_pid and c.agent_id=d.agent_id set c.new_ad_income = d.money where c.date=",curr_date," and c.app_id=",appId,"; "); PREPARE stmt from @sqlStr; EXECUTE stmt; DEALLOCATE PREPARE stmt; END
true
d9e3b517bfc0d14db5b5ebd28dc91729ffbe3b24
SQL
mstaragrieb/Kindle-Highlights
/resources/db/kindle_highlights.sql
UTF-8
453
2.640625
3
[]
no_license
CREATE DATABASE kindle_highlights; CREATE TABLE `kindle_highlights`.`new_table` ( `id` INT NOT NULL AUTO_INCREMENT , `book_id` INT(4) NULL , `high_lighted_text` TEXT NULL , `twitter` INT(1) NULL , `facebook` INT(1) NULL , PRIMARY KEY (`id`) ); CREATE TABLE `kindle_highlights`.`kindle_books` ( `id` INT NOT NULL AUTO_INCREMENT , `title` TEXT NULL , `author` VARCHAR(254) NULL , `link` VARCHAR(254) NULL , PRIMARY KEY (`id`) );
true
724fba913fa83fa03fe6147210bda7cec377d007
SQL
caiquesantosbrito/Senai_Sprint2_Backend
/Inlock_games/Scripts_BD/inlock_03_DQL.sql
UTF-8
649
3.53125
4
[]
no_license
USE Inlock_games; SELECT Usuarios.email, Usuarios.senha, TipoUsuario FROM Usuarios LEFT JOIN TiposUsuarios ON Usuarios.idTipoUsuario = TiposUsuarios.idTipoUsuario; SELECT * FROM Estudios; SELECT * FROM Jogos; SELECT Jogos.idJogo, Jogos.nomeJogo, Estudios.nomeEstudio, Jogos.descricao, Jogos.valor FROM Jogos LEFT JOIN Estudios ON Jogos.idEstudio = Estudios.idEstudio; SELECT Estudios.nomeEstudio, Jogos.nomeJogo FROM Estudios FULL OUTER JOIN Jogos ON Estudios.idEstudio = Jogos.idJogo; SELECT * FROM Usuarios WHERE email = 'cliente@cliente.com' AND senha = 'cliente'; SELECT * FROM Jogos WHERE idJogo = 1; SELECT * FROM Estudios WHERE idEstudio = 1;
true
d6df1d7183e70664bf399d48e33fd2a470748eeb
SQL
ASTAMBE/opnt
/opnt_sql/insertCartDelQ.sql
UTF-8
770
3.375
3
[]
no_license
-- insertCartDelQ DELIMITER // DROP PROCEDURE IF EXISTS insertCartDelQ // CREATE PROCEDURE insertCartDelQ(userid varchar(45), topicid INT) BEGIN /* 08/11/2020 Kapil: Confirmed */ declare orig_uid, pbuid INT; SET @orig_uid := (SELECT bringUserid(userid)); -- SET @Ppbuid := (SELECT bringUseridFromUsername(postuserid)); -- ADDED THE LINE BELOW AS A STEP FOR MAKING LAST_UPDATE_DTM-BASED CLUSTERING DELETE FROM OPN_CART_ARCHIVE WHERE OPN_CART_ARCHIVE.USERID = @orig_uid AND OPN_CART_ARCHIVE.TOPICID = topicid; -- THE DELETE FROM OPN_CART_ARCHIVE HAD TO BE ADDED BEFORE THE DELETE FROM OPN_USER_CARTS. ELSE IT DOESN'T WORK. DELETE FROM OPN_USER_CARTS WHERE OPN_USER_CARTS.USERID = @orig_uid AND OPN_USER_CARTS.TOPICID = topicid; END // DELIMITER ; --
true
4b083844b0ca9222ed609fd0f27a6caaa493e80d
SQL
anjithakkamal/S2
/ADBMS/labcycles/CYCLE3/C3SET3.sql
UTF-8
3,237
4.28125
4
[]
no_license
CREATE TABLE EMPLOYEE ( SSN INT, ENAME VARCHAR(40) NOT NULL, DESIGN VARCHAR(20), DNO INT, DOJ DATE, SALARY INT,PRIMARY KEY (SSN) ); CREATE TABLE DEPARTMENT (DNUMBER INT, DNAME VARCHAR(20), LOC VARCHAR(40), MGRSSN INT REFERENCES EMPLOYEE(SSN), PRIMARY KEY(DNUMBER) ); CREATE TABLE PROJECT ( PNUMBER INT, PNAME VARCHAR(15), DNUM INT, FOREIGN KEY(DNUM) REFERENCES DEPARTMENT(DNUMBER), PRIMARY KEY(PNUMBER) ); CREATE TABLE WORK_IN ( ESSN INT, PNO INT, HOURS INT, FOREIGN KEY (ESSN) REFERENCES EMPLOYEE(SSN), FOREIGN KEY (PNO) REFERENCES PROJECT(PNUMBER), FOREIGN KEY (HOURS) REFERENCES DEPARTMENT(DNUMBER) ); DESCRIBE EMPLOYEE; DESCRIBE DEPARTMENT; DESCRIBE PROJECT; INSERT INTO EMPLOYEE(SSN,ENAME,DESIGN,DNO,DOJ,SALARY)VALUES(1,'Abhi','HR',2,'2009-04-12',70000 ), (2,'bhama','admin',1,'2008-03-10',75000 ),(3,'chriz','sales',3,'2015-06-23',35000 ), (4,'diya','production',5,'2015-07-21',32000 ),(5,'govind','production',5,'2015-09-12',35000 ), (6,'hima','finance',4,'2013-01-19',51000 ),(7,'ira','hr',2,'2010-03-15',45000 ), (8,'sandeep','finance',4,'2010-07-26',49000 ); SELECT * FROM EMPLOYEE; INSERT INTO DEPARTMENT(DNUMBER,DNAME,LOC)VALUES(1,'Admin','Chennai'),(2,'HR','Banglore'), (3,'Sales','Kochi'),(4,'Finance','Delhi'),(5,'Production','Trivandrum'); SELECT * FROM DEPARTMENT; INSERT INTO PROJECT(PNUMBER,PNAME,DNUM)VALUES(11,'Bancs',3),(12,'Nielesan',5), (13,'WorldBank',1),(14,'Airlines',2),(15,'Amex',4); UPDATE DEPARTMENT SET MGRSSN=2 WHERE DNUMBER=1; UPDATE DEPARTMENT SET MGRSSN=1 WHERE DNUMBER=2; UPDATE DEPARTMENT SET MGRSSN=3 WHERE DNUMBER=3; UPDATE DEPARTMENT SET MGRSSN=6 WHERE DNUMBER=4; UPDATE DEPARTMENT SET MGRSSN=7 WHERE DNUMBER=2; UPDATE DEPARTMENT SET MGRSSN=4 WHERE DNUMBER=5; UPDATE DEPARTMENT SET MGRSSN=5 WHERE DNUMBER=5; SELECT * FROM PROJECT; INSERT INTO WORK_IN(ESSN,PNO,HOURS)VALUES(1,14,NULL),(4,13,NULL),(8,12,NULL), (6,15,NULL),(2,11,NULL),(3,13,NULL); SELECT * FROM WORK_IN; SELECT e.ENAME FROM EMPLOYEE e LEFT OUTER JOIN DEPARTMENT d on d.DNUMBER=e.DNO WHERE e.SALARY BETWEEN 30000 AND 40000 AND d.DNUMBER=5; SELECT e.ENAME,d.DNAME FROM EMPLOYEE e LEFT OUTER JOIN DEPARTMENT d on e.DNO=d.DNUMBER ORDER BY d.DNAME ASC,e.ENAME ASC; SELECT p.PNUMBER,p.PNAME,count(e.SSN) FROM WORK_IN w LEFT OUTER JOIN PROJECT p on w.PNO=p.PNUMBER LEFT OUTER JOIN EMPLOYEE e on w.ESSN=e.SSN GROUP BY p.PNAME,p.PNUMBER; SELECT p.PNUMBER,p.PNAME,count(e.SSN) FROM WORK_IN w LEFT OUTER JOIN PROJECT p on w.PNO=p.PNUMBER LEFT OUTER JOIN EMPLOYEE e on w.ESSN=e.SSN GROUP BY p.PNAME,p.PNUMBER HAVING count(e.SSN) > 2; SELECT p.PNUMBER,p.PNAME,d.DNUMBER,count(e.ssn) FROM PROJECT p LEFT OUTER JOIN DEPARTMENT d on d.DNUMBER=p.DNUM LEFT OUTER JOIN EMPLOYEE e on e.DNO=p.DNUM GROUP BY p.PNAME,p.PNUMBER,d.DNUMBER HAVING d.DNUMBER=5; create VIEW emp_dept_view as select * from EMPLOYEE NATURAL JOIN department; CREATE SYNONYM FROM EMP_dept_view; SELECT * FROM EMP_DEPT; SELECT * From EMPLOYEE e,DEPARTMENT d WHERE e.DNO=d.DNUMBER; SELECT * FROM EMPLOYEE e,DEPARTMENT d WHERE NOT(e.DNO=d.DNUMBER); SELECT * FROM EMPLOYEE e LEFT OUTER JOIN DEPARTMENT d ON e.DNO=d.DNUMBER; SELECT * FROM EMPLOYEE e RIGHT OUTER JOIN DEPARTMENT d ON e.DNO=d.DNUMBER; SELECT * FROM EMPLOYEE e INNER JOIN DEPARTMENT d ON e.DNO=d.DNUMBER;
true